-
Notifications
You must be signed in to change notification settings - Fork 226
Implement basic CodeQL debug adapter #2291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a3306da
055bfcd
e2017c7
65b0cb4
d489d0e
d0c405a
f182f42
61df133
0a0a9c6
7dfa52b
19e083e
1cbfd01
e8f39fe
809c86f
d14c844
60bf56d
785f009
9344499
a0a3af2
2da6895
22679b8
6efdd11
d3b118b
30b9d7e
59dcea6
60fd868
95dda2b
14a4247
6fa7757
03ceb73
ce2fecd
d1b5ab6
55644d5
ad2c065
aa9ca6e
103e397
7602d8e
74c3db7
a151ade
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -76,6 +76,48 @@ | |||||
| "editor.wordBasedSuggestions": false | ||||||
| } | ||||||
| }, | ||||||
| "debuggers": [ | ||||||
| { | ||||||
| "type": "codeql", | ||||||
| "label": "CodeQL Debugger", | ||||||
| "languages": [ | ||||||
| "ql" | ||||||
| ], | ||||||
| "configurationAttributes": { | ||||||
| "launch": { | ||||||
| "properties": { | ||||||
| "query": { | ||||||
| "type": "string", | ||||||
| "description": "Path to query file (.ql)", | ||||||
| "default": "${file}" | ||||||
| }, | ||||||
| "database": { | ||||||
| "type": "string", | ||||||
| "description": "Path to the target database" | ||||||
| }, | ||||||
| "additionalPacks": { | ||||||
| "type": [ | ||||||
| "array", | ||||||
| "string" | ||||||
| ], | ||||||
| "description": "Additional folders to search for library packs. Defaults to searching all workspace folders." | ||||||
| }, | ||||||
| "extensionPacks": { | ||||||
| "type": [ | ||||||
| "array", | ||||||
| "string" | ||||||
| ], | ||||||
| "description": "Names of extension packs to include in the evaluation. These are resolved from the locations specified in `additionalPacks`." | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
| "variables": { | ||||||
| "currentDatabase": "codeQL.getCurrentDatabase", | ||||||
| "currentQuery": "codeQL.getCurrentQuery" | ||||||
| } | ||||||
| } | ||||||
| ], | ||||||
| "jsonValidation": [ | ||||||
| { | ||||||
| "fileMatch": "GitHub.vscode-codeql/databases.json", | ||||||
|
|
@@ -309,6 +351,30 @@ | |||||
| "command": "codeQL.runQueryContextEditor", | ||||||
| "title": "CodeQL: Run Query on Selected Database" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.debugQuery", | ||||||
| "title": "CodeQL: Debug Query" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.debugQueryContextEditor", | ||||||
| "title": "CodeQL: Debug Query" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.startDebuggingSelection", | ||||||
| "title": "CodeQL: Debug Selection" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.startDebuggingSelectionContextEditor", | ||||||
| "title": "CodeQL: Debug Selection" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.continueDebuggingSelection", | ||||||
| "title": "CodeQL: Debug Selection" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.continueDebuggingSelectionContextEditor", | ||||||
| "title": "CodeQL: Debug Selection" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.runQueryOnMultipleDatabases", | ||||||
| "title": "CodeQL: Run Query on Multiple Databases" | ||||||
|
|
@@ -448,6 +514,14 @@ | |||||
| "command": "codeQL.setCurrentDatabase", | ||||||
| "title": "CodeQL: Set Current Database" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.getCurrentDatabase", | ||||||
| "title": "CodeQL: Get Current Database" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.getCurrentQuery", | ||||||
| "title": "CodeQL: Get Current Query" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.viewAst", | ||||||
| "title": "CodeQL: View AST" | ||||||
|
|
@@ -1022,6 +1096,30 @@ | |||||
| "command": "codeQL.runQueryContextEditor", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.debugQuery", | ||||||
| "when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql && !inDebugMode" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.debugQueryContextEditor", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.startDebuggingSelection", | ||||||
| "when": "config.codeQL.canary && editorLangId == ql && debugState == inactive && debugConfigurationType == codeql" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.startDebuggingSelectionContextEditor", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.continueDebuggingSelection", | ||||||
| "when": "config.codeQL.canary && editorLangId == ql && debugState == stopped && debugType == codeql" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.continueDebuggingSelectionContextEditor", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.runQueryOnMultipleDatabases", | ||||||
| "when": "resourceLangId == ql && resourceExtname == .ql" | ||||||
|
|
@@ -1070,6 +1168,14 @@ | |||||
| "command": "codeQL.setCurrentDatabase", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.getCurrentDatabase", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.getCurrentQuery", | ||||||
| "when": "false" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.viewAst", | ||||||
| "when": "resourceScheme == codeql-zip-archive" | ||||||
|
|
@@ -1330,7 +1436,7 @@ | |||||
| "editor/context": [ | ||||||
| { | ||||||
| "command": "codeQL.runQueryContextEditor", | ||||||
| "when": "editorLangId == ql && resourceExtname == .ql" | ||||||
| "when": "editorLangId == ql && resourceExtname == .ql && !inDebugMode" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This?
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an existing command, so wouldn't we still want to keep this available?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's the existing "CodeQL: Run Query" command. I just changed the Once we have the basic debugger support merged, we'll have to take a careful look at the UX around the commands, configuration, etc. What I've got now is intended to be the easiest-to-implement way to enable the new features, not necessarily the best UX. |
||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.runQueryOnMultipleDatabasesContextEditor", | ||||||
|
|
@@ -1350,7 +1456,19 @@ | |||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.quickEvalContextEditor", | ||||||
| "when": "editorLangId == ql" | ||||||
| "when": "editorLangId == ql && debugState == inactive" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.debugQueryContextEditor", | ||||||
| "when": "config.codeQL.canary && editorLangId == ql && resourceExtname == .ql && !inDebugMode" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.startDebuggingSelectionContextEditor", | ||||||
| "when": "config.codeQL.canary && editorLangId == ql && debugState == inactive && debugConfigurationType == codeql" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.continueDebuggingSelectionContextEditor", | ||||||
| "when": "config.codeQL.canary && editorLangId == ql && debugState == stopped && debugType == codeql" | ||||||
| }, | ||||||
| { | ||||||
| "command": "codeQL.openReferencedFileContextEditor", | ||||||
|
|
@@ -1451,6 +1569,8 @@ | |||||
| "@octokit/plugin-retry": "^3.0.9", | ||||||
| "@octokit/rest": "^19.0.4", | ||||||
| "@vscode/codicons": "^0.0.31", | ||||||
| "@vscode/debugadapter": "^1.59.0", | ||||||
| "@vscode/debugprotocol": "^1.59.0", | ||||||
| "@vscode/webview-ui-toolkit": "^1.0.1", | ||||||
| "ajv": "^8.11.0", | ||||||
| "child-process-promise": "^2.2.1", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also resolved from the package cache.