Pike LSP TypeScript API - v0.1.0-alpha.20
    Preparing search index...

    Module Context Service

    Manages import extraction, resolution, and waterfall symbol loading for Pike documents.

    Index

    Constructors

    Accessors

    Methods

    • Check for circular dependencies in a document.

      Parameters

      • uri: string

        Document URI

      • content: string

        Document content

      • bridge: {
            checkCircular: (
                code: string,
                filename?: string,
            ) => Promise<CircularCheckResult>;
            extractImports: (
                code: string,
                filename?: string,
            ) => Promise<ExtractImportsResult>;
        }

        PikeBridge instance

        • checkCircular: (code: string, filename?: string) => Promise<CircularCheckResult>
        • extractImports: (code: string, filename?: string) => Promise<ExtractImportsResult>

      Returns Promise<CircularCheckResult>

    • Get imports for a document.

      Parameters

      • uri: string

        Document URI

      • content: string

        Document content

      • bridge: {
            extractImports: (
                code: string,
                filename?: string,
            ) => Promise<ExtractImportsResult>;
        }

        PikeBridge instance

        • extractImports: (code: string, filename?: string) => Promise<ExtractImportsResult>
      • Optionalfilename: string

        Filename for Pike (extracted from URI)

      Returns Promise<ExtractedImport[]>

    • Get waterfall symbols for a document (transitive imports).

      Parameters

      • uri: string

        Document URI

      • content: string

        Document content

      • bridge: {
            extractImports: (
                code: string,
                filename?: string,
            ) => Promise<ExtractImportsResult>;
            getWaterfallSymbols: (
                code: string,
                filename?: string,
                maxDepth?: number,
            ) => Promise<WaterfallSymbolsResult>;
        }

        PikeBridge instance

        • extractImports: (code: string, filename?: string) => Promise<ExtractImportsResult>
        • getWaterfallSymbols: (
              code: string,
              filename?: string,
              maxDepth?: number,
          ) => Promise<WaterfallSymbolsResult>
      • maxDepth: number = 5

        Maximum depth for transitive resolution

      Returns Promise<WaterfallSymbolsResult>

    • Resolve an import target to its file path.

      Parameters

      • importType: ImportType

        Type of import (include, import, inherit, require)

      • target: string

        Import target path

      • currentFile: string

        Current file URI for relative resolution

      • bridge: {
            resolveImport: (
                importType: ImportType,
                target: string,
                currentFile?: string,
            ) => Promise<ResolveImportResult>;
        }

        PikeBridge instance

        • resolveImport: (
              importType: ImportType,
              target: string,
              currentFile?: string,
          ) => Promise<ResolveImportResult>

      Returns Promise<ResolveImportResult>