monaco-definition-provider - v2.0.0
    Preparing search index...

    Interface WorkspaceAccess

    Narrow view of the workspace handed to language analyzers. Implemented by WorkspaceIndex; trivially fakeable in tests.

    interface WorkspaceAccess {
        getDocument(uri: string): WorkspaceDocument | null;
        resolveImport(
            importPath: string,
            fromUri: string,
        ): Promise<WorkspaceDocument | null>;
    }

    Implemented by

    Index

    Methods

    • Resolve an import specifier (e.g. Python "..utils.helpers") from a file to a document — checking open models first, then asking the host's loadFile hook. Returns null when nothing can provide the file.

      Parameters

      • importPath: string
      • fromUri: string

      Returns Promise<WorkspaceDocument | null>