Commit Graph

786 Commits

Author SHA1 Message Date
Andrew Eisenberg
bc73712987 Fix AST viewer bug where nodes with id=0 did not have children 2020-07-23 12:43:11 -07:00
Jason Reed
09c4e7e99b Fix broken launch config
We need to provide the `--extensionDevelopmentPath` flag in these
launch configurations.

It appears to be unnecessary to include
`${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/**/*.js`
in addition to the strictly more general pattern
${workspaceRoot}/extensions/ql-vscode/out/**/*.js

An unfortunate UI fact appears to be that the log of the gulp build is
focused whenever these tasks are run, even though the log you actually
care about seeing is in the `Debug Console` section. Not sure how to
fix that.
2020-07-23 12:40:29 -07:00
jcreedcmu
d0e0ad619b Merge pull request #511 from ceh-forks/ceh-skip-log
Suppress database downloaded message when action canceled
2020-07-23 14:02:24 -04:00
Emil Hessman
e4ff8d1fa8 Only focus database panel on successful download 2020-07-23 19:44:36 +02:00
Andrew Eisenberg
9052851f9a Run CodeQL Action on PRs 2020-07-23 10:25:16 -07:00
jcreedcmu
a946965331 Merge pull request #508 from jcreedcmu/jcreed/untangle3
Fix documentation for current build process
2020-07-23 09:43:40 -04:00
Andrew Eisenberg
10177412f6 Merge pull request #492 from aeisenberg/aeisenberg/ast-viewer
Add the AST Viewer
2020-07-23 06:36:11 -07:00
jcreedcmu
4519e0f951 Update CONTRIBUTING.md
Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com>
2020-07-23 09:14:37 -04:00
Emil Hessman
0d2b44cdba Suppress database downloaded message when action canceled 2020-07-23 06:40:43 +02:00
Andrew Eisenberg
0045891f9d Clean up ast builder code 2020-07-22 13:34:01 -07:00
Jason Reed
2b712827df Clean up build instructions 2020-07-22 13:05:13 -04:00
Andrew Eisenberg
65b5b68df6 Remove duplicate changelog line 2020-07-21 12:28:50 -07:00
Andrew Eisenberg
f21296e4f6 Merge branch 'aeisenberg/ast-viewer' of github.com:aeisenberg/vscode-codeql into aeisenberg/ast-viewer 2020-07-21 10:10:23 -07:00
Jason Reed
762edd137c Fix CONTRIBUTING.md to reflect changes to build process. 2020-07-21 13:09:44 -04:00
jcreedcmu
b3dc7d75a8 Merge pull request #503 from jcreedcmu/jcreed/untangle2
Try moving build to just gulp
2020-07-21 12:56:34 -04:00
Jason Reed
9ad0bf6f43 Call into package.json scripts from actions workflow 2020-07-21 12:20:17 -04:00
Jason Reed
f8804f946c Use explicit path for vsce 2020-07-21 12:19:03 -04:00
Jason Reed
3c07be5f74 Move type dependency to devDependencies 2020-07-21 12:13:01 -04:00
Jason Reed
cd329eeaeb Fix source maps 2020-07-21 10:09:42 -04:00
Jason Reed
2671414f32 Extract rush from vscode tasks 2020-07-21 09:21:11 -04:00
Andrew Eisenberg
b6bd534857 Fixes pagination when there are no results
When there are no results, always ensure that max pages is 1.

This commit also changes the way pagination buttons are displayed,
removing their border.
2020-07-20 07:11:56 -07:00
Andrew Eisenberg
8093d9a529 Check window event origins
Fixes codescanning warnings:

- https://github.com/github/vscode-codeql/security/code-scanning/1
- https://github.com/github/vscode-codeql/security/code-scanning/2
2020-07-17 10:25:25 -07:00
jcreedcmu
aebab082c2 Merge branch 'main' into aeisenberg/ast-viewer 2020-07-17 10:53:15 -04:00
Andrew Eisenberg
36d612e5b0 Add feature flag for ast viewer
Set `codeQL.experimentalAstViewer` to true in settings
in order for component to be enabled.
2020-07-16 15:42:26 -07:00
Andrew Eisenberg
8459edb57c Fix tests and reformatting
* Fix command-linting tests.
* Fix failing windows test and Use Uri.parse(_, true)
* Use  Uri.parse(_, true). That is the preferred API.
* Reformat comments.
2020-07-16 14:42:48 -07:00
Andrew Eisenberg
af965c941a Update changelog 2020-07-16 14:42:48 -07:00
Andrew Eisenberg
eaa26e5ef7 Add the AST Viewer
This commit adds the AST Viewer for viewing the QL AST of a file in a
database.

