Skip to content

Commit 5754d19

Browse files
author
Alexander Eyers-Taylor
committed
Merge remote-tracking branch 'origin/main' into alexet/update-lsp
2 parents df83274 + f661386 commit 5754d19

543 files changed

Lines changed: 145564 additions & 20533 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ CHANGELOG.md merge=union
2323
# Mark some JSON files containing test data as generated so they are not included
2424
# as part of diffs or language statistics.
2525
extensions/ql-vscode/src/stories/remote-queries/data/*.json linguist-generated
26+
27+
# Always use LF line endings, also on Windows
28+
* text=auto eol=lf

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Checkout repository
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v3
2323

2424
- name: Initialize CodeQL
2525
uses: github/codeql-action/init@main

.github/workflows/main.yml

Lines changed: 78 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ jobs:
1616
os: [ubuntu-latest, windows-latest]
1717
steps:
1818
- name: Checkout
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020
with:
2121
fetch-depth: 1
2222

23-
- uses: actions/setup-node@v1
23+
- uses: actions/setup-node@v3
2424
with:
2525
node-version: '16.14.2'
26+
cache: 'npm'
27+
cache-dependency-path: extensions/ql-vscode/package-lock.json
2628

2729
- name: Install dependencies
2830
working-directory: extensions/ql-vscode
2931
run: |
30-
npm install
32+
npm ci
3133
shell: bash
3234

3335
- name: Build
@@ -65,37 +67,27 @@ jobs:
6567
# This workflow step gets an unstable testing version of the CodeQL CLI. It should not be used outside of these tests.
6668
run: |
6769
LATEST=`gh api repos/dsp-testing/codeql-cli-nightlies/releases --jq '.[].tag_name' --method GET --raw-field 'per_page=1'`
68-
echo "::set-output name=nightly-url::https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST"
70+
echo "nightly-url=https://github.com/dsp-testing/codeql-cli-nightlies/releases/download/$LATEST" >> "$GITHUB_OUTPUT"
6971
70-
test:
71-
name: Test
72-
runs-on: ${{ matrix.os }}
73-
needs: [find-nightly]
74-
strategy:
75-
matrix:
76-
os: [ubuntu-latest, windows-latest]
72+
lint:
73+
name: Lint
74+
runs-on: ubuntu-latest
7775
steps:
7876
- name: Checkout
79-
uses: actions/checkout@v2
77+
uses: actions/checkout@v3
8078
with:
8179
fetch-depth: 1
8280

83-
- uses: actions/setup-node@v1
81+
- uses: actions/setup-node@v3
8482
with:
85-
node-version: '16.14.0'
83+
node-version: '16.14.2'
84+
cache: 'npm'
85+
cache-dependency-path: extensions/ql-vscode/package-lock.json
8686

8787
- name: Install dependencies
8888
working-directory: extensions/ql-vscode
8989
run: |
90-
npm install
91-
shell: bash
92-
93-
- name: Build
94-
working-directory: extensions/ql-vscode
95-
env:
96-
APP_INSIGHTS_KEY: '${{ secrets.APP_INSIGHTS_KEY }}'
97-
run: |
98-
npm run build
90+
npm ci
9991
shell: bash
10092

10193
- name: Lint
@@ -108,18 +100,67 @@ jobs:
108100
run: |
109101
npm run lint:scenarios
110102
111-
- name: Run unit tests (Linux)
103+
unit-test:
104+
name: Unit Test
105+
runs-on: ${{ matrix.os }}
106+
strategy:
107+
matrix:
108+
os: [ubuntu-latest, windows-latest]
109+
steps:
110+
- name: Checkout
111+
uses: actions/checkout@v3
112+
with:
113+
fetch-depth: 1
114+
115+
- uses: actions/setup-node@v3
116+
with:
117+
node-version: '16.14.2'
118+
cache: 'npm'
119+
cache-dependency-path: extensions/ql-vscode/package-lock.json
120+
121+
- name: Install dependencies
112122
working-directory: extensions/ql-vscode
113-
if: matrix.os == 'ubuntu-latest'
114123
run: |
115-
npm run test
124+
npm ci
125+
shell: bash
116126

117-
- name: Run unit tests (Windows)
118-
if: matrix.os == 'windows-latest'
127+
- name: Run unit tests
119128
working-directory: extensions/ql-vscode
120129
run: |
121130
npm run test
122131
132+
test:
133+
name: Test
134+
runs-on: ${{ matrix.os }}
135+
strategy:
136+
matrix:
137+
os: [ubuntu-latest, windows-latest]
138+
steps:
139+
- name: Checkout
140+
uses: actions/checkout@v3
141+
with:
142+
fetch-depth: 1
143+
144+
- uses: actions/setup-node@v3
145+
with:
146+
node-version: '16.14.2'
147+
cache: 'npm'
148+
cache-dependency-path: extensions/ql-vscode/package-lock.json
149+
150+
- name: Install dependencies
151+
working-directory: extensions/ql-vscode
152+
run: |
153+
npm ci
154+
shell: bash
155+
156+
- name: Build
157+
working-directory: extensions/ql-vscode
158+
env:
159+
APP_INSIGHTS_KEY: '${{ secrets.APP_INSIGHTS_KEY }}'
160+
run: |
161+
npm run build
162+
shell: bash
163+
123164
- name: Run integration tests (Linux)
124165
if: matrix.os == 'ubuntu-latest'
125166
working-directory: extensions/ql-vscode
@@ -144,24 +185,26 @@ jobs:
144185
strategy:
145186
matrix:
146187
os: [ubuntu-latest, windows-latest]
147-
version: ['v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.5', 'v2.11.2', 'nightly']
188+
version: ['v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.5', 'v2.11.4', 'nightly']
148189
env:
149190
CLI_VERSION: ${{ matrix.version }}
150191
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
151192
TEST_CODEQL_PATH: '${{ github.workspace }}/codeql'
152193

153194
steps:
154195
- name: Checkout
155-
uses: actions/checkout@v2
196+
uses: actions/checkout@v3
156197

157-
- uses: actions/setup-node@v1
198+
- uses: actions/setup-node@v3
158199
with:
159-
node-version: '16.14.0'
200+
node-version: '16.14.2'
201+
cache: 'npm'
202+
cache-dependency-path: extensions/ql-vscode/package-lock.json
160203

161204
- name: Install dependencies
162205
working-directory: extensions/ql-vscode
163206
run: |
164-
npm install
207+
npm ci
165208
shell: bash
166209

167210
- name: Build
@@ -180,10 +223,10 @@ jobs:
180223
else
181224
REF="codeql-cli/${{ matrix.version }}"
182225
fi
183-
echo "::set-output name=ref::$REF"
226+
echo "ref=$REF" >> "$GITHUB_OUTPUT"
184227
185228
- name: Checkout QL
186-
uses: actions/checkout@v2
229+
uses: actions/checkout@v3
187230
with:
188231
repository: github/codeql
189232
ref: ${{ steps.choose-ref.outputs.ref }}

.github/workflows/release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
runs-on: ubuntu-latest
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2222

23-
- uses: actions/setup-node@v1
23+
- uses: actions/setup-node@v3
2424
with:
2525
node-version: '16.14.2'
2626

@@ -47,11 +47,11 @@ jobs:
4747
# Record the VSIX path as an output of this step.
4848
# This will be used later when uploading a release asset.
4949
VSIX_PATH="$(ls dist/*.vsix)"
50-
echo "::set-output name=vsix_path::$VSIX_PATH"
50+
echo "vsix_path=$VSIX_PATH" >> "$GITHUB_OUTPUT"
5151
# Transform the GitHub ref so it can be used in a filename.
5252
# The last sed invocation is used for testing branches that modify this workflow.
5353
REF_NAME="$(echo ${{ github.ref }} | sed -e 's:^refs/tags/::' | sed -e 's:/:-:g')"
54-
echo "::set-output name=ref_name::$REF_NAME"
54+
echo "ref_name=$REF_NAME" >> "$GITHUB_OUTPUT"
5555
5656
- name: Upload artifacts
5757
uses: actions/upload-artifact@v2
@@ -107,7 +107,7 @@ jobs:
107107
# Bump to the next patch version. Major or minor version bumps will have to be done manually.
108108
# Record the next version number as an output of this step.
109109
NEXT_VERSION="$(npm version patch)"
110-
echo "::set-output name=next_version::$NEXT_VERSION"
110+
echo "next_version=$NEXT_VERSION" >> "$GITHUB_OUTPUT"
111111
112112
- name: Add changelog for next release
113113
if: success()
@@ -136,7 +136,7 @@ jobs:
136136
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
137137
steps:
138138
- name: Download artifact
139-
uses: actions/download-artifact@v2
139+
uses: actions/download-artifact@v3
140140
with:
141141
name: vscode-codeql-extension
142142

@@ -156,7 +156,7 @@ jobs:
156156
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
157157
steps:
158158
- name: Download artifact
159-
uses: actions/download-artifact@v2
159+
uses: actions/download-artifact@v3
160160
with:
161161
name: vscode-codeql-extension
162162

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ artifacts/
1616
# Visual Studio workspace state
1717
.vs/
1818

19-
# Rush files
20-
/common/temp/**
21-
package-deps.json
22-
**/.rush/temp
19+
# CodeQL metadata
20+
.cache/
21+
.codeql/

