From 649bf3f782e7d7a98d299ada71f906296333faa8 Mon Sep 17 00:00:00 2001 From: Liam Barry Allan Date: Fri, 19 Aug 2022 11:38:22 -0400 Subject: [PATCH] Update symbol provider to support ranges Signed-off-by: Liam Barry Allan --- src/vscode/LanguageWorker.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vscode/LanguageWorker.js b/src/vscode/LanguageWorker.js index 1e0de7c2..3cdef350 100644 --- a/src/vscode/LanguageWorker.js +++ b/src/vscode/LanguageWorker.js @@ -224,11 +224,11 @@ module.exports = class LanguageWorker { currentScopeDefs.push( ...scope.subroutines.filter(sub => sub.position && sub.position.path === currentPath) .map(def => new vscode.DocumentSymbol( - def.name, + def.name, def.keywords.join(` `).trim(), vscode.SymbolKind.Function, - new vscode.Range(def.position.line, 0, def.position.line, 0), - new vscode.Range(def.position.line, 0, def.position.line, 0) + new vscode.Range(def.range.start, 0, def.range.end, 0), + new vscode.Range(def.range.start, 0, def.range.start, 0), )), ...scope.variables @@ -299,8 +299,8 @@ module.exports = class LanguageWorker { struct.name, struct.keywords.join(` `).trim(), vscode.SymbolKind.Struct, - new vscode.Range(struct.position.line, 0, struct.position.line, 0), - new vscode.Range(struct.position.line, 0, struct.position.line, 0) + new vscode.Range(struct.range.start, 0, struct.range.end, 0), + new vscode.Range(struct.range.start, 0, struct.range.start, 0), ); structDef.children.push( @@ -332,8 +332,8 @@ module.exports = class LanguageWorker { proc.name, proc.keywords.join(` `).trim(), vscode.SymbolKind.Function, - new vscode.Range(proc.position.line, 0, proc.position.line, 0), - new vscode.Range(proc.position.line, 0, proc.position.line, 0) + new vscode.Range(proc.range.start, 0, proc.range.end, 0), + new vscode.Range(proc.range.start, 0, proc.range.start, 0), ); procDef.children.push(