Commit Graph

577 Commits

Author SHA1 Message Date
Kasper Svendsen
9494d32144 Clear query server package cache on dbscheme edits 2024-06-11 10:55:42 +00:00
Andrew Eisenberg
376d6b75d6 Fix bug with reimporting test cases
When re-importing a test database, if the source archive for that
database is not in the workspace, then old source code will be seen when
inspected.

To reproduce:

1. Run a ql test file with a failure (I'm using a javascript DB).
2. Right click and import on the db that sticks around.
3. Change the JS source file for the test.
4. Re-run and still have a failure.
5. Re-import the database
6. Run the query under test
7. Click on a result item
8. **BUG:** The source code is old

The problem is that the source archive cache is not being flushed in
this case. I added a case to flush the source archive when the archive
was imported into the workspace as a folder, but not when the archive is
external.

The fix is to listen for database remove events in the archive
filesystem provider and flush the associated database source
archive.

There is a complication:

The database remove event didn't emit the removed database. This is
because the only place that consumed the event didn't need it.

To get around this, I changed the structure of the events. I added a
new `fullRefresh` boolean. If true, then the original database change
handler will ensure the entire tree is refreshed. If false, only the
selected database.
2024-05-17 23:10:56 +00:00
Koen Vlaswinkel
247df2e1f9 Merge pull request #3607 from github/koesie10/ghec-dr-variant-analysis
Add GHEC-DR support
2024-05-14 10:40:28 +02:00
Koen Vlaswinkel
47ae0fe9f5 Fix incorrect supported CLI version warning 2024-05-13 16:44:03 +02:00
Koen Vlaswinkel
871fc0b817 Use GHEC-DR URL in file blob URL 2024-05-13 11:19:31 +02:00
Koen Vlaswinkel
31b2d24ca9 Update custom errors to use GHEC-DR URL 2024-05-13 11:19:30 +02:00
Charis Kyriakou
0df508d1c6 Remove support for CodeQL CLI versions older than 2.14.6 (#3562) 2024-04-16 15:27:32 +01:00
Charis Kyriakou
070df13947 Rename vscode-app -> extension-app file to match convention (#3545) 2024-04-08 16:11:22 +01:00
Robert
4e43a07fb5 Merge branch 'main' into robertbrignull/fix-token-alerts 2024-04-02 17:27:53 +01:00
Robert
e23d4a9d9f Make restarting the query server not cancellable, because in practice it wasn't 2024-03-28 10:51:00 +00:00
Robert
6b0f7e86fa Mark progress bars as cancellable where it appears we are respecting the token 2024-03-26 17:05:22 +00:00
Robert
ec42728367 Only construct DatabaseFetcher once in extension.ts 2024-03-12 15:38:27 +00:00
Robert
3ee081e8c6 Move commonly-used field to DatabaseFetcher constructor 2024-03-12 15:32:40 +00:00
Robert
18f1a46493 Naively convert DatabaseFetcher to a class 2024-03-12 15:14:00 +00:00
Charis Kyriakou
f4a866b04b Add logic to trigger model evaluation run (#3397) 2024-02-23 11:17:25 +00:00
Nora
fc41360bad Check in npm run format 2024-01-19 10:15:00 +00:00
Dave Bartolomeo
fef394b79d Merge pull request #3233 from github/dbartol/mrva-multi-bundle
Use CLI to bundle packs for MRVA
2024-01-18 09:10:21 -05:00
Koen Vlaswinkel
479aa683ee Rename IDE server to language client 2024-01-17 11:40:00 +01:00
Shati Patel
be22964113 Send telemetry for addDatabaseSourceToWorkspace setting (#3238) 2024-01-16 17:05:59 +00:00
Dave Bartolomeo
fb63ec7db0 Consume codeql version JSON output for feature capabilities 2024-01-11 21:59:54 +00:00
Dave Bartolomeo
1dc6111fba Switch to built-in VS Code test UI unconditionally 2024-01-11 10:47:48 -05:00
Koen Vlaswinkel
188bc53761 Enable no-useless-escape ESLint rule
These fixes maintain the current functionality and do not make any
changes to the matching of the regular expressions.
2024-01-08 16:44:41 +01:00
Koen Vlaswinkel
9d6962ede2 Enforce consistent type imports 2024-01-05 17:13:45 +01:00
Robert
1ce2b365a6 Move files to codeql-cli/distribution directory 2024-01-03 16:10:08 +00:00
Robert
bc7c956d6d Pull out GithubApiError and GithubRateLimitedError to a separate file 2024-01-03 10:46:15 +00:00
Koen Vlaswinkel
1ad20fa354 Merge pull request #3163 from github/koesie10/queries-panel-no-cli-server
Do not use the CLI server to determine query pack language
2024-01-03 09:36:20 +01:00
Koen Vlaswinkel
785a5fa48a Remove QueryRunner abstraction
Since we're only supporting the new query server, we can remove the
`QueryRunner` abstraction and just use the `NewQueryRunner` as a
concrete `QueryRunner` without an abstract base class. This simplifies
the code of the query server and removes some unnecessary indirection.
2023-12-21 16:03:28 +01:00
Koen Vlaswinkel
7554c415af Do not use the CLI server to determine query pack language
This removes the use of the CLI `codeql resolve library-path` command to
detect the language of a query pack. Instead, it uses the `qlpack.yml`
file to determine the language. This is slightly less correct since it
only works for `codeql/${language}-all` dependencies, but it is much
faster and more reliable. It also doesn't result in the CLI server
restarting for invalid query packs (such as in the `github/codeql`
repository or in any workspaces containing it).
2023-12-21 12:20:12 +01:00
Koen Vlaswinkel
f99432153b Add tests for promptGitHubRepositoryDownload 2023-12-21 10:56:34 +01:00
Andrew Eisenberg
ef69a51741 Avoid creating a multitoken when finding definitions
This will avoid showing a query-server popup on hovers. When someone
does CTRL+hover on source code in a database archive, the definitions
provider is triggered. The first time this is run, there will be a query that
is invoked in order to find definitions. This can be a long process.

Previously, this query brought up a popup window that could be cancelled.
However, this is confusing users since the query is automatically cancelled
when the mouse hovers away from the element.

The downside of this PR is that even when find definitions is explicitly invoked,
(using F12), there will still be no hover.

I think this is an improvement, but I am happy to discuss if others disagree.
2023-12-13 22:50:37 +00:00
Koen Vlaswinkel
01085e75ba Automatically fix ESLint violations 2023-12-11 17:00:16 +01:00
Koen Vlaswinkel
ce20c7f6a4 Remove legacy query server 2023-11-28 16:11:26 +01:00
Koen Vlaswinkel
5e6b7d846e Rename GitHubDatabaseModule to GitHubDatabasesModule 2023-11-24 15:31:33 +01:00
Koen Vlaswinkel
829607f044 Move GitHub databases files to separate directory 2023-11-24 10:34:49 +01:00
Koen Vlaswinkel
636f8f1b5f Prompt user for database download on startup 2023-11-17 14:45:35 +01:00
Koen Vlaswinkel
019195b38c Add finding of GitHub repositories in workspace 2023-11-13 17:04:08 +01:00
Koen Vlaswinkel
ff36088ecc Merge pull request #3012 from github/koesie10/use-selected-queries-item
Create new queries in selected folder of queries panel
2023-10-26 11:55:42 +02:00
Shati Patel
9a97b7b0be Deselect current db when the language context changes (#3007) 2023-10-25 14:54:01 +01:00
Koen Vlaswinkel
68ab2fda2d Create new queries in selected folder of queries panel
This will change the behavior of the "Create new query" command to
create the new query in the same folder as the first selected item in
the queries panel. If no items are selected, the behavior is the same
as before.

I've used events to communicate the selection from the queries panel to
the local queries module. This is some more code and some extra
complexity, but it ensures that we don't have a dependency from the
local queries module to the queries panel module. This makes testing
easier.
2023-10-25 14:28:48 +02:00
Koen Vlaswinkel
8b5329fe08 Use selected language when creating query
This will change the "Create new query" command to use the selected
language when creating a new query. If no language is selected, it will
still prompt the user to pick a language.
2023-10-24 13:41:37 +02:00
Koen Vlaswinkel
78f832a73f Show stack for redactable error in log
When calling for example `showAndLogExceptionWithTelemetry`, the stack
trace would be sent to Application Insights, but there was no way to
see the stack trace from within VS Code. This will add the stack trace
to the log by returning it from `fullMessageWithStack` and using it in
the appropriate places.
2023-10-20 16:49:36 +02:00
Anders Starcke Henriksen
52d32a5051 Merge branch 'main' into starcke/language-selection-panel 2023-10-13 09:52:17 +02:00
Koen Vlaswinkel
22f6ac7974 Add stack trace to unhandled error log message
This change sets the `fullMessage` of the
`showAndLogExceptionWithTelemetry` to include the stack trace. This
makes it possible to find the source of the error rather than only
knowing that a specific error occurred. If the error does not have a
stack trace (which should be rare) the message will be the same as
before.
2023-10-10 15:45:49 +02:00
Anders Starcke Henriksen
c668b39b30 Add language filter panel. 2023-10-10 14:34:04 +02:00
Anders Starcke Henriksen
9362447338 Add support for filtering history panel. 2023-10-03 13:55:01 +02:00
Anders Starcke Henriksen
1e6b7a6619 Add support for filtering queries panel. 2023-09-29 09:28:44 +02:00
Anders Starcke Henriksen
552a4f6eb3 Merge pull request #2873 from github/starcke/language-context-store
Add language context store.
2023-09-29 09:24:31 +02:00
Anders Starcke Henriksen
7bfe0df901 Add language context store. 2023-09-27 15:28:11 +02:00
Koen Vlaswinkel
eb3900f642 Bump minimum VS Code version for warnings 2023-09-25 11:38:39 +02:00
Koen Vlaswinkel
d7565fb849 Use App instead of ExtensionContext for webviews 2023-09-14 12:03:18 +02:00