From a21c68ba911745c73e5ad3ce4b3cd4ce8144ea6e Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:17:04 +0800 Subject: [PATCH] feat: wait lsp until ready when fetching summary info (#1477) --- editors/vscode/src/features/tool.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/editors/vscode/src/features/tool.ts b/editors/vscode/src/features/tool.ts index 65dc016dd..09d59f8fe 100644 --- a/editors/vscode/src/features/tool.ts +++ b/editors/vscode/src/features/tool.ts @@ -610,10 +610,7 @@ async function fetchSummaryInfo(): Promise<[string | undefined, string | undefin async function work(focusingFile: string, res: [string | undefined, string | undefined]) { if (!res[0]) { - const result = await vscode.commands.executeCommand( - "tinymist.getDocumentMetrics", - focusingFile, - ); + const result = await tinymist.executeCommand("tinymist.getDocumentMetrics", [focusingFile]); if (!result) { return; } @@ -622,7 +619,7 @@ async function fetchSummaryInfo(): Promise<[string | undefined, string | undefin } if (!res[1]) { - const result2 = await vscode.commands.executeCommand("tinymist.getServerInfo"); + const result2 = await tinymist.executeCommand("tinymist.getServerInfo", []); if (!result2) { return; }