Skip to content

Commit 2787704

Browse files
authored
Merge pull request #34 from antaalt/use-symbol-tree
Compatibility with updated API for DocumentSymbol
2 parents 8a0f281 + 03052a5 commit 2787704

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/shaderVariant.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,12 @@ export class ShaderVariantTreeDataProvider implements vscode.TreeDataProvider<Sh
381381
// Symbols might have changed, so request them as we use this to compute symbols.
382382
this.requestDocumentSymbol(file.uri);
383383
}
384-
public onDocumentSymbols(uri: vscode.Uri, symbols: vscode.SymbolInformation[]) {
384+
public onDocumentSymbols(uri: vscode.Uri, symbols: vscode.DocumentSymbol[]) {
385+
// TODO:TREE: need to recurse child as well.
385386
this.shaderEntryPointList.set(uri.path, symbols.filter(symbol => symbol.kind === vscode.SymbolKind.Function).map(symbol => {
386387
return {
387388
entryPoint: symbol.name,
388-
range: new vscode.Range(
389-
new vscode.Position(symbol.location.range.start.line, symbol.location.range.start.character),
390-
new vscode.Position(symbol.location.range.end.line, symbol.location.range.end.character)
391-
)
389+
range: symbol.selectionRange
392390
};
393391
}));
394392
// Solve async request for goto.

src/validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function getMiddleware() : Middleware {
140140
const result = await next(document, token);
141141
if (result) {
142142
// /!\ Type casting need to match server data sent. /!\
143-
let resultArray = result as vscode.SymbolInformation[];
143+
let resultArray = result as vscode.DocumentSymbol[];
144144
sidebar.onDocumentSymbols(document.uri, resultArray);
145145
}
146146
return result;

0 commit comments

Comments
 (0)