.vscode/extensions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"recommendations": [
66
"amodio.tsl-problem-matcher",
77
"dbaeumer.vscode-eslint",
8-
"eternalphane.tsfmt-vscode"
8+
"esbenp.prettier-vscode",
9+
"Orta.vscode-jest",
910
],
1011
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1112
"unwantedRecommendations": []

.vscode/launch.json

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,16 @@
2929
"name": "Launch Unit Tests (vscode-codeql)",
3030
"type": "node",
3131
"request": "launch",
32-
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/mocha/bin/_mocha",
32+
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
3333
"showAsyncStacks": true,
3434
"cwd": "${workspaceFolder}/extensions/ql-vscode",
35-
"runtimeArgs": [
36-
"--inspect=9229"
37-
],
3835
"env": {
39-
"LANG": "en-US"
36+
"LANG": "en-US",
37+
"TZ": "UTC"
4038
},
4139
"args": [
42-
"--exit",
43-
"-u",
44-
"bdd",
45-
"--colors",
46-
"--diff",
47-
"-r",
48-
"ts-node/register",
49-
"-r",
50-
"test/mocha.setup.js",
51-
"test/pure-tests/**/*.ts"
40+
"--projects",
41+
"test"
5242
],
5343
"stopOnEntry": false,
5444
"sourceMaps": true,
@@ -62,6 +52,10 @@
6252
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
6353
"showAsyncStacks": true,
6454
"cwd": "${workspaceFolder}/extensions/ql-vscode",
55+
"args": [
56+
"--projects",
57+
"src/view"
58+
],
6559
"stopOnEntry": false,
6660
"sourceMaps": true,
6761
"console": "integratedTerminal",
@@ -119,7 +113,7 @@
119113
"--disable-extension",
120114
"github.copilot",
121115
"${workspaceRoot}/extensions/ql-vscode/src/vscode-tests/cli-integration/data",
122-
// Uncomment the last line and modify the path to a checked out
116+
// Uncomment the last line and modify the path to a checked out
123117
// instance of the codeql repository so the libraries are
124118
// available in the workspace for the tests.
125119
// "${workspaceRoot}/../codeql"

.vscode/settings.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,18 @@
3636
"typescript.preferences.quoteStyle": "single",
3737
"javascript.preferences.quoteStyle": "single",
3838
"editor.wordWrapColumn": 100,
39-
"jest.rootPath": "./extensions/ql-vscode"
39+
"jest.rootPath": "./extensions/ql-vscode",
40+
"jest.autoRun": "watch",
41+
"jest.nodeEnv": {
42+
"LANG": "en-US",
43+
"TZ": "UTC"
44+
},
45+
"[typescript]": {
46+
"editor.defaultFormatter": "esbenp.prettier-vscode",
47+
"editor.formatOnSave": true,
48+
},
49+
"[typescriptreact]": {
50+
"editor.defaultFormatter": "esbenp.prettier-vscode",
51+
"editor.formatOnSave": true,
52+
},
4053
}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/* @github/codeql-vscode-reviewers
22
**/remote-queries/ @github/code-scanning-secexp-reviewers
33
**/variant-analysis/ @github/code-scanning-secexp-reviewers
4+
**/databases/ @github/code-scanning-secexp-reviewers

0 commit comments

Comments
 (0)