/** * Copyright (c) 2026 Ivan Iraci * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ import type { Location, LocationLink, MarkupContent } from 'vscode-languageserver-protocol'; import type { LocationResult, LSPClient } from '../types.js'; /** * Prepare a file for LSP operations by ensuring it's open with the appropriate server. */ export declare function prepareFile(filePath: string): Promise<{ client: LSPClient; uri: string; content: string; }>; /** * Convert an LSP Location to our LocationResult format. */ export declare function locationToResult(location: Location, content?: string): Promise; /** * Convert an LSP LocationLink to our LocationResult format. */ export declare function locationLinkToResult(link: LocationLink): Promise; /** * Convert LSP locations (which can be Location, Location[], or LocationLink[]) to LocationResult[]. */ export declare function convertLocations(result: Location | Location[] | LocationLink[] | null): Promise; /** * Get human-readable symbol kind name. */ export declare function getSymbolKindName(kind: number): string; /** * Get human-readable completion kind name. */ export declare function getCompletionKindName(kind: number | undefined): string; /** * Get human-readable diagnostic severity name. */ export declare function getDiagnosticSeverityName(severity: number | undefined): 'error' | 'warning' | 'info' | 'hint'; /** * Normalize a diagnostic message to a plain string. * As of LSP types 3.18, `Diagnostic.message` may be a `MarkupContent` object * rather than a plain string; in that case we use its `value`. */ export declare function getDiagnosticMessageText(message: string | MarkupContent): string; /** * Convert 1-indexed position to LSP position for a file. */ export declare function toPosition(line: number, column: number, content: string): import("vscode-languageserver-types").Position; /** * Filter symbol kinds based on requested kinds. */ export declare function matchesSymbolKind(symbolKind: number, requestedKinds?: string[]): boolean; //# sourceMappingURL=utils.d.ts.map