Skip to content
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

Ephemeral quick query editor #619

Open
p0 opened this issue Oct 15, 2020 · 2 comments
Open

Ephemeral quick query editor #619

p0 opened this issue Oct 15, 2020 · 2 comments
Labels
enhancement New feature or request VSCode

Comments

@p0
Copy link

p0 commented Oct 15, 2020

Is your feature request related to a problem? Please describe.
When we added the quick query feature in #210, we had to stick within the confines of what was possible in VS Code at the time. This made the result a little less slick-feeling than the equivalent QL4E functionality: Quick queries are genuine files on disk, but in an obscure directory; this means they are stateful, and don't interact as well with repeated quick-query executions as QL4E's ephemeral design.

Describe the solution you'd like
With the advent of webview views, I think it's now possible do get feature-parity with Eclipse. We could create a "quick query" view which effectively consists of a large textarea that does CodeQL error checking and syntax highlighting in the context of the active database and workspace (meaning that the active database determines the language, and the qlpacks from the workspace are on the search path, like normal). We can then execute quick queries by passing the content of that text area to the query server, rather than by writing it to disk and passing a path.

The main benefit this unlocks is in conjunction with the query history view: If I double-click on a query execution that corresponds to a quick query, I want the quick query view to open, populated with the QL code that corresponds to the execution I double-clicked on. (We have support for looking at the QL text of existing query executions, but that goes via a slightly awkward readonly editor.)

A side benefit is the removal of the hidden quick-queries directory deep in the workspace, and any pretense that quick queries live in the filesystem, should appear in the outline, should be allowed to have QLLs next to them, and so on.

@p0 p0 added the enhancement New feature or request label Oct 15, 2020
@alexet
Copy link
Contributor

alexet commented Oct 15, 2020

We can't have a vscode editor inside a webview so we can't get nice text editing without implementing a web based text editor (or at least using one). We could have done this all inside a webview already. I don't think the location of where we could put the webview was the problem at the time. I think that without ide features it would be pretty painful.

@sj
Copy link
Contributor

sj commented Mar 8, 2022

Just in case anyone is looking for the "Quick query" functionality as it exists today in the VS Code extension: https://codeql.github.com/docs/codeql-for-visual-studio-code/analyzing-your-projects/#running-a-quick-query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request VSCode
Projects
None yet
Development

No branches or pull requests

3 participants