Table of Contents

Class ProjectFileLoader

Namespace
RDCore.SDK.Workspace
Assembly
RDCore.SDK.dll

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

fileSystem IFileSystem

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

workspaceRoot string

The absolute path of the workspace root directory.

token CancellationToken

A token that cancels the read.

Returns

Task<ProjectFile>

Exceptions

FileNotFoundException

No .rdproj exists under the workspace root.

InvalidOperationException

The .rdproj could 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

workspaceRoot string

The absolute path of the workspace root directory.

projectFilePath string

The resolved .rdproj path, whether or not it exists.

Returns

bool

true if a file exists at projectFilePath.