Commit Graph

754 Commits

Author SHA1 Message Date
Andrew Eisenberg
672b20d4aa Clear problems view when a database is removed
This commit fixes the problem whereby a database is removed and the
problems associated with queries run from that database stick around
in the problems view.

Also, once problems are cleared, we need to make sure that we uncheck
the checkbox in the results view.

This commit has several limitations:

1. There is duplicated code for message handling in both results.tsx and
result-tables.tsx.
2. Problems are cleared whenever there is *any* change to any database.
Ideally we should only clear problems when a database is removed and
only problems associated with that database. I'll fix part of this in
a future commit.

Resolves #525
2020-10-08 12:32:27 -07:00
Andrew Eisenberg
c83d1b305e Rename AstItem -> ChildAstItem and RootAstItem -> AstItem
This simplifies some of our type conversions since all ChildAstItem
are AstItem.
2020-10-07 17:48:40 -07:00
Andrew Eisenberg
732eb83d07 Select the appropriate node in the AST viewer when the editor text selection changes
When a user clicks in an editor that whose source tree is currently being displayed in
the ast viewer, the viewer selection will stay in sync with the editor selection.
2020-10-07 17:48:40 -07:00
Andrew Eisenberg
7e5d5922db Update changelog 2020-10-06 08:42:29 -07:00
Andrew Eisenberg
15f38c6f18 Add icons for various query history view commands
And show these commands in the title bar.
2020-10-06 08:42:29 -07:00
Andrew Eisenberg
4adbfa4e81 Update changelog 2020-10-06 08:42:29 -07:00
Andrew Eisenberg
7c10d72117 Adds a message that appears in an empty databases view
Also, fixes a regex.
2020-10-06 08:42:29 -07:00
Andrew Eisenberg
7800c68065 Allow setting number of threads to 0
Fixes #603
2020-10-05 07:54:42 -07:00
Andrew Eisenberg
c4d9eed734 Update error message when there is a missing contextual query
References #476
2020-10-01 14:15:07 -07:00
Andrew Eisenberg
c34c9fae6a Avoid using path.join for sarif uris
These are uris, not paths and always use '/', even on windows.
2020-10-01 07:44:47 -07:00
Andrew Eisenberg
03f1e4ef08 Update changelog 2020-10-01 07:44:47 -07:00
Andrew Eisenberg
06b6a4705a Ensure backslashes are properly escaped in sarif messages
Problem was that we were not globally replaceing `\\` with `\`.

Also, this PR adds some new tests to sarif-utils.ts. In doing so, we
have fixed a small bug in getPathRelativeToSourceLocationPrefix.

Previously, we were uri decoding the sarifRelativeUri. However, this is
no longer correct because the result is another URI and it should
remain encoded if it originally was.

Resolves #585
2020-10-01 07:44:47 -07:00
Andrew Eisenberg
7ca456d6a0 Ensure all fields have labels
Never show an empty string in the results view. This fixes #535 (again).
2020-09-30 11:05:20 -07:00
Jason Reed
5244a1c3b0 Actually refresh the treeview when updating SARIF context value 2020-09-29 15:04:00 -07:00
Jason Reed
f4775954b6 Fix #597. 2020-09-29 15:04:00 -07:00
Andrew Eisenberg
7c48c5f887 Update changelog 2020-09-29 15:03:15 -07:00
Andrew Eisenberg
3e3a31d5e2 Add unit tests for query-results.ts 2020-09-29 15:03:15 -07:00
Andrew Eisenberg
72160a24bd Fix incorrect call to bqrs info when retrieving paginated results
When retrieving paginated results, need to make sure we are getting
page offsets from the correct results file.

Previously, we were incorrectly extracting page offsets from the default
(unsorted) file. With this change, we ensure that we get offsets from
the proper results file when there is a request for a page of results.
2020-09-29 15:03:15 -07:00
Andrew Eisenberg
456c25f617 Fix invalid sort after reloading query results
With this change, we use the stored sort order if it exists
after reloading a query results page.
2020-09-29 15:03:15 -07:00
Andrew Eisenberg
0c571b1942 Fix mocha test running (#600)
PR #591 broke the build.
2020-09-29 16:34:51 -04:00
Andrew Eisenberg
7e4491ac45 Update mocha version (#591)
This fixes a dependabot error on yargs-parser
2020-09-29 09:04:46 -04:00
Andrew Eisenberg
75b5c1d316 Allow max queries to be configurable
Max number of simultaneous queries launchable by runQueries command is
now configurable by codeQL.runningQueries.maxQueries.
2020-09-25 07:54:41 -07:00
Andrew Eisenberg
db6fc5d7f0 Refactor: Change renderLocation in webview
* It is now more general and the logic is simplified
* Also, add more comments
* Rename `adaptBqrs` to `transformBqrsResultSet`
* Remove a react error for missing a key attribute in a list
2020-09-24 07:54:50 -07:00
Andrew Eisenberg
84028434e0 Refactor: Remove duplicated BQRS types
This refactoring combines the types in `bqrs-types.ts` and
`bqrs-cli-types.ts`. Historically, the former was used for BQRS files
parsed by the extension and the latter for BQRS files parsed by the cli.
They describe the same file types, but using different property and type
names.

We have moved to parsing all BQRS files by the cli. This refactoring
removes the `bqrs-types.ts` file and replaces all BQRS references to
use types in `bqrs-cli-types.ts`.

Additionally, the `adapt.ts` file has been deleted since its purpose
was to convert between extension and cli BQRS types. Some one type and
one function from `adapt.ts` has been moved from `adapt.ts` to
`bqrs-types.ts`. It's possible that we want to do a further refactoring
to simply remove them both.
2020-09-24 07:54:50 -07:00
github-actions[bot]
b917a204ba Bump version to v1.3.4 (#580)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2020-09-16 16:35:21 -04:00
jcreedcmu
8a5514c696 Date CHANGELOG for release (#579)
Some checks failed
Code Scanning - CodeQL / codeql (push) Has been cancelled
Build Extension / Build (ubuntu-latest) (push) Has been cancelled
Build Extension / Build (windows-latest) (push) Has been cancelled
Build Extension / Test (ubuntu-latest) (push) Has been cancelled
Build Extension / Test (windows-latest) (push) Has been cancelled
Release / Release (push) Has been cancelled
v1.3.3
2020-09-16 16:22:01 -04:00
Andrew Eisenberg
29f92575ee Update npm dependencies fix security vulns
* node-fetch
* bl
2020-09-16 07:57:31 -07:00
Aditya Sharad
5d63431b8c Actions: Pin version of upload-artifact action (#549) 2020-09-08 16:25:18 -07:00
Andrew Eisenberg
17eee86765 Update changelog 2020-09-02 08:16:27 -07:00
Andrew Eisenberg
95d5274fd4 Avoid showing a link when the underlying path is empty
A common situation when a file is not relevant for a particular result
is to return an empty file path location.

Currently, we are displaying this situation as a hyperlink in the
results, but when clicking on the link, there is an error.

To mirror the behaviour of Eclipse, we should avoid showing a link here.
This commit changes that behaviour.
2020-09-02 08:16:27 -07:00
Dave Bartolomeo
959552544a Fix highlighting after disembodied IPA branch
Fixes #543
```ql
newtype TA = TB()

