Class ProjectFileLoader
Loads a workspace's .rdproj ProjectFile from disk, read-only. Every platform
component that needs the project structure — the language server's workspace services and the
environment host's session composition — resolves the project through this service so there is a
single deserialization path.
public sealed class ProjectFileLoader : IProjectFileLoader
- Inheritance
-
ProjectFileLoader
- Implements
- Inherited Members
Constructors
ProjectFileLoader(IFileSystem)
Loads a workspace's .rdproj ProjectFile from disk, read-only. Every platform
component that needs the project structure — the language server's workspace services and the
environment host's session composition — resolves the project through this service so there is a
single deserialization path.
public ProjectFileLoader(IFileSystem fileSystem)
Parameters
fileSystemIFileSystem
Methods
LoadAsync(string, CancellationToken)
Loads and deserializes the .rdproj under workspaceRoot, stamping its
Uri with the workspace root everything else is relative to.
public Task<ProjectFile> LoadAsync(string workspaceRoot, CancellationToken token = default)
Parameters
workspaceRootstringThe absolute path of the workspace root directory.
tokenCancellationTokenA token that cancels the read.
Returns
Exceptions
- FileNotFoundException
No
.rdprojexists under the workspace root.- InvalidOperationException
The
.rdprojcould not be deserialized.
TryLocate(string, out string)
Resolves the path a .rdproj would occupy under workspaceRoot and
reports whether a file exists there.
public bool TryLocate(string workspaceRoot, out string projectFilePath)
Parameters
workspaceRootstringThe absolute path of the workspace root directory.
projectFilePathstringThe resolved
.rdprojpath, whether or not it exists.
Returns
- bool
trueif a file exists atprojectFilePath.