Skip to content

Commit 18e1cfa

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/fix-duplicate-downloads
2 parents 49f97e1 + e7a0c7e commit 18e1cfa

File tree

173 files changed

+39172
-15382
lines changed

Some content is hidden

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

173 files changed

+39172
-15382
lines changed

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

CONTRIBUTING.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,17 @@ We have several types of tests:
102102

103103
The CLI integration tests require an instance of the CodeQL CLI to run so they will require some extra setup steps. When adding new tests to our test suite, please be mindful of whether they need to be in the cli-integration folder. If the tests don't depend on the CLI, they are better suited to being a VSCode integration test.
104104

105+
Any test data you're using (sample projects, config files, etc.) must go in a `src/vscode-tests/*/data` directory. When you run the tests, the test runner will copy the data directory to `out/vscode-tests/*/data`.
106+
105107
#### Running the tests
106108

109+
Pre-requisites:
110+
1. Run `npm run build`.
111+
2. You will need to have `npm run watch` running in the background.
112+
107113
##### 1. From the terminal
108114

109-
First move into the `extensions/ql-vscode` directory. Then, depending on which tests you want to run, use the appropriate command to run the tests:
115+
Then, from the `extensions/ql-vscode` directory, use the appropriate command to run the tests:
110116

111117
* Unit tests: `npm run test:unit`
112118
* View Tests: `npm test:view`

extensions/ql-vscode/.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode-test/
2+
node_modules/
3+
out/
4+
5+
# Include the Storybook config
6+
!.storybook

extensions/ql-vscode/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
parserOptions: {
44
ecmaVersion: 2018,
55
sourceType: "module",
6-
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json"],
6+
project: ["tsconfig.json", "./src/**/tsconfig.json", "./gulpfile.ts/tsconfig.json", "./scripts/tsconfig.json", "./.storybook/tsconfig.json"],
77
},
88
plugins: ["@typescript-eslint"],
99
env: {

extensions/ql-vscode/.mocharc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"exit": true,
3-
"require": [
4-
"test/mocha.setup.js"
5-
]
3+
"require": ["test/mocha.setup.js"]
64
}

extensions/ql-vscode/.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import '@vscode/codicons/dist/codicon.css';
77
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
88
export const parameters = {
99
// All props starting with `on` will automatically receive an action as a prop
10-
actions: { argTypesRegex: "^on[A-Z].*" },
10+
actions: { argTypesRegex: '^on[A-Z].*' },
1111
// All props matching these names will automatically get the correct control
1212
controls: {
1313
matchers: {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export function config(entry = []) {
2-
return [...entry, require.resolve("./preview.ts")];
2+
return [...entry, require.resolve('./preview.ts')];
33
}
44

55
export function managerEntries(entry = []) {
6-
return [...entry, require.resolve("./manager.tsx")];
6+
return [...entry, require.resolve('./manager.tsx')];
77
}

extensions/ql-vscode/.storybook/vscode-theme-addon/theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ export enum VSCodeTheme {
66
export const themeNames: { [key in VSCodeTheme]: string } = {
77
[VSCodeTheme.Dark]: 'Dark+',
88
[VSCodeTheme.Light]: 'Light+',
9-
}
9+
};

extensions/ql-vscode/.storybook/vscode-theme-addon/withTheme.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from
44
import { VSCodeTheme } from './theme';
55

66
const themeFiles: { [key in VSCodeTheme]: string } = {
7+
// eslint-disable-next-line @typescript-eslint/no-var-requires
78
[VSCodeTheme.Dark]: require('!file-loader?modules!../../src/stories/vscode-theme-dark.css').default,
9+
// eslint-disable-next-line @typescript-eslint/no-var-requires
810
[VSCodeTheme.Light]: require('!file-loader?modules!../../src/stories/vscode-theme-light.css').default,
9-
}
11+
};
1012

1113
export const withTheme = (
1214
StoryFn: StoryFunction<AnyFramework>,
@@ -18,7 +20,7 @@ export const withTheme = (
1820
const styleSelectorId =
1921
context.viewMode === 'docs'
2022
? `addon-vscode-theme-docs-${context.id}`
21-
: `addon-vscode-theme-theme`;
23+
: 'addon-vscode-theme-theme';
2224

2325
const theme = Object.values(VSCodeTheme).includes(vscodeTheme) ? vscodeTheme as VSCodeTheme : VSCodeTheme.Dark;
2426

extensions/ql-vscode/gulpfile.ts/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as gulp from 'gulp';
22
import { compileTypeScript, watchTypeScript, cleanOutput } from './typescript';
33
import { compileTextMateGrammar } from './textmate';
4-
import { copyTestData } from './tests';
4+
import { copyTestData, watchTestData } from './tests';
55
import { compileView, watchView } from './webpack';
66
import { packageExtension } from './package';
77
import { injectAppInsightsKey } from './appInsights';
@@ -21,6 +21,7 @@ export {
2121
watchView,
2222
compileTypeScript,
2323
copyTestData,
24+
watchTestData,
2425
injectAppInsightsKey,
2526
compileView,
2627
};

0 commit comments

Comments
 (0)