feat(usages): search Java usages in Project Files first, Project and Libraries on demand (#1837)

Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-06 21:46:29 +08:00
1 джерело ef95cd1716
коміт a6d17543fd
26 files changed
+963 -96

No files matched your search

+9 -2
Переглянути файл
@@ -424,9 +424,12 @@ export const commands = {
/**
* References of the symbol at `pos`. `project_wide` also searches project files
* outside the language server's analysis scope; bulk scans over many symbols
* leave it off. Cancel with `cancel_request(request)`.
* leave it off. Java, `project_wide`: without `libraries`, the dependencies and the JDK
* are not searched; with it, those found in the sources arrive on `on_partial` before
* the slower search for the rest, and the result has them all. Cancel with
* `cancel_request(request)`.
*/
lspReferences: (request: RequestId, doc: DocId, pos: Pos, includeDeclaration: boolean, projectWide: boolean) => typedError<References, IdeError>(__TAURI_INVOKE("lsp_references", { request, doc, pos, includeDeclaration, projectWide })),
lspReferences: (request: RequestId, doc: DocId, pos: Pos, includeDeclaration: boolean, projectWide: boolean, libraries: boolean, onPartial: Channel<References>) => typedError<References, IdeError>(__TAURI_INVOKE("lsp_references", { request, doc, pos, includeDeclaration, projectWide, libraries, onPartial })),
lspDocumentHighlights: (doc: DocId, pos: Pos) => typedError<Highlight[], IdeError>(__TAURI_INVOKE("lsp_document_highlights", { doc, pos })),
lspWorkspaceSymbols: (request: RequestId, query: string) => typedError<WorkspaceSymbol[], IdeError>(__TAURI_INVOKE("lsp_workspace_symbols", { request, query })),
lspCodeActions: (doc: DocId, range: Range, only: string[]) => typedError<CodeAction[], IdeError>(__TAURI_INVOKE("lsp_code_actions", { doc, range, only })),
@@ -2113,6 +2116,8 @@ export type ClassifiedReference = {
access?: ReferenceAccess | null,
location: Location,
kind: ReferenceKind,
/** The usage's line, when the server has it at hand (a library class's). */
text?: string | null,
};
export type ClearCachesResult = {
@@ -6178,6 +6183,8 @@ export type References = {
classified?: ClassifiedReference[],
locations: Location[],
incomplete: ReferencesIncomplete | null,
/** The dependencies and the JDK were not searched (asked for without `libraries`). */
librariesSkipped?: boolean,
};
/** Why a references search may have missed usages. */