Skip to content

Commit

Permalink
search definitions in master script
Browse files Browse the repository at this point in the history
search references from master in other scripts
  • Loading branch information
pbaksa committed Oct 15, 2022
1 parent 00fd1ef commit 317be45
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 80 deletions.
14 changes: 2 additions & 12 deletions out/calltree.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion out/calltree.js.map

Large diffs are not rendered by default.

81 changes: 56 additions & 25 deletions out/extension.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion out/extension.js.map

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion out/parsexmlgdl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion out/parsexmlgdl.js.map

Large diffs are not rendered by default.

14 changes: 2 additions & 12 deletions src/calltree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,6 @@ export class CallTree implements vscode.CallHierarchyProvider {
});
}

static getScriptsToSearch(searchMode : Parser.ScriptType) : Parser.ScriptType[] {
if (searchMode === Parser.ScriptType.D) {
// master script mode should search all scripts
return Parser.Scripts;
} else {
// otherwise search mode and master
return [Parser.ScriptType.D, searchMode];
}
}

async getUrisToSearch(item : vscode.CallHierarchyItem, searchScripts : Parser.ScriptType[], cancel : vscode.CancellationToken) : Promise<vscode.Uri[]>{
let uris : Array<vscode.Uri>;

Expand Down Expand Up @@ -192,7 +182,7 @@ export class CallTree implements vscode.CallHierarchyProvider {

async getCallHierarchyOutgoingCalls(item : vscode.CallHierarchyItem, cancel : vscode.CancellationToken) : Promise<vscode.CallHierarchyOutgoingCall[]> {
const searchMode = CallTree.getContext(item.detail);
const searchScripts = CallTree.getScriptsToSearch(searchMode);
const searchScripts = Parser.getRelatedScripts(searchMode);
let calls : Promise<vscode.CallHierarchyOutgoingCall[]>[];
if (searchMode === Parser.ScriptType.D) {
// add all subscripts if looking at master script
Expand Down Expand Up @@ -233,7 +223,7 @@ export class CallTree implements vscode.CallHierarchyProvider {
}

const searchMode = CallTree.getIncomingMode(item.uri, CallTree.getContext(item.detail));
const searchScripts = CallTree.getScriptsToSearch(searchMode);
const searchScripts = Parser.getRelatedScripts(searchMode);

const libparts = await this.wsSymbols.values(cancel);
const calldata = libparts.map(async (libpart) => {
Expand Down
Loading

0 comments on commit 317be45

Please sign in to comment.