The different components are as follows:

1. There is a new view `codeQLAstViewer`, which displays the AST
2. This view is backed by the `AstViewerDataProvider` and `AstViewer` classes in astView.ts
3. To generate an AST, we use contextual queries, similar to how Find references/declarations are implemented. In particular, in `definitions.ts` there is `TemplatePrintAstProvider` which provides an AST for a given source buffer.
  - Similar to the other queries, we first determine which database the buffer belongs to.
  - Based on that, we generate a synthetic qlpack and run the templatized `printAst.ql` query
  - We plug in the archive-relative path name of the source file.
  - After the query is run, we wrap the results in an `AstBuilder` instance.
  - When requested, the `AstBuilder` will generate the full AST of the file from the BQRS results.
  - The AST roots (all top-level elements, functions, variable declarations, etc, are roots) are passed to the `AstViewer` instance, which handles the display lifecycle and other VS Code-specific functions.

There are a few unrelated pieces here, which can be pulled out to another PR if required:

- The `codeQLQueryHistory` view now has a _welcome_ message to make it more obvious to users how to start.
- `definitions.ts` is moved to the `contextual` subfolder.
- `fileRangeFromURI` is extracted from `definitions.ts` to its own file so it can be reused.

Also, note that this relies on https://github.com/github/codeql/pull/3931 for the C/C++ query to be available in the QL sources. Other languages will need similar queries.
2020-07-16 14:42:47 -07:00
Andrew Eisenberg
546ec2eb1c Update changelog 2020-07-16 09:10:05 -07:00
Andrew Eisenberg
565ea0d8a0 Use proper check for existence of search path
Fixes #499
2020-07-16 09:10:05 -07:00
Jason Reed
258f43132c Relax version constraints in package.json 2020-07-16 09:19:07 -04:00
Jason Reed
b7a72b9d21 Remove now unused rush configuration 2020-07-16 09:10:53 -04:00
Jason Reed
d2138907b9 Fix test section of workflow file 2020-07-16 08:51:35 -04:00
Jason Reed
bce3413158 Run npm-installed copy of vsce 2020-07-16 08:49:47 -04:00
Jason Reed
2b53396146 Fix warning 2020-07-16 08:49:07 -04:00
Jason Reed
19a76dcbee Update action to not depend on rush 2020-07-16 08:43:07 -04:00
Jason Reed
56b62ff758 Fix package deploy to not depend on rush 2020-07-16 08:39:17 -04:00
Jason Reed
9083c5d649 Reconcile vscode-engine and api versions 2020-07-16 08:00:37 -04:00
Jason Reed
49c0d39a50 Replace javascript gulpfile with typescript 2020-07-14 13:51:49 -04:00
jcreedcmu
57ea215639 Merge pull request #496 from jcreedcmu/jcreed/untangle
Reduce dependencies on internal modules
2020-07-14 13:03:03 -04:00
Jason Reed
528cbc8d49 Move more config into local typescript gulpfile 2020-07-14 12:52:06 -04:00
Jason Reed
2c5b672c81 Make stub typescript gulpfile 2020-07-14 12:11:54 -04:00
Jason Reed
f0055910c1 Remove typescript-config package 2020-07-14 12:02:51 -04:00
Jason Reed
657df5e07d inline tsconfig inheritance 2020-07-14 11:54:34 -04:00
Jason Reed
53d5c2438a Remove now unused library. 2020-07-14 08:19:45 -04:00
Jason Reed
ac941eb9dd Copy semmle-vscode-utils into extension. 2020-07-14 08:17:30 -04:00
Jason Reed
e5e854822d Remove now-unused libraries. 2020-07-14 08:00:11 -04:00
Jason Reed
868b356588 Sharpen comment slightly. 2020-07-14 07:46:43 -04:00
Jason Reed
2dd841e667 Pacify lint.
Apparently the linter wants a tsconfig file to be able to lint the
compare view typescript. I made the configFile specification in the
webpack.config.ts more specific so that we use the same config
every time during webview build.
2020-07-13 13:04:22 -04:00
Jason Reed
609fea404d Remove extension dependency on semmle-io-node 2020-07-13 12:59:13 -04:00
Jason Reed
24da63fbfa Remove extension dependency on semmle-bqrs 2020-07-13 12:48:55 -04:00