fix(lsp): report incomplete rename and caller searches, make them cancellable

Rename and incoming calls open the project files that mention the name, like
Find Usages, but dropped the reason a search could miss usages and could not be
cancelled. A rename past the 300-file limit changed part of the usages without
saying so.

- Rename and call hierarchy return why the result may be incomplete and take a
  request id for cancel_request.
- A rename that may have missed usages always opens the preview, with a warning.
- The Callers tree shows the note above the tree or on the expanded node.
- Candidates too large or not readable as text are reported as skipped.
- A newer rename or hierarchy query cancels the one it replaces.
Цей коміт міститься в:
l0ng-ai committed 2026-10-30 21:46:44 +08:00
1 джерело 33d8d87ca2
коміт bfa83d857c
18 files changed
+492 -94

No files matched your search

+6 -4
Переглянути файл
@@ -222,11 +222,12 @@ pub async fn lsp_prepare_rename(
pub async fn lsp_rename(
window: Window,
state: State<'_, AppState>,
request: RequestId,
doc: DocId,
pos: Pos,
new_name: String,
) -> IdeResult<WorkspaceEdit> {
ide_host::ops::lsp::lsp_rename(&state.host, window.label(), doc, pos, new_name).await
) -> IdeResult<Renamed> {
ide_host::ops::lsp::lsp_rename(&state.host, window.label(), request, doc, pos, new_name).await
}
#[tauri::command]
@@ -284,11 +285,12 @@ pub async fn lsp_document_links(
pub async fn lsp_call_hierarchy(
window: Window,
state: State<'_, AppState>,
request: RequestId,
doc: DocId,
pos: Pos,
direction: HierarchyDirection,
) -> IdeResult<Vec<HierarchyItem>> {
ide_host::ops::lsp::lsp_call_hierarchy(&state.host, window.label(), doc, pos, direction).await
) -> IdeResult<CallHierarchy> {
ide_host::ops::lsp::lsp_call_hierarchy(&state.host, window.label(), request, doc, pos, direction).await
}
#[tauri::command]