From ab25a6936b74b92f544b0838f0e8cd701a163c65 Mon Sep 17 00:00:00 2001 From: "bobo.yang" Date: Wed, 31 Jan 2024 12:42:49 +0800 Subject: [PATCH] fix: Correct substructure info in document symbols - Change condition for DocumentSymbol substructure processing - Use symbol.children instead of instance type check - Ensures complete information is returned by interface --- src/ide_services/lsp/lsp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ide_services/lsp/lsp.ts b/src/ide_services/lsp/lsp.ts index a0e4153..9ede985 100644 --- a/src/ide_services/lsp/lsp.ts +++ b/src/ide_services/lsp/lsp.ts @@ -91,7 +91,7 @@ const convertSymbolInformation = (symbol: vscode.SymbolInformation): any => { // Generic function to convert an array of DocumentSymbol or SymbolInformation to a plain object array export const convertSymbolsToPlainObjects = (symbols: vscode.DocumentSymbol[] | vscode.SymbolInformation[]): any[] => { return symbols.map(symbol => { - if (symbol instanceof vscode.DocumentSymbol) { + if (symbol.children) { // Handle DocumentSymbol with recursive conversion return convertDocumentSymbol(symbol); } else {