private SourceText?ReadText() { var diagnostics = new List <DiagnosticInfo>(); var text = _compiler.TryReadFileContent(_sourceFile, diagnostics); _diagnostics = diagnostics; return(text); }
/// <summary> /// Returns a <see cref="SourceText"/> with the contents of this file, or <c>null</c> if /// there were errors reading the file. /// </summary> public override SourceText GetText(CancellationToken cancellationToken = default) { lock (_lockObject) { if (_text == null) { var diagnostics = new List <DiagnosticInfo>(); _text = _compiler.TryReadFileContent(_sourceFile, diagnostics); _diagnostics = diagnostics; } } return(_text); }