Interface WorkspaceManager

The workspace manager is responsible for finding source files in the workspace. This service is shared between all languages of a language server.

interface WorkspaceManager {
    initialBuildOptions: undefined | BuildOptions;
    ready: Promise<void>;
    get workspaceFolders(): undefined | readonly WorkspaceFolder[];
    initialize(params: InitializeParams): void;
    initialized(params: InitializedParams): Promise<void>;
    initializeWorkspace(folders: WorkspaceFolder[], cancelToken?: CancellationToken): Promise<void>;
}

Implemented by

Properties

initialBuildOptions: undefined | BuildOptions

The options used for the initial workspace build.

ready: Promise<void>

A promise that resolves when the workspace manager is ready to be used. Use this to ensure that the workspace manager has finished its initialization.

Accessors

Methods

  • When used in a language server context, this method is called when the server receives the initialized notification.

    Parameters

    • params: InitializedParams

    Returns Promise<void>

  • Does the initial indexing of workspace folders. Collects information about exported and referenced AstNodes in each language file and stores it locally.

    Parameters

    • folders: WorkspaceFolder[]

      The set of workspace folders to be indexed.

    • OptionalcancelToken: CancellationToken

      A cancellation token that can be used to cancel the operation.

    Returns Promise<void>

    OperationCancelled if a cancellation event has been detected