/* auto-generated by NAPI-RS */ /* eslint-disable */ /** * A live, URI-keyed analysis session. Construct once with `new AnalysisHandle()`, push documents * with `openDocument`/`changeDocument`/`closeDocument` (+ `setProjectConfig`), then query. The Rust * `AnalysisHost` (and its salsa cache) stays alive across edits. napi objects are owned by the * single JS thread, so the held (non-`Sync`) salsa state is never shared across threads. */ export declare class AnalysisHandle { /** Create an empty analysis session. */ constructor() /** * Open or replace a document by `uri`. Pass `resPath` (`res://…`) on first open to enable * cross-file `preload` / `extends` / autoload resolution; it is recorded once and ignored on * later opens (re-sending would needlessly invalidate the resource-path registry). */ openDocument(uri: string, text: string, resPath?: string | undefined | null): void /** * Replace a document's text by `uri` (its `res://` path is unchanged). An unknown `uri` is * interned as a new document (an upsert). */ changeDocument(uri: string, text: string): void /** Close (remove) a document by `uri`. A later re-open assigns a fresh file id. */ closeDocument(uri: string): void /** Set the project's `project.godot` text (enables `[autoload]` singleton resolution). */ setProjectConfig(text: string): void /** * Declare whether the opened file set is the **whole project** (every `.gd` under the * project root). Pass `true` only after feeding every project file — it arms the * absence-based `UNDEFINED_FUNCTION` / `UNDEFINED_IDENTIFIER` diagnostics (silent otherwise: * a partial view can never prove a name is defined nowhere). */ setWorkspaceComplete(complete: boolean): void /** * Select the warning-gating profile: `"engine-defaults"` matches Godot's own default * levels (the `UNSAFE_*` opt-in family stays silent — an editor must not warn where the * engine wouldn't), `"strict"` promotes the safety opt-ins to WARN, `"none"` restores the * auto default (standalone ⇒ strict, project ⇒ engine defaults). Unknown strings are * ignored (forward-compatible). */ setWarningOverride(mode: string): void /** * Whether `uri` is currently open. Lets a client distinguish "file not tracked" from a genuine * empty result (the array queries return `[]` and the `null`-returning queries `null` for both). */ isOpen(uri: string): boolean /** Parse + type diagnostics for `uri`, as a JS array. */ diagnostics(uri: string): any /** The document outline for `uri`, as a JS array. */ documentSymbols(uri: string): any /** Foldable ranges for `uri`, as a JS array. */ foldingRanges(uri: string): any /** Inlay hints for `uri`, as a JS array. */ inlayHints(uri: string): any /** Completions at a byte `offset` in `uri`, as a JS array. */ completions(uri: string, offset: number): any /** Hover at a byte `offset` in `uri`; JS `null` when there is nothing typed there. */ hover(uri: string, offset: number): any | null /** Signature help at a byte `offset` in `uri`; JS `null` when not at a call site. */ signatureHelp(uri: string, offset: number): any | null /** Code actions at a byte `offset` in `uri`, as a JS array. */ codeActions(uri: string, offset: number): any /** * Go-to-definition target(s) for the symbol at a byte `offset` in `uri`, as a JS array (each * target carries a `uri`). */ gotoDefinition(uri: string, offset: number): any /** Every reference to the symbol at a byte `offset` in `uri`, as a JS array (each carries a `uri`). */ findReferences(uri: string, offset: number): any /** * Rename the symbol at a byte `offset` in `uri` to `newName`. A JS object: * `{ ok: }` or `{ error: }` (edits carry a `uri`). */ rename(uri: string, offset: number, newName: string): any /** Project-wide symbols matching `query`, as a JS array. */ workspaceSymbols(query: string): any /** The pretty-printed syntax tree for `uri` (debugging); JS `null` for an unknown `uri`. */ syntaxTree(uri: string): string | null /** Semantic-highlighting tokens for `uri`, as a JS array. */ semanticTokens(uri: string): any /** Format `uri`'s whole document; the tidied text, or JS `null` for an unknown `uri`. */ format(uri: string): string | null /** * Format only the lines overlapping the byte range `[start, end)`; a `{ range, new_text }` object, * or JS `null` when the selection's lines do not change / `uri` is unknown. */ formatRange(uri: string, start: number, end: number): any | null }