private predicate foo() { any() }
```
Our TextMate grammar didn't realize that the newtype declaration ended after the closing paren of the branch's parameter list, so the `private` modifier was highlighted incorrectly.

It's surprisingly tricky to get TextMate to handle this correctly, so I wound up just treating the IPA declaration head (`newtype TA`), the branch head (`= TB`), the branch parameter list, and the branch body as directly children of the module body. This is kind of hacky, but it does fix the bug without introducing any new cases where we have incorrect highlighting of valid code.
2020-09-01 22:31:16 -07:00
Andrew Eisenberg
16fab7f45d Fix typo 2020-08-26 08:27:11 -07:00
Andrew Eisenberg
cb03da3716 Avoid running query when a user cancels when there are unsaved changes
Fixes #538

Adds a new menu item to cancel a query run when the query is unsaved.

Also, ensures that no warning message is sent to the console.
2020-08-25 07:43:52 -07:00
Andrew Eisenberg
f968f8e2f5 Add a top-level tsconfig.json
The reason to add this is that I am getting misleadings errors in
vscode that this file is missing. By adding this file, I no longer
see these errors.
2020-08-24 10:58:17 -07:00
jcreedcmu
c247292181 Merge pull request #537 from jcreedcmu/jcreed/fix-paginated-sorting
Fix changing page forgetting about sorting
2020-08-14 09:47:46 -04:00
Jason Reed
518e6c14cc Add changelog entry 2020-08-14 08:09:28 -04:00
Jason Reed
37cf525c8e Fix changing page forgetting about sorting 2020-08-14 08:06:31 -04:00
jcreedcmu
1f4e69940d Merge pull request #536 from jcreedcmu/jcreed/fix-none
Fix #535
2020-08-13 11:04:09 -04:00
Jason Reed
72878fb6fd Pass up empty string at this stage 2020-08-13 09:43:04 -04:00
Jason Reed
6b343b4581 Add changelog entry 2020-08-13 08:23:02 -04:00
Jason Reed
b191f68599 Fix #535. 2020-08-13 08:19:55 -04:00
Andrew Eisenberg
ef84d8d362 Update changelog after release
Add a simple perl script that will augment the CHANGELOG with
an [UNRELEASED] section when creating the PR after a release.
2020-08-12 11:33:18 -07:00
github-actions[bot]
ef55d9d4e0 Bump version to v1.3.3 2020-08-12 10:43:21 -07:00
Andrew Eisenberg
ff841950ae Update Chnagelog for v1.3.2
Some checks failed
Code Scanning - CodeQL / codeql (push) Has been cancelled
Build Extension / Build (ubuntu-latest) (push) Has been cancelled
Build Extension / Build (windows-latest) (push) Has been cancelled
Build Extension / Test (ubuntu-latest) (push) Has been cancelled
Build Extension / Test (windows-latest) (push) Has been cancelled
Release / Release (push) Has been cancelled
v1.3.2
2020-08-12 10:35:35 -07:00
Andrew Eisenberg
aaf9e1fb9c Update changelog 2020-08-12 10:35:35 -07:00
jcreedcmu
7f885755c2 Merge pull request #529 from jcreedcmu/jcreed/fix-527
Fix sorting of raw results
2020-08-12 12:31:39 -04:00
Jason Reed
8c55e3ef2d Simplify argument passing 2020-08-12 12:25:20 -04:00
Jason Reed
039343efa2 Fix #527. 2020-08-12 12:10:02 -04:00
Jason Reed
d0982f34a4 Defunctionalize updating sort state
This leads to less sharing of codepaths which is a little bad (slightly more
repetition and rendundancy) but a lot good (can independently fix the way
raw results are redisplayed so as to be actually correct).
2020-08-12 12:10:02 -04:00
jcreedcmu
890821b273 Merge pull request #528 from aeisenberg/aeisenberg/ast-changelog
Update changelog to include line about experimental AST Viewer
2020-08-12 11:22:33 -04:00