Skip to content

Commit

Permalink
Update symbol provider to support ranges
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Barry Allan <[email protected]>
  • Loading branch information
worksofliam committed Aug 19, 2022
1 parent 519240e commit 649bf3f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/vscode/LanguageWorker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 649bf3f

Please sign in to comment.