ProjectManager.LoadSourceFiles Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
For each valid source file, generates the corrsponding TextDocumentIdentifier and reads the file content from disk.
public static System.Collections.Immutable.ImmutableDictionary<Uri,string> LoadSourceFiles (System.Collections.Generic.IEnumerable<string> sourceFiles, Action<Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic>? onDiagnostic = default, Action<Exception>? onException = default);
static member LoadSourceFiles : seq<string> * Action<Microsoft.VisualStudio.LanguageServer.Protocol.Diagnostic> * Action<Exception> -> System.Collections.Immutable.ImmutableDictionary<Uri, string>
Public Shared Function LoadSourceFiles (sourceFiles As IEnumerable(Of String), Optional onDiagnostic As Action(Of Diagnostic) = Nothing, Optional onException As Action(Of Exception) = Nothing) As ImmutableDictionary(Of Uri, String)
Parameters
- sourceFiles
- IEnumerable<String>
The source files to load.
- onDiagnostic
- Action<Diagnostic>
Called on all generated diagnostics.
Returns
The uri and file content for each file that could be loaded.
Remarks
Uses FilterFiles(IEnumerable<String>, WarningCode, Func<String,String,Diagnostic>, IEnumerable<Uri>, IEnumerable<Uri>, IEnumerable<ValueTuple<String,Exception>>, Action<Diagnostic>, Action<Exception>) to filter sourceFiles and generates the corresponding errors and warnings.
Generates a suitable error whenever the file content could not be loaded.