Skip to content

Commit

Permalink
Avoid AST Viewer for invalid selections
Browse files Browse the repository at this point in the history
When a directory is selected or there are multiple selections, do not
show the command.
  • Loading branch information
aeisenberg committed Feb 4, 2022
1 parent 210da1b commit 271d168
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion extensions/ql-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@
{
"command": "codeQL.viewAst",
"group": "9_qlCommands",
"when": "resourceScheme == codeql-zip-archive"
"when": "resourceScheme == codeql-zip-archive && !explorerResourceIsFolder && !listMultiSelection"
},
{
"command": "codeQL.runQueries",
Expand Down
3 changes: 1 addition & 2 deletions extensions/ql-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -996,9 +996,8 @@ async function activateWithInstalledDistribution(
ctx.subscriptions.push(commandRunnerWithProgress('codeQL.viewAst', async (
progress: ProgressCallback,
token: CancellationToken,
selectedFile: Uri,
selectedFile: Uri
) => {

const ast = await templateProvider.provideAst(
progress,
token,
Expand Down

0 comments on commit 271d168

Please sign in to comment.