Merge remote-tracking branch 'origin/main' into koesie10/stop-monitor-after-remove
This commit is contained in:
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -186,6 +186,7 @@ jobs:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
version: ['v2.7.6', 'v2.8.5', 'v2.9.4', 'v2.10.5', 'v2.11.4', 'nightly']
|
||||
fail-fast: false
|
||||
env:
|
||||
CLI_VERSION: ${{ matrix.version }}
|
||||
NIGHTLY_URL: ${{ needs.find-nightly.outputs.url }}
|
||||
|
||||
1
.vscode/extensions.json
vendored
1
.vscode/extensions.json
vendored
@@ -6,6 +6,7 @@
|
||||
"amodio.tsl-problem-matcher",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"firsttris.vscode-jest-runner",
|
||||
"Orta.vscode-jest",
|
||||
],
|
||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||
|
||||
97
.vscode/launch.json
vendored
97
.vscode/launch.json
vendored
@@ -45,6 +45,30 @@
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"name": "Launch Selected Unit Test (vscode-codeql)",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
|
||||
"showAsyncStacks": true,
|
||||
"cwd": "${workspaceFolder}/extensions/ql-vscode",
|
||||
"env": {
|
||||
"LANG": "en-US",
|
||||
"TZ": "UTC"
|
||||
},
|
||||
"args": [
|
||||
"--projects",
|
||||
"test",
|
||||
"-i",
|
||||
"${relativeFile}",
|
||||
"-t",
|
||||
"${selectedText}"
|
||||
],
|
||||
"stopOnEntry": false,
|
||||
"sourceMaps": true,
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen"
|
||||
},
|
||||
{
|
||||
"name": "Launch Unit Tests - React (vscode-codeql)",
|
||||
"type": "node",
|
||||
@@ -63,60 +87,46 @@
|
||||
},
|
||||
{
|
||||
"name": "Launch Integration Tests - No Workspace (vscode-codeql)",
|
||||
"type": "extensionHost",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
|
||||
"showAsyncStacks": true,
|
||||
"cwd": "${workspaceFolder}/extensions/ql-vscode",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
|
||||
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/no-workspace/index",
|
||||
"--disable-workspace-trust",
|
||||
"--disable-extensions",
|
||||
"--disable-gpu"
|
||||
"--projects",
|
||||
"out/vscode-tests/no-workspace"
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"attachSimplePort": 9223,
|
||||
},
|
||||
{
|
||||
"name": "Launch Integration Tests - Minimal Workspace (vscode-codeql)",
|
||||
"type": "extensionHost",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
|
||||
"showAsyncStacks": true,
|
||||
"cwd": "${workspaceFolder}/extensions/ql-vscode",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
|
||||
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/minimal-workspace/index",
|
||||
"--disable-workspace-trust",
|
||||
"--disable-extensions",
|
||||
"--disable-gpu",
|
||||
"${workspaceRoot}/extensions/ql-vscode/test/data"
|
||||
"--projects",
|
||||
"out/vscode-tests/minimal-workspace"
|
||||
],
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"attachSimplePort": 9223,
|
||||
},
|
||||
{
|
||||
"name": "Launch Integration Tests - With CLI",
|
||||
"type": "extensionHost",
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"program": "${workspaceFolder}/extensions/ql-vscode/node_modules/jest/bin/jest.js",
|
||||
"showAsyncStacks": true,
|
||||
"cwd": "${workspaceFolder}/extensions/ql-vscode",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}/extensions/ql-vscode",
|
||||
"--extensionTestsPath=${workspaceRoot}/extensions/ql-vscode/out/vscode-tests/cli-integration/index",
|
||||
"--disable-workspace-trust",
|
||||
"--disable-gpu",
|
||||
"--disable-extension",
|
||||
"eamodio.gitlens",
|
||||
"--disable-extension",
|
||||
"github.codespaces",
|
||||
"--disable-extension",
|
||||
"github.copilot",
|
||||
"${workspaceRoot}/extensions/ql-vscode/src/vscode-tests/cli-integration/data",
|
||||
// Uncomment the last line and modify the path to a checked out
|
||||
// instance of the codeql repository so the libraries are
|
||||
// available in the workspace for the tests.
|
||||
// "${workspaceRoot}/../codeql"
|
||||
"--projects",
|
||||
"out/vscode-tests/cli-integration"
|
||||
],
|
||||
"env": {
|
||||
// Optionally, set the version to use for the integration tests.
|
||||
@@ -130,11 +140,16 @@
|
||||
// If not specified, one will be downloaded automatically.
|
||||
// This option overrides the CLI_VERSION option.
|
||||
// "CLI_PATH": "${workspaceRoot}/../semmle-code/target/intree/codeql/codeql",
|
||||
|
||||
// Uncomment the last line and modify the path to a checked out
|
||||
// instance of the codeql repository so the libraries are
|
||||
// available in the workspace for the tests.
|
||||
// "TEST_CODEQL_PATH": "${workspaceRoot}/../codeql",
|
||||
},
|
||||
"sourceMaps": true,
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/extensions/ql-vscode/out/**/*.js",
|
||||
],
|
||||
"console": "integratedTerminal",
|
||||
"internalConsoleOptions": "neverOpen",
|
||||
"attachSimplePort": 9223,
|
||||
},
|
||||
{
|
||||
"name": "Launch Storybook",
|
||||
|
||||
9
.vscode/settings.json
vendored
9
.vscode/settings.json
vendored
@@ -37,11 +37,18 @@
|
||||
"javascript.preferences.quoteStyle": "single",
|
||||
"editor.wordWrapColumn": 100,
|
||||
"jest.rootPath": "./extensions/ql-vscode",
|
||||
"jest.autoRun": "watch",
|
||||
"jest.autoRun": "off",
|
||||
"jest.nodeEnv": {
|
||||
"LANG": "en-US",
|
||||
"TZ": "UTC"
|
||||
},
|
||||
// Uncomment to debug integration tests
|
||||
// "jestrunner.debugOptions": {
|
||||
// "attachSimplePort": 9223,
|
||||
// "env": {
|
||||
// "VSCODE_WAIT_FOR_DEBUGGER": "true",
|
||||
// }
|
||||
// },
|
||||
"[typescript]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
|
||||
@@ -150,6 +150,32 @@ The CLI integration tests require the CodeQL standard libraries in order to run
|
||||
|
||||
3. Run the VSCode task from the "Run and Debug" view called _Launch Integration Tests - With CLI_.
|
||||
|
||||
#### Running a single test
|
||||
|
||||
##### 1. From the terminal
|
||||
|
||||
The easiest way to run a single test is to change the `it` of the test to `it.only` and then run the test command with some additional options
|
||||
to only run tests for this specific file. For example, to run the test `src/vscode-tests/cli-integration/run-queries.test.ts`:
|
||||
|
||||
```shell
|
||||
npm run cli-integration -- --runTestsByPath src/vscode-tests/cli-integration/run-queries.test.ts
|
||||
```
|
||||
|
||||
You can also use the `--testNamePattern` option to run a specific test within a file. For example, to run the test `src/vscode-tests/cli-integration/run-queries.test.ts`:
|
||||
|
||||
```shell
|
||||
npm run cli-integration -- --runTestsByPath src/vscode-tests/cli-integration/run-queries.test.ts --testNamePattern "should create a QueryEvaluationInfo"
|
||||
```
|
||||
|
||||
##### 2. From VSCode
|
||||
|
||||
Alternatively, you can run a single test inside VSCode. To do so, install the [Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) extension. Then,
|
||||
you will have quicklinks to run a single test from within test files. To run a single unit or integration test, click the "Run" button. Debugging a single test is currently only supported
|
||||
for unit tests by default. To debug integration tests, open the `.vscode/settings.json` file and uncomment the `jestrunner.debugOptions` lines. This will allow you to debug integration tests.
|
||||
Please make sure to revert this change before committing; with this setting enabled, it is not possible to debug unit tests.
|
||||
|
||||
Without the Jest Runner extension, you can also use the "Launch Selected Unit Test (vscode-codeql)" launch configuration to run a single unit test.
|
||||
|
||||
#### Using a mock GitHub API server
|
||||
|
||||
Multi-Repo Variant Analyses (MRVA) rely on the GitHub API. In order to make development and testing easy, we have functionality that allows us to intercept requests to the GitHub API and provide mock responses.
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
export enum VSCodeTheme {
|
||||
Dark = "dark",
|
||||
Light = "light",
|
||||
LightHighContrast = "light-high-contrast",
|
||||
DarkHighContrast = "dark-high-contrast",
|
||||
GitHubLightDefault = "github-light-default",
|
||||
GitHubDarkDefault = "github-dark-default",
|
||||
}
|
||||
|
||||
export const themeNames: { [key in VSCodeTheme]: string } = {
|
||||
[VSCodeTheme.Dark]: "Dark+",
|
||||
[VSCodeTheme.Light]: "Light+",
|
||||
[VSCodeTheme.LightHighContrast]: "Light High Contrast",
|
||||
[VSCodeTheme.DarkHighContrast]: "Dark High Contrast",
|
||||
[VSCodeTheme.GitHubLightDefault]: "GitHub Light Default",
|
||||
[VSCodeTheme.GitHubDarkDefault]: "GitHub Dark Default",
|
||||
};
|
||||
|
||||
@@ -16,6 +16,22 @@ const themeFiles: { [key in VSCodeTheme]: string } = {
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require("!file-loader?modules!../../src/stories/vscode-theme-light.css")
|
||||
.default,
|
||||
[VSCodeTheme.LightHighContrast]:
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require("!file-loader?modules!../../src/stories/vscode-theme-light-high-contrast.css")
|
||||
.default,
|
||||
[VSCodeTheme.DarkHighContrast]:
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require("!file-loader?modules!../../src/stories/vscode-theme-dark-high-contrast.css")
|
||||
.default,
|
||||
[VSCodeTheme.GitHubLightDefault]:
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require("!file-loader?modules!../../src/stories/vscode-theme-github-light-default.css")
|
||||
.default,
|
||||
[VSCodeTheme.GitHubDarkDefault]:
|
||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
||||
require("!file-loader?modules!../../src/stories/vscode-theme-github-dark-default.css")
|
||||
.default,
|
||||
};
|
||||
|
||||
export const withTheme = (
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
- Required version of VS Code increased to 1.67.0.
|
||||
|
||||
## 1.7.6 - 21 November 2022
|
||||
|
||||
- Warn users when their VS Code version is too old to support all features in the vscode-codeql extension. [#1674](https://github.com/github/vscode-codeql/pull/1674)
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
* https://jestjs.io/docs/configuration
|
||||
*/
|
||||
|
||||
/** @type {import('@jest/types').Config.InitialOptions} */
|
||||
module.exports = {
|
||||
projects: ["<rootDir>/src/view", "<rootDir>/test"],
|
||||
projects: [
|
||||
"<rootDir>/src/view",
|
||||
"<rootDir>/test",
|
||||
"<rootDir>/src/vscode-tests/cli-integration",
|
||||
"<rootDir>/src/vscode-tests/no-workspace",
|
||||
"<rootDir>/src/vscode-tests/minimal-workspace",
|
||||
],
|
||||
};
|
||||
|
||||
1767
extensions/ql-vscode/package-lock.json
generated
1767
extensions/ql-vscode/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,7 @@
|
||||
"url": "https://github.com/github/vscode-codeql"
|
||||
},
|
||||
"engines": {
|
||||
"vscode": "^1.59.0",
|
||||
"vscode": "^1.67.0",
|
||||
"node": "^16.13.0",
|
||||
"npm": ">=7.20.6"
|
||||
},
|
||||
@@ -1272,17 +1272,18 @@
|
||||
"test": "npm-run-all -p test:*",
|
||||
"test:unit": "jest --projects test",
|
||||
"test:view": "jest --projects src/view",
|
||||
"integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace",
|
||||
"integration:no-workspace": "node ./out/vscode-tests/run-integration-tests.js no-workspace",
|
||||
"integration:minimal-workspace": "node ./out/vscode-tests/run-integration-tests.js minimal-workspace",
|
||||
"cli-integration": "node ./out/vscode-tests/run-integration-tests.js cli-integration",
|
||||
"integration": "npm-run-all integration:*",
|
||||
"integration:no-workspace": "jest --projects src/vscode-tests/no-workspace",
|
||||
"integration:minimal-workspace": "jest --projects src/vscode-tests/minimal-workspace",
|
||||
"cli-integration": "jest --projects src/vscode-tests/cli-integration",
|
||||
"update-vscode": "node ./node_modules/vscode/bin/install",
|
||||
"format": "prettier --write **/*.{ts,tsx} && eslint . --ext .ts,.tsx --fix",
|
||||
"lint": "eslint . --ext .ts,.tsx --max-warnings=0",
|
||||
"format-staged": "lint-staged",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook",
|
||||
"lint:scenarios": "ts-node scripts/lint-scenarios.ts"
|
||||
"lint:scenarios": "ts-node scripts/lint-scenarios.ts",
|
||||
"postinstall": "patch-package"
|
||||
},
|
||||
"dependencies": {
|
||||
"@octokit/plugin-retry": "^3.0.9",
|
||||
@@ -1321,8 +1322,8 @@
|
||||
"tree-kill": "~1.2.2",
|
||||
"unzipper": "~0.10.5",
|
||||
"vscode-extension-telemetry": "^0.1.6",
|
||||
"vscode-jsonrpc": "^5.0.1",
|
||||
"vscode-languageclient": "^6.1.3",
|
||||
"vscode-jsonrpc": "^8.0.2",
|
||||
"vscode-languageclient": "^8.0.2",
|
||||
"vscode-test-adapter-api": "~1.7.0",
|
||||
"vscode-test-adapter-util": "~0.7.0",
|
||||
"zip-a-folder": "~1.1.3"
|
||||
@@ -1343,8 +1344,6 @@
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^12.1.5",
|
||||
"@testing-library/user-event": "^14.4.3",
|
||||
"@types/chai": "^4.1.7",
|
||||
"@types/chai-as-promised": "~7.1.2",
|
||||
"@types/child-process-promise": "^2.2.1",
|
||||
"@types/classnames": "~2.2.9",
|
||||
"@types/d3": "^7.4.0",
|
||||
@@ -1359,17 +1358,13 @@
|
||||
"@types/jest": "^29.0.2",
|
||||
"@types/js-yaml": "^3.12.5",
|
||||
"@types/jszip": "~3.1.6",
|
||||
"@types/mocha": "^9.0.0",
|
||||
"@types/nanoid": "^3.0.0",
|
||||
"@types/node": "^16.11.25",
|
||||
"@types/node-fetch": "~2.5.2",
|
||||
"@types/proxyquire": "~1.3.28",
|
||||
"@types/react": "^17.0.2",
|
||||
"@types/react-dom": "^17.0.2",
|
||||
"@types/sarif": "~2.1.2",
|
||||
"@types/semver": "~7.2.0",
|
||||
"@types/sinon": "~7.5.2",
|
||||
"@types/sinon-chai": "~3.2.3",
|
||||
"@types/stream-chain": "~2.0.1",
|
||||
"@types/stream-json": "~1.7.1",
|
||||
"@types/tar-stream": "^2.2.2",
|
||||
@@ -1386,8 +1381,6 @@
|
||||
"ansi-colors": "^4.1.1",
|
||||
"applicationinsights": "^2.3.5",
|
||||
"babel-loader": "^8.2.5",
|
||||
"chai": "^4.2.0",
|
||||
"chai-as-promised": "~7.1.1",
|
||||
"css-loader": "~3.1.0",
|
||||
"del": "^6.0.0",
|
||||
"eslint": "^8.23.1",
|
||||
@@ -1409,13 +1402,9 @@
|
||||
"jest-runner-vscode": "^3.0.1",
|
||||
"lint-staged": "~10.2.2",
|
||||
"mini-css-extract-plugin": "^2.6.1",
|
||||
"mocha": "^10.0.0",
|
||||
"mocha-sinon": "~2.1.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"patch-package": "^6.5.0",
|
||||
"prettier": "^2.7.1",
|
||||
"proxyquire": "~2.1.3",
|
||||
"sinon": "~14.0.0",
|
||||
"sinon-chai": "~3.5.0",
|
||||
"tar-stream": "^2.2.0",
|
||||
"through2": "^4.0.2",
|
||||
"ts-jest": "^29.0.1",
|
||||
@@ -1431,7 +1420,7 @@
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run format-staged",
|
||||
"pre-push": "npm run lint && scripts/forbid-mocha-only"
|
||||
"pre-push": "npm run lint && scripts/forbid-test-only"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
|
||||
129
extensions/ql-vscode/patches/jest-runner-vscode+3.0.1.patch
Normal file
129
extensions/ql-vscode/patches/jest-runner-vscode+3.0.1.patch
Normal file
@@ -0,0 +1,129 @@
|
||||
diff --git a/node_modules/jest-runner-vscode/dist/child/runner.js b/node_modules/jest-runner-vscode/dist/child/runner.js
|
||||
index 0663c5c..4991663 100644
|
||||
--- a/node_modules/jest-runner-vscode/dist/child/runner.js
|
||||
+++ b/node_modules/jest-runner-vscode/dist/child/runner.js
|
||||
@@ -18,10 +18,13 @@ async function run() {
|
||||
const ipc = new ipc_client_1.default('child');
|
||||
const disconnected = new Promise(resolve => ipc.on('disconnect', resolve));
|
||||
try {
|
||||
- const { PARENT_JEST_OPTIONS } = process_1.default.env;
|
||||
+ const { PARENT_JEST_OPTIONS, PARENT_CWD } = process_1.default.env;
|
||||
if (!PARENT_JEST_OPTIONS) {
|
||||
throw new Error('PARENT_JEST_OPTIONS is not defined');
|
||||
}
|
||||
+ if (PARENT_CWD) {
|
||||
+ process_1.default.chdir(PARENT_CWD);
|
||||
+ }
|
||||
const options = JSON.parse(PARENT_JEST_OPTIONS);
|
||||
const jestOptions = [
|
||||
...options.args,
|
||||
diff --git a/node_modules/jest-runner-vscode/dist/public-types.d.ts b/node_modules/jest-runner-vscode/dist/public-types.d.ts
|
||||
index 57716e5..d8614af 100644
|
||||
--- a/node_modules/jest-runner-vscode/dist/public-types.d.ts
|
||||
+++ b/node_modules/jest-runner-vscode/dist/public-types.d.ts
|
||||
@@ -59,4 +59,5 @@ export interface RunnerOptions {
|
||||
* code, or download progress. Defaults to `false`.
|
||||
*/
|
||||
quiet?: boolean;
|
||||
+ retries?: number;
|
||||
}
|
||||
diff --git a/node_modules/jest-runner-vscode/dist/run-vscode.d.ts b/node_modules/jest-runner-vscode/dist/run-vscode.d.ts
|
||||
index 8657ace..4d35409 100644
|
||||
--- a/node_modules/jest-runner-vscode/dist/run-vscode.d.ts
|
||||
+++ b/node_modules/jest-runner-vscode/dist/run-vscode.d.ts
|
||||
@@ -16,5 +16,7 @@ export declare type RunVSCodeOptions = {
|
||||
onFailure: JestRunner.OnTestFailure;
|
||||
ipc: InstanceType<typeof IPC>;
|
||||
quiet?: boolean;
|
||||
+ attempt?: number;
|
||||
+ maxRetries?: number;
|
||||
};
|
||||
-export default function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig, filterOutput, onStart, onResult, onFailure, ipc, quiet, }: RunVSCodeOptions): Promise<void>;
|
||||
+export default function runVSCode(options: RunVSCodeOptions): Promise<void>;
|
||||
diff --git a/node_modules/jest-runner-vscode/dist/run-vscode.js b/node_modules/jest-runner-vscode/dist/run-vscode.js
|
||||
index 5d8e513..7e556ee 100644
|
||||
--- a/node_modules/jest-runner-vscode/dist/run-vscode.js
|
||||
+++ b/node_modules/jest-runner-vscode/dist/run-vscode.js
|
||||
@@ -5,8 +5,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const child_process_1 = __importDefault(require("child_process"));
|
||||
const console_1 = __importDefault(require("console"));
|
||||
-async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig, filterOutput, onStart, onResult, onFailure, ipc, quiet, }) {
|
||||
- return await new Promise(resolve => {
|
||||
+const fs_1 = __importDefault(require("fs"));
|
||||
+const path_1 = __importDefault(require("path"));
|
||||
+const os_1 = __importDefault(require("os"));
|
||||
+async function runVSCode(options) {
|
||||
+ const { vscodePath, args, jestArgs, env, tests, globalConfig, filterOutput, onStart, onResult, onFailure, ipc, quiet, attempt, maxRetries, } = options;
|
||||
+ const tempUserDir = await fs_1.default.promises.mkdtemp(path_1.default.resolve(os_1.default.tmpdir(), 'jest-runner-vscode-user-data-'));
|
||||
+ return await new Promise(promiseResolve => {
|
||||
+ const resolve = () => {
|
||||
+ fs_1.default.rm(tempUserDir, { recursive: true }, () => {
|
||||
+ promiseResolve();
|
||||
+ });
|
||||
+ };
|
||||
const useStdErr = globalConfig.json || globalConfig.useStderr;
|
||||
const log = useStdErr
|
||||
? console_1.default.error.bind(console_1.default)
|
||||
@@ -82,7 +92,11 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
|
||||
ipc.server.on('stdout', onStdout);
|
||||
ipc.server.on('stderr', onStderr);
|
||||
ipc.server.on('error', onError);
|
||||
- const vscode = child_process_1.default.spawn(vscodePath, args, { env: environment });
|
||||
+ const launchArgs = args;
|
||||
+ if (!hasArg('user-data-dir', launchArgs)) {
|
||||
+ launchArgs.push(`--user-data-dir=${tempUserDir}`);
|
||||
+ }
|
||||
+ const vscode = child_process_1.default.spawn(vscodePath, launchArgs, { env: environment });
|
||||
if (!silent && !filterOutput) {
|
||||
vscode.stdout.pipe(process.stdout);
|
||||
vscode.stderr.pipe(process.stderr);
|
||||
@@ -99,6 +113,29 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
|
||||
exited = true;
|
||||
const exit = code ?? signal ?? '<unknown>';
|
||||
const message = `VS Code exited with exit code ${exit}`;
|
||||
+ const currentAttempt = attempt ?? 0;
|
||||
+ const incompleteTests = tests.some(test => !completedTests.has(test));
|
||||
+ if (maxRetries &&
|
||||
+ maxRetries > 0 &&
|
||||
+ currentAttempt < maxRetries &&
|
||||
+ incompleteTests) {
|
||||
+ silent || quiet || log(message);
|
||||
+ const newAttempt = currentAttempt + 1;
|
||||
+ const newTests = tests.filter(test => !completedTests.has(test));
|
||||
+ ipc.server.off('testFileResult', onTestFileResult);
|
||||
+ ipc.server.off('testStart', onTestStart);
|
||||
+ ipc.server.off('testFileStart', onTestStart);
|
||||
+ ipc.server.off('stdout', onStdout);
|
||||
+ ipc.server.off('stderr', onStderr);
|
||||
+ ipc.server.off('error', onError);
|
||||
+ await runVSCode({
|
||||
+ ...options,
|
||||
+ tests: newTests,
|
||||
+ attempt: newAttempt,
|
||||
+ });
|
||||
+ resolve();
|
||||
+ return;
|
||||
+ }
|
||||
if (typeof code !== 'number' || code !== 0) {
|
||||
silent || quiet || console_1.default.error(message);
|
||||
const error = vscodeError ?? childError ?? new Error(message);
|
||||
@@ -138,3 +175,6 @@ async function runVSCode({ vscodePath, args, jestArgs, env, tests, globalConfig,
|
||||
});
|
||||
}
|
||||
exports.default = runVSCode;
|
||||
+function hasArg(argName, argList) {
|
||||
+ return argList.some(a => a === `--${argName}` || a.startsWith(`--${argName}=`));
|
||||
+}
|
||||
diff --git a/node_modules/jest-runner-vscode/dist/runner.js b/node_modules/jest-runner-vscode/dist/runner.js
|
||||
index e24c976..c374022 100644
|
||||
--- a/node_modules/jest-runner-vscode/dist/runner.js
|
||||
+++ b/node_modules/jest-runner-vscode/dist/runner.js
|
||||
@@ -107,6 +107,7 @@ class VSCodeTestRunner {
|
||||
onFailure,
|
||||
ipc,
|
||||
quiet: vscodeOptions.quiet,
|
||||
+ maxRetries: vscodeOptions.retries,
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as fs from "fs-extra";
|
||||
import * as unzipper from "unzipper";
|
||||
import * as vscode from "vscode";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
|
||||
// All path operations in this file must be on paths *within* the zip
|
||||
// archive.
|
||||
@@ -118,7 +118,7 @@ class InvalidSourceArchiveUriError extends Error {
|
||||
export function decodeSourceArchiveUri(uri: vscode.Uri): ZipFileReference {
|
||||
if (!uri.authority) {
|
||||
// Uri is malformed, but this is recoverable
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Warning: ${new InvalidSourceArchiveUriError(uri).message}`,
|
||||
);
|
||||
return {
|
||||
@@ -148,7 +148,7 @@ function ensureFile(map: DirectoryHierarchyMap, file: string) {
|
||||
const dirname = path.dirname(file);
|
||||
if (dirname === ".") {
|
||||
const error = `Ill-formed path ${file} in zip archive (expected absolute path)`;
|
||||
void logger.log(error);
|
||||
void extLogger.log(error);
|
||||
throw new Error(error);
|
||||
}
|
||||
ensureDir(map, dirname);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as semver from "semver";
|
||||
import { runCodeQlCliCommand } from "./cli";
|
||||
import { Logger } from "./logging";
|
||||
import { Logger } from "./common";
|
||||
import { getErrorMessage } from "./pure/helpers-pure";
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
getErrorStack,
|
||||
} from "./pure/helpers-pure";
|
||||
import { QueryMetadata, SortDirection } from "./pure/interface-types";
|
||||
import { Logger, ProgressReporter } from "./logging";
|
||||
import { Logger, ProgressReporter } from "./common";
|
||||
import { CompilationMessage } from "./pure/legacy-messages";
|
||||
import { sarifParser } from "./sarif-parser";
|
||||
import { dbSchemeToLanguage, walkDirectory } from "./helpers";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
ProgressLocation,
|
||||
} from "vscode";
|
||||
import { showAndLogErrorMessage, showAndLogWarningMessage } from "./helpers";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { getErrorMessage, getErrorStack } from "./pure/helpers-pure";
|
||||
import { telemetryListener } from "./telemetry";
|
||||
|
||||
@@ -131,7 +131,7 @@ export function commandRunner(
|
||||
if (e instanceof UserCancellationException) {
|
||||
// User has cancelled this action manually
|
||||
if (e.silent) {
|
||||
void logger.log(errorMessage);
|
||||
void extLogger.log(errorMessage);
|
||||
} else {
|
||||
void showAndLogWarningMessage(errorMessage);
|
||||
}
|
||||
@@ -166,7 +166,7 @@ export function commandRunnerWithProgress<R>(
|
||||
commandId: string,
|
||||
task: ProgressTask<R>,
|
||||
progressOptions: Partial<ProgressOptions>,
|
||||
outputLogger = logger,
|
||||
outputLogger = extLogger,
|
||||
): Disposable {
|
||||
return commands.registerCommand(commandId, async (...args: any[]) => {
|
||||
const startTime = Date.now();
|
||||
|
||||
1
extensions/ql-vscode/src/common/index.ts
Normal file
1
extensions/ql-vscode/src/common/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./logging";
|
||||
3
extensions/ql-vscode/src/common/logging/index.ts
Normal file
3
extensions/ql-vscode/src/common/logging/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from "./logger";
|
||||
export * from "./vscode/loggers";
|
||||
export * from "./vscode/output-channel-logger";
|
||||
35
extensions/ql-vscode/src/common/logging/logger.ts
Normal file
35
extensions/ql-vscode/src/common/logging/logger.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export interface LogOptions {
|
||||
// If false, don't output a trailing newline for the log entry. Default true.
|
||||
trailingNewline?: boolean;
|
||||
|
||||
// If specified, add this log entry to the log file at the specified location.
|
||||
additionalLogLocation?: string;
|
||||
}
|
||||
|
||||
export interface Logger {
|
||||
/**
|
||||
* Writes the given log message, optionally followed by a newline.
|
||||
* This function is asynchronous and will only resolve once the message is written
|
||||
* to the side log (if required). It is not necessary to await the results of this
|
||||
* function if you don't need to guarantee that the log writing is complete before
|
||||
* continuing.
|
||||
*
|
||||
* @param message The message to log.
|
||||
* @param options Optional settings.
|
||||
*/
|
||||
log(message: string, options?: LogOptions): Promise<void>;
|
||||
|
||||
/**
|
||||
* Reveal the logger channel in the UI.
|
||||
*
|
||||
* @param preserveFocus When `true` the channel will not take focus.
|
||||
*/
|
||||
show(preserveFocus?: boolean): void;
|
||||
|
||||
/**
|
||||
* Remove the log at the specified location.
|
||||
*
|
||||
* @param location log to remove
|
||||
*/
|
||||
removeAdditionalLogLocation(location: string | undefined): void;
|
||||
}
|
||||
19
extensions/ql-vscode/src/common/logging/vscode/loggers.ts
Normal file
19
extensions/ql-vscode/src/common/logging/vscode/loggers.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* This module contains instantiated loggers to use in the extension.
|
||||
*/
|
||||
|
||||
import { OutputChannelLogger } from "./output-channel-logger";
|
||||
|
||||
// Global logger for the extension.
|
||||
export const extLogger = new OutputChannelLogger("CodeQL Extension Log");
|
||||
|
||||
// Logger for messages from the query server.
|
||||
export const queryServerLogger = new OutputChannelLogger("CodeQL Query Server");
|
||||
|
||||
// Logger for messages from the language server.
|
||||
export const ideServerLogger = new OutputChannelLogger(
|
||||
"CodeQL Language Server",
|
||||
);
|
||||
|
||||
// Logger for messages from tests.
|
||||
export const testLogger = new OutputChannelLogger("CodeQL Tests");
|
||||
@@ -1,36 +1,12 @@
|
||||
import { window as Window, OutputChannel, Progress } from "vscode";
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import * as fs from "fs-extra";
|
||||
import * as path from "path";
|
||||
import { Logger, LogOptions } from "../logger";
|
||||
import { DisposableObject } from "../../../pure/disposable-object";
|
||||
|
||||
interface LogOptions {
|
||||
/** If false, don't output a trailing newline for the log entry. Default true. */
|
||||
trailingNewline?: boolean;
|
||||
|
||||
/** If specified, add this log entry to the log file at the specified location. */
|
||||
additionalLogLocation?: string;
|
||||
}
|
||||
|
||||
export interface Logger {
|
||||
/** Writes the given log message, optionally followed by a newline. */
|
||||
log(message: string, options?: LogOptions): Promise<void>;
|
||||
/**
|
||||
* Reveal this channel in the UI.
|
||||
*
|
||||
* @param preserveFocus When `true` the channel will not take focus.
|
||||
*/
|
||||
show(preserveFocus?: boolean): void;
|
||||
|
||||
/**
|
||||
* Remove the log at the specified location
|
||||
* @param location log to remove
|
||||
*/
|
||||
removeAdditionalLogLocation(location: string | undefined): void;
|
||||
}
|
||||
|
||||
export type ProgressReporter = Progress<{ message: string }>;
|
||||
|
||||
/** A logger that writes messages to an output channel in the Output tab. */
|
||||
/**
|
||||
* A logger that writes messages to an output channel in the VS Code Output tab.
|
||||
*/
|
||||
export class OutputChannelLogger extends DisposableObject implements Logger {
|
||||
public readonly outputChannel: OutputChannel;
|
||||
private readonly additionalLocations = new Map<
|
||||
@@ -46,12 +22,6 @@ export class OutputChannelLogger extends DisposableObject implements Logger {
|
||||
this.isCustomLogDirectory = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function is asynchronous and will only resolve once the message is written
|
||||
* to the side log (if required). It is not necessary to await the results of this
|
||||
* function if you don't need to guarantee that the log writing is complete before
|
||||
* continuing.
|
||||
*/
|
||||
async log(message: string, options = {} as LogOptions): Promise<void> {
|
||||
try {
|
||||
if (options.trailingNewline === undefined) {
|
||||
@@ -108,9 +78,7 @@ export class OutputChannelLogger extends DisposableObject implements Logger {
|
||||
}
|
||||
|
||||
class AdditionalLogLocation {
|
||||
constructor(private location: string) {
|
||||
/**/
|
||||
}
|
||||
constructor(private location: string) {}
|
||||
|
||||
async log(message: string, options = {} as LogOptions): Promise<void> {
|
||||
if (options.trailingNewline === undefined) {
|
||||
@@ -128,16 +96,4 @@ class AdditionalLogLocation {
|
||||
}
|
||||
}
|
||||
|
||||
/** The global logger for the extension. */
|
||||
export const logger = new OutputChannelLogger("CodeQL Extension Log");
|
||||
|
||||
/** The logger for messages from the query server. */
|
||||
export const queryServerLogger = new OutputChannelLogger("CodeQL Query Server");
|
||||
|
||||
/** The logger for messages from the language server. */
|
||||
export const ideServerLogger = new OutputChannelLogger(
|
||||
"CodeQL Language Server",
|
||||
);
|
||||
|
||||
/** The logger for messages from tests. */
|
||||
export const testLogger = new OutputChannelLogger("CodeQL Tests");
|
||||
export type ProgressReporter = Progress<{ message: string }>;
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
ToCompareViewMessage,
|
||||
QueryCompareResult,
|
||||
} from "../pure/interface-types";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { CodeQLCliServer } from "../cli";
|
||||
import { DatabaseManager } from "../databases";
|
||||
import { jumpToLocation } from "../interface-utils";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
ConfigurationTarget,
|
||||
} from "vscode";
|
||||
import { DistributionManager } from "./distribution";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { ONE_DAY_IN_MS } from "./pure/time";
|
||||
|
||||
export const ALL_SETTINGS: Setting[] = [];
|
||||
@@ -349,7 +349,7 @@ export class QueryServerConfigListener
|
||||
return undefined;
|
||||
}
|
||||
if (memory == 0 || typeof memory !== "number") {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Ignoring value '${memory}' for setting ${MEMORY_SETTING.qualifiedName}`,
|
||||
);
|
||||
return undefined;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { KeyType, kindOfKeyType, nameOfKeyType, tagOfKeyType } from "./keyType";
|
||||
import { CodeQLCliServer } from "../cli";
|
||||
import { DatabaseItem } from "../databases";
|
||||
import { QlPacksForLanguage } from "../helpers";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import { createInitialQueryInfo } from "../run-queries-shared";
|
||||
import { CancellationToken, Uri } from "vscode";
|
||||
import { ProgressCallback } from "../commandRunner";
|
||||
@@ -161,17 +161,17 @@ async function resolveContextualQuery(
|
||||
// No lock file, likely because this library pack is in the package cache.
|
||||
// Create a lock file so that we can resolve dependencies and library path
|
||||
// for the contextual query.
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Library pack ${packPath} is missing a lock file; creating a temporary lock file`,
|
||||
);
|
||||
await cli.packResolveDependencies(packPath);
|
||||
createdTempLockFile = true;
|
||||
// Clear CLI server pack cache before installing dependencies,
|
||||
// so that it picks up the new lock file, not the previously cached pack.
|
||||
void logger.log("Clearing the CodeQL CLI server's pack cache");
|
||||
void extLogger.log("Clearing the CodeQL CLI server's pack cache");
|
||||
await cli.clearCache();
|
||||
// Install dependencies.
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Installing package dependencies for library pack ${packPath}`,
|
||||
);
|
||||
await cli.packInstall(packPath);
|
||||
@@ -181,7 +181,7 @@ async function resolveContextualQuery(
|
||||
|
||||
async function removeTemporaryLockFile(packPath: string) {
|
||||
const tempLockFilePath = path.resolve(packPath, "codeql-pack.lock.yml");
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Deleting temporary package lock file at ${tempLockFilePath}`,
|
||||
);
|
||||
// It's fine if the file doesn't exist.
|
||||
@@ -212,7 +212,7 @@ export async function runContextualQuery(
|
||||
},
|
||||
false,
|
||||
);
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Running contextual query ${query}; results will be stored in ${queryStorageDir}`,
|
||||
);
|
||||
const queryResult = await qs.compileAndRunQueryAgainstDatabase(
|
||||
|
||||
@@ -11,7 +11,7 @@ import { retry } from "@octokit/plugin-retry";
|
||||
import { DatabaseManager, DatabaseItem } from "./databases";
|
||||
import { showAndLogInformationMessage } from "./helpers";
|
||||
import { reportStreamProgress, ProgressCallback } from "./commandRunner";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { tmpDir } from "./helpers";
|
||||
import { Credentials } from "./authentication";
|
||||
import { REPO_REGEX, getErrorMessage } from "./pure/helpers-pure";
|
||||
@@ -585,7 +585,7 @@ export async function convertGithubNwoToDatabaseUrl(
|
||||
name: repo,
|
||||
};
|
||||
} catch (e) {
|
||||
void logger.log(`Error: ${getErrorMessage(e)}`);
|
||||
void extLogger.log(`Error: ${getErrorMessage(e)}`);
|
||||
throw new Error(`Unable to get database for '${githubRepo}'`);
|
||||
}
|
||||
}
|
||||
@@ -696,7 +696,7 @@ export async function convertLgtmUrlToDatabaseUrl(
|
||||
language,
|
||||
].join("/")}`;
|
||||
} catch (e) {
|
||||
void logger.log(`Error: ${getErrorMessage(e)}`);
|
||||
void extLogger.log(`Error: ${getErrorMessage(e)}`);
|
||||
throw new Error(`Invalid LGTM URL: ${lgtmUrl}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
isLikelyDbLanguageFolder,
|
||||
showAndLogErrorMessage,
|
||||
} from "./helpers";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import {
|
||||
importArchiveDatabase,
|
||||
promptImportGithubDatabase,
|
||||
@@ -241,7 +241,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
}
|
||||
|
||||
init() {
|
||||
void logger.log("Registering database panel commands.");
|
||||
void extLogger.log("Registering database panel commands.");
|
||||
this.push(
|
||||
commandRunnerWithProgress(
|
||||
"codeQL.setCurrentDatabase",
|
||||
@@ -393,14 +393,14 @@ export class DatabaseUI extends DisposableObject {
|
||||
};
|
||||
|
||||
handleRemoveOrphanedDatabases = async (): Promise<void> => {
|
||||
void logger.log("Removing orphaned databases from workspace storage.");
|
||||
void extLogger.log("Removing orphaned databases from workspace storage.");
|
||||
let dbDirs = undefined;
|
||||
|
||||
if (
|
||||
!(await fs.pathExists(this.storagePath)) ||
|
||||
!(await fs.stat(this.storagePath)).isDirectory()
|
||||
) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Missing or invalid storage directory. Not trying to remove orphaned databases.",
|
||||
);
|
||||
return;
|
||||
@@ -425,7 +425,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
dbDirs = await asyncFilter(dbDirs, isLikelyDatabaseRoot);
|
||||
|
||||
if (!dbDirs.length) {
|
||||
void logger.log("No orphaned databases found.");
|
||||
void extLogger.log("No orphaned databases found.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -434,7 +434,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
await Promise.all(
|
||||
dbDirs.map(async (dbDir) => {
|
||||
try {
|
||||
void logger.log(`Deleting orphaned database '${dbDir}'.`);
|
||||
void extLogger.log(`Deleting orphaned database '${dbDir}'.`);
|
||||
await fs.remove(dbDir);
|
||||
} catch (e) {
|
||||
failures.push(`${path.basename(dbDir)}`);
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
encodeSourceArchiveUri,
|
||||
} from "./archive-filesystem-provider";
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { Logger, logger } from "./logging";
|
||||
import { Logger, extLogger } from "./common";
|
||||
import { getErrorMessage } from "./pure/helpers-pure";
|
||||
import { QueryRunner } from "./queryRunner";
|
||||
|
||||
@@ -545,7 +545,7 @@ function eventFired<T>(
|
||||
): Promise<T | undefined> {
|
||||
return new Promise((res, _rej) => {
|
||||
const timeout = setTimeout(() => {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Waiting for event ${event} timed out after ${timeoutMs}ms`,
|
||||
);
|
||||
res(undefined);
|
||||
@@ -657,12 +657,12 @@ export class DatabaseManager extends DisposableObject {
|
||||
|
||||
const msg = item.verifyZippedSources();
|
||||
if (msg) {
|
||||
void logger.log(`Could not add source folder because ${msg}`);
|
||||
void extLogger.log(`Could not add source folder because ${msg}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const uri = item.getSourceArchiveExplorerUri();
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Adding workspace folder for ${item.name} source archive at index ${end}`,
|
||||
);
|
||||
if ((vscode.workspace.workspaceFolders || []).length < 2) {
|
||||
@@ -916,7 +916,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
(folder) => item.belongsToSourceArchiveExplorerUri(folder.uri),
|
||||
);
|
||||
if (folderIndex >= 0) {
|
||||
void logger.log(`Removing workspace folder at index ${folderIndex}`);
|
||||
void extLogger.log(`Removing workspace folder at index ${folderIndex}`);
|
||||
vscode.workspace.updateWorkspaceFolders(folderIndex, 1);
|
||||
}
|
||||
|
||||
@@ -925,11 +925,11 @@ export class DatabaseManager extends DisposableObject {
|
||||
|
||||
// Delete folder from file system only if it is controlled by the extension
|
||||
if (this.isExtensionControlledLocation(item.databaseUri)) {
|
||||
void logger.log("Deleting database from filesystem.");
|
||||
void extLogger.log("Deleting database from filesystem.");
|
||||
fs.remove(item.databaseUri.fsPath).then(
|
||||
() => void logger.log(`Deleted '${item.databaseUri.fsPath}'`),
|
||||
() => void extLogger.log(`Deleted '${item.databaseUri.fsPath}'`),
|
||||
(e) =>
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Failed to delete '${
|
||||
item.databaseUri.fsPath
|
||||
}'. Reason: ${getErrorMessage(e)}`,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { App, AppMode } from "../common/app";
|
||||
import { isCanary, isNewQueryRunExperienceEnabled } from "../config";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DbConfigStore } from "./config/db-config-store";
|
||||
import { DbManager } from "./db-manager";
|
||||
@@ -19,7 +19,7 @@ export class DbModule extends DisposableObject {
|
||||
return;
|
||||
}
|
||||
|
||||
void logger.log("Initializing database module");
|
||||
void extLogger.log("Initializing database module");
|
||||
|
||||
const dbConfigStore = new DbConfigStore(app);
|
||||
await dbConfigStore.initialize();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
|
||||
/**
|
||||
* Base class for "discovery" operations, which scan the file system to find specific kinds of
|
||||
@@ -62,7 +62,7 @@ export abstract class Discovery<T> extends DisposableObject {
|
||||
})
|
||||
|
||||
.catch((err) => {
|
||||
void logger.log(`${this.name} failed. Reason: ${err.message}`);
|
||||
void extLogger.log(`${this.name} failed. Reason: ${err.message}`);
|
||||
})
|
||||
|
||||
.finally(() => {
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as fs from "fs-extra";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import * as semver from "semver";
|
||||
import * as unzipper from "unzipper";
|
||||
import * as url from "url";
|
||||
import { ExtensionContext, Event } from "vscode";
|
||||
import { DistributionConfig } from "./config";
|
||||
@@ -13,9 +12,15 @@ import {
|
||||
showAndLogErrorMessage,
|
||||
showAndLogWarningMessage,
|
||||
} from "./helpers";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { getCodeQlCliVersion } from "./cli-version";
|
||||
import { ProgressCallback, reportStreamProgress } from "./commandRunner";
|
||||
import {
|
||||
codeQlLauncherName,
|
||||
deprecatedCodeQlLauncherName,
|
||||
extractZipArchive,
|
||||
getRequiredAssetName,
|
||||
} from "./pure/distribution";
|
||||
|
||||
/**
|
||||
* distribution.ts
|
||||
@@ -55,22 +60,6 @@ export interface DistributionProvider {
|
||||
}
|
||||
|
||||
export class DistributionManager implements DistributionProvider {
|
||||
/**
|
||||
* Get the name of the codeql cli installation we prefer to install, based on our current platform.
|
||||
*/
|
||||
public static getRequiredAssetName(): string {
|
||||
switch (os.platform()) {
|
||||
case "linux":
|
||||
return "codeql-linux64.zip";
|
||||
case "darwin":
|
||||
return "codeql-osx64.zip";
|
||||
case "win32":
|
||||
return "codeql-win64.zip";
|
||||
default:
|
||||
return "codeql.zip";
|
||||
}
|
||||
}
|
||||
|
||||
constructor(
|
||||
public readonly config: DistributionConfig,
|
||||
private readonly versionRange: semver.Range,
|
||||
@@ -101,7 +90,10 @@ export class DistributionManager implements DistributionProvider {
|
||||
kind: FindDistributionResultKind.NoDistribution,
|
||||
};
|
||||
}
|
||||
const version = await getCodeQlCliVersion(distribution.codeQlPath, logger);
|
||||
const version = await getCodeQlCliVersion(
|
||||
distribution.codeQlPath,
|
||||
extLogger,
|
||||
);
|
||||
if (version === undefined) {
|
||||
return {
|
||||
distribution,
|
||||
@@ -207,7 +199,7 @@ export class DistributionManager implements DistributionProvider {
|
||||
};
|
||||
}
|
||||
}
|
||||
void logger.log("INFO: Could not find CodeQL on path.");
|
||||
void extLogger.log("INFO: Could not find CodeQL on path.");
|
||||
}
|
||||
|
||||
return undefined;
|
||||
@@ -303,7 +295,7 @@ class ExtensionSpecificDistributionManager {
|
||||
try {
|
||||
await this.removeDistribution();
|
||||
} catch (e) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"WARNING: Tried to remove corrupted CodeQL CLI at " +
|
||||
`${this.getDistributionStoragePath()} but encountered an error: ${e}.`,
|
||||
);
|
||||
@@ -354,14 +346,14 @@ class ExtensionSpecificDistributionManager {
|
||||
try {
|
||||
await this.removeDistribution();
|
||||
} catch (e) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Tried to clean up old version of CLI at ${this.getDistributionStoragePath()} ` +
|
||||
`but encountered an error: ${e}.`,
|
||||
);
|
||||
}
|
||||
|
||||
// Filter assets to the unique one that we require.
|
||||
const requiredAssetName = DistributionManager.getRequiredAssetName();
|
||||
const requiredAssetName = getRequiredAssetName();
|
||||
const assets = release.assets.filter(
|
||||
(asset) => asset.name === requiredAssetName,
|
||||
);
|
||||
@@ -371,7 +363,7 @@ class ExtensionSpecificDistributionManager {
|
||||
);
|
||||
}
|
||||
if (assets.length > 1) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"WARNING: chose a release with more than one asset to install, found " +
|
||||
assets.map((asset) => asset.name).join(", "),
|
||||
);
|
||||
@@ -409,7 +401,7 @@ class ExtensionSpecificDistributionManager {
|
||||
|
||||
await this.bumpDistributionFolderIndex();
|
||||
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Extracting CodeQL CLI to ${this.getDistributionStoragePath()}`,
|
||||
);
|
||||
await extractZipArchive(archivePath, this.getDistributionStoragePath());
|
||||
@@ -431,8 +423,8 @@ class ExtensionSpecificDistributionManager {
|
||||
}
|
||||
|
||||
private async getLatestRelease(): Promise<Release> {
|
||||
const requiredAssetName = DistributionManager.getRequiredAssetName();
|
||||
void logger.log(
|
||||
const requiredAssetName = getRequiredAssetName();
|
||||
void extLogger.log(
|
||||
`Searching for latest release including ${requiredAssetName}.`,
|
||||
);
|
||||
return this.createReleasesApiConsumer().getLatestRelease(
|
||||
@@ -444,13 +436,13 @@ class ExtensionSpecificDistributionManager {
|
||||
);
|
||||
if (matchingAssets.length === 0) {
|
||||
// For example, this could be a release with no platform-specific assets.
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`INFO: Ignoring a release with no assets named ${requiredAssetName}`,
|
||||
);
|
||||
return false;
|
||||
}
|
||||
if (matchingAssets.length > 1) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`WARNING: Ignoring a release with more than one asset named ${requiredAssetName}`,
|
||||
);
|
||||
return false;
|
||||
@@ -683,39 +675,6 @@ export class ReleasesApiConsumer {
|
||||
private static readonly _maxRedirects = 20;
|
||||
}
|
||||
|
||||
export async function extractZipArchive(
|
||||
archivePath: string,
|
||||
outPath: string,
|
||||
): Promise<void> {
|
||||
const archive = await unzipper.Open.file(archivePath);
|
||||
await archive.extract({
|
||||
concurrency: 4,
|
||||
path: outPath,
|
||||
});
|
||||
// Set file permissions for extracted files
|
||||
await Promise.all(
|
||||
archive.files.map(async (file) => {
|
||||
// Only change file permissions if within outPath (path.join normalises the path)
|
||||
const extractedPath = path.join(outPath, file.path);
|
||||
if (
|
||||
extractedPath.indexOf(outPath) !== 0 ||
|
||||
!(await fs.pathExists(extractedPath))
|
||||
) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return fs.chmod(extractedPath, file.externalFileAttributes >>> 16);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function codeQlLauncherName(): string {
|
||||
return os.platform() === "win32" ? "codeql.exe" : "codeql";
|
||||
}
|
||||
|
||||
function deprecatedCodeQlLauncherName(): string | undefined {
|
||||
return os.platform() === "win32" ? "codeql.cmd" : undefined;
|
||||
}
|
||||
|
||||
function isRedirectStatusCode(statusCode: number): boolean {
|
||||
return (
|
||||
statusCode === 301 ||
|
||||
@@ -861,7 +820,7 @@ export async function getExecutableFromDirectory(
|
||||
return alternateExpectedLauncherPath;
|
||||
}
|
||||
if (warnWhenNotFound) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`WARNING: Expected to find a CodeQL CLI executable at ${expectedLauncherPath} but one was not found. ` +
|
||||
"Will try PATH.",
|
||||
);
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
ProviderResult,
|
||||
version as vscodeVersion,
|
||||
} from "vscode";
|
||||
import { LanguageClient } from "vscode-languageclient";
|
||||
import { LanguageClient } from "vscode-languageclient/node";
|
||||
import * as os from "os";
|
||||
import * as fs from "fs-extra";
|
||||
import * as path from "path";
|
||||
@@ -76,10 +76,10 @@ import { ResultsView } from "./interface";
|
||||
import { WebviewReveal } from "./interface-utils";
|
||||
import {
|
||||
ideServerLogger,
|
||||
logger,
|
||||
extLogger,
|
||||
ProgressReporter,
|
||||
queryServerLogger,
|
||||
} from "./logging";
|
||||
} from "./common";
|
||||
import { QueryHistoryManager } from "./query-history";
|
||||
import { CompletedLocalQueryInfo, LocalQueryInfo } from "./query-results";
|
||||
import * as legacyQueryServer from "./legacy-query-server/queryserver-client";
|
||||
@@ -230,7 +230,7 @@ const MIN_VERSION = "1.67.0";
|
||||
export async function activate(
|
||||
ctx: ExtensionContext,
|
||||
): Promise<CodeQLExtensionInterface | Record<string, never>> {
|
||||
void logger.log(`Starting ${extensionId} extension`);
|
||||
void extLogger.log(`Starting ${extensionId} extension`);
|
||||
if (extension === undefined) {
|
||||
throw new Error(`Can't find extension ${extensionId}`);
|
||||
}
|
||||
@@ -278,7 +278,7 @@ export async function activate(
|
||||
const minSecondsSinceLastUpdateCheck = config.isUserInitiated ? 0 : 86400;
|
||||
const noUpdatesLoggingFunc = config.shouldDisplayMessageWhenNoUpdates
|
||||
? showAndLogInformationMessage
|
||||
: async (message: string) => void logger.log(message);
|
||||
: async (message: string) => void extLogger.log(message);
|
||||
const result =
|
||||
await distributionManager.checkForUpdatesToExtensionManagedDistribution(
|
||||
minSecondsSinceLastUpdateCheck,
|
||||
@@ -291,7 +291,7 @@ export async function activate(
|
||||
|
||||
switch (result.kind) {
|
||||
case DistributionUpdateCheckResultKind.AlreadyCheckedRecentlyResult:
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Didn't perform CodeQL CLI update check since a check was already performed within the previous " +
|
||||
`${minSecondsSinceLastUpdateCheck} seconds.`,
|
||||
);
|
||||
@@ -400,7 +400,7 @@ export async function activate(
|
||||
const result = await distributionManager.getDistribution();
|
||||
switch (result.kind) {
|
||||
case FindDistributionResultKind.CompatibleDistribution:
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Found compatible version of CodeQL CLI (version ${result.version.raw})`,
|
||||
);
|
||||
break;
|
||||
@@ -543,18 +543,18 @@ async function activateWithInstalledDistribution(
|
||||
// of activation.
|
||||
errorStubs.forEach((stub) => stub.dispose());
|
||||
|
||||
void logger.log("Initializing configuration listener...");
|
||||
void extLogger.log("Initializing configuration listener...");
|
||||
const qlConfigurationListener =
|
||||
await QueryServerConfigListener.createQueryServerConfigListener(
|
||||
distributionManager,
|
||||
);
|
||||
ctx.subscriptions.push(qlConfigurationListener);
|
||||
|
||||
void logger.log("Initializing CodeQL cli server...");
|
||||
void extLogger.log("Initializing CodeQL cli server...");
|
||||
const cliServer = new CodeQLCliServer(
|
||||
distributionManager,
|
||||
new CliConfigListener(),
|
||||
logger,
|
||||
extLogger,
|
||||
);
|
||||
ctx.subscriptions.push(cliServer);
|
||||
|
||||
@@ -564,7 +564,7 @@ async function activateWithInstalledDistribution(
|
||||
);
|
||||
ctx.subscriptions.push(statusBar);
|
||||
|
||||
void logger.log("Initializing query server client.");
|
||||
void extLogger.log("Initializing query server client.");
|
||||
const qs = await createQueryServer(qlConfigurationListener, cliServer, ctx);
|
||||
|
||||
for (const glob of PACK_GLOBS) {
|
||||
@@ -575,14 +575,14 @@ async function activateWithInstalledDistribution(
|
||||
});
|
||||
}
|
||||
|
||||
void logger.log("Initializing database manager.");
|
||||
const dbm = new DatabaseManager(ctx, qs, cliServer, logger);
|
||||
void extLogger.log("Initializing database manager.");
|
||||
const dbm = new DatabaseManager(ctx, qs, cliServer, extLogger);
|
||||
|
||||
// Let this run async.
|
||||
void dbm.loadPersistedState();
|
||||
|
||||
ctx.subscriptions.push(dbm);
|
||||
void logger.log("Initializing database panel.");
|
||||
void extLogger.log("Initializing database panel.");
|
||||
const databaseUI = new DatabaseUI(
|
||||
dbm,
|
||||
qs,
|
||||
@@ -593,11 +593,11 @@ async function activateWithInstalledDistribution(
|
||||
databaseUI.init();
|
||||
ctx.subscriptions.push(databaseUI);
|
||||
|
||||
void logger.log("Initializing evaluator log viewer.");
|
||||
void extLogger.log("Initializing evaluator log viewer.");
|
||||
const evalLogViewer = new EvalLogViewer();
|
||||
ctx.subscriptions.push(evalLogViewer);
|
||||
|
||||
void logger.log("Initializing query history manager.");
|
||||
void extLogger.log("Initializing query history manager.");
|
||||
const queryHistoryConfigurationListener = new QueryHistoryConfigListener();
|
||||
ctx.subscriptions.push(queryHistoryConfigurationListener);
|
||||
const showResults = async (item: CompletedLocalQueryInfo) =>
|
||||
@@ -608,7 +608,7 @@ async function activateWithInstalledDistribution(
|
||||
queryHistoryConfigurationListener,
|
||||
);
|
||||
|
||||
void logger.log("Initializing results panel interface.");
|
||||
void extLogger.log("Initializing results panel interface.");
|
||||
const localQueryResultsView = new ResultsView(
|
||||
ctx,
|
||||
dbm,
|
||||
@@ -618,7 +618,7 @@ async function activateWithInstalledDistribution(
|
||||
);
|
||||
ctx.subscriptions.push(localQueryResultsView);
|
||||
|
||||
void logger.log("Initializing variant analysis manager.");
|
||||
void extLogger.log("Initializing variant analysis manager.");
|
||||
const variantAnalysisStorageDir = path.join(
|
||||
ctx.globalStorageUri.fsPath,
|
||||
"variant-analyses",
|
||||
@@ -626,7 +626,7 @@ async function activateWithInstalledDistribution(
|
||||
await fs.ensureDir(variantAnalysisStorageDir);
|
||||
const variantAnalysisResultsManager = new VariantAnalysisResultsManager(
|
||||
cliServer,
|
||||
logger,
|
||||
extLogger,
|
||||
);
|
||||
const variantAnalysisManager = new VariantAnalysisManager(
|
||||
ctx,
|
||||
@@ -643,11 +643,16 @@ async function activateWithInstalledDistribution(
|
||||
),
|
||||
);
|
||||
|
||||
void logger.log("Initializing remote queries manager.");
|
||||
const rqm = new RemoteQueriesManager(ctx, cliServer, queryStorageDir, logger);
|
||||
void extLogger.log("Initializing remote queries manager.");
|
||||
const rqm = new RemoteQueriesManager(
|
||||
ctx,
|
||||
cliServer,
|
||||
queryStorageDir,
|
||||
extLogger,
|
||||
);
|
||||
ctx.subscriptions.push(rqm);
|
||||
|
||||
void logger.log("Initializing query history.");
|
||||
void extLogger.log("Initializing query history.");
|
||||
const qhm = new QueryHistoryManager(
|
||||
qs,
|
||||
dbm,
|
||||
@@ -665,7 +670,7 @@ async function activateWithInstalledDistribution(
|
||||
|
||||
ctx.subscriptions.push(qhm);
|
||||
|
||||
void logger.log("Initializing evaluation log scanners.");
|
||||
void extLogger.log("Initializing evaluation log scanners.");
|
||||
const logScannerService = new LogScannerService(qhm);
|
||||
ctx.subscriptions.push(logScannerService);
|
||||
ctx.subscriptions.push(
|
||||
@@ -674,7 +679,7 @@ async function activateWithInstalledDistribution(
|
||||
),
|
||||
);
|
||||
|
||||
void logger.log("Initializing compare view.");
|
||||
void extLogger.log("Initializing compare view.");
|
||||
const compareView = new CompareView(
|
||||
ctx,
|
||||
dbm,
|
||||
@@ -685,7 +690,7 @@ async function activateWithInstalledDistribution(
|
||||
);
|
||||
ctx.subscriptions.push(compareView);
|
||||
|
||||
void logger.log("Initializing source archive filesystem provider.");
|
||||
void extLogger.log("Initializing source archive filesystem provider.");
|
||||
archiveFilesystemProvider.activate(ctx);
|
||||
|
||||
async function showResultsForComparison(
|
||||
@@ -821,7 +826,7 @@ async function activateWithInstalledDistribution(
|
||||
|
||||
ctx.subscriptions.push(tmpDirDisposal);
|
||||
|
||||
void logger.log("Initializing CodeQL language server.");
|
||||
void extLogger.log("Initializing CodeQL language server.");
|
||||
const client = new LanguageClient(
|
||||
"CodeQL Language Server",
|
||||
() => spawnIdeServer(qlConfigurationListener),
|
||||
@@ -839,7 +844,7 @@ async function activateWithInstalledDistribution(
|
||||
true,
|
||||
);
|
||||
|
||||
void logger.log("Initializing QLTest interface.");
|
||||
void extLogger.log("Initializing QLTest interface.");
|
||||
const testExplorerExtension = extensions.getExtension<TestHub>(
|
||||
testExplorerExtensionId,
|
||||
);
|
||||
@@ -856,7 +861,7 @@ async function activateWithInstalledDistribution(
|
||||
ctx.subscriptions.push(testUIService);
|
||||
}
|
||||
|
||||
void logger.log("Registering top-level command palette commands.");
|
||||
void extLogger.log("Registering top-level command palette commands.");
|
||||
ctx.subscriptions.push(
|
||||
commandRunnerWithProgress(
|
||||
"codeQL.runQuery",
|
||||
@@ -938,7 +943,7 @@ async function activateWithInstalledDistribution(
|
||||
}
|
||||
}
|
||||
if (skippedDatabases.length > 0) {
|
||||
void logger.log(`Errors:\n${errors.join("\n")}`);
|
||||
void extLogger.log(`Errors:\n${errors.join("\n")}`);
|
||||
void showAndLogWarningMessage(
|
||||
`The following databases were skipped:\n${skippedDatabases.join(
|
||||
"\n",
|
||||
@@ -1415,17 +1420,21 @@ async function activateWithInstalledDistribution(
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner("codeQL.showLogs", async () => {
|
||||
logger.show();
|
||||
extLogger.show();
|
||||
}),
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(new SummaryLanguageSupport());
|
||||
|
||||
void logger.log("Starting language server.");
|
||||
ctx.subscriptions.push(client.start());
|
||||
|
||||
void extLogger.log("Starting language server.");
|
||||
await client.start();
|
||||
ctx.subscriptions.push({
|
||||
dispose: () => {
|
||||
void client.stop();
|
||||
},
|
||||
});
|
||||
// Jump-to-definition and find-references
|
||||
void logger.log("Registering jump-to-definition handlers.");
|
||||
void extLogger.log("Registering jump-to-definition handlers.");
|
||||
|
||||
// Store contextual queries in a temporary folder so that they are removed
|
||||
// when the application closes. There is no need for the user to interact with them.
|
||||
@@ -1541,14 +1550,14 @@ async function activateWithInstalledDistribution(
|
||||
|
||||
await commands.executeCommand("codeQLDatabases.removeOrphanedDatabases");
|
||||
|
||||
void logger.log("Reading query history");
|
||||
void extLogger.log("Reading query history");
|
||||
await qhm.readQueryHistory();
|
||||
|
||||
const app = new ExtensionApp(ctx);
|
||||
const dbModule = await initializeDbModule(app);
|
||||
ctx.subscriptions.push(dbModule);
|
||||
|
||||
void logger.log("Successfully finished extension initialization.");
|
||||
void extLogger.log("Successfully finished extension initialization.");
|
||||
|
||||
return {
|
||||
ctx,
|
||||
@@ -1611,7 +1620,7 @@ function getContextStoragePath(ctx: ExtensionContext) {
|
||||
}
|
||||
|
||||
async function initializeLogging(ctx: ExtensionContext): Promise<void> {
|
||||
ctx.subscriptions.push(logger);
|
||||
ctx.subscriptions.push(extLogger);
|
||||
ctx.subscriptions.push(queryServerLogger);
|
||||
ctx.subscriptions.push(ideServerLogger);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from "vscode";
|
||||
import { CodeQLCliServer, QlpacksInfo } from "./cli";
|
||||
import { UserCancellationException } from "./commandRunner";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { QueryMetadata } from "./pure/interface-types";
|
||||
|
||||
// Shared temporary folder for the extension.
|
||||
@@ -29,7 +29,7 @@ export const tmpDirDisposal = {
|
||||
try {
|
||||
tmpDir.removeCallback();
|
||||
} catch (e) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Failed to remove temporary directory ${tmpDir.name}: ${e}`,
|
||||
);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export const tmpDirDisposal = {
|
||||
export async function showAndLogErrorMessage(
|
||||
message: string,
|
||||
{
|
||||
outputLogger = logger,
|
||||
outputLogger = extLogger,
|
||||
items = [] as string[],
|
||||
fullMessage = undefined as string | undefined,
|
||||
} = {},
|
||||
@@ -80,7 +80,7 @@ function dropLinesExceptInitial(message: string, n = 2) {
|
||||
*/
|
||||
export async function showAndLogWarningMessage(
|
||||
message: string,
|
||||
{ outputLogger = logger, items = [] as string[] } = {},
|
||||
{ outputLogger = extLogger, items = [] as string[] } = {},
|
||||
): Promise<string | undefined> {
|
||||
return internalShowAndLog(
|
||||
message,
|
||||
@@ -100,7 +100,7 @@ export async function showAndLogWarningMessage(
|
||||
*/
|
||||
export async function showAndLogInformationMessage(
|
||||
message: string,
|
||||
{ outputLogger = logger, items = [] as string[], fullMessage = "" } = {},
|
||||
{ outputLogger = extLogger, items = [] as string[], fullMessage = "" } = {},
|
||||
): Promise<string | undefined> {
|
||||
return internalShowAndLog(
|
||||
message,
|
||||
@@ -119,7 +119,7 @@ type ShowMessageFn = (
|
||||
async function internalShowAndLog(
|
||||
message: string,
|
||||
items: string[],
|
||||
outputLogger = logger,
|
||||
outputLogger = extLogger,
|
||||
fn: ShowMessageFn,
|
||||
fullMessage?: string,
|
||||
): Promise<string | undefined> {
|
||||
@@ -402,13 +402,13 @@ export async function getQlPackForDbscheme(
|
||||
const packs: QlPackWithPath[] = Object.entries(qlpacks).map(
|
||||
([packName, dirs]) => {
|
||||
if (dirs.length < 1) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`In getQlPackFor ${dbschemePath}, qlpack ${packName} has no directories`,
|
||||
);
|
||||
return { packName, packDir: undefined };
|
||||
}
|
||||
if (dirs.length > 1) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`In getQlPackFor ${dbschemePath}, qlpack ${packName} has more than one directory; arbitrarily choosing the first`,
|
||||
);
|
||||
}
|
||||
@@ -622,10 +622,10 @@ export async function findLanguage(
|
||||
uri,
|
||||
);
|
||||
const language = Object.keys(queryInfo.byLanguage)[0];
|
||||
void logger.log(`Detected query language: ${language}`);
|
||||
void extLogger.log(`Detected query language: ${language}`);
|
||||
return language;
|
||||
} catch (e) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Could not autodetect query language. Select language manually.",
|
||||
);
|
||||
}
|
||||
@@ -673,7 +673,7 @@ export async function tryGetQueryMetadata(
|
||||
return await cliServer.resolveMetadata(queryPath);
|
||||
} catch (e) {
|
||||
// Ignore errors and provide no metadata.
|
||||
void logger.log(`Couldn't resolve metadata for ${queryPath}: ${e}`);
|
||||
void extLogger.log(`Couldn't resolve metadata for ${queryPath}: ${e}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ProgressLocation, window } from "vscode";
|
||||
import { StreamInfo } from "vscode-languageclient";
|
||||
import { StreamInfo } from "vscode-languageclient/node";
|
||||
import * as cli from "./cli";
|
||||
import { QueryServerConfig } from "./config";
|
||||
import { ideServerLogger } from "./logging";
|
||||
import { ideServerLogger } from "./common";
|
||||
|
||||
/**
|
||||
* Managing the language server for CodeQL.
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import { tryGetResolvableLocation, isLineColumnLoc } from "./pure/bqrs-utils";
|
||||
import { DatabaseItem, DatabaseManager } from "./databases";
|
||||
import { ViewSourceFileMsg } from "./pure/interface-types";
|
||||
import { Logger } from "./logging";
|
||||
import { Logger } from "./common";
|
||||
import {
|
||||
LineColumnLocation,
|
||||
WholeFileLocation,
|
||||
|
||||
@@ -34,7 +34,7 @@ import {
|
||||
RawResultsSortState,
|
||||
NavigationDirection,
|
||||
} from "./pure/interface-types";
|
||||
import { Logger } from "./logging";
|
||||
import { Logger } from "./common";
|
||||
import { commandRunner } from "./commandRunner";
|
||||
import {
|
||||
CompletedQueryInfo,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Logger } from "./logging";
|
||||
import { Logger } from "./common";
|
||||
import * as cp from "child_process";
|
||||
import { Disposable } from "vscode";
|
||||
import { MessageConnection } from "vscode-jsonrpc";
|
||||
|
||||
@@ -3,10 +3,10 @@ import * as fs from "fs-extra";
|
||||
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { CancellationToken, commands } from "vscode";
|
||||
import { createMessageConnection, RequestType } from "vscode-jsonrpc";
|
||||
import { createMessageConnection, RequestType } from "vscode-jsonrpc/node";
|
||||
import * as cli from "../cli";
|
||||
import { QueryServerConfig } from "../config";
|
||||
import { Logger, ProgressReporter } from "../logging";
|
||||
import { Logger, ProgressReporter } from "../common";
|
||||
import {
|
||||
completeQuery,
|
||||
EvaluationResult,
|
||||
@@ -237,8 +237,8 @@ export class QueryServerClient extends DisposableObject {
|
||||
return this.serverProcess!.child.pid || 0;
|
||||
}
|
||||
|
||||
async sendRequest<P, R, E, RO>(
|
||||
type: RequestType<WithProgressId<P>, R, E, RO>,
|
||||
async sendRequest<P, R, E>(
|
||||
type: RequestType<WithProgressId<P>, R, E>,
|
||||
parameter: P,
|
||||
token?: CancellationToken,
|
||||
progress?: (res: ProgressMessage) => void,
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as fs from "fs-extra";
|
||||
import * as tmp from "tmp-promise";
|
||||
import * as path from "path";
|
||||
import { CancellationToken, Uri } from "vscode";
|
||||
import { ErrorCodes, ResponseError } from "vscode-languageclient";
|
||||
import { LSPErrorCodes, ResponseError } from "vscode-languageclient";
|
||||
|
||||
import * as cli from "../cli";
|
||||
import { DatabaseItem } from "../databases";
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
} from "../helpers";
|
||||
import { ProgressCallback } from "../commandRunner";
|
||||
import { QueryMetadata } from "../pure/interface-types";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import * as messages from "../pure/legacy-messages";
|
||||
import { InitialQueryInfo, LocalQueryInfo } from "../query-results";
|
||||
import * as qsClient from "./queryserver-client";
|
||||
@@ -382,7 +382,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
const querySchemaName = path.basename(packConfig.dbscheme);
|
||||
const dbSchemaName = path.basename(dbItem.contents.dbSchemeUri.fsPath);
|
||||
if (querySchemaName != dbSchemaName) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Query schema was ${querySchemaName}, but database schema was ${dbSchemaName}.`,
|
||||
);
|
||||
throw new Error(
|
||||
@@ -411,7 +411,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
|
||||
let availableMlModels: cli.MlModelInfo[] = [];
|
||||
if (!(await cliServer.cliConstraints.supportsResolveMlModels())) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Resolving ML models is unsupported by this version of the CLI. Running the query without any ML models.",
|
||||
);
|
||||
} else {
|
||||
@@ -423,13 +423,13 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
)
|
||||
).models;
|
||||
if (availableMlModels.length) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Found available ML models at the following paths: ${availableMlModels
|
||||
.map((x) => `'${x.path}'`)
|
||||
.join(", ")}.`,
|
||||
);
|
||||
} else {
|
||||
void logger.log("Did not find any available ML models.");
|
||||
void extLogger.log("Did not find any available ML models.");
|
||||
}
|
||||
} catch (e) {
|
||||
const message =
|
||||
@@ -480,7 +480,10 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
try {
|
||||
errors = await query.compile(qs, qlProgram, progress, token);
|
||||
} catch (e) {
|
||||
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
|
||||
if (
|
||||
e instanceof ResponseError &&
|
||||
e.code == LSPErrorCodes.RequestCancelled
|
||||
) {
|
||||
return createSyntheticResult(query, "Query cancelled");
|
||||
} else {
|
||||
throw e;
|
||||
@@ -499,7 +502,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
);
|
||||
if (result.resultType !== messages.QueryResultType.SUCCESS) {
|
||||
const message = result.message || "Failed to run query";
|
||||
void logger.log(message);
|
||||
void extLogger.log(message);
|
||||
void showAndLogErrorMessage(message);
|
||||
}
|
||||
const message = formatLegacyMessage(result);
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
tmpDir,
|
||||
} from "../helpers";
|
||||
import { ProgressCallback, UserCancellationException } from "../commandRunner";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import * as messages from "../pure/legacy-messages";
|
||||
import * as qsClient from "./queryserver-client";
|
||||
import * as tmp from "tmp-promise";
|
||||
@@ -107,7 +107,7 @@ async function checkAndConfirmDatabaseUpgrade(
|
||||
descriptionMessage += `Would perform upgrade: ${script.description}\n`;
|
||||
descriptionMessage += `\t-> Compatibility: ${script.compatibility}\n`;
|
||||
}
|
||||
void logger.log(descriptionMessage);
|
||||
void extLogger.log(descriptionMessage);
|
||||
|
||||
// If the quiet flag is set, do the upgrade without a popup.
|
||||
if (quiet) {
|
||||
@@ -143,7 +143,7 @@ async function checkAndConfirmDatabaseUpgrade(
|
||||
);
|
||||
|
||||
if (chosenItem === showLogItem) {
|
||||
logger.outputChannel.show();
|
||||
extLogger.outputChannel.show();
|
||||
}
|
||||
|
||||
if (chosenItem !== yesItem) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "./log-scanner";
|
||||
import { PipelineInfo, SummarySymbols } from "./summary-parser";
|
||||
import * as fs from "fs-extra";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
|
||||
/**
|
||||
* Compute the key used to find a predicate in the summary symbols.
|
||||
@@ -56,7 +56,7 @@ class ProblemReporter implements EvaluationLogProblemReporter {
|
||||
}
|
||||
|
||||
public log(message: string): void {
|
||||
void logger.log(message);
|
||||
void extLogger.log(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
} from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { commandRunner } from "../commandRunner";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
|
||||
/** A `Position` within a specified file on disk. */
|
||||
@@ -103,7 +103,7 @@ export class SummaryLanguageSupport extends DisposableObject {
|
||||
this.sourceMap = await new SourceMapConsumer(rawMap);
|
||||
} catch (e: unknown) {
|
||||
// Error reading sourcemap. Pretend there was no sourcemap.
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Error reading sourcemap file '${mapPath}': ${getErrorMessage(e)}`,
|
||||
);
|
||||
this.sourceMap = undefined;
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from "./helpers";
|
||||
import { QuickPickItem, window } from "vscode";
|
||||
import { ProgressCallback, UserCancellationException } from "./commandRunner";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
|
||||
const QUERY_PACKS = [
|
||||
"codeql/cpp-queries",
|
||||
@@ -139,7 +139,7 @@ export async function handleInstallPackDependencies(
|
||||
}
|
||||
}
|
||||
if (failedPacks.length > 0) {
|
||||
void logger.log(`Errors:\n${errors.join("\n")}`);
|
||||
void extLogger.log(`Errors:\n${errors.join("\n")}`);
|
||||
throw new Error(
|
||||
`Unable to install pack dependencies for: ${failedPacks.join(
|
||||
", ",
|
||||
|
||||
53
extensions/ql-vscode/src/pure/distribution.ts
Normal file
53
extensions/ql-vscode/src/pure/distribution.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
import * as os from "os";
|
||||
import * as unzipper from "unzipper";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs-extra";
|
||||
|
||||
/**
|
||||
* Get the name of the codeql cli installation we prefer to install, based on our current platform.
|
||||
*/
|
||||
export function getRequiredAssetName(): string {
|
||||
switch (os.platform()) {
|
||||
case "linux":
|
||||
return "codeql-linux64.zip";
|
||||
case "darwin":
|
||||
return "codeql-osx64.zip";
|
||||
case "win32":
|
||||
return "codeql-win64.zip";
|
||||
default:
|
||||
return "codeql.zip";
|
||||
}
|
||||
}
|
||||
|
||||
export async function extractZipArchive(
|
||||
archivePath: string,
|
||||
outPath: string,
|
||||
): Promise<void> {
|
||||
const archive = await unzipper.Open.file(archivePath);
|
||||
await archive.extract({
|
||||
concurrency: 4,
|
||||
path: outPath,
|
||||
});
|
||||
// Set file permissions for extracted files
|
||||
await Promise.all(
|
||||
archive.files.map(async (file) => {
|
||||
// Only change file permissions if within outPath (path.join normalises the path)
|
||||
const extractedPath = path.join(outPath, file.path);
|
||||
if (
|
||||
extractedPath.indexOf(outPath) !== 0 ||
|
||||
!(await fs.pathExists(extractedPath))
|
||||
) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return fs.chmod(extractedPath, file.externalFileAttributes >>> 16);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function codeQlLauncherName(): string {
|
||||
return os.platform() === "win32" ? "codeql.exe" : "codeql";
|
||||
}
|
||||
|
||||
export function deprecatedCodeQlLauncherName(): string | undefined {
|
||||
return os.platform() === "win32" ? "codeql.cmd" : undefined;
|
||||
}
|
||||
@@ -973,7 +973,6 @@ export type ProgressMessage = shared.ProgressMessage;
|
||||
export const checkQuery = new rpc.RequestType<
|
||||
WithProgressId<CheckQueryParams>,
|
||||
CheckQueryResult,
|
||||
void,
|
||||
void
|
||||
>("compilation/checkQuery");
|
||||
/**
|
||||
@@ -982,7 +981,6 @@ export const checkQuery = new rpc.RequestType<
|
||||
export const compileQuery = new rpc.RequestType<
|
||||
WithProgressId<CompileQueryParams>,
|
||||
CheckQueryResult,
|
||||
void,
|
||||
void
|
||||
>("compilation/compileQuery");
|
||||
/**
|
||||
@@ -991,7 +989,6 @@ export const compileQuery = new rpc.RequestType<
|
||||
export const compileDilQuery = new rpc.RequestType<
|
||||
WithProgressId<CompileDilParams>,
|
||||
CheckQueryResult,
|
||||
void,
|
||||
void
|
||||
>("compilation/compileDilQuery");
|
||||
|
||||
@@ -1001,7 +998,6 @@ export const compileDilQuery = new rpc.RequestType<
|
||||
export const checkUpgrade = new rpc.RequestType<
|
||||
WithProgressId<UpgradeParams>,
|
||||
CheckUpgradeResult,
|
||||
void,
|
||||
void
|
||||
>("compilation/checkUpgrade");
|
||||
/**
|
||||
@@ -1010,7 +1006,6 @@ export const checkUpgrade = new rpc.RequestType<
|
||||
export const compileUpgrade = new rpc.RequestType<
|
||||
WithProgressId<CompileUpgradeParams>,
|
||||
CompileUpgradeResult,
|
||||
void,
|
||||
void
|
||||
>("compilation/compileUpgrade");
|
||||
/**
|
||||
@@ -1019,7 +1014,6 @@ export const compileUpgrade = new rpc.RequestType<
|
||||
export const compileUpgradeSequence = new rpc.RequestType<
|
||||
WithProgressId<CompileUpgradeSequenceParams>,
|
||||
CompileUpgradeSequenceResult,
|
||||
void,
|
||||
void
|
||||
>("compilation/compileUpgradeSequence");
|
||||
|
||||
@@ -1029,7 +1023,6 @@ export const compileUpgradeSequence = new rpc.RequestType<
|
||||
export const startLog = new rpc.RequestType<
|
||||
WithProgressId<StartLogParams>,
|
||||
StartLogResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/startLog");
|
||||
|
||||
@@ -1039,7 +1032,6 @@ export const startLog = new rpc.RequestType<
|
||||
export const endLog = new rpc.RequestType<
|
||||
WithProgressId<EndLogParams>,
|
||||
EndLogResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/endLog");
|
||||
|
||||
@@ -1049,7 +1041,6 @@ export const endLog = new rpc.RequestType<
|
||||
export const clearCache = new rpc.RequestType<
|
||||
WithProgressId<ClearCacheParams>,
|
||||
ClearCacheResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/clearCache");
|
||||
/**
|
||||
@@ -1058,7 +1049,6 @@ export const clearCache = new rpc.RequestType<
|
||||
export const trimCache = new rpc.RequestType<
|
||||
WithProgressId<TrimCacheParams>,
|
||||
ClearCacheResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/trimCache");
|
||||
|
||||
@@ -1068,7 +1058,6 @@ export const trimCache = new rpc.RequestType<
|
||||
export const runQueries = new rpc.RequestType<
|
||||
WithProgressId<EvaluateQueriesParams>,
|
||||
EvaluationComplete,
|
||||
void,
|
||||
void
|
||||
>("evaluation/runQueries");
|
||||
|
||||
@@ -1078,21 +1067,18 @@ export const runQueries = new rpc.RequestType<
|
||||
export const runUpgrade = new rpc.RequestType<
|
||||
WithProgressId<RunUpgradeParams>,
|
||||
RunUpgradeResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/runUpgrade");
|
||||
|
||||
export const registerDatabases = new rpc.RequestType<
|
||||
WithProgressId<RegisterDatabasesParams>,
|
||||
RegisterDatabasesResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/registerDatabases");
|
||||
|
||||
export const deregisterDatabases = new rpc.RequestType<
|
||||
WithProgressId<DeregisterDatabasesParams>,
|
||||
DeregisterDatabasesResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/deregisterDatabases");
|
||||
|
||||
@@ -1103,7 +1089,6 @@ export const deregisterDatabases = new rpc.RequestType<
|
||||
export const completeQuery = new rpc.RequestType<
|
||||
EvaluationResult,
|
||||
Record<string, any>,
|
||||
void,
|
||||
void
|
||||
>("evaluation/queryCompleted");
|
||||
|
||||
|
||||
@@ -106,6 +106,6 @@ export interface ProgressMessage {
|
||||
/**
|
||||
* A notification that the progress has been changed.
|
||||
*/
|
||||
export const progress = new rpc.NotificationType<ProgressMessage, void>(
|
||||
export const progress = new rpc.NotificationType<ProgressMessage>(
|
||||
"ql/progressUpdated",
|
||||
);
|
||||
|
||||
@@ -167,7 +167,6 @@ export type ProgressMessage = shared.ProgressMessage;
|
||||
export const clearCache = new rpc.RequestType<
|
||||
WithProgressId<ClearCacheParams>,
|
||||
ClearCacheResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/clearCache");
|
||||
/**
|
||||
@@ -176,7 +175,6 @@ export const clearCache = new rpc.RequestType<
|
||||
export const trimCache = new rpc.RequestType<
|
||||
WithProgressId<TrimCacheParams>,
|
||||
ClearCacheResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/trimCache");
|
||||
|
||||
@@ -186,7 +184,6 @@ export const trimCache = new rpc.RequestType<
|
||||
export const clearPackCache = new rpc.RequestType<
|
||||
WithProgressId<ClearPackCacheParams>,
|
||||
ClearPackCacheResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/clearPackCache");
|
||||
|
||||
@@ -196,28 +193,24 @@ export const clearPackCache = new rpc.RequestType<
|
||||
export const runQuery = new rpc.RequestType<
|
||||
WithProgressId<RunQueryParams>,
|
||||
RunQueryResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/runQuery");
|
||||
|
||||
export const registerDatabases = new rpc.RequestType<
|
||||
WithProgressId<RegisterDatabasesParams>,
|
||||
RegisterDatabasesResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/registerDatabases");
|
||||
|
||||
export const deregisterDatabases = new rpc.RequestType<
|
||||
WithProgressId<DeregisterDatabasesParams>,
|
||||
DeregisterDatabasesResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/deregisterDatabases");
|
||||
|
||||
export const upgradeDatabase = new rpc.RequestType<
|
||||
WithProgressId<UpgradeParams>,
|
||||
UpgradeResult,
|
||||
void,
|
||||
void
|
||||
>("evaluation/runUpgrade");
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as fs from "fs-extra";
|
||||
import * as os from "os";
|
||||
import * as path from "path";
|
||||
import { Disposable, ExtensionContext } from "vscode";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { QueryHistoryManager } from "./query-history";
|
||||
|
||||
const LAST_SCRUB_TIME_KEY = "lastScrubTime";
|
||||
@@ -74,9 +74,9 @@ async function scrubQueries(
|
||||
let scrubCount = 0; // total number of directories deleted
|
||||
try {
|
||||
counter?.increment();
|
||||
void logger.log("Scrubbing query directory. Removing old queries.");
|
||||
void extLogger.log("Scrubbing query directory. Removing old queries.");
|
||||
if (!(await fs.pathExists(queryDirectory))) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Cannot scrub. Query directory does not exist: ${queryDirectory}`,
|
||||
);
|
||||
return;
|
||||
@@ -99,9 +99,9 @@ async function scrubQueries(
|
||||
throw new Error(os.EOL + errors.join(os.EOL));
|
||||
}
|
||||
} catch (e) {
|
||||
void logger.log(`Error while scrubbing queries: ${e}`);
|
||||
void extLogger.log(`Error while scrubbing queries: ${e}`);
|
||||
} finally {
|
||||
void logger.log(`Scrubbed ${scrubCount} old queries.`);
|
||||
void extLogger.log(`Scrubbed ${scrubCount} old queries.`);
|
||||
}
|
||||
await qhm.removeDeletedQueries();
|
||||
}
|
||||
@@ -119,30 +119,30 @@ async function scrubDirectory(
|
||||
try {
|
||||
let deleted = true;
|
||||
if (!(await fs.stat(dir)).isDirectory()) {
|
||||
void logger.log(` ${dir} is not a directory. Deleting.`);
|
||||
void extLogger.log(` ${dir} is not a directory. Deleting.`);
|
||||
await fs.remove(dir);
|
||||
} else if (!(await fs.pathExists(timestampFile))) {
|
||||
void logger.log(` ${dir} has no timestamp file. Deleting.`);
|
||||
void extLogger.log(` ${dir} has no timestamp file. Deleting.`);
|
||||
await fs.remove(dir);
|
||||
} else if (!(await fs.stat(timestampFile)).isFile()) {
|
||||
void logger.log(` ${timestampFile} is not a file. Deleting.`);
|
||||
void extLogger.log(` ${timestampFile} is not a file. Deleting.`);
|
||||
await fs.remove(dir);
|
||||
} else {
|
||||
const timestampText = await fs.readFile(timestampFile, "utf8");
|
||||
const timestamp = parseInt(timestampText, 10);
|
||||
|
||||
if (Number.isNaN(timestamp)) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
` ${dir} has invalid timestamp '${timestampText}'. Deleting.`,
|
||||
);
|
||||
await fs.remove(dir);
|
||||
} else if (now - timestamp > maxQueryTime) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
` ${dir} is older than ${maxQueryTime / 1000} seconds. Deleting.`,
|
||||
);
|
||||
await fs.remove(dir);
|
||||
} else {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
` ${dir} is not older than ${maxQueryTime / 1000} seconds. Keeping.`,
|
||||
);
|
||||
deleted = false;
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
showAndLogWarningMessage,
|
||||
showBinaryChoiceDialog,
|
||||
} from "./helpers";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { URLSearchParams } from "url";
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { commandRunner } from "./commandRunner";
|
||||
@@ -460,7 +460,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
}),
|
||||
);
|
||||
|
||||
void logger.log("Registering query history panel commands.");
|
||||
void extLogger.log("Registering query history panel commands.");
|
||||
this.push(
|
||||
commandRunner(
|
||||
"codeQLQueryHistory.openQuery",
|
||||
@@ -705,7 +705,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
});
|
||||
await this.refreshTreeView();
|
||||
} else {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Variant analysis status update event received for unknown variant analysis",
|
||||
);
|
||||
}
|
||||
@@ -775,7 +775,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
}
|
||||
await this.refreshTreeView();
|
||||
} else {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Variant analysis status update event received for unknown variant analysis",
|
||||
);
|
||||
}
|
||||
@@ -787,7 +787,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
}
|
||||
|
||||
async readQueryHistory(): Promise<void> {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Reading cached query history from '${this.queryMetadataStorageLocation}'.`,
|
||||
);
|
||||
const history = await slurpQueryHistory(this.queryMetadataStorageLocation);
|
||||
@@ -929,9 +929,9 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
// Remote queries can be removed locally, but not remotely.
|
||||
// The user must cancel the query on GitHub Actions explicitly.
|
||||
this.treeDataProvider.remove(item);
|
||||
void logger.log(`Deleted ${this.labelProvider.getLabel(item)}.`);
|
||||
void extLogger.log(`Deleted ${this.labelProvider.getLabel(item)}.`);
|
||||
if (item.status === QueryStatus.InProgress) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"The variant analysis is still running on GitHub Actions. To cancel there, you must go to the workflow run in your browser.",
|
||||
);
|
||||
}
|
||||
@@ -945,9 +945,9 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
// We can remove a Variant Analysis locally, but not remotely.
|
||||
// The user must cancel the query on GitHub Actions explicitly.
|
||||
this.treeDataProvider.remove(item);
|
||||
void logger.log(`Deleted ${this.labelProvider.getLabel(item)}.`);
|
||||
void extLogger.log(`Deleted ${this.labelProvider.getLabel(item)}.`);
|
||||
if (item.status === QueryStatus.InProgress) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"The variant analysis is still running on GitHub Actions. To cancel there, you must go to the workflow run in your browser.",
|
||||
);
|
||||
}
|
||||
@@ -1604,8 +1604,8 @@ the file in the file explorer and dragging it into the workspace.`,
|
||||
}
|
||||
} else {
|
||||
void showAndLogErrorMessage(`Could not open file ${fileLocation}`);
|
||||
void logger.log(getErrorMessage(e));
|
||||
void logger.log(getErrorStack(e));
|
||||
void extLogger.log(getErrorMessage(e));
|
||||
void extLogger.log(getErrorStack(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ import * as fs from "fs-extra";
|
||||
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { CancellationToken, commands } from "vscode";
|
||||
import { createMessageConnection, RequestType } from "vscode-jsonrpc";
|
||||
import { createMessageConnection, RequestType } from "vscode-jsonrpc/node";
|
||||
import * as cli from "../cli";
|
||||
import { QueryServerConfig } from "../config";
|
||||
import { Logger, ProgressReporter } from "../logging";
|
||||
import { Logger, ProgressReporter } from "../common";
|
||||
import {
|
||||
progress,
|
||||
ProgressMessage,
|
||||
@@ -201,8 +201,8 @@ export class QueryServerClient extends DisposableObject {
|
||||
return this.serverProcess!.child.pid || 0;
|
||||
}
|
||||
|
||||
async sendRequest<P, R, E, RO>(
|
||||
type: RequestType<WithProgressId<P>, R, E, RO>,
|
||||
async sendRequest<P, R, E>(
|
||||
type: RequestType<WithProgressId<P>, R, E>,
|
||||
parameter: P,
|
||||
token?: CancellationToken,
|
||||
progress?: (res: ProgressMessage) => void,
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
showAndLogWarningMessage,
|
||||
tryGetQueryMetadata,
|
||||
} from "../helpers";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import * as messages from "../pure/new-messages";
|
||||
import * as legacyMessages from "../pure/legacy-messages";
|
||||
import { InitialQueryInfo, LocalQueryInfo } from "../query-results";
|
||||
@@ -110,7 +110,7 @@ export async function compileAndRunQueryAgainstDatabase(
|
||||
|
||||
if (result.resultType !== messages.QueryResultType.SUCCESS) {
|
||||
const message = result.message || "Failed to run query";
|
||||
void logger.log(message);
|
||||
void extLogger.log(message);
|
||||
void showAndLogErrorMessage(message);
|
||||
}
|
||||
let message;
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
workspace,
|
||||
Uri,
|
||||
} from "vscode";
|
||||
import { ErrorCodes, ResponseError } from "vscode-languageclient";
|
||||
import { LSPErrorCodes, ResponseError } from "vscode-languageclient";
|
||||
import { CodeQLCliServer } from "./cli";
|
||||
import { DatabaseUI } from "./databases-ui";
|
||||
import {
|
||||
@@ -148,7 +148,10 @@ export async function displayQuickQuery(
|
||||
|
||||
await Window.showTextDocument(await workspace.openTextDocument(qlFile));
|
||||
} catch (e) {
|
||||
if (e instanceof ResponseError && e.code == ErrorCodes.RequestCancelled) {
|
||||
if (
|
||||
e instanceof ResponseError &&
|
||||
e.code == LSPErrorCodes.RequestCancelled
|
||||
) {
|
||||
throw new UserCancellationException(getErrorMessage(e));
|
||||
} else {
|
||||
throw e;
|
||||
|
||||
@@ -4,7 +4,7 @@ import * as path from "path";
|
||||
import { CancellationToken, ExtensionContext } from "vscode";
|
||||
|
||||
import { Credentials } from "../authentication";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { downloadArtifactFromLink } from "./gh-api/gh-actions-api-client";
|
||||
import { AnalysisSummary } from "./shared/remote-query-result";
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CodeQLCliServer } from "../cli";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { transformBqrsResultSet } from "../pure/bqrs-cli-types";
|
||||
import { AnalysisRawResults } from "./shared/analysis-result";
|
||||
import { MAX_RAW_RESULTS } from "./shared/result-limits";
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { Credentials } from "../authentication";
|
||||
import { UserCancellationException } from "../commandRunner";
|
||||
import { showInformationMessageWithAction } from "../helpers";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import { QueryHistoryManager } from "../query-history";
|
||||
import { createGist } from "./gh-api/gh-api-client";
|
||||
import { RemoteQueriesManager } from "./remote-queries-manager";
|
||||
@@ -76,7 +76,7 @@ export async function exportRemoteQueryResults(
|
||||
): Promise<void> {
|
||||
const queryHistoryItem = queryHistoryManager.getRemoteQueryById(queryId);
|
||||
if (!queryHistoryItem) {
|
||||
void logger.log(`Could not find query with id ${queryId}`);
|
||||
void extLogger.log(`Could not find query with id ${queryId}`);
|
||||
throw new Error(
|
||||
"There was an error when trying to retrieve variant analysis information",
|
||||
);
|
||||
@@ -86,7 +86,7 @@ export async function exportRemoteQueryResults(
|
||||
throw new Error("Variant analysis results are not yet available.");
|
||||
}
|
||||
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Exporting variant analysis results for query: ${queryHistoryItem.queryId}`,
|
||||
);
|
||||
const query = queryHistoryItem.remoteQuery;
|
||||
@@ -148,7 +148,7 @@ export async function exportVariantAnalysisResults(
|
||||
variantAnalysisId,
|
||||
);
|
||||
if (!variantAnalysis) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Could not find variant analysis with id ${variantAnalysisId}`,
|
||||
);
|
||||
throw new Error(
|
||||
@@ -156,7 +156,7 @@ export async function exportVariantAnalysisResults(
|
||||
);
|
||||
}
|
||||
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Exporting variant analysis results for variant analysis with id ${variantAnalysis.id}`,
|
||||
);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
tmpDir,
|
||||
} from "../../helpers";
|
||||
import { Credentials } from "../../authentication";
|
||||
import { logger } from "../../logging";
|
||||
import { extLogger } from "../../common";
|
||||
import { RemoteQueryWorkflowResult } from "../remote-query-workflow-result";
|
||||
import { DownloadLink, createDownloadPath } from "../download-link";
|
||||
import { RemoteQuery } from "../remote-query";
|
||||
@@ -384,10 +384,10 @@ async function unzipBuffer(
|
||||
filePath: string,
|
||||
destinationPath: string,
|
||||
): Promise<void> {
|
||||
void logger.log(`Saving file to ${filePath}`);
|
||||
void extLogger.log(`Saving file to ${filePath}`);
|
||||
await fs.writeFile(filePath, Buffer.from(data));
|
||||
|
||||
void logger.log(`Unzipping file to ${destinationPath}`);
|
||||
void extLogger.log(`Unzipping file to ${destinationPath}`);
|
||||
await unzipFile(filePath, destinationPath);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
showAndLogInformationMessage,
|
||||
showInformationMessageWithAction,
|
||||
} from "../helpers";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { prepareRemoteQueryRun } from "./run-remote-query";
|
||||
import { RemoteQueriesView } from "./remote-queries-view";
|
||||
import { buildRemoteQueryEntity, RemoteQuery } from "./remote-query";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as vscode from "vscode";
|
||||
import { Credentials } from "../authentication";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { sleep } from "../pure/time";
|
||||
import {
|
||||
getWorkflowStatus,
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
RemoteQueryDownloadAnalysisResultsMessage,
|
||||
RemoteQueryDownloadAllAnalysesResultsMessage,
|
||||
} from "../pure/interface-types";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { assertNever } from "../pure/helpers-pure";
|
||||
import {
|
||||
AnalysisSummary,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from "fs-extra";
|
||||
import { QuickPickItem, window } from "vscode";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import {
|
||||
getRemoteRepositoryLists,
|
||||
getRemoteRepositoryListsPath,
|
||||
@@ -50,12 +50,12 @@ export async function getRepositorySelection(): Promise<RepositorySelection> {
|
||||
);
|
||||
|
||||
if (quickpick?.repositories?.length) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Selected repositories: ${quickpick.repositories.join(", ")}`,
|
||||
);
|
||||
return { repositories: quickpick.repositories };
|
||||
} else if (quickpick?.repositoryList) {
|
||||
void logger.log(`Selected repository list: ${quickpick.repositoryList}`);
|
||||
void extLogger.log(`Selected repository list: ${quickpick.repositoryList}`);
|
||||
return { repositoryLists: [quickpick.repositoryList] };
|
||||
} else if (quickpick?.useCustomRepo) {
|
||||
const customRepo = await getCustomRepo();
|
||||
@@ -68,7 +68,7 @@ export async function getRepositorySelection(): Promise<RepositorySelection> {
|
||||
"Invalid repository format. Please enter a valid repository in the format <owner>/<repo> (e.g. github/codeql)",
|
||||
);
|
||||
}
|
||||
void logger.log(`Entered repository: ${customRepo}`);
|
||||
void extLogger.log(`Entered repository: ${customRepo}`);
|
||||
return { repositories: [customRepo] };
|
||||
} else if (quickpick?.useAllReposOfOwner) {
|
||||
const owner = await getOwner();
|
||||
@@ -79,7 +79,7 @@ export async function getRepositorySelection(): Promise<RepositorySelection> {
|
||||
if (!owner || !OWNER_REGEX.test(owner)) {
|
||||
throw new Error(`Invalid user or organization: ${owner}`);
|
||||
}
|
||||
void logger.log(`Entered owner: ${owner}`);
|
||||
void extLogger.log(`Entered owner: ${owner}`);
|
||||
return { owners: [owner] };
|
||||
} else {
|
||||
// We don't need to display a warning pop-up in this case, since the user just escaped out of the operation.
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from "../helpers";
|
||||
import { Credentials } from "../authentication";
|
||||
import * as cli from "../cli";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import {
|
||||
getActionBranch,
|
||||
getRemoteControllerRepo,
|
||||
@@ -97,7 +97,7 @@ async function generateQueryPack(
|
||||
}),
|
||||
});
|
||||
|
||||
void logger.log(`Copied ${copiedCount} files to ${queryPackDir}`);
|
||||
void extLogger.log(`Copied ${copiedCount} files to ${queryPackDir}`);
|
||||
|
||||
await fixPackFile(queryPackDir, packRelativePath);
|
||||
|
||||
@@ -108,9 +108,9 @@ async function generateQueryPack(
|
||||
|
||||
// copy only the query file to the query pack directory
|
||||
// and generate a synthetic query pack
|
||||
void logger.log(`Copying ${queryFile} to ${queryPackDir}`);
|
||||
void extLogger.log(`Copying ${queryFile} to ${queryPackDir}`);
|
||||
await fs.copy(queryFile, targetQueryFileName);
|
||||
void logger.log("Generating synthetic query pack");
|
||||
void extLogger.log("Generating synthetic query pack");
|
||||
const syntheticQueryPack = {
|
||||
name: QUERY_PACK_NAME,
|
||||
version: "0.0.0",
|
||||
@@ -144,7 +144,7 @@ async function generateQueryPack(
|
||||
}
|
||||
|
||||
const bundlePath = await getPackedBundlePath(queryPackDir);
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Compiling and bundling query pack from ${queryPackDir} to ${bundlePath}. (This may take a while.)`,
|
||||
);
|
||||
await cliServer.packInstall(queryPackDir);
|
||||
@@ -359,7 +359,7 @@ export async function getControllerRepo(
|
||||
let controllerRepoNwo: string | undefined;
|
||||
controllerRepoNwo = getRemoteControllerRepo();
|
||||
if (!controllerRepoNwo || !REPO_REGEX.test(controllerRepoNwo)) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
controllerRepoNwo
|
||||
? "Invalid controller repository name."
|
||||
: "No controller repository defined.",
|
||||
@@ -380,13 +380,13 @@ export async function getControllerRepo(
|
||||
"Invalid repository format. Must be a valid GitHub repository in the format <owner>/<repo>.",
|
||||
);
|
||||
}
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
`Setting the controller repository as: ${controllerRepoNwo}`,
|
||||
);
|
||||
await setRemoteControllerRepo(controllerRepoNwo);
|
||||
}
|
||||
|
||||
void logger.log(`Using controller repository: ${controllerRepoNwo}`);
|
||||
void extLogger.log(`Using controller repository: ${controllerRepoNwo}`);
|
||||
const [owner, repo] = controllerRepoNwo.split("/");
|
||||
|
||||
try {
|
||||
@@ -395,7 +395,7 @@ export async function getControllerRepo(
|
||||
owner,
|
||||
repo,
|
||||
);
|
||||
void logger.log(`Controller repository ID: ${controllerRepo.id}`);
|
||||
void extLogger.log(`Controller repository ID: ${controllerRepo.id}`);
|
||||
return {
|
||||
id: controllerRepo.id,
|
||||
fullName: controllerRepo.full_name,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { VariantAnalysis } from "./variant-analysis";
|
||||
|
||||
export type VariantAnalysisMonitorStatus = "Completed" | "Canceled";
|
||||
|
||||
export interface VariantAnalysisMonitorResult {
|
||||
status: VariantAnalysisMonitorStatus;
|
||||
scannedReposDownloaded?: number[];
|
||||
variantAnalysis?: VariantAnalysis;
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
VariantAnalysis,
|
||||
VariantAnalysisScannedRepository,
|
||||
} from "./shared/variant-analysis";
|
||||
import { VariantAnalysisMonitorResult } from "./shared/variant-analysis-monitor-result";
|
||||
import { processUpdatedVariantAnalysis } from "./variant-analysis-processor";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { sleep } from "../pure/time";
|
||||
@@ -41,7 +40,7 @@ export class VariantAnalysisMonitor extends DisposableObject {
|
||||
public async monitorVariantAnalysis(
|
||||
variantAnalysis: VariantAnalysis,
|
||||
cancellationToken: CancellationToken,
|
||||
): Promise<VariantAnalysisMonitorResult> {
|
||||
): Promise<void> {
|
||||
const credentials = await Credentials.initialize(this.extensionContext);
|
||||
if (!credentials) {
|
||||
throw Error("Error authenticating with GitHub");
|
||||
@@ -54,11 +53,11 @@ export class VariantAnalysisMonitor extends DisposableObject {
|
||||
await sleep(VariantAnalysisMonitor.sleepTime);
|
||||
|
||||
if (cancellationToken && cancellationToken.isCancellationRequested) {
|
||||
return { status: "Canceled" };
|
||||
return;
|
||||
}
|
||||
|
||||
if (await this.shouldCancelMonitor(variantAnalysis.id)) {
|
||||
return { status: "Canceled" };
|
||||
return;
|
||||
}
|
||||
|
||||
const variantAnalysisSummary = await ghApiClient.getVariantAnalysis(
|
||||
@@ -86,8 +85,6 @@ export class VariantAnalysisMonitor extends DisposableObject {
|
||||
|
||||
attemptCount++;
|
||||
}
|
||||
|
||||
return { status: "Completed", scannedReposDownloaded, variantAnalysis };
|
||||
}
|
||||
|
||||
private scheduleForDownload(
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as os from "os";
|
||||
import * as path from "path";
|
||||
|
||||
import { Credentials } from "../authentication";
|
||||
import { Logger } from "../logging";
|
||||
import { Logger } from "../common";
|
||||
import { AnalysisAlert, AnalysisRawResults } from "./shared/analysis-result";
|
||||
import { sarifParser } from "../sarif-parser";
|
||||
import { extractAnalysisAlerts } from "./sarif-processing";
|
||||
@@ -121,6 +121,7 @@ export class VariantAnalysisResultsManager extends DisposableObject {
|
||||
createCacheKey(variantAnalysisId, repositoryFullName),
|
||||
);
|
||||
if (result) {
|
||||
this._onResultLoaded.fire(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "vscode";
|
||||
import { URLSearchParams } from "url";
|
||||
import { AbstractWebview, WebviewPanelConfig } from "../abstract-webview";
|
||||
import { logger } from "../logging";
|
||||
import { extLogger } from "../common";
|
||||
import {
|
||||
FromVariantAnalysisMessage,
|
||||
ToVariantAnalysisMessage,
|
||||
@@ -159,7 +159,7 @@ export class VariantAnalysisView
|
||||
protected async onWebViewLoaded() {
|
||||
super.onWebViewLoaded();
|
||||
|
||||
void logger.log("Variant analysis view loaded");
|
||||
void extLogger.log("Variant analysis view loaded");
|
||||
|
||||
const variantAnalysis = await this.manager.getVariantAnalysis(
|
||||
this.variantAnalysisId,
|
||||
|
||||
@@ -25,7 +25,8 @@ import { CodeQLCliServer } from "./cli";
|
||||
import { SELECT_QUERY_NAME } from "./contextual/locationFinder";
|
||||
import { DatabaseManager } from "./databases";
|
||||
import { DecodedBqrsChunk } from "./pure/bqrs-cli-types";
|
||||
import { logger, Logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { Logger } from "./common";
|
||||
import { generateSummarySymbolsFile } from "./log-insights/summary-parser";
|
||||
import { asError } from "./pure/helpers-pure";
|
||||
|
||||
@@ -142,7 +143,7 @@ export class QueryEvaluationInfo {
|
||||
*/
|
||||
canHaveInterpretedResults(): boolean {
|
||||
if (!this.databaseHasMetadataFile) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Cannot produce interpreted results since the database does not have a .dbinfo or codeql-database.yml file.",
|
||||
);
|
||||
return false;
|
||||
@@ -151,7 +152,7 @@ export class QueryEvaluationInfo {
|
||||
const kind = this.metadata?.kind;
|
||||
const hasKind = !!kind;
|
||||
if (!hasKind) {
|
||||
void logger.log(
|
||||
void extLogger.log(
|
||||
"Cannot produce interpreted results since the query does not have @kind metadata.",
|
||||
);
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,577 @@
|
||||
/*
|
||||
* These were copied from VSCode Dark High Contrast theme.
|
||||
*
|
||||
* To update these, open a webview in VSCode, open the webview developer tools and find the
|
||||
* iframe hosting the webview. The <html> element will have a style attribute that contains
|
||||
* the CSS variables. Copy these to this file.
|
||||
*/
|
||||
:root {
|
||||
--vscode-font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
--vscode-font-weight: normal;
|
||||
--vscode-font-size: 13px;
|
||||
--vscode-editor-font-family: Menlo, Monaco, "Courier New", monospace;
|
||||
--vscode-editor-font-weight: normal;
|
||||
--vscode-editor-font-size: 12px;
|
||||
--vscode-foreground: #ffffff;
|
||||
--vscode-disabledForeground: #a5a5a5;
|
||||
--vscode-errorForeground: #f48771;
|
||||
--vscode-descriptionForeground: rgba(255, 255, 255, 0.7);
|
||||
--vscode-icon-foreground: #ffffff;
|
||||
--vscode-focusBorder: #f38518;
|
||||
--vscode-contrastBorder: #6fc3df;
|
||||
--vscode-contrastActiveBorder: #f38518;
|
||||
--vscode-selection-background: #008000;
|
||||
--vscode-textSeparator-foreground: #000000;
|
||||
--vscode-textLink-foreground: #3794ff;
|
||||
--vscode-textLink-activeForeground: #3794ff;
|
||||
--vscode-textPreformat-foreground: #d7ba7d;
|
||||
--vscode-textBlockQuote-border: #ffffff;
|
||||
--vscode-textCodeBlock-background: #000000;
|
||||
--vscode-input-background: #000000;
|
||||
--vscode-input-foreground: #ffffff;
|
||||
--vscode-input-border: #6fc3df;
|
||||
--vscode-inputOption-activeBorder: #6fc3df;
|
||||
--vscode-inputOption-activeBackground: rgba(0, 0, 0, 0);
|
||||
--vscode-inputOption-activeForeground: #ffffff;
|
||||
--vscode-input-placeholderForeground: rgba(255, 255, 255, 0.7);
|
||||
--vscode-inputValidation-infoBackground: #000000;
|
||||
--vscode-inputValidation-infoBorder: #6fc3df;
|
||||
--vscode-inputValidation-warningBackground: #000000;
|
||||
--vscode-inputValidation-warningBorder: #6fc3df;
|
||||
--vscode-inputValidation-errorBackground: #000000;
|
||||
--vscode-inputValidation-errorBorder: #6fc3df;
|
||||
--vscode-dropdown-background: #000000;
|
||||
--vscode-dropdown-listBackground: #000000;
|
||||
--vscode-dropdown-foreground: #ffffff;
|
||||
--vscode-dropdown-border: #6fc3df;
|
||||
--vscode-button-foreground: #ffffff;
|
||||
--vscode-button-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-button-border: #6fc3df;
|
||||
--vscode-button-secondaryForeground: #ffffff;
|
||||
--vscode-badge-background: #000000;
|
||||
--vscode-badge-foreground: #ffffff;
|
||||
--vscode-scrollbarSlider-background: rgba(111, 195, 223, 0.6);
|
||||
--vscode-scrollbarSlider-hoverBackground: rgba(111, 195, 223, 0.8);
|
||||
--vscode-scrollbarSlider-activeBackground: #6fc3df;
|
||||
--vscode-progressBar-background: #6fc3df;
|
||||
--vscode-editorError-foreground: #f48771;
|
||||
--vscode-editorError-border: rgba(228, 119, 119, 0.8);
|
||||
--vscode-editorWarning-foreground: #ff0000;
|
||||
--vscode-editorWarning-border: rgba(255, 204, 0, 0.8);
|
||||
--vscode-editorInfo-foreground: #3794ff;
|
||||
--vscode-editorInfo-border: rgba(55, 148, 255, 0.8);
|
||||
--vscode-editorHint-border: rgba(238, 238, 238, 0.8);
|
||||
--vscode-sash-hoverBorder: #f38518;
|
||||
--vscode-editor-background: #000000;
|
||||
--vscode-editor-foreground: #ffffff;
|
||||
--vscode-editorStickyScroll-background: #000000;
|
||||
--vscode-editorWidget-background: #0c141f;
|
||||
--vscode-editorWidget-foreground: #ffffff;
|
||||
--vscode-editorWidget-border: #6fc3df;
|
||||
--vscode-quickInput-background: #0c141f;
|
||||
--vscode-quickInput-foreground: #ffffff;
|
||||
--vscode-quickInputTitle-background: #000000;
|
||||
--vscode-pickerGroup-foreground: #ffffff;
|
||||
--vscode-pickerGroup-border: #ffffff;
|
||||
--vscode-keybindingLabel-background: rgba(0, 0, 0, 0);
|
||||
--vscode-keybindingLabel-foreground: #ffffff;
|
||||
--vscode-keybindingLabel-border: #6fc3df;
|
||||
--vscode-keybindingLabel-bottomBorder: #6fc3df;
|
||||
--vscode-editor-selectionBackground: #ffffff;
|
||||
--vscode-editor-selectionForeground: #000000;
|
||||
--vscode-editor-inactiveSelectionBackground: rgba(255, 255, 255, 0.7);
|
||||
--vscode-editor-selectionHighlightBorder: #f38518;
|
||||
--vscode-editor-findMatchBorder: #f38518;
|
||||
--vscode-editor-findMatchHighlightBorder: #f38518;
|
||||
--vscode-editor-findRangeHighlightBorder: rgba(243, 133, 24, 0.4);
|
||||
--vscode-searchEditor-findMatchBorder: #f38518;
|
||||
--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, 0.15);
|
||||
--vscode-editorHoverWidget-background: #0c141f;
|
||||
--vscode-editorHoverWidget-foreground: #ffffff;
|
||||
--vscode-editorHoverWidget-border: #6fc3df;
|
||||
--vscode-editorHoverWidget-statusBarBackground: #0c141f;
|
||||
--vscode-editorLink-activeForeground: #00ffff;
|
||||
--vscode-editorInlayHint-foreground: #000000;
|
||||
--vscode-editorInlayHint-background: #f38518;
|
||||
--vscode-editorInlayHint-typeForeground: #000000;
|
||||
--vscode-editorInlayHint-typeBackground: #f38518;
|
||||
--vscode-editorInlayHint-parameterForeground: #000000;
|
||||
--vscode-editorInlayHint-parameterBackground: #f38518;
|
||||
--vscode-editorLightBulb-foreground: #ffcc00;
|
||||
--vscode-editorLightBulbAutoFix-foreground: #75beff;
|
||||
--vscode-diffEditor-insertedTextBorder: #33ff2e;
|
||||
--vscode-diffEditor-removedTextBorder: #ff008f;
|
||||
--vscode-diffEditor-border: #6fc3df;
|
||||
--vscode-list-focusOutline: #f38518;
|
||||
--vscode-list-highlightForeground: #f38518;
|
||||
--vscode-list-focusHighlightForeground: #f38518;
|
||||
--vscode-list-invalidItemForeground: #b89500;
|
||||
--vscode-listFilterWidget-background: #0c141f;
|
||||
--vscode-listFilterWidget-outline: #f38518;
|
||||
--vscode-listFilterWidget-noMatchesOutline: #6fc3df;
|
||||
--vscode-list-filterMatchBorder: #6fc3df;
|
||||
--vscode-tree-indentGuidesStroke: #a9a9a9;
|
||||
--vscode-list-deemphasizedForeground: #a7a8a9;
|
||||
--vscode-checkbox-background: #000000;
|
||||
--vscode-checkbox-selectBackground: #0c141f;
|
||||
--vscode-checkbox-foreground: #ffffff;
|
||||
--vscode-checkbox-border: #6fc3df;
|
||||
--vscode-checkbox-selectBorder: #0c141f;
|
||||
--vscode-menu-border: #6fc3df;
|
||||
--vscode-menu-foreground: #ffffff;
|
||||
--vscode-menu-background: #000000;
|
||||
--vscode-menu-selectionBorder: #f38518;
|
||||
--vscode-menu-separatorBackground: #6fc3df;
|
||||
--vscode-toolbar-hoverOutline: #f38518;
|
||||
--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, 0.3);
|
||||
--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;
|
||||
--vscode-breadcrumb-foreground: rgba(255, 255, 255, 0.8);
|
||||
--vscode-breadcrumb-background: #000000;
|
||||
--vscode-breadcrumb-focusForeground: #ffffff;
|
||||
--vscode-breadcrumb-activeSelectionForeground: #ffffff;
|
||||
--vscode-breadcrumbPicker-background: #0c141f;
|
||||
--vscode-merge-border: #c3df6f;
|
||||
--vscode-editorOverviewRuler-currentContentForeground: #c3df6f;
|
||||
--vscode-editorOverviewRuler-incomingContentForeground: #c3df6f;
|
||||
--vscode-editorOverviewRuler-commonContentForeground: #c3df6f;
|
||||
--vscode-editorOverviewRuler-findMatchForeground: #ab5a00;
|
||||
--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-minimap-findMatchHighlight: #ab5a00;
|
||||
--vscode-minimap-selectionOccurrenceHighlight: #ffffff;
|
||||
--vscode-minimap-selectionHighlight: #ffffff;
|
||||
--vscode-minimap-errorHighlight: #ff3232;
|
||||
--vscode-minimap-warningHighlight: rgba(255, 204, 0, 0.8);
|
||||
--vscode-minimap-foregroundOpacity: #000000;
|
||||
--vscode-minimapSlider-background: rgba(111, 195, 223, 0.3);
|
||||
--vscode-minimapSlider-hoverBackground: rgba(111, 195, 223, 0.4);
|
||||
--vscode-minimapSlider-activeBackground: rgba(111, 195, 223, 0.5);
|
||||
--vscode-problemsErrorIcon-foreground: #f48771;
|
||||
--vscode-problemsWarningIcon-foreground: #ff0000;
|
||||
--vscode-problemsInfoIcon-foreground: #3794ff;
|
||||
--vscode-charts-foreground: #ffffff;
|
||||
--vscode-charts-lines: rgba(255, 255, 255, 0.5);
|
||||
--vscode-charts-red: #f48771;
|
||||
--vscode-charts-blue: #3794ff;
|
||||
--vscode-charts-yellow: #ff0000;
|
||||
--vscode-charts-orange: #ab5a00;
|
||||
--vscode-charts-green: #89d185;
|
||||
--vscode-charts-purple: #b180d7;
|
||||
--vscode-symbolIcon-arrayForeground: #ffffff;
|
||||
--vscode-symbolIcon-booleanForeground: #ffffff;
|
||||
--vscode-symbolIcon-classForeground: #ee9d28;
|
||||
--vscode-symbolIcon-colorForeground: #ffffff;
|
||||
--vscode-symbolIcon-constantForeground: #ffffff;
|
||||
--vscode-symbolIcon-constructorForeground: #b180d7;
|
||||
--vscode-symbolIcon-enumeratorForeground: #ee9d28;
|
||||
--vscode-symbolIcon-enumeratorMemberForeground: #75beff;
|
||||
--vscode-symbolIcon-eventForeground: #ee9d28;
|
||||
--vscode-symbolIcon-fieldForeground: #75beff;
|
||||
--vscode-symbolIcon-fileForeground: #ffffff;
|
||||
--vscode-symbolIcon-folderForeground: #ffffff;
|
||||
--vscode-symbolIcon-functionForeground: #b180d7;
|
||||
--vscode-symbolIcon-interfaceForeground: #75beff;
|
||||
--vscode-symbolIcon-keyForeground: #ffffff;
|
||||
--vscode-symbolIcon-keywordForeground: #ffffff;
|
||||
--vscode-symbolIcon-methodForeground: #b180d7;
|
||||
--vscode-symbolIcon-moduleForeground: #ffffff;
|
||||
--vscode-symbolIcon-namespaceForeground: #ffffff;
|
||||
--vscode-symbolIcon-nullForeground: #ffffff;
|
||||
--vscode-symbolIcon-numberForeground: #ffffff;
|
||||
--vscode-symbolIcon-objectForeground: #ffffff;
|
||||
--vscode-symbolIcon-operatorForeground: #ffffff;
|
||||
--vscode-symbolIcon-packageForeground: #ffffff;
|
||||
--vscode-symbolIcon-propertyForeground: #ffffff;
|
||||
--vscode-symbolIcon-referenceForeground: #ffffff;
|
||||
--vscode-symbolIcon-snippetForeground: #ffffff;
|
||||
--vscode-symbolIcon-stringForeground: #ffffff;
|
||||
--vscode-symbolIcon-structForeground: #ffffff;
|
||||
--vscode-symbolIcon-textForeground: #ffffff;
|
||||
--vscode-symbolIcon-typeParameterForeground: #ffffff;
|
||||
--vscode-symbolIcon-unitForeground: #ffffff;
|
||||
--vscode-symbolIcon-variableForeground: #75beff;
|
||||
--vscode-editor-lineHighlightBorder: #f38518;
|
||||
--vscode-editor-rangeHighlightBorder: #f38518;
|
||||
--vscode-editor-symbolHighlightBorder: #f38518;
|
||||
--vscode-editorCursor-foreground: #ffffff;
|
||||
--vscode-editorWhitespace-foreground: #7c7c7c;
|
||||
--vscode-editorIndentGuide-background: #ffffff;
|
||||
--vscode-editorIndentGuide-activeBackground: #ffffff;
|
||||
--vscode-editorLineNumber-foreground: #ffffff;
|
||||
--vscode-editorActiveLineNumber-foreground: #f38518;
|
||||
--vscode-editorLineNumber-activeForeground: #f38518;
|
||||
--vscode-editorRuler-foreground: #ffffff;
|
||||
--vscode-editorCodeLens-foreground: #999999;
|
||||
--vscode-editorBracketMatch-background: rgba(0, 100, 0, 0.1);
|
||||
--vscode-editorBracketMatch-border: #6fc3df;
|
||||
--vscode-editorOverviewRuler-border: rgba(127, 127, 127, 0.3);
|
||||
--vscode-editorGutter-background: #000000;
|
||||
--vscode-editorUnnecessaryCode-border: rgba(255, 255, 255, 0.8);
|
||||
--vscode-editorGhostText-border: rgba(255, 255, 255, 0.8);
|
||||
--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, 0.6);
|
||||
--vscode-editorOverviewRuler-errorForeground: #ff3232;
|
||||
--vscode-editorOverviewRuler-warningForeground: rgba(255, 204, 0, 0.8);
|
||||
--vscode-editorOverviewRuler-infoForeground: rgba(55, 148, 255, 0.8);
|
||||
--vscode-editorBracketHighlight-foreground1: #ffd700;
|
||||
--vscode-editorBracketHighlight-foreground2: #da70d6;
|
||||
--vscode-editorBracketHighlight-foreground3: #87cefa;
|
||||
--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketHighlight-unexpectedBracket\.foreground: #ff3232;
|
||||
--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorUnicodeHighlight-border: #ff0000;
|
||||
--vscode-editorUnicodeHighlight-background: rgba(0, 0, 0, 0);
|
||||
--vscode-editorHoverWidget-highlightForeground: #f38518;
|
||||
--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;
|
||||
--vscode-editorGutter-foldingControlForeground: #ffffff;
|
||||
--vscode-editor-linkedEditingBackground: rgba(255, 0, 0, 0.3);
|
||||
--vscode-editor-wordHighlightBorder: #f38518;
|
||||
--vscode-editor-wordHighlightStrongBorder: #f38518;
|
||||
--vscode-editorOverviewRuler-wordHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(
|
||||
192,
|
||||
160,
|
||||
192,
|
||||
0.8
|
||||
);
|
||||
--vscode-peekViewTitleLabel-foreground: #ffffff;
|
||||
--vscode-peekViewTitleDescription-foreground: rgba(255, 255, 255, 0.6);
|
||||
--vscode-peekView-border: #6fc3df;
|
||||
--vscode-peekViewResult-background: #000000;
|
||||
--vscode-peekViewResult-lineForeground: #ffffff;
|
||||
--vscode-peekViewResult-fileForeground: #ffffff;
|
||||
--vscode-peekViewResult-selectionForeground: #ffffff;
|
||||
--vscode-peekViewEditor-background: #000000;
|
||||
--vscode-peekViewEditorGutter-background: #000000;
|
||||
--vscode-peekViewEditor-matchHighlightBorder: #f38518;
|
||||
--vscode-editorMarkerNavigationError-background: #6fc3df;
|
||||
--vscode-editorMarkerNavigationWarning-background: #6fc3df;
|
||||
--vscode-editorMarkerNavigationWarning-headerBackground: #0c141f;
|
||||
--vscode-editorMarkerNavigationInfo-background: #6fc3df;
|
||||
--vscode-editorMarkerNavigation-background: #000000;
|
||||
--vscode-editorSuggestWidget-background: #0c141f;
|
||||
--vscode-editorSuggestWidget-border: #6fc3df;
|
||||
--vscode-editorSuggestWidget-foreground: #ffffff;
|
||||
--vscode-editorSuggestWidget-highlightForeground: #f38518;
|
||||
--vscode-editorSuggestWidget-focusHighlightForeground: #f38518;
|
||||
--vscode-editorSuggestWidgetStatus-foreground: rgba(255, 255, 255, 0.5);
|
||||
--vscode-tab-activeBackground: #000000;
|
||||
--vscode-tab-unfocusedActiveBackground: #000000;
|
||||
--vscode-tab-activeForeground: #ffffff;
|
||||
--vscode-tab-inactiveForeground: #ffffff;
|
||||
--vscode-tab-unfocusedActiveForeground: #ffffff;
|
||||
--vscode-tab-unfocusedInactiveForeground: #ffffff;
|
||||
--vscode-tab-border: #6fc3df;
|
||||
--vscode-tab-lastPinnedBorder: #6fc3df;
|
||||
--vscode-tab-inactiveModifiedBorder: #ffffff;
|
||||
--vscode-tab-unfocusedActiveModifiedBorder: #ffffff;
|
||||
--vscode-tab-unfocusedInactiveModifiedBorder: #ffffff;
|
||||
--vscode-editorPane-background: #000000;
|
||||
--vscode-editorGroup-focusedEmptyBorder: #f38518;
|
||||
--vscode-editorGroupHeader-noTabsBackground: #000000;
|
||||
--vscode-editorGroupHeader-border: #6fc3df;
|
||||
--vscode-editorGroup-border: #6fc3df;
|
||||
--vscode-editorGroup-dropIntoPromptForeground: #ffffff;
|
||||
--vscode-editorGroup-dropIntoPromptBackground: #0c141f;
|
||||
--vscode-editorGroup-dropIntoPromptBorder: #6fc3df;
|
||||
--vscode-sideBySideEditor-horizontalBorder: #6fc3df;
|
||||
--vscode-sideBySideEditor-verticalBorder: #6fc3df;
|
||||
--vscode-panel-background: #000000;
|
||||
--vscode-panel-border: #6fc3df;
|
||||
--vscode-panelTitle-activeForeground: #ffffff;
|
||||
--vscode-panelTitle-inactiveForeground: #ffffff;
|
||||
--vscode-panelTitle-activeBorder: #6fc3df;
|
||||
--vscode-panelInput-border: #6fc3df;
|
||||
--vscode-panel-dropBorder: #ffffff;
|
||||
--vscode-panelSectionHeader-border: #6fc3df;
|
||||
--vscode-panelSection-border: #6fc3df;
|
||||
--vscode-banner-iconForeground: #3794ff;
|
||||
--vscode-statusBar-foreground: #ffffff;
|
||||
--vscode-statusBar-noFolderForeground: #ffffff;
|
||||
--vscode-statusBar-border: #6fc3df;
|
||||
--vscode-statusBar-noFolderBorder: #6fc3df;
|
||||
--vscode-statusBarItem-activeBackground: rgba(255, 255, 255, 0.18);
|
||||
--vscode-statusBarItem-hoverBackground: rgba(255, 255, 255, 0.12);
|
||||
--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, 0.2);
|
||||
--vscode-statusBarItem-prominentForeground: #ffffff;
|
||||
--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, 0.5);
|
||||
--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, 0.3);
|
||||
--vscode-statusBarItem-errorForeground: #ffffff;
|
||||
--vscode-statusBarItem-warningForeground: #ffffff;
|
||||
--vscode-activityBar-background: #000000;
|
||||
--vscode-activityBar-foreground: #ffffff;
|
||||
--vscode-activityBar-inactiveForeground: #ffffff;
|
||||
--vscode-activityBar-border: #6fc3df;
|
||||
--vscode-activityBarBadge-background: #000000;
|
||||
--vscode-activityBarBadge-foreground: #ffffff;
|
||||
--vscode-activityBarItem-profilesForeground: #ffffff;
|
||||
--vscode-activityBarItem-profilesHoverForeground: #ffffff;
|
||||
--vscode-statusBarItem-remoteBackground: rgba(0, 0, 0, 0);
|
||||
--vscode-statusBarItem-remoteForeground: #ffffff;
|
||||
--vscode-extensionBadge-remoteBackground: #000000;
|
||||
--vscode-extensionBadge-remoteForeground: #ffffff;
|
||||
--vscode-sideBar-background: #000000;
|
||||
--vscode-sideBar-border: #6fc3df;
|
||||
--vscode-sideBarTitle-foreground: #ffffff;
|
||||
--vscode-sideBarSectionHeader-border: #6fc3df;
|
||||
--vscode-titleBar-activeForeground: #ffffff;
|
||||
--vscode-titleBar-activeBackground: #000000;
|
||||
--vscode-titleBar-border: #6fc3df;
|
||||
--vscode-menubar-selectionForeground: #ffffff;
|
||||
--vscode-menubar-selectionBorder: #f38518;
|
||||
--vscode-notificationCenter-border: #6fc3df;
|
||||
--vscode-notificationToast-border: #6fc3df;
|
||||
--vscode-notifications-foreground: #ffffff;
|
||||
--vscode-notifications-background: #0c141f;
|
||||
--vscode-notificationLink-foreground: #3794ff;
|
||||
--vscode-notificationCenterHeader-background: #0c141f;
|
||||
--vscode-notifications-border: #0c141f;
|
||||
--vscode-notificationsErrorIcon-foreground: #f48771;
|
||||
--vscode-notificationsWarningIcon-foreground: #ff0000;
|
||||
--vscode-notificationsInfoIcon-foreground: #3794ff;
|
||||
--vscode-window-activeBorder: #6fc3df;
|
||||
--vscode-window-inactiveBorder: #6fc3df;
|
||||
--vscode-commandCenter-foreground: #ffffff;
|
||||
--vscode-commandCenter-activeForeground: #ffffff;
|
||||
--vscode-commandCenter-border: rgba(255, 255, 255, 0.6);
|
||||
--vscode-commandCenter-activeBorder: #ffffff;
|
||||
--vscode-editorCommentsWidget-resolvedBorder: #6fc3df;
|
||||
--vscode-editorCommentsWidget-unresolvedBorder: #6fc3df;
|
||||
--vscode-editorCommentsWidget-rangeBackground: rgba(111, 195, 223, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeBorder: rgba(111, 195, 223, 0.4);
|
||||
--vscode-editorCommentsWidget-rangeActiveBackground: rgba(111, 195, 223, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeActiveBorder: rgba(111, 195, 223, 0.4);
|
||||
--vscode-editorGutter-commentRangeForeground: #ffffff;
|
||||
--vscode-debugToolBar-background: #000000;
|
||||
--vscode-debugIcon-startForeground: #89d185;
|
||||
--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 0, 0.2);
|
||||
--vscode-editor-focusedStackFrameHighlightBackground: rgba(
|
||||
122,
|
||||
189,
|
||||
122,
|
||||
0.3
|
||||
);
|
||||
--vscode-mergeEditor-change\.background: rgba(155, 185, 85, 0.2);
|
||||
--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, 0.2);
|
||||
--vscode-mergeEditor-changeBase\.background: #4b1818;
|
||||
--vscode-mergeEditor-changeBase\.word\.background: #6f1313;
|
||||
--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(
|
||||
255,
|
||||
166,
|
||||
0,
|
||||
0.48
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;
|
||||
--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(
|
||||
134,
|
||||
134,
|
||||
134,
|
||||
0.29
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(
|
||||
193,
|
||||
193,
|
||||
193,
|
||||
0.8
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(
|
||||
173,
|
||||
172,
|
||||
168,
|
||||
0.93
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;
|
||||
--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, 0.28);
|
||||
--vscode-settings-headerForeground: #ffffff;
|
||||
--vscode-settings-modifiedItemIndicator: #00497a;
|
||||
--vscode-settings-headerBorder: #6fc3df;
|
||||
--vscode-settings-sashBorder: #6fc3df;
|
||||
--vscode-settings-dropdownBackground: #000000;
|
||||
--vscode-settings-dropdownForeground: #ffffff;
|
||||
--vscode-settings-dropdownBorder: #6fc3df;
|
||||
--vscode-settings-dropdownListBorder: #6fc3df;
|
||||
--vscode-settings-checkboxBackground: #000000;
|
||||
--vscode-settings-checkboxForeground: #ffffff;
|
||||
--vscode-settings-checkboxBorder: #6fc3df;
|
||||
--vscode-settings-textInputBackground: #000000;
|
||||
--vscode-settings-textInputForeground: #ffffff;
|
||||
--vscode-settings-textInputBorder: #6fc3df;
|
||||
--vscode-settings-numberInputBackground: #000000;
|
||||
--vscode-settings-numberInputForeground: #ffffff;
|
||||
--vscode-settings-numberInputBorder: #6fc3df;
|
||||
--vscode-settings-focusedRowBorder: #f38518;
|
||||
--vscode-terminal-foreground: #ffffff;
|
||||
--vscode-terminal-selectionBackground: #ffffff;
|
||||
--vscode-terminal-inactiveSelectionBackground: rgba(255, 255, 255, 0.7);
|
||||
--vscode-terminal-selectionForeground: #000000;
|
||||
--vscode-terminalCommandDecoration-defaultBackground: rgba(
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
0.5
|
||||
);
|
||||
--vscode-terminalCommandDecoration-successBackground: #1b81a8;
|
||||
--vscode-terminalCommandDecoration-errorBackground: #f14c4c;
|
||||
--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8);
|
||||
--vscode-terminal-border: #6fc3df;
|
||||
--vscode-terminal-findMatchBorder: #f38518;
|
||||
--vscode-terminal-findMatchHighlightBorder: #f38518;
|
||||
--vscode-terminalOverviewRuler-findMatchForeground: #f38518;
|
||||
--vscode-testing-iconFailed: #f14c4c;
|
||||
--vscode-testing-iconErrored: #f14c4c;
|
||||
--vscode-testing-iconPassed: #73c991;
|
||||
--vscode-testing-runAction: #73c991;
|
||||
--vscode-testing-iconQueued: #cca700;
|
||||
--vscode-testing-iconUnset: #848484;
|
||||
--vscode-testing-iconSkipped: #848484;
|
||||
--vscode-testing-peekBorder: #6fc3df;
|
||||
--vscode-testing-message\.error\.decorationForeground: #ffffff;
|
||||
--vscode-testing-message\.info\.decorationForeground: rgba(
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
0.5
|
||||
);
|
||||
--vscode-welcomePage-tileBackground: #000000;
|
||||
--vscode-welcomePage-tileBorder: #6fc3df;
|
||||
--vscode-welcomePage-progress\.background: #000000;
|
||||
--vscode-welcomePage-progress\.foreground: #3794ff;
|
||||
--vscode-debugExceptionWidget-border: #a31515;
|
||||
--vscode-debugExceptionWidget-background: #420b0d;
|
||||
--vscode-ports-iconRunningProcessForeground: #ffffff;
|
||||
--vscode-statusBar-debuggingBackground: #ba592c;
|
||||
--vscode-statusBar-debuggingForeground: #ffffff;
|
||||
--vscode-statusBar-debuggingBorder: #6fc3df;
|
||||
--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, 0.5);
|
||||
--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2);
|
||||
--vscode-editorGutter-modifiedBackground: #1b81a8;
|
||||
--vscode-editorGutter-addedBackground: #487e02;
|
||||
--vscode-editorGutter-deletedBackground: #f48771;
|
||||
--vscode-minimapGutter-modifiedBackground: #1b81a8;
|
||||
--vscode-minimapGutter-addedBackground: #487e02;
|
||||
--vscode-minimapGutter-deletedBackground: #f48771;
|
||||
--vscode-editorOverviewRuler-modifiedForeground: rgba(27, 129, 168, 0.6);
|
||||
--vscode-editorOverviewRuler-addedForeground: rgba(72, 126, 2, 0.6);
|
||||
--vscode-editorOverviewRuler-deletedForeground: rgba(244, 135, 113, 0.6);
|
||||
--vscode-debugIcon-breakpointForeground: #e51400;
|
||||
--vscode-debugIcon-breakpointDisabledForeground: #848484;
|
||||
--vscode-debugIcon-breakpointUnverifiedForeground: #848484;
|
||||
--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;
|
||||
--vscode-debugIcon-breakpointStackframeForeground: #89d185;
|
||||
--vscode-notebook-cellBorderColor: #6fc3df;
|
||||
--vscode-notebook-focusedEditorBorder: #f38518;
|
||||
--vscode-notebookStatusSuccessIcon-foreground: #89d185;
|
||||
--vscode-notebookStatusErrorIcon-foreground: #f48771;
|
||||
--vscode-notebookStatusRunningIcon-foreground: #ffffff;
|
||||
--vscode-notebook-cellToolbarSeparator: #6fc3df;
|
||||
--vscode-notebook-selectedCellBorder: #6fc3df;
|
||||
--vscode-notebook-inactiveSelectedCellBorder: #f38518;
|
||||
--vscode-notebook-focusedCellBorder: #f38518;
|
||||
--vscode-notebook-inactiveFocusedCellBorder: #6fc3df;
|
||||
--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, 0.15);
|
||||
--vscode-notebook-cellInsertionIndicator: #f38518;
|
||||
--vscode-notebookScrollbarSlider-background: rgba(111, 195, 223, 0.6);
|
||||
--vscode-notebookScrollbarSlider-hoverBackground: rgba(111, 195, 223, 0.8);
|
||||
--vscode-notebookScrollbarSlider-activeBackground: #6fc3df;
|
||||
--vscode-scm-providerBorder: #6fc3df;
|
||||
--vscode-searchEditor-textInputBorder: #6fc3df;
|
||||
--vscode-debugTokenExpression-name: #ffffff;
|
||||
--vscode-debugTokenExpression-value: #ffffff;
|
||||
--vscode-debugTokenExpression-string: #f48771;
|
||||
--vscode-debugTokenExpression-boolean: #75bdfe;
|
||||
--vscode-debugTokenExpression-number: #89d185;
|
||||
--vscode-debugTokenExpression-error: #f48771;
|
||||
--vscode-debugView-exceptionLabelForeground: #ffffff;
|
||||
--vscode-debugView-exceptionLabelBackground: #6c2022;
|
||||
--vscode-debugView-stateLabelForeground: #ffffff;
|
||||
--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, 0.27);
|
||||
--vscode-debugView-valueChangedHighlight: #569cd6;
|
||||
--vscode-debugConsole-infoForeground: #ffffff;
|
||||
--vscode-debugConsole-warningForeground: #008000;
|
||||
--vscode-debugConsole-errorForeground: #f48771;
|
||||
--vscode-debugConsole-sourceForeground: #ffffff;
|
||||
--vscode-debugConsoleInputIcon-foreground: #ffffff;
|
||||
--vscode-debugIcon-pauseForeground: #75beff;
|
||||
--vscode-debugIcon-stopForeground: #f48771;
|
||||
--vscode-debugIcon-disconnectForeground: #f48771;
|
||||
--vscode-debugIcon-restartForeground: #89d185;
|
||||
--vscode-debugIcon-stepOverForeground: #75beff;
|
||||
--vscode-debugIcon-stepIntoForeground: #75beff;
|
||||
--vscode-debugIcon-stepOutForeground: #75beff;
|
||||
--vscode-debugIcon-continueForeground: #75beff;
|
||||
--vscode-debugIcon-stepBackForeground: #75beff;
|
||||
--vscode-extensionButton-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-extensionIcon-starForeground: #ff8e00;
|
||||
--vscode-extensionIcon-verifiedForeground: #3794ff;
|
||||
--vscode-extensionIcon-preReleaseForeground: #1d9271;
|
||||
--vscode-terminal-ansiBlack: #000000;
|
||||
--vscode-terminal-ansiRed: #cd0000;
|
||||
--vscode-terminal-ansiGreen: #00cd00;
|
||||
--vscode-terminal-ansiYellow: #cdcd00;
|
||||
--vscode-terminal-ansiBlue: #0000ee;
|
||||
--vscode-terminal-ansiMagenta: #cd00cd;
|
||||
--vscode-terminal-ansiCyan: #00cdcd;
|
||||
--vscode-terminal-ansiWhite: #e5e5e5;
|
||||
--vscode-terminal-ansiBrightBlack: #7f7f7f;
|
||||
--vscode-terminal-ansiBrightRed: #ff0000;
|
||||
--vscode-terminal-ansiBrightGreen: #00ff00;
|
||||
--vscode-terminal-ansiBrightYellow: #ffff00;
|
||||
--vscode-terminal-ansiBrightBlue: #5c5cff;
|
||||
--vscode-terminal-ansiBrightMagenta: #ff00ff;
|
||||
--vscode-terminal-ansiBrightCyan: #00ffff;
|
||||
--vscode-terminal-ansiBrightWhite: #ffffff;
|
||||
--vscode-interactive-activeCodeBorder: #6fc3df;
|
||||
--vscode-interactive-inactiveCodeBorder: #6fc3df;
|
||||
--vscode-gitDecoration-addedResourceForeground: #a1e3ad;
|
||||
--vscode-gitDecoration-modifiedResourceForeground: #e2c08d;
|
||||
--vscode-gitDecoration-deletedResourceForeground: #c74e39;
|
||||
--vscode-gitDecoration-renamedResourceForeground: #73c991;
|
||||
--vscode-gitDecoration-untrackedResourceForeground: #73c991;
|
||||
--vscode-gitDecoration-ignoredResourceForeground: #a7a8a9;
|
||||
--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;
|
||||
--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;
|
||||
--vscode-gitDecoration-conflictingResourceForeground: #c74e39;
|
||||
--vscode-gitDecoration-submoduleResourceForeground: #8db9e2;
|
||||
--vscode-testExplorer-errorDecorationBackground: #000000;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is copied in the same way, but from the <body> element
|
||||
*/
|
||||
body {
|
||||
background-color: transparent;
|
||||
color: var(--vscode-editor-foreground);
|
||||
font-family: var(--vscode-font-family);
|
||||
font-weight: var(--vscode-font-weight);
|
||||
font-size: var(--vscode-font-size);
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used for setting the background on the Storybook preview.
|
||||
*/
|
||||
body {
|
||||
background-color: var(--vscode-editor-background);
|
||||
}
|
||||
@@ -0,0 +1,674 @@
|
||||
/*
|
||||
* These were copied from VSCode GitHub Dark Default theme from the
|
||||
* https://marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme extension.
|
||||
*
|
||||
* To update these, open a webview in VSCode, open the webview developer tools and find the
|
||||
* iframe hosting the webview. The <html> element will have a style attribute that contains
|
||||
* the CSS variables. Copy these to this file.
|
||||
*/
|
||||
:root {
|
||||
--vscode-font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
--vscode-font-weight: normal;
|
||||
--vscode-font-size: 13px;
|
||||
--vscode-editor-font-family: Menlo, Monaco, "Courier New", monospace;
|
||||
--vscode-editor-font-weight: normal;
|
||||
--vscode-editor-font-size: 12px;
|
||||
--vscode-foreground: #c9d1d9;
|
||||
--vscode-disabledForeground: rgba(204, 204, 204, 0.5);
|
||||
--vscode-errorForeground: #f85149;
|
||||
--vscode-descriptionForeground: #8b949e;
|
||||
--vscode-icon-foreground: #8b949e;
|
||||
--vscode-focusBorder: #1f6feb;
|
||||
--vscode-textSeparator-foreground: #21262d;
|
||||
--vscode-textLink-foreground: #58a6ff;
|
||||
--vscode-textLink-activeForeground: #58a6ff;
|
||||
--vscode-textPreformat-foreground: #8b949e;
|
||||
--vscode-textBlockQuote-background: #010409;
|
||||
--vscode-textBlockQuote-border: #30363d;
|
||||
--vscode-textCodeBlock-background: rgba(110, 118, 129, 0.4);
|
||||
--vscode-widget-shadow: rgba(0, 0, 0, 0.36);
|
||||
--vscode-input-background: #0d1117;
|
||||
--vscode-input-foreground: #c9d1d9;
|
||||
--vscode-input-border: #30363d;
|
||||
--vscode-inputOption-activeBorder: rgba(0, 122, 204, 0);
|
||||
--vscode-inputOption-hoverBackground: rgba(90, 93, 94, 0.5);
|
||||
--vscode-inputOption-activeBackground: rgba(31, 111, 235, 0.4);
|
||||
--vscode-inputOption-activeForeground: #ffffff;
|
||||
--vscode-input-placeholderForeground: #484f58;
|
||||
--vscode-inputValidation-infoBackground: #063b49;
|
||||
--vscode-inputValidation-infoBorder: #007acc;
|
||||
--vscode-inputValidation-warningBackground: #352a05;
|
||||
--vscode-inputValidation-warningBorder: #b89500;
|
||||
--vscode-inputValidation-errorBackground: #5a1d1d;
|
||||
--vscode-inputValidation-errorBorder: #be1100;
|
||||
--vscode-dropdown-background: #161b22;
|
||||
--vscode-dropdown-listBackground: #161b22;
|
||||
--vscode-dropdown-foreground: #c9d1d9;
|
||||
--vscode-dropdown-border: #30363d;
|
||||
--vscode-button-foreground: #ffffff;
|
||||
--vscode-button-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-button-background: #238636;
|
||||
--vscode-button-hoverBackground: #2ea043;
|
||||
--vscode-button-secondaryForeground: #c9d1d9;
|
||||
--vscode-button-secondaryBackground: #282e33;
|
||||
--vscode-button-secondaryHoverBackground: #30363d;
|
||||
--vscode-badge-background: #1f6feb;
|
||||
--vscode-badge-foreground: #f0f6fc;
|
||||
--vscode-scrollbar-shadow: rgba(72, 79, 88, 0.2);
|
||||
--vscode-scrollbarSlider-background: rgba(110, 118, 129, 0.2);
|
||||
--vscode-scrollbarSlider-hoverBackground: rgba(110, 118, 129, 0.27);
|
||||
--vscode-scrollbarSlider-activeBackground: rgba(110, 118, 129, 0.53);
|
||||
--vscode-progressBar-background: #1f6feb;
|
||||
--vscode-editorError-foreground: #f14c4c;
|
||||
--vscode-editorWarning-foreground: #cca700;
|
||||
--vscode-editorInfo-foreground: #3794ff;
|
||||
--vscode-editorHint-foreground: rgba(238, 238, 238, 0.7);
|
||||
--vscode-sash-hoverBorder: #1f6feb;
|
||||
--vscode-editor-background: #0d1117;
|
||||
--vscode-editor-foreground: #c9d1d9;
|
||||
--vscode-editorStickyScroll-background: #0d1117;
|
||||
--vscode-editorStickyScrollHover-background: #2a2d2e;
|
||||
--vscode-editorWidget-background: #161b22;
|
||||
--vscode-editorWidget-foreground: #c9d1d9;
|
||||
--vscode-editorWidget-border: #454545;
|
||||
--vscode-quickInput-background: #161b22;
|
||||
--vscode-quickInput-foreground: #c9d1d9;
|
||||
--vscode-quickInputTitle-background: rgba(255, 255, 255, 0.1);
|
||||
--vscode-pickerGroup-foreground: #8b949e;
|
||||
--vscode-pickerGroup-border: #30363d;
|
||||
--vscode-keybindingLabel-background: rgba(128, 128, 128, 0.17);
|
||||
--vscode-keybindingLabel-foreground: #c9d1d9;
|
||||
--vscode-keybindingLabel-border: rgba(51, 51, 51, 0.6);
|
||||
--vscode-keybindingLabel-bottomBorder: rgba(68, 68, 68, 0.6);
|
||||
--vscode-editor-selectionBackground: #264f78;
|
||||
--vscode-editor-inactiveSelectionBackground: rgba(38, 79, 120, 0.5);
|
||||
--vscode-editor-selectionHighlightBackground: rgba(63, 185, 80, 0.25);
|
||||
--vscode-editor-findMatchBackground: #9e6a03;
|
||||
--vscode-editor-findMatchHighlightBackground: rgba(242, 204, 96, 0.5);
|
||||
--vscode-editor-findRangeHighlightBackground: rgba(58, 61, 65, 0.4);
|
||||
--vscode-searchEditor-findMatchBackground: rgba(242, 204, 96, 0.33);
|
||||
--vscode-editor-hoverHighlightBackground: rgba(38, 79, 120, 0.25);
|
||||
--vscode-editorHoverWidget-background: #161b22;
|
||||
--vscode-editorHoverWidget-foreground: #c9d1d9;
|
||||
--vscode-editorHoverWidget-border: #454545;
|
||||
--vscode-editorHoverWidget-statusBarBackground: #1a2029;
|
||||
--vscode-editorLink-activeForeground: #4e94ce;
|
||||
--vscode-editorInlayHint-foreground: #8b949e;
|
||||
--vscode-editorInlayHint-background: rgba(139, 148, 158, 0.2);
|
||||
--vscode-editorInlayHint-typeForeground: #8b949e;
|
||||
--vscode-editorInlayHint-typeBackground: rgba(139, 148, 158, 0.2);
|
||||
--vscode-editorInlayHint-parameterForeground: #8b949e;
|
||||
--vscode-editorInlayHint-parameterBackground: rgba(139, 148, 158, 0.2);
|
||||
--vscode-editorLightBulb-foreground: #ffcc00;
|
||||
--vscode-editorLightBulbAutoFix-foreground: #75beff;
|
||||
--vscode-diffEditor-insertedTextBackground: rgba(35, 134, 54, 0.3);
|
||||
--vscode-diffEditor-removedTextBackground: rgba(218, 54, 51, 0.3);
|
||||
--vscode-diffEditor-insertedLineBackground: rgba(35, 134, 54, 0.2);
|
||||
--vscode-diffEditor-removedLineBackground: rgba(218, 54, 51, 0.2);
|
||||
--vscode-diffEditor-diagonalFill: rgba(204, 204, 204, 0.2);
|
||||
--vscode-list-focusBackground: rgba(56, 139, 253, 0.15);
|
||||
--vscode-list-focusForeground: #c9d1d9;
|
||||
--vscode-list-focusOutline: #1f6feb;
|
||||
--vscode-list-activeSelectionBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-list-activeSelectionForeground: #c9d1d9;
|
||||
--vscode-list-inactiveSelectionBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-list-inactiveSelectionForeground: #c9d1d9;
|
||||
--vscode-list-inactiveFocusBackground: rgba(56, 139, 253, 0.15);
|
||||
--vscode-list-hoverBackground: rgba(110, 118, 129, 0.1);
|
||||
--vscode-list-hoverForeground: #c9d1d9;
|
||||
--vscode-list-dropBackground: #062f4a;
|
||||
--vscode-list-highlightForeground: #58a6ff;
|
||||
--vscode-list-focusHighlightForeground: #58a6ff;
|
||||
--vscode-list-invalidItemForeground: #b89500;
|
||||
--vscode-list-errorForeground: #f88070;
|
||||
--vscode-list-warningForeground: #cca700;
|
||||
--vscode-listFilterWidget-background: #161b22;
|
||||
--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);
|
||||
--vscode-listFilterWidget-noMatchesOutline: #be1100;
|
||||
--vscode-listFilterWidget-shadow: rgba(0, 0, 0, 0.36);
|
||||
--vscode-list-filterMatchBackground: rgba(242, 204, 96, 0.5);
|
||||
--vscode-tree-indentGuidesStroke: #21262d;
|
||||
--vscode-tree-tableColumnsBorder: rgba(204, 204, 204, 0.13);
|
||||
--vscode-tree-tableOddRowsBackground: rgba(201, 209, 217, 0.04);
|
||||
--vscode-list-deemphasizedForeground: #8c8c8c;
|
||||
--vscode-checkbox-background: #161b22;
|
||||
--vscode-checkbox-selectBackground: #161b22;
|
||||
--vscode-checkbox-foreground: #c9d1d9;
|
||||
--vscode-checkbox-border: #30363d;
|
||||
--vscode-checkbox-selectBorder: #161b22;
|
||||
--vscode-quickInputList-focusForeground: #c9d1d9;
|
||||
--vscode-quickInputList-focusBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-menu-foreground: #c9d1d9;
|
||||
--vscode-menu-background: #161b22;
|
||||
--vscode-menu-selectionForeground: #c9d1d9;
|
||||
--vscode-menu-selectionBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-menu-separatorBackground: #606060;
|
||||
--vscode-toolbar-hoverBackground: rgba(90, 93, 94, 0.31);
|
||||
--vscode-toolbar-activeBackground: rgba(99, 102, 103, 0.31);
|
||||
--vscode-editor-snippetTabstopHighlightBackground: rgba(124, 124, 124, 0.3);
|
||||
--vscode-editor-snippetFinalTabstopHighlightBorder: #525252;
|
||||
--vscode-breadcrumb-foreground: #8b949e;
|
||||
--vscode-breadcrumb-background: #0d1117;
|
||||
--vscode-breadcrumb-focusForeground: #c9d1d9;
|
||||
--vscode-breadcrumb-activeSelectionForeground: #8b949e;
|
||||
--vscode-breadcrumbPicker-background: #161b22;
|
||||
--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, 0.5);
|
||||
--vscode-merge-currentContentBackground: rgba(64, 200, 174, 0.2);
|
||||
--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, 0.5);
|
||||
--vscode-merge-incomingContentBackground: rgba(64, 166, 255, 0.2);
|
||||
--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, 0.4);
|
||||
--vscode-merge-commonContentBackground: rgba(96, 96, 96, 0.16);
|
||||
--vscode-editorOverviewRuler-currentContentForeground: rgba(
|
||||
64,
|
||||
200,
|
||||
174,
|
||||
0.5
|
||||
);
|
||||
--vscode-editorOverviewRuler-incomingContentForeground: rgba(
|
||||
64,
|
||||
166,
|
||||
255,
|
||||
0.5
|
||||
);
|
||||
--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, 0.4);
|
||||
--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49);
|
||||
--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-minimap-findMatchHighlight: #d18616;
|
||||
--vscode-minimap-selectionOccurrenceHighlight: #676767;
|
||||
--vscode-minimap-selectionHighlight: #264f78;
|
||||
--vscode-minimap-errorHighlight: rgba(255, 18, 18, 0.7);
|
||||
--vscode-minimap-warningHighlight: #cca700;
|
||||
--vscode-minimap-foregroundOpacity: #000000;
|
||||
--vscode-minimapSlider-background: rgba(110, 118, 129, 0.1);
|
||||
--vscode-minimapSlider-hoverBackground: rgba(110, 118, 129, 0.14);
|
||||
--vscode-minimapSlider-activeBackground: rgba(110, 118, 129, 0.27);
|
||||
--vscode-problemsErrorIcon-foreground: #f14c4c;
|
||||
--vscode-problemsWarningIcon-foreground: #cca700;
|
||||
--vscode-problemsInfoIcon-foreground: #3794ff;
|
||||
--vscode-charts-foreground: #c9d1d9;
|
||||
--vscode-charts-lines: rgba(201, 209, 217, 0.5);
|
||||
--vscode-charts-red: #f14c4c;
|
||||
--vscode-charts-blue: #3794ff;
|
||||
--vscode-charts-yellow: #cca700;
|
||||
--vscode-charts-orange: #d18616;
|
||||
--vscode-charts-green: #89d185;
|
||||
--vscode-charts-purple: #b180d7;
|
||||
--vscode-symbolIcon-arrayForeground: #f0883e;
|
||||
--vscode-symbolIcon-booleanForeground: #58a6ff;
|
||||
--vscode-symbolIcon-classForeground: #f0883e;
|
||||
--vscode-symbolIcon-colorForeground: #79c0ff;
|
||||
--vscode-symbolIcon-constantForeground: #c9d1d9;
|
||||
--vscode-symbolIcon-constructorForeground: #d2a8ff;
|
||||
--vscode-symbolIcon-enumeratorForeground: #f0883e;
|
||||
--vscode-symbolIcon-enumeratorMemberForeground: #58a6ff;
|
||||
--vscode-symbolIcon-eventForeground: #6e7681;
|
||||
--vscode-symbolIcon-fieldForeground: #f0883e;
|
||||
--vscode-symbolIcon-fileForeground: #d29922;
|
||||
--vscode-symbolIcon-folderForeground: #d29922;
|
||||
--vscode-symbolIcon-functionForeground: #bc8cff;
|
||||
--vscode-symbolIcon-interfaceForeground: #f0883e;
|
||||
--vscode-symbolIcon-keyForeground: #58a6ff;
|
||||
--vscode-symbolIcon-keywordForeground: #ff7b72;
|
||||
--vscode-symbolIcon-methodForeground: #bc8cff;
|
||||
--vscode-symbolIcon-moduleForeground: #ff7b72;
|
||||
--vscode-symbolIcon-namespaceForeground: #ff7b72;
|
||||
--vscode-symbolIcon-nullForeground: #58a6ff;
|
||||
--vscode-symbolIcon-numberForeground: #3fb950;
|
||||
--vscode-symbolIcon-objectForeground: #f0883e;
|
||||
--vscode-symbolIcon-operatorForeground: #79c0ff;
|
||||
--vscode-symbolIcon-packageForeground: #f0883e;
|
||||
--vscode-symbolIcon-propertyForeground: #f0883e;
|
||||
--vscode-symbolIcon-referenceForeground: #58a6ff;
|
||||
--vscode-symbolIcon-snippetForeground: #58a6ff;
|
||||
--vscode-symbolIcon-stringForeground: #79c0ff;
|
||||
--vscode-symbolIcon-structForeground: #f0883e;
|
||||
--vscode-symbolIcon-textForeground: #79c0ff;
|
||||
--vscode-symbolIcon-typeParameterForeground: #79c0ff;
|
||||
--vscode-symbolIcon-unitForeground: #58a6ff;
|
||||
--vscode-symbolIcon-variableForeground: #f0883e;
|
||||
--vscode-editor-lineHighlightBackground: rgba(110, 118, 129, 0.1);
|
||||
--vscode-editor-lineHighlightBorder: #282828;
|
||||
--vscode-editor-rangeHighlightBackground: rgba(255, 255, 255, 0.04);
|
||||
--vscode-editor-symbolHighlightBackground: rgba(242, 204, 96, 0.5);
|
||||
--vscode-editorCursor-foreground: #58a6ff;
|
||||
--vscode-editorWhitespace-foreground: #484f58;
|
||||
--vscode-editorIndentGuide-background: rgba(201, 209, 217, 0.12);
|
||||
--vscode-editorIndentGuide-activeBackground: rgba(201, 209, 217, 0.24);
|
||||
--vscode-editorLineNumber-foreground: #6e7681;
|
||||
--vscode-editorActiveLineNumber-foreground: #c6c6c6;
|
||||
--vscode-editorLineNumber-activeForeground: #c9d1d9;
|
||||
--vscode-editorRuler-foreground: #5a5a5a;
|
||||
--vscode-editorCodeLens-foreground: #999999;
|
||||
--vscode-editorBracketMatch-background: rgba(63, 185, 80, 0.25);
|
||||
--vscode-editorBracketMatch-border: rgba(63, 185, 80, 0.6);
|
||||
--vscode-editorOverviewRuler-border: #010409;
|
||||
--vscode-editorGutter-background: #0d1117;
|
||||
--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, 0.67);
|
||||
--vscode-editorGhostText-foreground: rgba(255, 255, 255, 0.34);
|
||||
--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, 0.6);
|
||||
--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, 0.7);
|
||||
--vscode-editorOverviewRuler-warningForeground: #cca700;
|
||||
--vscode-editorOverviewRuler-infoForeground: #3794ff;
|
||||
--vscode-editorBracketHighlight-foreground1: #79c0ff;
|
||||
--vscode-editorBracketHighlight-foreground2: #56d364;
|
||||
--vscode-editorBracketHighlight-foreground3: #e3b341;
|
||||
--vscode-editorBracketHighlight-foreground4: #ffa198;
|
||||
--vscode-editorBracketHighlight-foreground5: #ff9bce;
|
||||
--vscode-editorBracketHighlight-foreground6: #d2a8ff;
|
||||
--vscode-editorBracketHighlight-unexpectedBracket\.foreground: #8b949e;
|
||||
--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorUnicodeHighlight-border: #bd9b03;
|
||||
--vscode-editorUnicodeHighlight-background: rgba(189, 155, 3, 0.15);
|
||||
--vscode-editorHoverWidget-highlightForeground: #58a6ff;
|
||||
--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;
|
||||
--vscode-editor-foldBackground: rgba(110, 118, 129, 0.1);
|
||||
--vscode-editorGutter-foldingControlForeground: #8b949e;
|
||||
--vscode-editor-linkedEditingBackground: rgba(88, 166, 255, 0.07);
|
||||
--vscode-editor-wordHighlightBackground: rgba(110, 118, 129, 0.5);
|
||||
--vscode-editor-wordHighlightStrongBackground: rgba(110, 118, 129, 0.3);
|
||||
--vscode-editor-wordHighlightBorder: rgba(110, 118, 129, 0.6);
|
||||
--vscode-editor-wordHighlightStrongBorder: rgba(110, 118, 129, 0.6);
|
||||
--vscode-editorOverviewRuler-wordHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(
|
||||
192,
|
||||
160,
|
||||
192,
|
||||
0.8
|
||||
);
|
||||
--vscode-peekViewTitle-background: rgba(55, 148, 255, 0.1);
|
||||
--vscode-peekViewTitleLabel-foreground: #ffffff;
|
||||
--vscode-peekViewTitleDescription-foreground: rgba(204, 204, 204, 0.7);
|
||||
--vscode-peekView-border: #3794ff;
|
||||
--vscode-peekViewResult-background: #0d1117;
|
||||
--vscode-peekViewResult-lineForeground: #bbbbbb;
|
||||
--vscode-peekViewResult-fileForeground: #ffffff;
|
||||
--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, 0.2);
|
||||
--vscode-peekViewResult-selectionForeground: #ffffff;
|
||||
--vscode-peekViewEditor-background: rgba(110, 118, 129, 0.1);
|
||||
--vscode-peekViewEditorGutter-background: rgba(110, 118, 129, 0.1);
|
||||
--vscode-peekViewResult-matchHighlightBackground: rgba(187, 128, 9, 0.4);
|
||||
--vscode-peekViewEditor-matchHighlightBackground: rgba(187, 128, 9, 0.4);
|
||||
--vscode-editorMarkerNavigationError-background: #f14c4c;
|
||||
--vscode-editorMarkerNavigationError-headerBackground: rgba(241, 76, 76, 0.1);
|
||||
--vscode-editorMarkerNavigationWarning-background: #cca700;
|
||||
--vscode-editorMarkerNavigationWarning-headerBackground: rgba(
|
||||
204,
|
||||
167,
|
||||
0,
|
||||
0.1
|
||||
);
|
||||
--vscode-editorMarkerNavigationInfo-background: #3794ff;
|
||||
--vscode-editorMarkerNavigationInfo-headerBackground: rgba(55, 148, 255, 0.1);
|
||||
--vscode-editorMarkerNavigation-background: #0d1117;
|
||||
--vscode-editorSuggestWidget-background: #161b22;
|
||||
--vscode-editorSuggestWidget-border: #454545;
|
||||
--vscode-editorSuggestWidget-foreground: #c9d1d9;
|
||||
--vscode-editorSuggestWidget-selectedForeground: #c9d1d9;
|
||||
--vscode-editorSuggestWidget-selectedBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-editorSuggestWidget-highlightForeground: #58a6ff;
|
||||
--vscode-editorSuggestWidget-focusHighlightForeground: #58a6ff;
|
||||
--vscode-editorSuggestWidgetStatus-foreground: rgba(201, 209, 217, 0.5);
|
||||
--vscode-tab-activeBackground: #0d1117;
|
||||
--vscode-tab-unfocusedActiveBackground: #0d1117;
|
||||
--vscode-tab-inactiveBackground: #010409;
|
||||
--vscode-tab-unfocusedInactiveBackground: #010409;
|
||||
--vscode-tab-activeForeground: #c9d1d9;
|
||||
--vscode-tab-inactiveForeground: #8b949e;
|
||||
--vscode-tab-unfocusedActiveForeground: rgba(201, 209, 217, 0.5);
|
||||
--vscode-tab-unfocusedInactiveForeground: rgba(139, 148, 158, 0.5);
|
||||
--vscode-tab-hoverBackground: #0d1117;
|
||||
--vscode-tab-unfocusedHoverBackground: rgba(110, 118, 129, 0.1);
|
||||
--vscode-tab-border: #30363d;
|
||||
--vscode-tab-lastPinnedBorder: #21262d;
|
||||
--vscode-tab-activeBorder: #0d1117;
|
||||
--vscode-tab-unfocusedActiveBorder: #0d1117;
|
||||
--vscode-tab-activeBorderTop: #f78166;
|
||||
--vscode-tab-unfocusedActiveBorderTop: #30363d;
|
||||
--vscode-tab-activeModifiedBorder: #3399cc;
|
||||
--vscode-tab-inactiveModifiedBorder: rgba(51, 153, 204, 0.5);
|
||||
--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 153, 204, 0.5);
|
||||
--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 153, 204, 0.25);
|
||||
--vscode-editorPane-background: #0d1117;
|
||||
--vscode-editorGroupHeader-tabsBackground: #010409;
|
||||
--vscode-editorGroupHeader-tabsBorder: #30363d;
|
||||
--vscode-editorGroupHeader-noTabsBackground: #0d1117;
|
||||
--vscode-editorGroup-border: #30363d;
|
||||
--vscode-editorGroup-dropBackground: rgba(83, 89, 93, 0.5);
|
||||
--vscode-editorGroup-dropIntoPromptForeground: #c9d1d9;
|
||||
--vscode-editorGroup-dropIntoPromptBackground: #161b22;
|
||||
--vscode-sideBySideEditor-horizontalBorder: #30363d;
|
||||
--vscode-sideBySideEditor-verticalBorder: #30363d;
|
||||
--vscode-panel-background: #010409;
|
||||
--vscode-panel-border: #30363d;
|
||||
--vscode-panelTitle-activeForeground: #c9d1d9;
|
||||
--vscode-panelTitle-inactiveForeground: #8b949e;
|
||||
--vscode-panelTitle-activeBorder: #f78166;
|
||||
--vscode-panelInput-border: #30363d;
|
||||
--vscode-panel-dropBorder: #c9d1d9;
|
||||
--vscode-panelSection-dropBackground: rgba(83, 89, 93, 0.5);
|
||||
--vscode-panelSectionHeader-background: rgba(128, 128, 128, 0.2);
|
||||
--vscode-panelSection-border: #30363d;
|
||||
--vscode-banner-background: rgba(110, 118, 129, 0.4);
|
||||
--vscode-banner-foreground: #c9d1d9;
|
||||
--vscode-banner-iconForeground: #3794ff;
|
||||
--vscode-statusBar-foreground: #8b949e;
|
||||
--vscode-statusBar-noFolderForeground: #8b949e;
|
||||
--vscode-statusBar-background: #0d1117;
|
||||
--vscode-statusBar-noFolderBackground: #0d1117;
|
||||
--vscode-statusBar-border: #30363d;
|
||||
--vscode-statusBar-focusBorder: rgba(31, 111, 235, 0.5);
|
||||
--vscode-statusBar-noFolderBorder: #30363d;
|
||||
--vscode-statusBarItem-activeBackground: rgba(201, 209, 217, 0.12);
|
||||
--vscode-statusBarItem-focusBorder: #1f6feb;
|
||||
--vscode-statusBarItem-hoverBackground: rgba(201, 209, 217, 0.08);
|
||||
--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, 0.2);
|
||||
--vscode-statusBarItem-prominentForeground: #8b949e;
|
||||
--vscode-statusBarItem-prominentBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, 0.3);
|
||||
--vscode-statusBarItem-errorBackground: #b91007;
|
||||
--vscode-statusBarItem-errorForeground: #ffffff;
|
||||
--vscode-statusBarItem-warningBackground: #7a6400;
|
||||
--vscode-statusBarItem-warningForeground: #ffffff;
|
||||
--vscode-activityBar-background: #0d1117;
|
||||
--vscode-activityBar-foreground: #c9d1d9;
|
||||
--vscode-activityBar-inactiveForeground: #8b949e;
|
||||
--vscode-activityBar-border: #30363d;
|
||||
--vscode-activityBar-activeBorder: #f78166;
|
||||
--vscode-activityBar-dropBorder: #c9d1d9;
|
||||
--vscode-activityBarBadge-background: #1f6feb;
|
||||
--vscode-activityBarBadge-foreground: #f0f6fc;
|
||||
--vscode-activityBarItem-profilesForeground: #8b949e;
|
||||
--vscode-activityBarItem-profilesHoverForeground: #c9d1d9;
|
||||
--vscode-activityBarItem-profilesBackground: #141a23;
|
||||
--vscode-statusBarItem-remoteBackground: #30363d;
|
||||
--vscode-statusBarItem-remoteForeground: #c9d1d9;
|
||||
--vscode-extensionBadge-remoteBackground: #1f6feb;
|
||||
--vscode-extensionBadge-remoteForeground: #f0f6fc;
|
||||
--vscode-sideBar-background: #010409;
|
||||
--vscode-sideBar-foreground: #c9d1d9;
|
||||
--vscode-sideBar-border: #30363d;
|
||||
--vscode-sideBarTitle-foreground: #c9d1d9;
|
||||
--vscode-sideBar-dropBackground: rgba(83, 89, 93, 0.5);
|
||||
--vscode-sideBarSectionHeader-background: #010409;
|
||||
--vscode-sideBarSectionHeader-foreground: #c9d1d9;
|
||||
--vscode-sideBarSectionHeader-border: #30363d;
|
||||
--vscode-titleBar-activeForeground: #8b949e;
|
||||
--vscode-titleBar-inactiveForeground: #8b949e;
|
||||
--vscode-titleBar-activeBackground: #0d1117;
|
||||
--vscode-titleBar-inactiveBackground: #010409;
|
||||
--vscode-titleBar-border: #30363d;
|
||||
--vscode-menubar-selectionForeground: #8b949e;
|
||||
--vscode-menubar-selectionBackground: rgba(90, 93, 94, 0.31);
|
||||
--vscode-notifications-foreground: #c9d1d9;
|
||||
--vscode-notifications-background: #161b22;
|
||||
--vscode-notificationLink-foreground: #58a6ff;
|
||||
--vscode-notificationCenterHeader-foreground: #8b949e;
|
||||
--vscode-notificationCenterHeader-background: #161b22;
|
||||
--vscode-notifications-border: #30363d;
|
||||
--vscode-notificationsErrorIcon-foreground: #f85149;
|
||||
--vscode-notificationsWarningIcon-foreground: #d29922;
|
||||
--vscode-notificationsInfoIcon-foreground: #58a6ff;
|
||||
--vscode-commandCenter-foreground: #8b949e;
|
||||
--vscode-commandCenter-activeForeground: #8b949e;
|
||||
--vscode-commandCenter-inactiveForeground: #8b949e;
|
||||
--vscode-commandCenter-background: rgba(255, 255, 255, 0.05);
|
||||
--vscode-commandCenter-activeBackground: rgba(255, 255, 255, 0.08);
|
||||
--vscode-commandCenter-border: rgba(139, 148, 158, 0.2);
|
||||
--vscode-commandCenter-activeBorder: rgba(139, 148, 158, 0.3);
|
||||
--vscode-commandCenter-inactiveBorder: rgba(139, 148, 158, 0.25);
|
||||
--vscode-editorCommentsWidget-resolvedBorder: rgba(204, 204, 204, 0.5);
|
||||
--vscode-editorCommentsWidget-unresolvedBorder: #3794ff;
|
||||
--vscode-editorCommentsWidget-rangeBackground: rgba(55, 148, 255, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeBorder: rgba(55, 148, 255, 0.4);
|
||||
--vscode-editorCommentsWidget-rangeActiveBackground: rgba(55, 148, 255, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeActiveBorder: rgba(55, 148, 255, 0.4);
|
||||
--vscode-editorGutter-commentRangeForeground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-debugToolBar-background: #161b22;
|
||||
--vscode-debugIcon-startForeground: #89d185;
|
||||
--vscode-editor-stackFrameHighlightBackground: rgba(187, 128, 9, 0.4);
|
||||
--vscode-editor-focusedStackFrameHighlightBackground: rgba(46, 160, 67, 0.4);
|
||||
--vscode-mergeEditor-change\.background: rgba(155, 185, 85, 0.2);
|
||||
--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, 0.2);
|
||||
--vscode-mergeEditor-changeBase\.background: #4b1818;
|
||||
--vscode-mergeEditor-changeBase\.word\.background: #6f1313;
|
||||
--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(
|
||||
255,
|
||||
166,
|
||||
0,
|
||||
0.48
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;
|
||||
--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(
|
||||
134,
|
||||
134,
|
||||
134,
|
||||
0.29
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(
|
||||
193,
|
||||
193,
|
||||
193,
|
||||
0.8
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(
|
||||
173,
|
||||
172,
|
||||
168,
|
||||
0.93
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;
|
||||
--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, 0.28);
|
||||
--vscode-mergeEditor-conflict\.input1\.background: rgba(64, 200, 174, 0.2);
|
||||
--vscode-mergeEditor-conflict\.input2\.background: rgba(64, 166, 255, 0.2);
|
||||
--vscode-settings-headerForeground: #8b949e;
|
||||
--vscode-settings-modifiedItemIndicator: rgba(187, 128, 9, 0.4);
|
||||
--vscode-settings-headerBorder: #30363d;
|
||||
--vscode-settings-sashBorder: #30363d;
|
||||
--vscode-settings-dropdownBackground: #161b22;
|
||||
--vscode-settings-dropdownForeground: #c9d1d9;
|
||||
--vscode-settings-dropdownBorder: #30363d;
|
||||
--vscode-settings-dropdownListBorder: #454545;
|
||||
--vscode-settings-checkboxBackground: #161b22;
|
||||
--vscode-settings-checkboxForeground: #c9d1d9;
|
||||
--vscode-settings-checkboxBorder: #30363d;
|
||||
--vscode-settings-textInputBackground: #0d1117;
|
||||
--vscode-settings-textInputForeground: #c9d1d9;
|
||||
--vscode-settings-textInputBorder: #30363d;
|
||||
--vscode-settings-numberInputBackground: #0d1117;
|
||||
--vscode-settings-numberInputForeground: #c9d1d9;
|
||||
--vscode-settings-numberInputBorder: #30363d;
|
||||
--vscode-settings-focusedRowBackground: rgba(110, 118, 129, 0.06);
|
||||
--vscode-settings-rowHoverBackground: rgba(110, 118, 129, 0.03);
|
||||
--vscode-settings-focusedRowBorder: #1f6feb;
|
||||
--vscode-terminal-foreground: #c9d1d9;
|
||||
--vscode-terminal-selectionBackground: #264f78;
|
||||
--vscode-terminal-inactiveSelectionBackground: rgba(38, 79, 120, 0.5);
|
||||
--vscode-terminalCommandDecoration-defaultBackground: rgba(
|
||||
255,
|
||||
255,
|
||||
255,
|
||||
0.25
|
||||
);
|
||||
--vscode-terminalCommandDecoration-successBackground: #1b81a8;
|
||||
--vscode-terminalCommandDecoration-errorBackground: #f14c4c;
|
||||
--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8);
|
||||
--vscode-terminal-border: #30363d;
|
||||
--vscode-terminal-findMatchBackground: #9e6a03;
|
||||
--vscode-terminal-findMatchHighlightBackground: rgba(242, 204, 96, 0.5);
|
||||
--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49);
|
||||
--vscode-terminal-dropBackground: rgba(83, 89, 93, 0.5);
|
||||
--vscode-terminal-tab\.activeBorder: #0d1117;
|
||||
--vscode-testing-iconFailed: #f14c4c;
|
||||
--vscode-testing-iconErrored: #f14c4c;
|
||||
--vscode-testing-iconPassed: #73c991;
|
||||
--vscode-testing-runAction: #73c991;
|
||||
--vscode-testing-iconQueued: #cca700;
|
||||
--vscode-testing-iconUnset: #848484;
|
||||
--vscode-testing-iconSkipped: #848484;
|
||||
--vscode-testing-peekBorder: #f14c4c;
|
||||
--vscode-testing-peekHeaderBackground: rgba(241, 76, 76, 0.1);
|
||||
--vscode-testing-message\.error\.decorationForeground: #f14c4c;
|
||||
--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, 0.2);
|
||||
--vscode-testing-message\.info\.decorationForeground: rgba(
|
||||
201,
|
||||
209,
|
||||
217,
|
||||
0.5
|
||||
);
|
||||
--vscode-welcomePage-tileBackground: #161b22;
|
||||
--vscode-welcomePage-tileHoverBackground: #1a2029;
|
||||
--vscode-welcomePage-tileBorder: rgba(255, 255, 255, 0.1);
|
||||
--vscode-welcomePage-progress\.background: #0d1117;
|
||||
--vscode-welcomePage-progress\.foreground: #58a6ff;
|
||||
--vscode-walkthrough-stepTitle\.foreground: #ffffff;
|
||||
--vscode-debugExceptionWidget-border: #a31515;
|
||||
--vscode-debugExceptionWidget-background: #420b0d;
|
||||
--vscode-ports-iconRunningProcessForeground: #30363d;
|
||||
--vscode-statusBar-debuggingBackground: #da3633;
|
||||
--vscode-statusBar-debuggingForeground: #f0f6fc;
|
||||
--vscode-statusBar-debuggingBorder: #30363d;
|
||||
--vscode-editor-inlineValuesForeground: rgba(255, 255, 255, 0.5);
|
||||
--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2);
|
||||
--vscode-editorGutter-modifiedBackground: rgba(187, 128, 9, 0.4);
|
||||
--vscode-editorGutter-addedBackground: rgba(46, 160, 67, 0.4);
|
||||
--vscode-editorGutter-deletedBackground: rgba(248, 81, 73, 0.4);
|
||||
--vscode-minimapGutter-modifiedBackground: rgba(187, 128, 9, 0.4);
|
||||
--vscode-minimapGutter-addedBackground: rgba(46, 160, 67, 0.4);
|
||||
--vscode-minimapGutter-deletedBackground: rgba(248, 81, 73, 0.4);
|
||||
--vscode-editorOverviewRuler-modifiedForeground: rgba(187, 128, 9, 0.24);
|
||||
--vscode-editorOverviewRuler-addedForeground: rgba(46, 160, 67, 0.24);
|
||||
--vscode-editorOverviewRuler-deletedForeground: rgba(248, 81, 73, 0.24);
|
||||
--vscode-debugIcon-breakpointForeground: #f85149;
|
||||
--vscode-debugIcon-breakpointDisabledForeground: #848484;
|
||||
--vscode-debugIcon-breakpointUnverifiedForeground: #848484;
|
||||
--vscode-debugIcon-breakpointCurrentStackframeForeground: #ffcc00;
|
||||
--vscode-debugIcon-breakpointStackframeForeground: #89d185;
|
||||
--vscode-notebook-cellBorderColor: rgba(110, 118, 129, 0.4);
|
||||
--vscode-notebook-focusedEditorBorder: #1f6feb;
|
||||
--vscode-notebookStatusSuccessIcon-foreground: #89d185;
|
||||
--vscode-notebookStatusErrorIcon-foreground: #f85149;
|
||||
--vscode-notebookStatusRunningIcon-foreground: #c9d1d9;
|
||||
--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, 0.35);
|
||||
--vscode-notebook-selectedCellBackground: rgba(110, 118, 129, 0.4);
|
||||
--vscode-notebook-selectedCellBorder: rgba(110, 118, 129, 0.4);
|
||||
--vscode-notebook-focusedCellBorder: #1f6feb;
|
||||
--vscode-notebook-inactiveFocusedCellBorder: rgba(110, 118, 129, 0.4);
|
||||
--vscode-notebook-cellStatusBarItemHoverBackground: rgba(255, 255, 255, 0.15);
|
||||
--vscode-notebook-cellInsertionIndicator: #1f6feb;
|
||||
--vscode-notebookScrollbarSlider-background: rgba(110, 118, 129, 0.2);
|
||||
--vscode-notebookScrollbarSlider-hoverBackground: rgba(110, 118, 129, 0.27);
|
||||
--vscode-notebookScrollbarSlider-activeBackground: rgba(110, 118, 129, 0.53);
|
||||
--vscode-notebook-symbolHighlightBackground: rgba(255, 255, 255, 0.04);
|
||||
--vscode-notebook-cellEditorBackground: #010409;
|
||||
--vscode-notebook-editorBackground: #0d1117;
|
||||
--vscode-keybindingTable-headerBackground: rgba(201, 209, 217, 0.04);
|
||||
--vscode-keybindingTable-rowsBackground: rgba(201, 209, 217, 0.04);
|
||||
--vscode-scm-providerBorder: #454545;
|
||||
--vscode-searchEditor-textInputBorder: #30363d;
|
||||
--vscode-debugTokenExpression-name: #79c0ff;
|
||||
--vscode-debugTokenExpression-value: #a5d6ff;
|
||||
--vscode-debugTokenExpression-string: #a5d6ff;
|
||||
--vscode-debugTokenExpression-boolean: #56d364;
|
||||
--vscode-debugTokenExpression-number: #56d364;
|
||||
--vscode-debugTokenExpression-error: #ffa198;
|
||||
--vscode-debugView-exceptionLabelForeground: #c9d1d9;
|
||||
--vscode-debugView-exceptionLabelBackground: #6c2022;
|
||||
--vscode-debugView-stateLabelForeground: #c9d1d9;
|
||||
--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, 0.27);
|
||||
--vscode-debugView-valueChangedHighlight: #569cd6;
|
||||
--vscode-debugConsole-infoForeground: #8b949e;
|
||||
--vscode-debugConsole-warningForeground: #d29922;
|
||||
--vscode-debugConsole-errorForeground: #ffa198;
|
||||
--vscode-debugConsole-sourceForeground: #e3b341;
|
||||
--vscode-debugConsoleInputIcon-foreground: #bc8cff;
|
||||
--vscode-debugIcon-pauseForeground: #75beff;
|
||||
--vscode-debugIcon-stopForeground: #f48771;
|
||||
--vscode-debugIcon-disconnectForeground: #f48771;
|
||||
--vscode-debugIcon-restartForeground: #89d185;
|
||||
--vscode-debugIcon-stepOverForeground: #75beff;
|
||||
--vscode-debugIcon-stepIntoForeground: #75beff;
|
||||
--vscode-debugIcon-stepOutForeground: #75beff;
|
||||
--vscode-debugIcon-continueForeground: #75beff;
|
||||
--vscode-debugIcon-stepBackForeground: #75beff;
|
||||
--vscode-extensionButton-background: #238636;
|
||||
--vscode-extensionButton-foreground: #ffffff;
|
||||
--vscode-extensionButton-hoverBackground: #2ea043;
|
||||
--vscode-extensionButton-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-extensionButton-prominentBackground: #238636;
|
||||
--vscode-extensionButton-prominentForeground: #ffffff;
|
||||
--vscode-extensionButton-prominentHoverBackground: #2ea043;
|
||||
--vscode-extensionIcon-starForeground: #ff8e00;
|
||||
--vscode-extensionIcon-verifiedForeground: #58a6ff;
|
||||
--vscode-extensionIcon-preReleaseForeground: #1d9271;
|
||||
--vscode-extensionIcon-sponsorForeground: #d758b3;
|
||||
--vscode-terminal-ansiBlack: #484f58;
|
||||
--vscode-terminal-ansiRed: #ff7b72;
|
||||
--vscode-terminal-ansiGreen: #3fb950;
|
||||
--vscode-terminal-ansiYellow: #d29922;
|
||||
--vscode-terminal-ansiBlue: #58a6ff;
|
||||
--vscode-terminal-ansiMagenta: #bc8cff;
|
||||
--vscode-terminal-ansiCyan: #39c5cf;
|
||||
--vscode-terminal-ansiWhite: #b1bac4;
|
||||
--vscode-terminal-ansiBrightBlack: #6e7681;
|
||||
--vscode-terminal-ansiBrightRed: #ffa198;
|
||||
--vscode-terminal-ansiBrightGreen: #56d364;
|
||||
--vscode-terminal-ansiBrightYellow: #e3b341;
|
||||
--vscode-terminal-ansiBrightBlue: #79c0ff;
|
||||
--vscode-terminal-ansiBrightMagenta: #d2a8ff;
|
||||
--vscode-terminal-ansiBrightCyan: #56d4dd;
|
||||
--vscode-terminal-ansiBrightWhite: #f0f6fc;
|
||||
--vscode-interactive-activeCodeBorder: #3794ff;
|
||||
--vscode-interactive-inactiveCodeBorder: rgba(110, 118, 129, 0.4);
|
||||
--vscode-gitDecoration-addedResourceForeground: #3fb950;
|
||||
--vscode-gitDecoration-modifiedResourceForeground: #d29922;
|
||||
--vscode-gitDecoration-deletedResourceForeground: #f85149;
|
||||
--vscode-gitDecoration-renamedResourceForeground: #73c991;
|
||||
--vscode-gitDecoration-untrackedResourceForeground: #3fb950;
|
||||
--vscode-gitDecoration-ignoredResourceForeground: #484f58;
|
||||
--vscode-gitDecoration-stageModifiedResourceForeground: #e2c08d;
|
||||
--vscode-gitDecoration-stageDeletedResourceForeground: #c74e39;
|
||||
--vscode-gitDecoration-conflictingResourceForeground: #db6d28;
|
||||
--vscode-gitDecoration-submoduleResourceForeground: #8b949e;
|
||||
--vscode-testExplorer-errorDecorationBackground: #5a1d1d;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is copied in the same way, but from the <body> element
|
||||
*/
|
||||
body {
|
||||
background-color: transparent;
|
||||
color: var(--vscode-editor-foreground);
|
||||
font-family: var(--vscode-font-family);
|
||||
font-weight: var(--vscode-font-weight);
|
||||
font-size: var(--vscode-font-size);
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used for setting the background on the Storybook preview.
|
||||
*/
|
||||
body {
|
||||
background-color: var(--vscode-editor-background);
|
||||
}
|
||||
@@ -0,0 +1,659 @@
|
||||
/*
|
||||
* These were copied from VSCode GitHub Light Default theme from the
|
||||
* https://marketplace.visualstudio.com/items?itemName=GitHub.github-vscode-theme extension.
|
||||
*
|
||||
* To update these, open a webview in VSCode, open the webview developer tools and find the
|
||||
* iframe hosting the webview. The <html> element will have a style attribute that contains
|
||||
* the CSS variables. Copy these to this file.
|
||||
*/
|
||||
:root {
|
||||
--vscode-font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
--vscode-font-weight: normal;
|
||||
--vscode-font-size: 13px;
|
||||
--vscode-editor-font-family: Menlo, Monaco, "Courier New", monospace;
|
||||
--vscode-editor-font-weight: normal;
|
||||
--vscode-editor-font-size: 12px;
|
||||
--vscode-foreground: #24292f;
|
||||
--vscode-disabledForeground: rgba(97, 97, 97, 0.5);
|
||||
--vscode-errorForeground: #cf222e;
|
||||
--vscode-descriptionForeground: #57606a;
|
||||
--vscode-icon-foreground: #57606a;
|
||||
--vscode-focusBorder: #0969da;
|
||||
--vscode-textSeparator-foreground: #d8dee4;
|
||||
--vscode-textLink-foreground: #0969da;
|
||||
--vscode-textLink-activeForeground: #0969da;
|
||||
--vscode-textPreformat-foreground: #57606a;
|
||||
--vscode-textBlockQuote-background: #f6f8fa;
|
||||
--vscode-textBlockQuote-border: #d0d7de;
|
||||
--vscode-textCodeBlock-background: rgba(175, 184, 193, 0.2);
|
||||
--vscode-widget-shadow: rgba(0, 0, 0, 0.16);
|
||||
--vscode-input-background: #ffffff;
|
||||
--vscode-input-foreground: #24292f;
|
||||
--vscode-input-border: #d0d7de;
|
||||
--vscode-inputOption-activeBorder: rgba(0, 122, 204, 0);
|
||||
--vscode-inputOption-hoverBackground: rgba(184, 184, 184, 0.31);
|
||||
--vscode-inputOption-activeBackground: rgba(9, 105, 218, 0.2);
|
||||
--vscode-inputOption-activeForeground: #000000;
|
||||
--vscode-input-placeholderForeground: #6e7781;
|
||||
--vscode-inputValidation-infoBackground: #d6ecf2;
|
||||
--vscode-inputValidation-infoBorder: #007acc;
|
||||
--vscode-inputValidation-warningBackground: #f6f5d2;
|
||||
--vscode-inputValidation-warningBorder: #b89500;
|
||||
--vscode-inputValidation-errorBackground: #f2dede;
|
||||
--vscode-inputValidation-errorBorder: #be1100;
|
||||
--vscode-dropdown-background: #ffffff;
|
||||
--vscode-dropdown-listBackground: #ffffff;
|
||||
--vscode-dropdown-foreground: #24292f;
|
||||
--vscode-dropdown-border: #d0d7de;
|
||||
--vscode-button-foreground: #ffffff;
|
||||
--vscode-button-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-button-background: #2da44e;
|
||||
--vscode-button-hoverBackground: #2c974b;
|
||||
--vscode-button-secondaryForeground: #24292f;
|
||||
--vscode-button-secondaryBackground: #ebecf0;
|
||||
--vscode-button-secondaryHoverBackground: #f3f4f6;
|
||||
--vscode-badge-background: #0969da;
|
||||
--vscode-badge-foreground: #ffffff;
|
||||
--vscode-scrollbar-shadow: rgba(110, 119, 129, 0.2);
|
||||
--vscode-scrollbarSlider-background: rgba(140, 149, 159, 0.2);
|
||||
--vscode-scrollbarSlider-hoverBackground: rgba(140, 149, 159, 0.27);
|
||||
--vscode-scrollbarSlider-activeBackground: rgba(140, 149, 159, 0.53);
|
||||
--vscode-progressBar-background: #0969da;
|
||||
--vscode-editorError-foreground: #e51400;
|
||||
--vscode-editorWarning-foreground: #bf8803;
|
||||
--vscode-editorInfo-foreground: #1a85ff;
|
||||
--vscode-editorHint-foreground: #6c6c6c;
|
||||
--vscode-sash-hoverBorder: #0969da;
|
||||
--vscode-editor-background: #ffffff;
|
||||
--vscode-editor-foreground: #24292f;
|
||||
--vscode-editorStickyScroll-background: #ffffff;
|
||||
--vscode-editorStickyScrollHover-background: #f0f0f0;
|
||||
--vscode-editorWidget-background: #ffffff;
|
||||
--vscode-editorWidget-foreground: #24292f;
|
||||
--vscode-editorWidget-border: #c8c8c8;
|
||||
--vscode-quickInput-background: #ffffff;
|
||||
--vscode-quickInput-foreground: #24292f;
|
||||
--vscode-quickInputTitle-background: rgba(0, 0, 0, 0.06);
|
||||
--vscode-pickerGroup-foreground: #57606a;
|
||||
--vscode-pickerGroup-border: #d0d7de;
|
||||
--vscode-keybindingLabel-background: rgba(221, 221, 221, 0.4);
|
||||
--vscode-keybindingLabel-foreground: #24292f;
|
||||
--vscode-keybindingLabel-border: rgba(204, 204, 204, 0.4);
|
||||
--vscode-keybindingLabel-bottomBorder: rgba(187, 187, 187, 0.4);
|
||||
--vscode-editor-selectionBackground: #add6ff;
|
||||
--vscode-editor-inactiveSelectionBackground: rgba(173, 214, 255, 0.5);
|
||||
--vscode-editor-selectionHighlightBackground: rgba(74, 194, 107, 0.25);
|
||||
--vscode-editor-findMatchBackground: #bf8700;
|
||||
--vscode-editor-findMatchHighlightBackground: rgba(250, 225, 125, 0.5);
|
||||
--vscode-editor-findRangeHighlightBackground: rgba(180, 180, 180, 0.3);
|
||||
--vscode-searchEditor-findMatchBackground: rgba(250, 225, 125, 0.33);
|
||||
--vscode-editor-hoverHighlightBackground: rgba(173, 214, 255, 0.15);
|
||||
--vscode-editorHoverWidget-background: #ffffff;
|
||||
--vscode-editorHoverWidget-foreground: #24292f;
|
||||
--vscode-editorHoverWidget-border: #c8c8c8;
|
||||
--vscode-editorHoverWidget-statusBarBackground: #f2f2f2;
|
||||
--vscode-editorLink-activeForeground: #0000ff;
|
||||
--vscode-editorInlayHint-foreground: #57606a;
|
||||
--vscode-editorInlayHint-background: rgba(175, 184, 193, 0.2);
|
||||
--vscode-editorInlayHint-typeForeground: #57606a;
|
||||
--vscode-editorInlayHint-typeBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-editorInlayHint-parameterForeground: #57606a;
|
||||
--vscode-editorInlayHint-parameterBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-editorLightBulb-foreground: #ddb100;
|
||||
--vscode-editorLightBulbAutoFix-foreground: #007acc;
|
||||
--vscode-diffEditor-insertedTextBackground: rgba(111, 221, 139, 0.4);
|
||||
--vscode-diffEditor-removedTextBackground: rgba(255, 171, 168, 0.4);
|
||||
--vscode-diffEditor-insertedLineBackground: rgba(172, 238, 187, 0.3);
|
||||
--vscode-diffEditor-removedLineBackground: rgba(255, 206, 203, 0.3);
|
||||
--vscode-diffEditor-diagonalFill: rgba(34, 34, 34, 0.2);
|
||||
--vscode-list-focusBackground: #ddf4ff;
|
||||
--vscode-list-focusForeground: #24292f;
|
||||
--vscode-list-focusOutline: #0969da;
|
||||
--vscode-list-activeSelectionBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-list-activeSelectionForeground: #24292f;
|
||||
--vscode-list-inactiveSelectionBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-list-inactiveSelectionForeground: #24292f;
|
||||
--vscode-list-inactiveFocusBackground: #ddf4ff;
|
||||
--vscode-list-hoverBackground: rgba(234, 238, 242, 0.5);
|
||||
--vscode-list-hoverForeground: #24292f;
|
||||
--vscode-list-dropBackground: #d6ebff;
|
||||
--vscode-list-highlightForeground: #0969da;
|
||||
--vscode-list-focusHighlightForeground: #0969da;
|
||||
--vscode-list-invalidItemForeground: #b89500;
|
||||
--vscode-list-errorForeground: #b01011;
|
||||
--vscode-list-warningForeground: #855f00;
|
||||
--vscode-listFilterWidget-background: #ffffff;
|
||||
--vscode-listFilterWidget-outline: rgba(0, 0, 0, 0);
|
||||
--vscode-listFilterWidget-noMatchesOutline: #be1100;
|
||||
--vscode-listFilterWidget-shadow: rgba(0, 0, 0, 0.16);
|
||||
--vscode-list-filterMatchBackground: rgba(250, 225, 125, 0.5);
|
||||
--vscode-tree-indentGuidesStroke: #d8dee4;
|
||||
--vscode-tree-tableColumnsBorder: rgba(97, 97, 97, 0.13);
|
||||
--vscode-tree-tableOddRowsBackground: rgba(36, 41, 47, 0.04);
|
||||
--vscode-list-deemphasizedForeground: #8e8e90;
|
||||
--vscode-checkbox-background: #f6f8fa;
|
||||
--vscode-checkbox-selectBackground: #ffffff;
|
||||
--vscode-checkbox-foreground: #24292f;
|
||||
--vscode-checkbox-border: #d0d7de;
|
||||
--vscode-checkbox-selectBorder: #ffffff;
|
||||
--vscode-quickInputList-focusForeground: #24292f;
|
||||
--vscode-quickInputList-focusBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-menu-foreground: #24292f;
|
||||
--vscode-menu-background: #ffffff;
|
||||
--vscode-menu-selectionForeground: #24292f;
|
||||
--vscode-menu-selectionBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-menu-separatorBackground: #d4d4d4;
|
||||
--vscode-toolbar-hoverBackground: rgba(184, 184, 184, 0.31);
|
||||
--vscode-toolbar-activeBackground: rgba(166, 166, 166, 0.31);
|
||||
--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, 0.2);
|
||||
--vscode-editor-snippetFinalTabstopHighlightBorder: rgba(10, 50, 100, 0.5);
|
||||
--vscode-breadcrumb-foreground: #57606a;
|
||||
--vscode-breadcrumb-background: #ffffff;
|
||||
--vscode-breadcrumb-focusForeground: #24292f;
|
||||
--vscode-breadcrumb-activeSelectionForeground: #57606a;
|
||||
--vscode-breadcrumbPicker-background: #ffffff;
|
||||
--vscode-merge-currentHeaderBackground: rgba(64, 200, 174, 0.5);
|
||||
--vscode-merge-currentContentBackground: rgba(64, 200, 174, 0.2);
|
||||
--vscode-merge-incomingHeaderBackground: rgba(64, 166, 255, 0.5);
|
||||
--vscode-merge-incomingContentBackground: rgba(64, 166, 255, 0.2);
|
||||
--vscode-merge-commonHeaderBackground: rgba(96, 96, 96, 0.4);
|
||||
--vscode-merge-commonContentBackground: rgba(96, 96, 96, 0.16);
|
||||
--vscode-editorOverviewRuler-currentContentForeground: rgba(
|
||||
64,
|
||||
200,
|
||||
174,
|
||||
0.5
|
||||
);
|
||||
--vscode-editorOverviewRuler-incomingContentForeground: rgba(
|
||||
64,
|
||||
166,
|
||||
255,
|
||||
0.5
|
||||
);
|
||||
--vscode-editorOverviewRuler-commonContentForeground: rgba(96, 96, 96, 0.4);
|
||||
--vscode-editorOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49);
|
||||
--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-minimap-findMatchHighlight: #d18616;
|
||||
--vscode-minimap-selectionOccurrenceHighlight: #c9c9c9;
|
||||
--vscode-minimap-selectionHighlight: #add6ff;
|
||||
--vscode-minimap-errorHighlight: rgba(255, 18, 18, 0.7);
|
||||
--vscode-minimap-warningHighlight: #bf8803;
|
||||
--vscode-minimap-foregroundOpacity: #000000;
|
||||
--vscode-minimapSlider-background: rgba(140, 149, 159, 0.1);
|
||||
--vscode-minimapSlider-hoverBackground: rgba(140, 149, 159, 0.14);
|
||||
--vscode-minimapSlider-activeBackground: rgba(140, 149, 159, 0.27);
|
||||
--vscode-problemsErrorIcon-foreground: #e51400;
|
||||
--vscode-problemsWarningIcon-foreground: #bf8803;
|
||||
--vscode-problemsInfoIcon-foreground: #1a85ff;
|
||||
--vscode-charts-foreground: #24292f;
|
||||
--vscode-charts-lines: rgba(36, 41, 47, 0.5);
|
||||
--vscode-charts-red: #e51400;
|
||||
--vscode-charts-blue: #1a85ff;
|
||||
--vscode-charts-yellow: #bf8803;
|
||||
--vscode-charts-orange: #d18616;
|
||||
--vscode-charts-green: #388a34;
|
||||
--vscode-charts-purple: #652d90;
|
||||
--vscode-symbolIcon-arrayForeground: #953800;
|
||||
--vscode-symbolIcon-booleanForeground: #0550ae;
|
||||
--vscode-symbolIcon-classForeground: #953800;
|
||||
--vscode-symbolIcon-colorForeground: #0a3069;
|
||||
--vscode-symbolIcon-constantForeground: #116329;
|
||||
--vscode-symbolIcon-constructorForeground: #3e1f79;
|
||||
--vscode-symbolIcon-enumeratorForeground: #953800;
|
||||
--vscode-symbolIcon-enumeratorMemberForeground: #0550ae;
|
||||
--vscode-symbolIcon-eventForeground: #57606a;
|
||||
--vscode-symbolIcon-fieldForeground: #953800;
|
||||
--vscode-symbolIcon-fileForeground: #7d4e00;
|
||||
--vscode-symbolIcon-folderForeground: #7d4e00;
|
||||
--vscode-symbolIcon-functionForeground: #6639ba;
|
||||
--vscode-symbolIcon-interfaceForeground: #953800;
|
||||
--vscode-symbolIcon-keyForeground: #0550ae;
|
||||
--vscode-symbolIcon-keywordForeground: #a40e26;
|
||||
--vscode-symbolIcon-methodForeground: #6639ba;
|
||||
--vscode-symbolIcon-moduleForeground: #a40e26;
|
||||
--vscode-symbolIcon-namespaceForeground: #a40e26;
|
||||
--vscode-symbolIcon-nullForeground: #0550ae;
|
||||
--vscode-symbolIcon-numberForeground: #116329;
|
||||
--vscode-symbolIcon-objectForeground: #953800;
|
||||
--vscode-symbolIcon-operatorForeground: #0a3069;
|
||||
--vscode-symbolIcon-packageForeground: #953800;
|
||||
--vscode-symbolIcon-propertyForeground: #953800;
|
||||
--vscode-symbolIcon-referenceForeground: #0550ae;
|
||||
--vscode-symbolIcon-snippetForeground: #0550ae;
|
||||
--vscode-symbolIcon-stringForeground: #0a3069;
|
||||
--vscode-symbolIcon-structForeground: #953800;
|
||||
--vscode-symbolIcon-textForeground: #0a3069;
|
||||
--vscode-symbolIcon-typeParameterForeground: #0a3069;
|
||||
--vscode-symbolIcon-unitForeground: #0550ae;
|
||||
--vscode-symbolIcon-variableForeground: #953800;
|
||||
--vscode-editor-lineHighlightBackground: rgba(234, 238, 242, 0.5);
|
||||
--vscode-editor-lineHighlightBorder: #eeeeee;
|
||||
--vscode-editor-rangeHighlightBackground: rgba(253, 255, 0, 0.2);
|
||||
--vscode-editor-symbolHighlightBackground: rgba(250, 225, 125, 0.5);
|
||||
--vscode-editorCursor-foreground: #0969da;
|
||||
--vscode-editorWhitespace-foreground: #afb8c1;
|
||||
--vscode-editorIndentGuide-background: rgba(36, 41, 47, 0.12);
|
||||
--vscode-editorIndentGuide-activeBackground: rgba(36, 41, 47, 0.24);
|
||||
--vscode-editorLineNumber-foreground: #8c959f;
|
||||
--vscode-editorActiveLineNumber-foreground: #0b216f;
|
||||
--vscode-editorLineNumber-activeForeground: #24292f;
|
||||
--vscode-editorRuler-foreground: #d3d3d3;
|
||||
--vscode-editorCodeLens-foreground: #919191;
|
||||
--vscode-editorBracketMatch-background: rgba(74, 194, 107, 0.25);
|
||||
--vscode-editorBracketMatch-border: rgba(74, 194, 107, 0.6);
|
||||
--vscode-editorOverviewRuler-border: #ffffff;
|
||||
--vscode-editorGutter-background: #ffffff;
|
||||
--vscode-editorUnnecessaryCode-opacity: rgba(0, 0, 0, 0.47);
|
||||
--vscode-editorGhostText-foreground: rgba(0, 0, 0, 0.47);
|
||||
--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, 0.6);
|
||||
--vscode-editorOverviewRuler-errorForeground: rgba(255, 18, 18, 0.7);
|
||||
--vscode-editorOverviewRuler-warningForeground: #bf8803;
|
||||
--vscode-editorOverviewRuler-infoForeground: #1a85ff;
|
||||
--vscode-editorBracketHighlight-foreground1: #0969da;
|
||||
--vscode-editorBracketHighlight-foreground2: #1a7f37;
|
||||
--vscode-editorBracketHighlight-foreground3: #9a6700;
|
||||
--vscode-editorBracketHighlight-foreground4: #cf222e;
|
||||
--vscode-editorBracketHighlight-foreground5: #bf3989;
|
||||
--vscode-editorBracketHighlight-foreground6: #8250df;
|
||||
--vscode-editorBracketHighlight-unexpectedBracket\.foreground: #57606a;
|
||||
--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorUnicodeHighlight-border: #cea33d;
|
||||
--vscode-editorUnicodeHighlight-background: rgba(206, 163, 61, 0.08);
|
||||
--vscode-editorHoverWidget-highlightForeground: #0969da;
|
||||
--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;
|
||||
--vscode-editor-foldBackground: rgba(110, 119, 129, 0.1);
|
||||
--vscode-editorGutter-foldingControlForeground: #57606a;
|
||||
--vscode-editor-linkedEditingBackground: rgba(9, 105, 218, 0.07);
|
||||
--vscode-editor-wordHighlightBackground: rgba(234, 238, 242, 0.5);
|
||||
--vscode-editor-wordHighlightStrongBackground: rgba(175, 184, 193, 0.3);
|
||||
--vscode-editor-wordHighlightBorder: rgba(175, 184, 193, 0.6);
|
||||
--vscode-editor-wordHighlightStrongBorder: rgba(175, 184, 193, 0.6);
|
||||
--vscode-editorOverviewRuler-wordHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(
|
||||
192,
|
||||
160,
|
||||
192,
|
||||
0.8
|
||||
);
|
||||
--vscode-peekViewTitle-background: rgba(26, 133, 255, 0.1);
|
||||
--vscode-peekViewTitleLabel-foreground: #000000;
|
||||
--vscode-peekViewTitleDescription-foreground: #616161;
|
||||
--vscode-peekView-border: #1a85ff;
|
||||
--vscode-peekViewResult-background: #f3f3f3;
|
||||
--vscode-peekViewResult-lineForeground: #646465;
|
||||
--vscode-peekViewResult-fileForeground: #1e1e1e;
|
||||
--vscode-peekViewResult-selectionBackground: rgba(51, 153, 255, 0.2);
|
||||
--vscode-peekViewResult-selectionForeground: #6c6c6c;
|
||||
--vscode-peekViewEditor-background: #f2f8fc;
|
||||
--vscode-peekViewEditorGutter-background: #f2f8fc;
|
||||
--vscode-peekViewResult-matchHighlightBackground: rgba(234, 92, 0, 0.3);
|
||||
--vscode-peekViewEditor-matchHighlightBackground: rgba(245, 216, 2, 0.87);
|
||||
--vscode-editorMarkerNavigationError-background: #e51400;
|
||||
--vscode-editorMarkerNavigationError-headerBackground: rgba(229, 20, 0, 0.1);
|
||||
--vscode-editorMarkerNavigationWarning-background: #bf8803;
|
||||
--vscode-editorMarkerNavigationWarning-headerBackground: rgba(
|
||||
191,
|
||||
136,
|
||||
3,
|
||||
0.1
|
||||
);
|
||||
--vscode-editorMarkerNavigationInfo-background: #1a85ff;
|
||||
--vscode-editorMarkerNavigationInfo-headerBackground: rgba(26, 133, 255, 0.1);
|
||||
--vscode-editorMarkerNavigation-background: #ffffff;
|
||||
--vscode-editorSuggestWidget-background: #ffffff;
|
||||
--vscode-editorSuggestWidget-border: #c8c8c8;
|
||||
--vscode-editorSuggestWidget-foreground: #24292f;
|
||||
--vscode-editorSuggestWidget-selectedForeground: #24292f;
|
||||
--vscode-editorSuggestWidget-selectedBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-editorSuggestWidget-highlightForeground: #0969da;
|
||||
--vscode-editorSuggestWidget-focusHighlightForeground: #0969da;
|
||||
--vscode-editorSuggestWidgetStatus-foreground: rgba(36, 41, 47, 0.5);
|
||||
--vscode-tab-activeBackground: #ffffff;
|
||||
--vscode-tab-unfocusedActiveBackground: #ffffff;
|
||||
--vscode-tab-inactiveBackground: #f6f8fa;
|
||||
--vscode-tab-unfocusedInactiveBackground: #f6f8fa;
|
||||
--vscode-tab-activeForeground: #24292f;
|
||||
--vscode-tab-inactiveForeground: #57606a;
|
||||
--vscode-tab-unfocusedActiveForeground: rgba(36, 41, 47, 0.7);
|
||||
--vscode-tab-unfocusedInactiveForeground: rgba(87, 96, 106, 0.5);
|
||||
--vscode-tab-hoverBackground: #ffffff;
|
||||
--vscode-tab-unfocusedHoverBackground: rgba(234, 238, 242, 0.5);
|
||||
--vscode-tab-border: #d0d7de;
|
||||
--vscode-tab-lastPinnedBorder: #d8dee4;
|
||||
--vscode-tab-activeBorder: #ffffff;
|
||||
--vscode-tab-unfocusedActiveBorder: #ffffff;
|
||||
--vscode-tab-activeBorderTop: #fd8c73;
|
||||
--vscode-tab-unfocusedActiveBorderTop: #d0d7de;
|
||||
--vscode-tab-activeModifiedBorder: #33aaee;
|
||||
--vscode-tab-inactiveModifiedBorder: rgba(51, 170, 238, 0.5);
|
||||
--vscode-tab-unfocusedActiveModifiedBorder: rgba(51, 170, 238, 0.7);
|
||||
--vscode-tab-unfocusedInactiveModifiedBorder: rgba(51, 170, 238, 0.25);
|
||||
--vscode-editorPane-background: #ffffff;
|
||||
--vscode-editorGroupHeader-tabsBackground: #f6f8fa;
|
||||
--vscode-editorGroupHeader-tabsBorder: #d0d7de;
|
||||
--vscode-editorGroupHeader-noTabsBackground: #ffffff;
|
||||
--vscode-editorGroup-border: #d0d7de;
|
||||
--vscode-editorGroup-dropBackground: rgba(38, 119, 203, 0.18);
|
||||
--vscode-editorGroup-dropIntoPromptForeground: #24292f;
|
||||
--vscode-editorGroup-dropIntoPromptBackground: #ffffff;
|
||||
--vscode-sideBySideEditor-horizontalBorder: #d0d7de;
|
||||
--vscode-sideBySideEditor-verticalBorder: #d0d7de;
|
||||
--vscode-panel-background: #f6f8fa;
|
||||
--vscode-panel-border: #d0d7de;
|
||||
--vscode-panelTitle-activeForeground: #24292f;
|
||||
--vscode-panelTitle-inactiveForeground: #57606a;
|
||||
--vscode-panelTitle-activeBorder: #fd8c73;
|
||||
--vscode-panelInput-border: #d0d7de;
|
||||
--vscode-panel-dropBorder: #24292f;
|
||||
--vscode-panelSection-dropBackground: rgba(38, 119, 203, 0.18);
|
||||
--vscode-panelSectionHeader-background: rgba(128, 128, 128, 0.2);
|
||||
--vscode-panelSection-border: #d0d7de;
|
||||
--vscode-banner-background: rgba(113, 129, 145, 0.2);
|
||||
--vscode-banner-foreground: #24292f;
|
||||
--vscode-banner-iconForeground: #1a85ff;
|
||||
--vscode-statusBar-foreground: #57606a;
|
||||
--vscode-statusBar-noFolderForeground: #57606a;
|
||||
--vscode-statusBar-background: #ffffff;
|
||||
--vscode-statusBar-noFolderBackground: #ffffff;
|
||||
--vscode-statusBar-border: #d0d7de;
|
||||
--vscode-statusBar-focusBorder: rgba(9, 105, 218, 0.5);
|
||||
--vscode-statusBar-noFolderBorder: #d0d7de;
|
||||
--vscode-statusBarItem-activeBackground: rgba(36, 41, 47, 0.12);
|
||||
--vscode-statusBarItem-focusBorder: #0969da;
|
||||
--vscode-statusBarItem-hoverBackground: rgba(36, 41, 47, 0.08);
|
||||
--vscode-statusBarItem-compactHoverBackground: rgba(255, 255, 255, 0.2);
|
||||
--vscode-statusBarItem-prominentForeground: #57606a;
|
||||
--vscode-statusBarItem-prominentBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-statusBarItem-prominentHoverBackground: rgba(0, 0, 0, 0.3);
|
||||
--vscode-statusBarItem-errorBackground: #7c141b;
|
||||
--vscode-statusBarItem-errorForeground: #ffffff;
|
||||
--vscode-statusBarItem-warningBackground: #725102;
|
||||
--vscode-statusBarItem-warningForeground: #ffffff;
|
||||
--vscode-activityBar-background: #ffffff;
|
||||
--vscode-activityBar-foreground: #24292f;
|
||||
--vscode-activityBar-inactiveForeground: #57606a;
|
||||
--vscode-activityBar-border: #d0d7de;
|
||||
--vscode-activityBar-activeBorder: #fd8c73;
|
||||
--vscode-activityBar-dropBorder: #24292f;
|
||||
--vscode-activityBarBadge-background: #0969da;
|
||||
--vscode-activityBarBadge-foreground: #ffffff;
|
||||
--vscode-activityBarItem-profilesForeground: #57606a;
|
||||
--vscode-activityBarItem-profilesHoverForeground: #24292f;
|
||||
--vscode-activityBarItem-profilesBackground: #e0e0e0;
|
||||
--vscode-statusBarItem-remoteBackground: #eaeef2;
|
||||
--vscode-statusBarItem-remoteForeground: #24292f;
|
||||
--vscode-extensionBadge-remoteBackground: #0969da;
|
||||
--vscode-extensionBadge-remoteForeground: #ffffff;
|
||||
--vscode-sideBar-background: #f6f8fa;
|
||||
--vscode-sideBar-foreground: #24292f;
|
||||
--vscode-sideBar-border: #d0d7de;
|
||||
--vscode-sideBarTitle-foreground: #24292f;
|
||||
--vscode-sideBar-dropBackground: rgba(38, 119, 203, 0.18);
|
||||
--vscode-sideBarSectionHeader-background: #f6f8fa;
|
||||
--vscode-sideBarSectionHeader-foreground: #24292f;
|
||||
--vscode-sideBarSectionHeader-border: #d0d7de;
|
||||
--vscode-titleBar-activeForeground: #57606a;
|
||||
--vscode-titleBar-inactiveForeground: #57606a;
|
||||
--vscode-titleBar-activeBackground: #ffffff;
|
||||
--vscode-titleBar-inactiveBackground: #f6f8fa;
|
||||
--vscode-titleBar-border: #d0d7de;
|
||||
--vscode-menubar-selectionForeground: #57606a;
|
||||
--vscode-menubar-selectionBackground: rgba(184, 184, 184, 0.31);
|
||||
--vscode-notifications-foreground: #24292f;
|
||||
--vscode-notifications-background: #ffffff;
|
||||
--vscode-notificationLink-foreground: #0969da;
|
||||
--vscode-notificationCenterHeader-foreground: #57606a;
|
||||
--vscode-notificationCenterHeader-background: #f6f8fa;
|
||||
--vscode-notifications-border: #d0d7de;
|
||||
--vscode-notificationsErrorIcon-foreground: #cf222e;
|
||||
--vscode-notificationsWarningIcon-foreground: #9a6700;
|
||||
--vscode-notificationsInfoIcon-foreground: #0969da;
|
||||
--vscode-commandCenter-foreground: #57606a;
|
||||
--vscode-commandCenter-activeForeground: #57606a;
|
||||
--vscode-commandCenter-inactiveForeground: #57606a;
|
||||
--vscode-commandCenter-background: rgba(0, 0, 0, 0.05);
|
||||
--vscode-commandCenter-activeBackground: rgba(0, 0, 0, 0.08);
|
||||
--vscode-commandCenter-border: rgba(87, 96, 106, 0.2);
|
||||
--vscode-commandCenter-activeBorder: rgba(87, 96, 106, 0.3);
|
||||
--vscode-commandCenter-inactiveBorder: rgba(87, 96, 106, 0.25);
|
||||
--vscode-editorCommentsWidget-resolvedBorder: rgba(97, 97, 97, 0.5);
|
||||
--vscode-editorCommentsWidget-unresolvedBorder: #1a85ff;
|
||||
--vscode-editorCommentsWidget-rangeBackground: rgba(26, 133, 255, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeBorder: rgba(26, 133, 255, 0.4);
|
||||
--vscode-editorCommentsWidget-rangeActiveBackground: rgba(26, 133, 255, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeActiveBorder: rgba(26, 133, 255, 0.4);
|
||||
--vscode-editorGutter-commentRangeForeground: rgba(165, 175, 185, 0.2);
|
||||
--vscode-debugToolBar-background: #ffffff;
|
||||
--vscode-debugIcon-startForeground: #388a34;
|
||||
--vscode-editor-stackFrameHighlightBackground: rgba(212, 167, 44, 0.4);
|
||||
--vscode-editor-focusedStackFrameHighlightBackground: rgba(74, 194, 107, 0.4);
|
||||
--vscode-mergeEditor-change\.background: rgba(155, 185, 85, 0.2);
|
||||
--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, 0.4);
|
||||
--vscode-mergeEditor-changeBase\.background: #ffcccc;
|
||||
--vscode-mergeEditor-changeBase\.word\.background: #ffa3a3;
|
||||
--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: #ffa600;
|
||||
--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;
|
||||
--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(
|
||||
134,
|
||||
134,
|
||||
134,
|
||||
0.29
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(
|
||||
193,
|
||||
193,
|
||||
193,
|
||||
0.8
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(
|
||||
173,
|
||||
172,
|
||||
168,
|
||||
0.93
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;
|
||||
--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, 0.28);
|
||||
--vscode-mergeEditor-conflict\.input1\.background: rgba(64, 200, 174, 0.2);
|
||||
--vscode-mergeEditor-conflict\.input2\.background: rgba(64, 166, 255, 0.2);
|
||||
--vscode-settings-headerForeground: #57606a;
|
||||
--vscode-settings-modifiedItemIndicator: rgba(212, 167, 44, 0.4);
|
||||
--vscode-settings-headerBorder: #d0d7de;
|
||||
--vscode-settings-sashBorder: #d0d7de;
|
||||
--vscode-settings-dropdownBackground: #ffffff;
|
||||
--vscode-settings-dropdownForeground: #24292f;
|
||||
--vscode-settings-dropdownBorder: #d0d7de;
|
||||
--vscode-settings-dropdownListBorder: #c8c8c8;
|
||||
--vscode-settings-checkboxBackground: #f6f8fa;
|
||||
--vscode-settings-checkboxForeground: #24292f;
|
||||
--vscode-settings-checkboxBorder: #d0d7de;
|
||||
--vscode-settings-textInputBackground: #ffffff;
|
||||
--vscode-settings-textInputForeground: #24292f;
|
||||
--vscode-settings-textInputBorder: #d0d7de;
|
||||
--vscode-settings-numberInputBackground: #ffffff;
|
||||
--vscode-settings-numberInputForeground: #24292f;
|
||||
--vscode-settings-numberInputBorder: #d0d7de;
|
||||
--vscode-settings-focusedRowBackground: rgba(234, 238, 242, 0.3);
|
||||
--vscode-settings-rowHoverBackground: rgba(234, 238, 242, 0.15);
|
||||
--vscode-settings-focusedRowBorder: #0969da;
|
||||
--vscode-terminal-foreground: #24292f;
|
||||
--vscode-terminal-selectionBackground: #add6ff;
|
||||
--vscode-terminal-inactiveSelectionBackground: rgba(173, 214, 255, 0.5);
|
||||
--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, 0.25);
|
||||
--vscode-terminalCommandDecoration-successBackground: #2090d3;
|
||||
--vscode-terminalCommandDecoration-errorBackground: #e51400;
|
||||
--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8);
|
||||
--vscode-terminal-border: #d0d7de;
|
||||
--vscode-terminal-findMatchBackground: #bf8700;
|
||||
--vscode-terminal-findMatchHighlightBackground: rgba(250, 225, 125, 0.5);
|
||||
--vscode-terminalOverviewRuler-findMatchForeground: rgba(209, 134, 22, 0.49);
|
||||
--vscode-terminal-dropBackground: rgba(38, 119, 203, 0.18);
|
||||
--vscode-terminal-tab\.activeBorder: #ffffff;
|
||||
--vscode-testing-iconFailed: #f14c4c;
|
||||
--vscode-testing-iconErrored: #f14c4c;
|
||||
--vscode-testing-iconPassed: #73c991;
|
||||
--vscode-testing-runAction: #73c991;
|
||||
--vscode-testing-iconQueued: #cca700;
|
||||
--vscode-testing-iconUnset: #848484;
|
||||
--vscode-testing-iconSkipped: #848484;
|
||||
--vscode-testing-peekBorder: #e51400;
|
||||
--vscode-testing-peekHeaderBackground: rgba(229, 20, 0, 0.1);
|
||||
--vscode-testing-message\.error\.decorationForeground: #e51400;
|
||||
--vscode-testing-message\.error\.lineBackground: rgba(255, 0, 0, 0.2);
|
||||
--vscode-testing-message\.info\.decorationForeground: rgba(36, 41, 47, 0.5);
|
||||
--vscode-welcomePage-tileBackground: #ffffff;
|
||||
--vscode-welcomePage-tileHoverBackground: #e6e6e6;
|
||||
--vscode-welcomePage-tileBorder: rgba(0, 0, 0, 0.1);
|
||||
--vscode-welcomePage-progress\.background: #ffffff;
|
||||
--vscode-welcomePage-progress\.foreground: #0969da;
|
||||
--vscode-walkthrough-stepTitle\.foreground: #000000;
|
||||
--vscode-debugExceptionWidget-border: #a31515;
|
||||
--vscode-debugExceptionWidget-background: #f1dfde;
|
||||
--vscode-ports-iconRunningProcessForeground: #eaeef2;
|
||||
--vscode-statusBar-debuggingBackground: #cf222e;
|
||||
--vscode-statusBar-debuggingForeground: #ffffff;
|
||||
--vscode-statusBar-debuggingBorder: #d0d7de;
|
||||
--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, 0.5);
|
||||
--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2);
|
||||
--vscode-editorGutter-modifiedBackground: rgba(212, 167, 44, 0.4);
|
||||
--vscode-editorGutter-addedBackground: rgba(74, 194, 107, 0.4);
|
||||
--vscode-editorGutter-deletedBackground: rgba(255, 129, 130, 0.4);
|
||||
--vscode-minimapGutter-modifiedBackground: rgba(212, 167, 44, 0.4);
|
||||
--vscode-minimapGutter-addedBackground: rgba(74, 194, 107, 0.4);
|
||||
--vscode-minimapGutter-deletedBackground: rgba(255, 129, 130, 0.4);
|
||||
--vscode-editorOverviewRuler-modifiedForeground: rgba(212, 167, 44, 0.24);
|
||||
--vscode-editorOverviewRuler-addedForeground: rgba(74, 194, 107, 0.24);
|
||||
--vscode-editorOverviewRuler-deletedForeground: rgba(255, 129, 130, 0.24);
|
||||
--vscode-debugIcon-breakpointForeground: #cf222e;
|
||||
--vscode-debugIcon-breakpointDisabledForeground: #848484;
|
||||
--vscode-debugIcon-breakpointUnverifiedForeground: #848484;
|
||||
--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;
|
||||
--vscode-debugIcon-breakpointStackframeForeground: #89d185;
|
||||
--vscode-notebook-cellBorderColor: rgba(175, 184, 193, 0.2);
|
||||
--vscode-notebook-focusedEditorBorder: #0969da;
|
||||
--vscode-notebookStatusSuccessIcon-foreground: #388a34;
|
||||
--vscode-notebookStatusErrorIcon-foreground: #cf222e;
|
||||
--vscode-notebookStatusRunningIcon-foreground: #24292f;
|
||||
--vscode-notebook-cellToolbarSeparator: rgba(128, 128, 128, 0.35);
|
||||
--vscode-notebook-selectedCellBackground: rgba(175, 184, 193, 0.2);
|
||||
--vscode-notebook-selectedCellBorder: rgba(175, 184, 193, 0.2);
|
||||
--vscode-notebook-focusedCellBorder: #0969da;
|
||||
--vscode-notebook-inactiveFocusedCellBorder: rgba(175, 184, 193, 0.2);
|
||||
--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, 0.08);
|
||||
--vscode-notebook-cellInsertionIndicator: #0969da;
|
||||
--vscode-notebookScrollbarSlider-background: rgba(140, 149, 159, 0.2);
|
||||
--vscode-notebookScrollbarSlider-hoverBackground: rgba(140, 149, 159, 0.27);
|
||||
--vscode-notebookScrollbarSlider-activeBackground: rgba(140, 149, 159, 0.53);
|
||||
--vscode-notebook-symbolHighlightBackground: rgba(253, 255, 0, 0.2);
|
||||
--vscode-notebook-cellEditorBackground: #f6f8fa;
|
||||
--vscode-notebook-editorBackground: #ffffff;
|
||||
--vscode-keybindingTable-headerBackground: rgba(36, 41, 47, 0.04);
|
||||
--vscode-keybindingTable-rowsBackground: rgba(36, 41, 47, 0.04);
|
||||
--vscode-scm-providerBorder: #c8c8c8;
|
||||
--vscode-searchEditor-textInputBorder: #d0d7de;
|
||||
--vscode-debugTokenExpression-name: #0550ae;
|
||||
--vscode-debugTokenExpression-value: #0a3069;
|
||||
--vscode-debugTokenExpression-string: #0a3069;
|
||||
--vscode-debugTokenExpression-boolean: #116329;
|
||||
--vscode-debugTokenExpression-number: #116329;
|
||||
--vscode-debugTokenExpression-error: #a40e26;
|
||||
--vscode-debugView-exceptionLabelForeground: #ffffff;
|
||||
--vscode-debugView-exceptionLabelBackground: #a31515;
|
||||
--vscode-debugView-stateLabelForeground: #24292f;
|
||||
--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, 0.27);
|
||||
--vscode-debugView-valueChangedHighlight: #569cd6;
|
||||
--vscode-debugConsole-infoForeground: #57606a;
|
||||
--vscode-debugConsole-warningForeground: #7d4e00;
|
||||
--vscode-debugConsole-errorForeground: #cf222e;
|
||||
--vscode-debugConsole-sourceForeground: #9a6700;
|
||||
--vscode-debugConsoleInputIcon-foreground: #6639ba;
|
||||
--vscode-debugIcon-pauseForeground: #007acc;
|
||||
--vscode-debugIcon-stopForeground: #a1260d;
|
||||
--vscode-debugIcon-disconnectForeground: #a1260d;
|
||||
--vscode-debugIcon-restartForeground: #388a34;
|
||||
--vscode-debugIcon-stepOverForeground: #007acc;
|
||||
--vscode-debugIcon-stepIntoForeground: #007acc;
|
||||
--vscode-debugIcon-stepOutForeground: #007acc;
|
||||
--vscode-debugIcon-continueForeground: #007acc;
|
||||
--vscode-debugIcon-stepBackForeground: #007acc;
|
||||
--vscode-extensionButton-background: #2da44e;
|
||||
--vscode-extensionButton-foreground: #ffffff;
|
||||
--vscode-extensionButton-hoverBackground: #2c974b;
|
||||
--vscode-extensionButton-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-extensionButton-prominentBackground: #2da44e;
|
||||
--vscode-extensionButton-prominentForeground: #ffffff;
|
||||
--vscode-extensionButton-prominentHoverBackground: #2c974b;
|
||||
--vscode-extensionIcon-starForeground: #df6100;
|
||||
--vscode-extensionIcon-verifiedForeground: #0969da;
|
||||
--vscode-extensionIcon-preReleaseForeground: #1d9271;
|
||||
--vscode-extensionIcon-sponsorForeground: #b51e78;
|
||||
--vscode-terminal-ansiBlack: #24292f;
|
||||
--vscode-terminal-ansiRed: #cf222e;
|
||||
--vscode-terminal-ansiGreen: #116329;
|
||||
--vscode-terminal-ansiYellow: #4d2d00;
|
||||
--vscode-terminal-ansiBlue: #0969da;
|
||||
--vscode-terminal-ansiMagenta: #8250df;
|
||||
--vscode-terminal-ansiCyan: #1b7c83;
|
||||
--vscode-terminal-ansiWhite: #6e7781;
|
||||
--vscode-terminal-ansiBrightBlack: #57606a;
|
||||
--vscode-terminal-ansiBrightRed: #a40e26;
|
||||
--vscode-terminal-ansiBrightGreen: #1a7f37;
|
||||
--vscode-terminal-ansiBrightYellow: #633c01;
|
||||
--vscode-terminal-ansiBrightBlue: #218bff;
|
||||
--vscode-terminal-ansiBrightMagenta: #a475f9;
|
||||
--vscode-terminal-ansiBrightCyan: #3192aa;
|
||||
--vscode-terminal-ansiBrightWhite: #8c959f;
|
||||
--vscode-interactive-activeCodeBorder: #1a85ff;
|
||||
--vscode-interactive-inactiveCodeBorder: rgba(175, 184, 193, 0.2);
|
||||
--vscode-gitDecoration-addedResourceForeground: #1a7f37;
|
||||
--vscode-gitDecoration-modifiedResourceForeground: #9a6700;
|
||||
--vscode-gitDecoration-deletedResourceForeground: #cf222e;
|
||||
--vscode-gitDecoration-renamedResourceForeground: #007100;
|
||||
--vscode-gitDecoration-untrackedResourceForeground: #1a7f37;
|
||||
--vscode-gitDecoration-ignoredResourceForeground: #6e7781;
|
||||
--vscode-gitDecoration-stageModifiedResourceForeground: #895503;
|
||||
--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;
|
||||
--vscode-gitDecoration-conflictingResourceForeground: #bc4c00;
|
||||
--vscode-gitDecoration-submoduleResourceForeground: #57606a;
|
||||
--vscode-testExplorer-errorDecorationBackground: #f2dede;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is copied in the same way, but from the <body> element
|
||||
*/
|
||||
body {
|
||||
background-color: transparent;
|
||||
color: var(--vscode-editor-foreground);
|
||||
font-family: var(--vscode-font-family);
|
||||
font-weight: var(--vscode-font-weight);
|
||||
font-size: var(--vscode-font-size);
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used for setting the background on the Storybook preview.
|
||||
*/
|
||||
body {
|
||||
background-color: var(--vscode-editor-background);
|
||||
}
|
||||
@@ -0,0 +1,596 @@
|
||||
/*
|
||||
* These were copied from VSCode Light High Contrast theme.
|
||||
*
|
||||
* To update these, open a webview in VSCode, open the webview developer tools and find the
|
||||
* iframe hosting the webview. The <html> element will have a style attribute that contains
|
||||
* the CSS variables. Copy these to this file.
|
||||
*/
|
||||
:root {
|
||||
--vscode-font-family: -apple-system, BlinkMacSystemFont, sans-serif;
|
||||
--vscode-font-weight: normal;
|
||||
--vscode-font-size: 13px;
|
||||
--vscode-editor-font-family: Menlo, Monaco, "Courier New", monospace;
|
||||
--vscode-editor-font-weight: normal;
|
||||
--vscode-editor-font-size: 12px;
|
||||
--vscode-foreground: #292929;
|
||||
--vscode-disabledForeground: #7f7f7f;
|
||||
--vscode-errorForeground: #b5200d;
|
||||
--vscode-descriptionForeground: rgba(41, 41, 41, 0.7);
|
||||
--vscode-icon-foreground: #292929;
|
||||
--vscode-focusBorder: #0f4a85;
|
||||
--vscode-contrastBorder: #0f4a85;
|
||||
--vscode-contrastActiveBorder: #0f4a85;
|
||||
--vscode-textSeparator-foreground: #292929;
|
||||
--vscode-textLink-foreground: #0f4a85;
|
||||
--vscode-textLink-activeForeground: #0f4a85;
|
||||
--vscode-textPreformat-foreground: #292929;
|
||||
--vscode-textBlockQuote-background: #f2f2f2;
|
||||
--vscode-textBlockQuote-border: #292929;
|
||||
--vscode-textCodeBlock-background: #f2f2f2;
|
||||
--vscode-input-background: #ffffff;
|
||||
--vscode-input-foreground: #292929;
|
||||
--vscode-input-border: #0f4a85;
|
||||
--vscode-inputOption-activeBorder: #0f4a85;
|
||||
--vscode-inputOption-activeBackground: rgba(0, 0, 0, 0);
|
||||
--vscode-inputOption-activeForeground: #292929;
|
||||
--vscode-input-placeholderForeground: rgba(41, 41, 41, 0.7);
|
||||
--vscode-inputValidation-infoBackground: #ffffff;
|
||||
--vscode-inputValidation-infoForeground: #292929;
|
||||
--vscode-inputValidation-infoBorder: #0f4a85;
|
||||
--vscode-inputValidation-warningBackground: #ffffff;
|
||||
--vscode-inputValidation-warningForeground: #292929;
|
||||
--vscode-inputValidation-warningBorder: #0f4a85;
|
||||
--vscode-inputValidation-errorBackground: #ffffff;
|
||||
--vscode-inputValidation-errorForeground: #292929;
|
||||
--vscode-inputValidation-errorBorder: #0f4a85;
|
||||
--vscode-dropdown-background: #ffffff;
|
||||
--vscode-dropdown-listBackground: #ffffff;
|
||||
--vscode-dropdown-foreground: #292929;
|
||||
--vscode-dropdown-border: #0f4a85;
|
||||
--vscode-button-foreground: #ffffff;
|
||||
--vscode-button-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-button-background: #0f4a85;
|
||||
--vscode-button-hoverBackground: #0f4a85;
|
||||
--vscode-button-border: #0f4a85;
|
||||
--vscode-button-secondaryForeground: #292929;
|
||||
--vscode-button-secondaryBackground: #ffffff;
|
||||
--vscode-badge-background: #0f4a85;
|
||||
--vscode-badge-foreground: #ffffff;
|
||||
--vscode-scrollbarSlider-background: rgba(15, 74, 133, 0.4);
|
||||
--vscode-scrollbarSlider-hoverBackground: rgba(15, 74, 133, 0.8);
|
||||
--vscode-scrollbarSlider-activeBackground: #0f4a85;
|
||||
--vscode-progressBar-background: #0f4a85;
|
||||
--vscode-editorError-foreground: #b5200d;
|
||||
--vscode-editorError-border: #b5200d;
|
||||
--vscode-editorWarning-foreground: #895503;
|
||||
--vscode-editorWarning-border: #ff0000;
|
||||
--vscode-editorInfo-foreground: #1a85ff;
|
||||
--vscode-editorInfo-border: #292929;
|
||||
--vscode-editorHint-border: #292929;
|
||||
--vscode-sash-hoverBorder: #0f4a85;
|
||||
--vscode-editor-background: #ffffff;
|
||||
--vscode-editor-foreground: #292929;
|
||||
--vscode-editorStickyScroll-background: #ffffff;
|
||||
--vscode-editorStickyScrollHover-background: rgba(15, 74, 133, 0.1);
|
||||
--vscode-editorWidget-background: #ffffff;
|
||||
--vscode-editorWidget-foreground: #292929;
|
||||
--vscode-editorWidget-border: #0f4a85;
|
||||
--vscode-quickInput-background: #ffffff;
|
||||
--vscode-quickInput-foreground: #292929;
|
||||
--vscode-quickInputTitle-background: #ffffff;
|
||||
--vscode-pickerGroup-foreground: #0f4a85;
|
||||
--vscode-pickerGroup-border: #0f4a85;
|
||||
--vscode-keybindingLabel-background: rgba(0, 0, 0, 0);
|
||||
--vscode-keybindingLabel-foreground: #292929;
|
||||
--vscode-keybindingLabel-border: #0f4a85;
|
||||
--vscode-keybindingLabel-bottomBorder: #292929;
|
||||
--vscode-editor-selectionBackground: #0f4a85;
|
||||
--vscode-editor-selectionForeground: #ffffff;
|
||||
--vscode-editor-inactiveSelectionBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-editor-selectionHighlightBorder: #0f4a85;
|
||||
--vscode-editor-findMatchBorder: #0f4a85;
|
||||
--vscode-editor-findMatchHighlightBorder: #0f4a85;
|
||||
--vscode-editor-findRangeHighlightBorder: rgba(15, 74, 133, 0.4);
|
||||
--vscode-searchEditor-findMatchBorder: #0f4a85;
|
||||
--vscode-editorHoverWidget-background: #ffffff;
|
||||
--vscode-editorHoverWidget-foreground: #292929;
|
||||
--vscode-editorHoverWidget-border: #0f4a85;
|
||||
--vscode-editorHoverWidget-statusBarBackground: #ffffff;
|
||||
--vscode-editorLink-activeForeground: #292929;
|
||||
--vscode-editorInlayHint-foreground: #ffffff;
|
||||
--vscode-editorInlayHint-background: #0f4a85;
|
||||
--vscode-editorInlayHint-typeForeground: #ffffff;
|
||||
--vscode-editorInlayHint-typeBackground: #0f4a85;
|
||||
--vscode-editorInlayHint-parameterForeground: #ffffff;
|
||||
--vscode-editorInlayHint-parameterBackground: #0f4a85;
|
||||
--vscode-editorLightBulb-foreground: #007acc;
|
||||
--vscode-editorLightBulbAutoFix-foreground: #007acc;
|
||||
--vscode-diffEditor-insertedTextBorder: #374e06;
|
||||
--vscode-diffEditor-removedTextBorder: #ad0707;
|
||||
--vscode-diffEditor-border: #0f4a85;
|
||||
--vscode-list-focusOutline: #0f4a85;
|
||||
--vscode-list-activeSelectionBackground: rgba(15, 74, 133, 0.1);
|
||||
--vscode-list-inactiveSelectionBackground: rgba(15, 74, 133, 0.1);
|
||||
--vscode-list-hoverBackground: rgba(15, 74, 133, 0.1);
|
||||
--vscode-list-highlightForeground: #0f4a85;
|
||||
--vscode-list-focusHighlightForeground: #0f4a85;
|
||||
--vscode-list-invalidItemForeground: #b5200d;
|
||||
--vscode-listFilterWidget-background: #ffffff;
|
||||
--vscode-listFilterWidget-outline: #007acc;
|
||||
--vscode-listFilterWidget-noMatchesOutline: #0f4a85;
|
||||
--vscode-list-filterMatchBorder: #0f4a85;
|
||||
--vscode-tree-indentGuidesStroke: #a5a5a5;
|
||||
--vscode-list-deemphasizedForeground: #666666;
|
||||
--vscode-checkbox-background: #ffffff;
|
||||
--vscode-checkbox-selectBackground: #ffffff;
|
||||
--vscode-checkbox-foreground: #292929;
|
||||
--vscode-checkbox-border: #0f4a85;
|
||||
--vscode-checkbox-selectBorder: #ffffff;
|
||||
--vscode-menu-border: #0f4a85;
|
||||
--vscode-menu-foreground: #292929;
|
||||
--vscode-menu-background: #ffffff;
|
||||
--vscode-menu-selectionBackground: rgba(15, 74, 133, 0.1);
|
||||
--vscode-menu-selectionBorder: #0f4a85;
|
||||
--vscode-menu-separatorBackground: #0f4a85;
|
||||
--vscode-toolbar-hoverOutline: #0f4a85;
|
||||
--vscode-editor-snippetTabstopHighlightBackground: rgba(10, 50, 100, 0.2);
|
||||
--vscode-editor-snippetFinalTabstopHighlightBorder: #292929;
|
||||
--vscode-breadcrumb-foreground: rgba(41, 41, 41, 0.8);
|
||||
--vscode-breadcrumb-background: #ffffff;
|
||||
--vscode-breadcrumb-focusForeground: #2d2d2d;
|
||||
--vscode-breadcrumb-activeSelectionForeground: #2d2d2d;
|
||||
--vscode-breadcrumbPicker-background: #ffffff;
|
||||
--vscode-merge-border: #007acc;
|
||||
--vscode-editorOverviewRuler-currentContentForeground: #007acc;
|
||||
--vscode-editorOverviewRuler-incomingContentForeground: #007acc;
|
||||
--vscode-editorOverviewRuler-commonContentForeground: #007acc;
|
||||
--vscode-editorOverviewRuler-selectionHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-minimap-findMatchHighlight: #0f4a85;
|
||||
--vscode-minimap-selectionOccurrenceHighlight: #0f4a85;
|
||||
--vscode-minimap-selectionHighlight: #0f4a85;
|
||||
--vscode-minimap-errorHighlight: #b5200d;
|
||||
--vscode-minimap-warningHighlight: #ff0000;
|
||||
--vscode-minimap-foregroundOpacity: #000000;
|
||||
--vscode-minimapSlider-background: rgba(15, 74, 133, 0.2);
|
||||
--vscode-minimapSlider-hoverBackground: rgba(15, 74, 133, 0.4);
|
||||
--vscode-minimapSlider-activeBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-problemsErrorIcon-foreground: #b5200d;
|
||||
--vscode-problemsWarningIcon-foreground: #895503;
|
||||
--vscode-problemsInfoIcon-foreground: #1a85ff;
|
||||
--vscode-charts-foreground: #292929;
|
||||
--vscode-charts-lines: rgba(41, 41, 41, 0.5);
|
||||
--vscode-charts-red: #b5200d;
|
||||
--vscode-charts-blue: #1a85ff;
|
||||
--vscode-charts-yellow: #895503;
|
||||
--vscode-charts-orange: #0f4a85;
|
||||
--vscode-charts-green: #374e06;
|
||||
--vscode-charts-purple: #652d90;
|
||||
--vscode-symbolIcon-arrayForeground: #292929;
|
||||
--vscode-symbolIcon-booleanForeground: #292929;
|
||||
--vscode-symbolIcon-classForeground: #d67e00;
|
||||
--vscode-symbolIcon-colorForeground: #292929;
|
||||
--vscode-symbolIcon-constantForeground: #292929;
|
||||
--vscode-symbolIcon-constructorForeground: #652d90;
|
||||
--vscode-symbolIcon-enumeratorForeground: #d67e00;
|
||||
--vscode-symbolIcon-enumeratorMemberForeground: #007acc;
|
||||
--vscode-symbolIcon-eventForeground: #d67e00;
|
||||
--vscode-symbolIcon-fieldForeground: #007acc;
|
||||
--vscode-symbolIcon-fileForeground: #292929;
|
||||
--vscode-symbolIcon-folderForeground: #292929;
|
||||
--vscode-symbolIcon-functionForeground: #652d90;
|
||||
--vscode-symbolIcon-interfaceForeground: #007acc;
|
||||
--vscode-symbolIcon-keyForeground: #292929;
|
||||
--vscode-symbolIcon-keywordForeground: #292929;
|
||||
--vscode-symbolIcon-methodForeground: #652d90;
|
||||
--vscode-symbolIcon-moduleForeground: #292929;
|
||||
--vscode-symbolIcon-namespaceForeground: #292929;
|
||||
--vscode-symbolIcon-nullForeground: #292929;
|
||||
--vscode-symbolIcon-numberForeground: #292929;
|
||||
--vscode-symbolIcon-objectForeground: #292929;
|
||||
--vscode-symbolIcon-operatorForeground: #292929;
|
||||
--vscode-symbolIcon-packageForeground: #292929;
|
||||
--vscode-symbolIcon-propertyForeground: #292929;
|
||||
--vscode-symbolIcon-referenceForeground: #292929;
|
||||
--vscode-symbolIcon-snippetForeground: #292929;
|
||||
--vscode-symbolIcon-stringForeground: #292929;
|
||||
--vscode-symbolIcon-structForeground: #292929;
|
||||
--vscode-symbolIcon-textForeground: #292929;
|
||||
--vscode-symbolIcon-typeParameterForeground: #292929;
|
||||
--vscode-symbolIcon-unitForeground: #292929;
|
||||
--vscode-symbolIcon-variableForeground: #007acc;
|
||||
--vscode-editor-lineHighlightBorder: #0f4a85;
|
||||
--vscode-editor-rangeHighlightBorder: #0f4a85;
|
||||
--vscode-editor-symbolHighlightBorder: #0f4a85;
|
||||
--vscode-editorCursor-foreground: #0f4a85;
|
||||
--vscode-editorWhitespace-foreground: #cccccc;
|
||||
--vscode-editorIndentGuide-background: #cccccc;
|
||||
--vscode-editorIndentGuide-activeBackground: #cccccc;
|
||||
--vscode-editorLineNumber-foreground: #292929;
|
||||
--vscode-editorActiveLineNumber-foreground: #0f4a85;
|
||||
--vscode-editorLineNumber-activeForeground: #0f4a85;
|
||||
--vscode-editorRuler-foreground: #292929;
|
||||
--vscode-editorCodeLens-foreground: #292929;
|
||||
--vscode-editorBracketMatch-background: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketMatch-border: #0f4a85;
|
||||
--vscode-editorOverviewRuler-border: #666666;
|
||||
--vscode-editorGutter-background: #ffffff;
|
||||
--vscode-editorUnnecessaryCode-border: #0f4a85;
|
||||
--vscode-editorGhostText-border: rgba(41, 41, 41, 0.8);
|
||||
--vscode-editorOverviewRuler-rangeHighlightForeground: rgba(0, 122, 204, 0.6);
|
||||
--vscode-editorOverviewRuler-errorForeground: #b5200d;
|
||||
--vscode-editorOverviewRuler-warningForeground: #ff0000;
|
||||
--vscode-editorOverviewRuler-infoForeground: #292929;
|
||||
--vscode-editorBracketHighlight-foreground1: #0431fa;
|
||||
--vscode-editorBracketHighlight-foreground2: #319331;
|
||||
--vscode-editorBracketHighlight-foreground3: #7b3814;
|
||||
--vscode-editorBracketHighlight-foreground4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketHighlight-foreground5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketHighlight-foreground6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-background6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground1: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground2: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground3: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground4: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground5: rgba(0, 0, 0, 0);
|
||||
--vscode-editorBracketPairGuide-activeBackground6: rgba(0, 0, 0, 0);
|
||||
--vscode-editorHoverWidget-highlightForeground: #0f4a85;
|
||||
--vscode-editorOverviewRuler-bracketMatchForeground: #a0a0a0;
|
||||
--vscode-editorGutter-foldingControlForeground: #292929;
|
||||
--vscode-editor-linkedEditingBackground: #ffffff;
|
||||
--vscode-editor-wordHighlightBorder: #0f4a85;
|
||||
--vscode-editor-wordHighlightStrongBorder: #0f4a85;
|
||||
--vscode-editorOverviewRuler-wordHighlightForeground: rgba(
|
||||
160,
|
||||
160,
|
||||
160,
|
||||
0.8
|
||||
);
|
||||
--vscode-editorOverviewRuler-wordHighlightStrongForeground: rgba(
|
||||
192,
|
||||
160,
|
||||
192,
|
||||
0.8
|
||||
);
|
||||
--vscode-peekViewTitleLabel-foreground: #292929;
|
||||
--vscode-peekViewTitleDescription-foreground: #292929;
|
||||
--vscode-peekView-border: #0f4a85;
|
||||
--vscode-peekViewResult-background: #ffffff;
|
||||
--vscode-peekViewResult-lineForeground: #292929;
|
||||
--vscode-peekViewResult-fileForeground: #292929;
|
||||
--vscode-peekViewResult-selectionForeground: #292929;
|
||||
--vscode-peekViewEditor-background: #ffffff;
|
||||
--vscode-peekViewEditorGutter-background: #ffffff;
|
||||
--vscode-peekViewEditor-matchHighlightBorder: #0f4a85;
|
||||
--vscode-editorMarkerNavigationError-background: #0f4a85;
|
||||
--vscode-editorMarkerNavigationWarning-background: #0f4a85;
|
||||
--vscode-editorMarkerNavigationWarning-headerBackground: rgba(
|
||||
15,
|
||||
74,
|
||||
133,
|
||||
0.2
|
||||
);
|
||||
--vscode-editorMarkerNavigationInfo-background: #0f4a85;
|
||||
--vscode-editorMarkerNavigation-background: #ffffff;
|
||||
--vscode-editorSuggestWidget-background: #ffffff;
|
||||
--vscode-editorSuggestWidget-border: #0f4a85;
|
||||
--vscode-editorSuggestWidget-foreground: #292929;
|
||||
--vscode-editorSuggestWidget-highlightForeground: #0f4a85;
|
||||
--vscode-editorSuggestWidget-focusHighlightForeground: #0f4a85;
|
||||
--vscode-editorSuggestWidgetStatus-foreground: rgba(41, 41, 41, 0.5);
|
||||
--vscode-tab-activeBackground: #ffffff;
|
||||
--vscode-tab-unfocusedActiveBackground: #ffffff;
|
||||
--vscode-tab-activeForeground: #292929;
|
||||
--vscode-tab-inactiveForeground: #292929;
|
||||
--vscode-tab-unfocusedActiveForeground: #292929;
|
||||
--vscode-tab-unfocusedInactiveForeground: #292929;
|
||||
--vscode-tab-border: #0f4a85;
|
||||
--vscode-tab-lastPinnedBorder: #0f4a85;
|
||||
--vscode-tab-activeBorderTop: #b5200d;
|
||||
--vscode-tab-unfocusedActiveBorderTop: #b5200d;
|
||||
--vscode-tab-unfocusedHoverBorder: #0f4a85;
|
||||
--vscode-tab-activeModifiedBorder: #0f4a85;
|
||||
--vscode-tab-inactiveModifiedBorder: #0f4a85;
|
||||
--vscode-tab-unfocusedActiveModifiedBorder: #0f4a85;
|
||||
--vscode-tab-unfocusedInactiveModifiedBorder: #0f4a85;
|
||||
--vscode-editorPane-background: #ffffff;
|
||||
--vscode-editorGroup-focusedEmptyBorder: #0f4a85;
|
||||
--vscode-editorGroupHeader-noTabsBackground: #ffffff;
|
||||
--vscode-editorGroupHeader-border: #0f4a85;
|
||||
--vscode-editorGroup-border: #0f4a85;
|
||||
--vscode-editorGroup-dropBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-editorGroup-dropIntoPromptForeground: #292929;
|
||||
--vscode-editorGroup-dropIntoPromptBackground: #ffffff;
|
||||
--vscode-editorGroup-dropIntoPromptBorder: #0f4a85;
|
||||
--vscode-sideBySideEditor-horizontalBorder: #0f4a85;
|
||||
--vscode-sideBySideEditor-verticalBorder: #0f4a85;
|
||||
--vscode-panel-background: #ffffff;
|
||||
--vscode-panel-border: #0f4a85;
|
||||
--vscode-panelTitle-activeForeground: #292929;
|
||||
--vscode-panelTitle-inactiveForeground: #292929;
|
||||
--vscode-panelTitle-activeBorder: #b5200d;
|
||||
--vscode-panelInput-border: #0f4a85;
|
||||
--vscode-panel-dropBorder: #292929;
|
||||
--vscode-panelSection-dropBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-panelSectionHeader-border: #0f4a85;
|
||||
--vscode-panelSection-border: #0f4a85;
|
||||
--vscode-banner-background: rgba(15, 74, 133, 0.1);
|
||||
--vscode-banner-iconForeground: #1a85ff;
|
||||
--vscode-statusBar-foreground: #292929;
|
||||
--vscode-statusBar-noFolderForeground: #292929;
|
||||
--vscode-statusBar-border: #0f4a85;
|
||||
--vscode-statusBar-focusBorder: #292929;
|
||||
--vscode-statusBar-noFolderBorder: #0f4a85;
|
||||
--vscode-statusBarItem-activeBackground: rgba(0, 0, 0, 0.18);
|
||||
--vscode-statusBarItem-focusBorder: #0f4a85;
|
||||
--vscode-statusBarItem-hoverBackground: rgba(0, 0, 0, 0.12);
|
||||
--vscode-statusBarItem-compactHoverBackground: rgba(0, 0, 0, 0.2);
|
||||
--vscode-statusBarItem-prominentForeground: #292929;
|
||||
--vscode-statusBarItem-prominentBackground: rgba(0, 0, 0, 0.5);
|
||||
--vscode-statusBarItem-errorBackground: #b5200d;
|
||||
--vscode-statusBarItem-errorForeground: #ffffff;
|
||||
--vscode-statusBarItem-warningBackground: #895503;
|
||||
--vscode-statusBarItem-warningForeground: #ffffff;
|
||||
--vscode-activityBar-background: #ffffff;
|
||||
--vscode-activityBar-foreground: #292929;
|
||||
--vscode-activityBar-inactiveForeground: #292929;
|
||||
--vscode-activityBar-border: #0f4a85;
|
||||
--vscode-activityBar-activeBorder: #0f4a85;
|
||||
--vscode-activityBar-activeFocusBorder: #b5200d;
|
||||
--vscode-activityBarBadge-background: #0f4a85;
|
||||
--vscode-activityBarBadge-foreground: #ffffff;
|
||||
--vscode-activityBarItem-profilesForeground: #292929;
|
||||
--vscode-activityBarItem-profilesHoverForeground: #292929;
|
||||
--vscode-statusBarItem-remoteBackground: #0f4a85;
|
||||
--vscode-statusBarItem-remoteForeground: #ffffff;
|
||||
--vscode-extensionBadge-remoteBackground: #0f4a85;
|
||||
--vscode-extensionBadge-remoteForeground: #ffffff;
|
||||
--vscode-sideBar-background: #ffffff;
|
||||
--vscode-sideBar-border: #0f4a85;
|
||||
--vscode-sideBar-dropBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-sideBarSectionHeader-border: #0f4a85;
|
||||
--vscode-titleBar-activeForeground: #292929;
|
||||
--vscode-titleBar-inactiveForeground: #292929;
|
||||
--vscode-titleBar-activeBackground: #ffffff;
|
||||
--vscode-titleBar-border: #0f4a85;
|
||||
--vscode-menubar-selectionForeground: #292929;
|
||||
--vscode-menubar-selectionBorder: #0f4a85;
|
||||
--vscode-notificationCenter-border: #0f4a85;
|
||||
--vscode-notificationToast-border: #0f4a85;
|
||||
--vscode-notifications-foreground: #292929;
|
||||
--vscode-notifications-background: #ffffff;
|
||||
--vscode-notificationLink-foreground: #0f4a85;
|
||||
--vscode-notificationCenterHeader-background: #ffffff;
|
||||
--vscode-notifications-border: #ffffff;
|
||||
--vscode-notificationsErrorIcon-foreground: #b5200d;
|
||||
--vscode-notificationsWarningIcon-foreground: #895503;
|
||||
--vscode-notificationsInfoIcon-foreground: #1a85ff;
|
||||
--vscode-window-activeBorder: #0f4a85;
|
||||
--vscode-window-inactiveBorder: #0f4a85;
|
||||
--vscode-commandCenter-foreground: #292929;
|
||||
--vscode-commandCenter-activeForeground: #292929;
|
||||
--vscode-commandCenter-inactiveForeground: #292929;
|
||||
--vscode-commandCenter-border: rgba(41, 41, 41, 0.6);
|
||||
--vscode-commandCenter-activeBorder: #292929;
|
||||
--vscode-commandCenter-inactiveBorder: rgba(41, 41, 41, 0.25);
|
||||
--vscode-editorCommentsWidget-resolvedBorder: #0f4a85;
|
||||
--vscode-editorCommentsWidget-unresolvedBorder: #0f4a85;
|
||||
--vscode-editorCommentsWidget-rangeBackground: rgba(15, 74, 133, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeBorder: rgba(15, 74, 133, 0.4);
|
||||
--vscode-editorCommentsWidget-rangeActiveBackground: rgba(15, 74, 133, 0.1);
|
||||
--vscode-editorCommentsWidget-rangeActiveBorder: rgba(15, 74, 133, 0.2);
|
||||
--vscode-editorGutter-commentRangeForeground: #000000;
|
||||
--vscode-debugToolBar-background: #ffffff;
|
||||
--vscode-debugIcon-startForeground: #388a34;
|
||||
--vscode-editor-stackFrameHighlightBackground: rgba(255, 255, 102, 0.45);
|
||||
--vscode-editor-focusedStackFrameHighlightBackground: rgba(
|
||||
206,
|
||||
231,
|
||||
206,
|
||||
0.45
|
||||
);
|
||||
--vscode-mergeEditor-change\.background: rgba(155, 185, 85, 0.2);
|
||||
--vscode-mergeEditor-change\.word\.background: rgba(156, 204, 44, 0.4);
|
||||
--vscode-mergeEditor-changeBase\.background: #ffcccc;
|
||||
--vscode-mergeEditor-changeBase\.word\.background: #ffa3a3;
|
||||
--vscode-mergeEditor-conflict\.unhandledUnfocused\.border: rgba(
|
||||
255,
|
||||
166,
|
||||
0,
|
||||
0.48
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandledFocused\.border: #ffa600;
|
||||
--vscode-mergeEditor-conflict\.handledUnfocused\.border: rgba(
|
||||
134,
|
||||
134,
|
||||
134,
|
||||
0.29
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handledFocused\.border: rgba(
|
||||
193,
|
||||
193,
|
||||
193,
|
||||
0.8
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.handled\.minimapOverViewRuler: rgba(
|
||||
173,
|
||||
172,
|
||||
168,
|
||||
0.93
|
||||
);
|
||||
--vscode-mergeEditor-conflict\.unhandled\.minimapOverViewRuler: #fcba03;
|
||||
--vscode-mergeEditor-conflictingLines\.background: rgba(255, 234, 0, 0.28);
|
||||
--vscode-settings-headerForeground: #292929;
|
||||
--vscode-settings-modifiedItemIndicator: #66afe0;
|
||||
--vscode-settings-headerBorder: #0f4a85;
|
||||
--vscode-settings-sashBorder: #0f4a85;
|
||||
--vscode-settings-dropdownBackground: #ffffff;
|
||||
--vscode-settings-dropdownForeground: #292929;
|
||||
--vscode-settings-dropdownBorder: #0f4a85;
|
||||
--vscode-settings-dropdownListBorder: #0f4a85;
|
||||
--vscode-settings-checkboxBackground: #ffffff;
|
||||
--vscode-settings-checkboxForeground: #292929;
|
||||
--vscode-settings-checkboxBorder: #0f4a85;
|
||||
--vscode-settings-textInputBackground: #ffffff;
|
||||
--vscode-settings-textInputForeground: #292929;
|
||||
--vscode-settings-textInputBorder: #0f4a85;
|
||||
--vscode-settings-numberInputBackground: #ffffff;
|
||||
--vscode-settings-numberInputForeground: #292929;
|
||||
--vscode-settings-numberInputBorder: #0f4a85;
|
||||
--vscode-settings-focusedRowBorder: #0f4a85;
|
||||
--vscode-terminal-foreground: #292929;
|
||||
--vscode-terminal-selectionBackground: #0f4a85;
|
||||
--vscode-terminal-inactiveSelectionBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-terminal-selectionForeground: #ffffff;
|
||||
--vscode-terminalCommandDecoration-defaultBackground: rgba(0, 0, 0, 0.25);
|
||||
--vscode-terminalCommandDecoration-successBackground: #007100;
|
||||
--vscode-terminalCommandDecoration-errorBackground: #b5200d;
|
||||
--vscode-terminalOverviewRuler-cursorForeground: rgba(160, 160, 160, 0.8);
|
||||
--vscode-terminal-border: #0f4a85;
|
||||
--vscode-terminal-findMatchBackground: #0f4a85;
|
||||
--vscode-terminal-findMatchBorder: #0f4a85;
|
||||
--vscode-terminal-findMatchHighlightBorder: #0f4a85;
|
||||
--vscode-terminalOverviewRuler-findMatchForeground: #0f4a85;
|
||||
--vscode-terminal-dropBackground: rgba(15, 74, 133, 0.5);
|
||||
--vscode-testing-iconFailed: #b5200d;
|
||||
--vscode-testing-iconErrored: #b5200d;
|
||||
--vscode-testing-iconPassed: #007100;
|
||||
--vscode-testing-runAction: #007100;
|
||||
--vscode-testing-iconQueued: #cca700;
|
||||
--vscode-testing-iconUnset: #848484;
|
||||
--vscode-testing-iconSkipped: #848484;
|
||||
--vscode-testing-peekBorder: #0f4a85;
|
||||
--vscode-testing-message\.error\.decorationForeground: #292929;
|
||||
--vscode-testing-message\.info\.decorationForeground: rgba(41, 41, 41, 0.5);
|
||||
--vscode-welcomePage-tileBackground: #ffffff;
|
||||
--vscode-welcomePage-tileBorder: #0f4a85;
|
||||
--vscode-welcomePage-progress\.background: #ffffff;
|
||||
--vscode-welcomePage-progress\.foreground: #0f4a85;
|
||||
--vscode-debugExceptionWidget-border: #a31515;
|
||||
--vscode-debugExceptionWidget-background: #f1dfde;
|
||||
--vscode-ports-iconRunningProcessForeground: #0f4a85;
|
||||
--vscode-statusBar-debuggingBackground: #b5200d;
|
||||
--vscode-statusBar-debuggingForeground: #ffffff;
|
||||
--vscode-statusBar-debuggingBorder: #0f4a85;
|
||||
--vscode-editor-inlineValuesForeground: rgba(0, 0, 0, 0.5);
|
||||
--vscode-editor-inlineValuesBackground: rgba(255, 200, 0, 0.2);
|
||||
--vscode-editorGutter-modifiedBackground: #2090d3;
|
||||
--vscode-editorGutter-addedBackground: #48985d;
|
||||
--vscode-editorGutter-deletedBackground: #b5200d;
|
||||
--vscode-minimapGutter-modifiedBackground: #2090d3;
|
||||
--vscode-minimapGutter-addedBackground: #48985d;
|
||||
--vscode-minimapGutter-deletedBackground: #b5200d;
|
||||
--vscode-editorOverviewRuler-modifiedForeground: rgba(32, 144, 211, 0.6);
|
||||
--vscode-editorOverviewRuler-addedForeground: rgba(72, 152, 93, 0.6);
|
||||
--vscode-editorOverviewRuler-deletedForeground: rgba(181, 32, 13, 0.6);
|
||||
--vscode-debugIcon-breakpointForeground: #e51400;
|
||||
--vscode-debugIcon-breakpointDisabledForeground: #848484;
|
||||
--vscode-debugIcon-breakpointUnverifiedForeground: #848484;
|
||||
--vscode-debugIcon-breakpointCurrentStackframeForeground: #be8700;
|
||||
--vscode-debugIcon-breakpointStackframeForeground: #89d185;
|
||||
--vscode-notebook-cellBorderColor: #0f4a85;
|
||||
--vscode-notebook-focusedEditorBorder: #0f4a85;
|
||||
--vscode-notebookStatusSuccessIcon-foreground: #388a34;
|
||||
--vscode-notebookStatusErrorIcon-foreground: #b5200d;
|
||||
--vscode-notebookStatusRunningIcon-foreground: #292929;
|
||||
--vscode-notebook-cellToolbarSeparator: #0f4a85;
|
||||
--vscode-notebook-selectedCellBorder: #0f4a85;
|
||||
--vscode-notebook-inactiveSelectedCellBorder: #0f4a85;
|
||||
--vscode-notebook-focusedCellBorder: #0f4a85;
|
||||
--vscode-notebook-inactiveFocusedCellBorder: #0f4a85;
|
||||
--vscode-notebook-cellStatusBarItemHoverBackground: rgba(0, 0, 0, 0.08);
|
||||
--vscode-notebook-cellInsertionIndicator: #0f4a85;
|
||||
--vscode-notebookScrollbarSlider-background: rgba(15, 74, 133, 0.4);
|
||||
--vscode-notebookScrollbarSlider-hoverBackground: rgba(15, 74, 133, 0.8);
|
||||
--vscode-notebookScrollbarSlider-activeBackground: #0f4a85;
|
||||
--vscode-scm-providerBorder: #0f4a85;
|
||||
--vscode-searchEditor-textInputBorder: #0f4a85;
|
||||
--vscode-debugTokenExpression-name: #292929;
|
||||
--vscode-debugTokenExpression-value: #292929;
|
||||
--vscode-debugTokenExpression-string: #a31515;
|
||||
--vscode-debugTokenExpression-boolean: #0000ff;
|
||||
--vscode-debugTokenExpression-number: #098658;
|
||||
--vscode-debugTokenExpression-error: #e51400;
|
||||
--vscode-debugView-exceptionLabelForeground: #292929;
|
||||
--vscode-debugView-exceptionLabelBackground: #a31515;
|
||||
--vscode-debugView-stateLabelForeground: #292929;
|
||||
--vscode-debugView-stateLabelBackground: rgba(136, 136, 136, 0.27);
|
||||
--vscode-debugView-valueChangedHighlight: #569cd6;
|
||||
--vscode-debugConsole-infoForeground: #292929;
|
||||
--vscode-debugConsole-warningForeground: #895503;
|
||||
--vscode-debugConsole-errorForeground: #b5200d;
|
||||
--vscode-debugConsole-sourceForeground: #292929;
|
||||
--vscode-debugConsoleInputIcon-foreground: #292929;
|
||||
--vscode-debugIcon-pauseForeground: #007acc;
|
||||
--vscode-debugIcon-stopForeground: #a1260d;
|
||||
--vscode-debugIcon-disconnectForeground: #a1260d;
|
||||
--vscode-debugIcon-restartForeground: #388a34;
|
||||
--vscode-debugIcon-stepOverForeground: #007acc;
|
||||
--vscode-debugIcon-stepIntoForeground: #007acc;
|
||||
--vscode-debugIcon-stepOutForeground: #007acc;
|
||||
--vscode-debugIcon-continueForeground: #007acc;
|
||||
--vscode-debugIcon-stepBackForeground: #007acc;
|
||||
--vscode-extensionButton-separator: rgba(255, 255, 255, 0.4);
|
||||
--vscode-extensionIcon-starForeground: #0f4a85;
|
||||
--vscode-extensionIcon-verifiedForeground: #0f4a85;
|
||||
--vscode-extensionIcon-preReleaseForeground: #0f4a85;
|
||||
--vscode-extensionIcon-sponsorForeground: #b51e78;
|
||||
--vscode-terminal-ansiBlack: #292929;
|
||||
--vscode-terminal-ansiRed: #cd3131;
|
||||
--vscode-terminal-ansiGreen: #00bc00;
|
||||
--vscode-terminal-ansiYellow: #949800;
|
||||
--vscode-terminal-ansiBlue: #0451a5;
|
||||
--vscode-terminal-ansiMagenta: #bc05bc;
|
||||
--vscode-terminal-ansiCyan: #ff0000;
|
||||
--vscode-terminal-ansiWhite: #555555;
|
||||
--vscode-terminal-ansiBrightBlack: #666666;
|
||||
--vscode-terminal-ansiBrightRed: #cd3131;
|
||||
--vscode-terminal-ansiBrightGreen: #00bc00;
|
||||
--vscode-terminal-ansiBrightYellow: #b5ba00;
|
||||
--vscode-terminal-ansiBrightBlue: #0451a5;
|
||||
--vscode-terminal-ansiBrightMagenta: #bc05bc;
|
||||
--vscode-terminal-ansiBrightCyan: #0598bc;
|
||||
--vscode-terminal-ansiBrightWhite: #a5a5a5;
|
||||
--vscode-interactive-activeCodeBorder: #0f4a85;
|
||||
--vscode-interactive-inactiveCodeBorder: #0f4a85;
|
||||
--vscode-gitDecoration-addedResourceForeground: #374e06;
|
||||
--vscode-gitDecoration-modifiedResourceForeground: #895503;
|
||||
--vscode-gitDecoration-deletedResourceForeground: #ad0707;
|
||||
--vscode-gitDecoration-renamedResourceForeground: #007100;
|
||||
--vscode-gitDecoration-untrackedResourceForeground: #007100;
|
||||
--vscode-gitDecoration-ignoredResourceForeground: #8e8e90;
|
||||
--vscode-gitDecoration-stageModifiedResourceForeground: #895503;
|
||||
--vscode-gitDecoration-stageDeletedResourceForeground: #ad0707;
|
||||
--vscode-gitDecoration-conflictingResourceForeground: #ad0707;
|
||||
--vscode-gitDecoration-submoduleResourceForeground: #1258a7;
|
||||
--vscode-testExplorer-errorDecorationBackground: #ffffff;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is copied in the same way, but from the <body> element
|
||||
*/
|
||||
body {
|
||||
background-color: transparent;
|
||||
color: var(--vscode-editor-foreground);
|
||||
font-family: var(--vscode-font-family);
|
||||
font-weight: var(--vscode-font-weight);
|
||||
font-size: var(--vscode-font-size);
|
||||
margin: 0;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used for setting the background on the Storybook preview.
|
||||
*/
|
||||
body {
|
||||
background-color: var(--vscode-editor-background);
|
||||
}
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
isIntegrationTestMode,
|
||||
} from "./config";
|
||||
import * as appInsights from "applicationinsights";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
import { UserCancellationException } from "./commandRunner";
|
||||
import { showBinaryChoiceWithUrlDialog } from "./helpers";
|
||||
|
||||
@@ -135,7 +135,7 @@ export class TelemetryListener extends ConfigListener {
|
||||
}
|
||||
|
||||
if (LOG_TELEMETRY.getValue<boolean>()) {
|
||||
void logger.log(`Telemetry: ${JSON.stringify(envelope)}`);
|
||||
void extLogger.log(`Telemetry: ${JSON.stringify(envelope)}`);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
@@ -33,7 +33,7 @@ import {
|
||||
showAndLogErrorMessage,
|
||||
showAndLogWarningMessage,
|
||||
} from "./helpers";
|
||||
import { testLogger } from "./logging";
|
||||
import { testLogger } from "./common";
|
||||
import { DatabaseItem, DatabaseManager } from "./databases";
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ import { TestTreeNode } from "./test-tree-node";
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { UIService } from "./vscode-utils/ui-service";
|
||||
import { QLTestAdapter, getExpectedFile, getActualFile } from "./test-adapter";
|
||||
import { logger } from "./logging";
|
||||
import { extLogger } from "./common";
|
||||
|
||||
type VSCodeTestEvent =
|
||||
| TestRunStartedEvent
|
||||
@@ -48,7 +48,7 @@ export class TestUIService extends UIService implements TestController {
|
||||
constructor(private readonly testHub: TestHub) {
|
||||
super();
|
||||
|
||||
void logger.log("Registering CodeQL test panel commands.");
|
||||
void extLogger.log("Registering CodeQL test panel commands.");
|
||||
this.registerCommand(
|
||||
"codeQLTests.showOutputDifferences",
|
||||
this.showOutputDifferences,
|
||||
|
||||
@@ -76,7 +76,7 @@ export const AnalyzedRepoItemContent = ({
|
||||
<Alert
|
||||
type="error"
|
||||
title="Canceled"
|
||||
message="The variant analysis or this repository was canceled."
|
||||
message="The variant analysis for this repository was canceled."
|
||||
/>
|
||||
</AlertContainer>
|
||||
)}
|
||||
|
||||
@@ -12,7 +12,7 @@ const Container = styled.div`
|
||||
`;
|
||||
|
||||
const Header = styled.div`
|
||||
color: var(--vscode-badge-foreground);
|
||||
color: var(--vscode-editor-foreground);
|
||||
font-size: 0.85em;
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
|
||||
@@ -5,6 +5,7 @@ import {
|
||||
VariantAnalysis as VariantAnalysisDomainModel,
|
||||
VariantAnalysisScannedRepositoryResult,
|
||||
VariantAnalysisScannedRepositoryState,
|
||||
VariantAnalysisStatus,
|
||||
} from "../../remote-queries/shared/variant-analysis";
|
||||
import { VariantAnalysisHeader } from "./VariantAnalysisHeader";
|
||||
import { VariantAnalysisOutcomePanels } from "./VariantAnalysisOutcomePanels";
|
||||
@@ -16,7 +17,7 @@ import {
|
||||
RepositoriesFilterSortState,
|
||||
} from "../../pure/variant-analysis-filter-sort";
|
||||
|
||||
type Props = {
|
||||
export type VariantAnalysisProps = {
|
||||
variantAnalysis?: VariantAnalysisDomainModel;
|
||||
repoStates?: VariantAnalysisScannedRepositoryState[];
|
||||
repoResults?: VariantAnalysisScannedRepositoryResult[];
|
||||
@@ -50,7 +51,7 @@ export function VariantAnalysis({
|
||||
variantAnalysis: initialVariantAnalysis,
|
||||
repoStates: initialRepoStates = [],
|
||||
repoResults: initialRepoResults = [],
|
||||
}: Props): JSX.Element {
|
||||
}: VariantAnalysisProps): JSX.Element {
|
||||
const [variantAnalysis, setVariantAnalysis] = useState<
|
||||
VariantAnalysisDomainModel | undefined
|
||||
>(initialVariantAnalysis);
|
||||
@@ -128,10 +129,17 @@ export function VariantAnalysis({
|
||||
});
|
||||
}, [filterSortState, selectedRepositoryIds]);
|
||||
|
||||
if (variantAnalysis?.actionsWorkflowRunId === undefined) {
|
||||
if (
|
||||
variantAnalysis === undefined ||
|
||||
(variantAnalysis.status === VariantAnalysisStatus.InProgress &&
|
||||
variantAnalysis.actionsWorkflowRunId === undefined)
|
||||
) {
|
||||
return <VariantAnalysisLoading />;
|
||||
}
|
||||
|
||||
const onViewLogsClick =
|
||||
variantAnalysis.actionsWorkflowRunId === undefined ? undefined : openLogs;
|
||||
|
||||
return (
|
||||
<>
|
||||
<VariantAnalysisHeader
|
||||
@@ -141,7 +149,7 @@ export function VariantAnalysis({
|
||||
onStopQueryClick={stopQuery}
|
||||
onCopyRepositoryListClick={copyRepositoryList}
|
||||
onExportResultsClick={exportResults}
|
||||
onViewLogsClick={openLogs}
|
||||
onViewLogsClick={onViewLogsClick}
|
||||
/>
|
||||
<VariantAnalysisOutcomePanels
|
||||
variantAnalysis={variantAnalysis}
|
||||
|
||||
@@ -24,7 +24,7 @@ export type VariantAnalysisHeaderProps = {
|
||||
onCopyRepositoryListClick: () => void;
|
||||
onExportResultsClick: () => void;
|
||||
|
||||
onViewLogsClick: () => void;
|
||||
onViewLogsClick?: () => void;
|
||||
};
|
||||
|
||||
const Container = styled.div`
|
||||
|
||||
@@ -20,7 +20,7 @@ export type VariantAnalysisStatsProps = {
|
||||
createdAt: Date;
|
||||
completedAt?: Date | undefined;
|
||||
|
||||
onViewLogsClick: () => void;
|
||||
onViewLogsClick?: () => void;
|
||||
};
|
||||
|
||||
const Row = styled.div`
|
||||
@@ -88,6 +88,7 @@ export const VariantAnalysisStats = ({
|
||||
</StatItem>
|
||||
<StatItem title={completionHeaderName}>
|
||||
<VariantAnalysisStatusStats
|
||||
variantAnalysisStatus={variantAnalysisStatus}
|
||||
completedAt={completedAt}
|
||||
onViewLogsClick={onViewLogsClick}
|
||||
/>
|
||||
|
||||
@@ -2,11 +2,13 @@ import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react";
|
||||
import { formatDate } from "../../pure/date";
|
||||
import { VariantAnalysisStatus } from "../../remote-queries/shared/variant-analysis";
|
||||
|
||||
type Props = {
|
||||
completedAt?: Date | undefined;
|
||||
export type VariantAnalysisStatusStatsProps = {
|
||||
variantAnalysisStatus: VariantAnalysisStatus;
|
||||
completedAt?: Date;
|
||||
|
||||
onViewLogsClick: () => void;
|
||||
onViewLogsClick?: () => void;
|
||||
};
|
||||
|
||||
const Container = styled.div`
|
||||
@@ -21,17 +23,20 @@ const Icon = styled.span`
|
||||
`;
|
||||
|
||||
export const VariantAnalysisStatusStats = ({
|
||||
variantAnalysisStatus,
|
||||
completedAt,
|
||||
onViewLogsClick,
|
||||
}: Props) => {
|
||||
if (completedAt === undefined) {
|
||||
}: VariantAnalysisStatusStatsProps) => {
|
||||
if (variantAnalysisStatus === VariantAnalysisStatus.InProgress) {
|
||||
return <Icon className="codicon codicon-loading codicon-modifier-spin" />;
|
||||
}
|
||||
|
||||
return (
|
||||
<Container>
|
||||
<span>{formatDate(completedAt)}</span>
|
||||
<VSCodeLink onClick={onViewLogsClick}>View logs</VSCodeLink>
|
||||
<span>{completedAt !== undefined ? formatDate(completedAt) : "-"}</span>
|
||||
{onViewLogsClick && (
|
||||
<VSCodeLink onClick={onViewLogsClick}>View logs</VSCodeLink>
|
||||
)}
|
||||
</Container>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import * as React from "react";
|
||||
import { render as reactRender, screen } from "@testing-library/react";
|
||||
import {
|
||||
VariantAnalysisFailureReason,
|
||||
VariantAnalysisStatus,
|
||||
} from "../../../remote-queries/shared/variant-analysis";
|
||||
import { VariantAnalysis, VariantAnalysisProps } from "../VariantAnalysis";
|
||||
import { createMockVariantAnalysis } from "../../../vscode-tests/factories/remote-queries/shared/variant-analysis";
|
||||
|
||||
describe(VariantAnalysis.name, () => {
|
||||
const render = (props: Partial<VariantAnalysisProps> = {}) =>
|
||||
reactRender(
|
||||
<VariantAnalysis
|
||||
variantAnalysis={createMockVariantAnalysis({})}
|
||||
{...props}
|
||||
/>,
|
||||
);
|
||||
|
||||
it("renders a pending analysis", () => {
|
||||
const variantAnalysis = createMockVariantAnalysis({
|
||||
status: VariantAnalysisStatus.InProgress,
|
||||
});
|
||||
variantAnalysis.actionsWorkflowRunId = undefined;
|
||||
render({ variantAnalysis });
|
||||
|
||||
expect(
|
||||
screen.getByText("We are getting everything ready"),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders an analysis where there were no repos to analyse", () => {
|
||||
const variantAnalysis = createMockVariantAnalysis({
|
||||
status: VariantAnalysisStatus.Failed,
|
||||
});
|
||||
variantAnalysis.failureReason = VariantAnalysisFailureReason.NoReposQueried;
|
||||
variantAnalysis.actionsWorkflowRunId = undefined;
|
||||
render({ variantAnalysis });
|
||||
|
||||
expect(
|
||||
screen.queryByText("We are getting everything ready"),
|
||||
).not.toBeInTheDocument();
|
||||
|
||||
expect(
|
||||
screen.getByText(
|
||||
"No repositories available after processing. No repositories were analyzed.",
|
||||
),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
import * as React from "react";
|
||||
import { render as reactRender, screen } from "@testing-library/react";
|
||||
import { VariantAnalysisStatus } from "../../../remote-queries/shared/variant-analysis";
|
||||
import {
|
||||
VariantAnalysisStatusStats,
|
||||
VariantAnalysisStatusStatsProps,
|
||||
} from "../VariantAnalysisStatusStats";
|
||||
import { formatDate } from "../../../pure/date";
|
||||
|
||||
describe(VariantAnalysisStatusStats.name, () => {
|
||||
const render = (props: Partial<VariantAnalysisStatusStatsProps> = {}) =>
|
||||
reactRender(
|
||||
<VariantAnalysisStatusStats
|
||||
variantAnalysisStatus={VariantAnalysisStatus.InProgress}
|
||||
{...props}
|
||||
/>,
|
||||
);
|
||||
|
||||
it("renders an in-progress status correctly", () => {
|
||||
const { container } = render({
|
||||
variantAnalysisStatus: VariantAnalysisStatus.InProgress,
|
||||
});
|
||||
|
||||
expect(
|
||||
container.getElementsByClassName(
|
||||
"codicon codicon-loading codicon-modifier-spin",
|
||||
)[0],
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders when there is a completedAt date", () => {
|
||||
const completedAt = new Date();
|
||||
render({
|
||||
variantAnalysisStatus: VariantAnalysisStatus.Succeeded,
|
||||
completedAt,
|
||||
});
|
||||
|
||||
expect(screen.getByText(formatDate(completedAt))).toBeInTheDocument();
|
||||
expect(screen.queryByText("-")).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders when there isn't a completedAt date", () => {
|
||||
render({
|
||||
variantAnalysisStatus: VariantAnalysisStatus.Succeeded,
|
||||
completedAt: undefined,
|
||||
});
|
||||
|
||||
expect(screen.getByText("-")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders when there is a viewLogs links", () => {
|
||||
render({
|
||||
variantAnalysisStatus: VariantAnalysisStatus.Succeeded,
|
||||
onViewLogsClick: () => undefined,
|
||||
});
|
||||
|
||||
expect(screen.getByText("View logs")).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("renders when there isn't a viewLogs links", () => {
|
||||
render({
|
||||
variantAnalysisStatus: VariantAnalysisStatus.Succeeded,
|
||||
onViewLogsClick: undefined,
|
||||
});
|
||||
|
||||
expect(screen.queryByText("View logs")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -3,7 +3,7 @@ module.exports = {
|
||||
project: ["../../tsconfig.json"],
|
||||
},
|
||||
env: {
|
||||
mocha: true
|
||||
jest: true,
|
||||
},
|
||||
rules: {
|
||||
"@typescript-eslint/ban-types": [
|
||||
@@ -12,11 +12,11 @@ module.exports = {
|
||||
// For a full list of the default banned types, see:
|
||||
// https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/ban-types.md
|
||||
extendDefaults: true,
|
||||
"types": {
|
||||
types: {
|
||||
// Don't complain about the `Function` type in test files. (Default is `true`.)
|
||||
"Function": false,
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Function: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import * as sinon from "sinon";
|
||||
import * as path from "path";
|
||||
import { fail } from "assert";
|
||||
import { expect } from "chai";
|
||||
import { extensions, CancellationToken, Uri, window } from "vscode";
|
||||
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
@@ -12,64 +9,51 @@ import {
|
||||
importArchiveDatabase,
|
||||
promptImportInternetDatabase,
|
||||
} from "../../databaseFetcher";
|
||||
import { ProgressCallback } from "../../commandRunner";
|
||||
import { cleanDatabases, dbLoc, DB_URL, storagePath } from "./global.helper";
|
||||
|
||||
jest.setTimeout(60_000);
|
||||
|
||||
/**
|
||||
* Run various integration tests for databases
|
||||
*/
|
||||
describe("Databases", function () {
|
||||
this.timeout(60000);
|
||||
|
||||
describe("Databases", () => {
|
||||
const LGTM_URL =
|
||||
"https://lgtm.com/projects/g/aeisenberg/angular-bind-notifier/";
|
||||
|
||||
let databaseManager: DatabaseManager;
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
let inputBoxStub: sinon.SinonStub;
|
||||
let inputBoxStub: jest.SpiedFunction<typeof window.showInputBox>;
|
||||
let cli: CodeQLCliServer;
|
||||
let progressCallback: ProgressCallback;
|
||||
const progressCallback = jest.fn();
|
||||
|
||||
beforeEach(async () => {
|
||||
try {
|
||||
sandbox = sinon.createSandbox();
|
||||
// the uri.fsPath function on windows returns a lowercase drive letter
|
||||
// so, force the storage path string to be lowercase, too.
|
||||
progressCallback = sandbox.spy();
|
||||
inputBoxStub = sandbox.stub(window, "showInputBox");
|
||||
sandbox.stub(window, "showErrorMessage");
|
||||
sandbox.stub(window, "showInformationMessage");
|
||||
inputBoxStub = jest
|
||||
.spyOn(window, "showInputBox")
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("databaseManager" in extension) {
|
||||
databaseManager = extension.databaseManager;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
jest.spyOn(window, "showErrorMessage").mockResolvedValue(undefined);
|
||||
jest.spyOn(window, "showInformationMessage").mockResolvedValue(undefined);
|
||||
|
||||
await cleanDatabases(databaseManager);
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("databaseManager" in extension) {
|
||||
databaseManager = extension.databaseManager;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
|
||||
await cleanDatabases(databaseManager);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
try {
|
||||
sandbox.restore();
|
||||
await cleanDatabases(databaseManager);
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
await cleanDatabases(databaseManager);
|
||||
});
|
||||
|
||||
it("should add a database from a folder", async () => {
|
||||
const progressCallback = sandbox.spy() as ProgressCallback;
|
||||
const uri = Uri.file(dbLoc);
|
||||
let dbItem = await importArchiveDatabase(
|
||||
uri.toString(true),
|
||||
@@ -79,16 +63,16 @@ describe("Databases", function () {
|
||||
{} as CancellationToken,
|
||||
cli,
|
||||
);
|
||||
expect(dbItem).to.be.eq(databaseManager.currentDatabaseItem);
|
||||
expect(dbItem).to.be.eq(databaseManager.databaseItems[0]);
|
||||
expect(dbItem).not.to.be.undefined;
|
||||
expect(dbItem).toBe(databaseManager.currentDatabaseItem);
|
||||
expect(dbItem).toBe(databaseManager.databaseItems[0]);
|
||||
expect(dbItem).toBeDefined();
|
||||
dbItem = dbItem!;
|
||||
expect(dbItem.name).to.eq("db");
|
||||
expect(dbItem.databaseUri.fsPath).to.eq(path.join(storagePath, "db", "db"));
|
||||
expect(dbItem.name).toBe("db");
|
||||
expect(dbItem.databaseUri.fsPath).toBe(path.join(storagePath, "db", "db"));
|
||||
});
|
||||
|
||||
it("should add a database from lgtm with only one language", async () => {
|
||||
inputBoxStub.resolves(LGTM_URL);
|
||||
inputBoxStub.mockResolvedValue(LGTM_URL);
|
||||
let dbItem = await promptImportLgtmDatabase(
|
||||
databaseManager,
|
||||
storagePath,
|
||||
@@ -96,10 +80,10 @@ describe("Databases", function () {
|
||||
{} as CancellationToken,
|
||||
cli,
|
||||
);
|
||||
expect(dbItem).not.to.be.undefined;
|
||||
expect(dbItem).toBeDefined();
|
||||
dbItem = dbItem!;
|
||||
expect(dbItem.name).to.eq("aeisenberg_angular-bind-notifier_106179a");
|
||||
expect(dbItem.databaseUri.fsPath).to.eq(
|
||||
expect(dbItem.name).toBe("aeisenberg_angular-bind-notifier_106179a");
|
||||
expect(dbItem.databaseUri.fsPath).toBe(
|
||||
path.join(
|
||||
storagePath,
|
||||
"javascript",
|
||||
@@ -109,7 +93,7 @@ describe("Databases", function () {
|
||||
});
|
||||
|
||||
it("should add a database from a url", async () => {
|
||||
inputBoxStub.resolves(DB_URL);
|
||||
inputBoxStub.mockResolvedValue(DB_URL);
|
||||
|
||||
let dbItem = await promptImportInternetDatabase(
|
||||
databaseManager,
|
||||
@@ -118,10 +102,10 @@ describe("Databases", function () {
|
||||
{} as CancellationToken,
|
||||
cli,
|
||||
);
|
||||
expect(dbItem).not.to.be.undefined;
|
||||
expect(dbItem).toBeDefined();
|
||||
dbItem = dbItem!;
|
||||
expect(dbItem.name).to.eq("db");
|
||||
expect(dbItem.databaseUri.fsPath).to.eq(
|
||||
expect(dbItem.name).toBe("db");
|
||||
expect(dbItem.databaseUri.fsPath).toBe(
|
||||
path.join(storagePath, "simple-db", "db"),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
import * as path from "path";
|
||||
import * as tmp from "tmp";
|
||||
import * as yaml from "js-yaml";
|
||||
import * as fs from "fs-extra";
|
||||
import fetch from "node-fetch";
|
||||
|
||||
import { fail } from "assert";
|
||||
import { commands, extensions, workspace } from "vscode";
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { commands } from "vscode";
|
||||
import { DatabaseManager } from "../../databases";
|
||||
import { getTestSetting } from "../test-config";
|
||||
import { CUSTOM_CODEQL_PATH_SETTING } from "../../config";
|
||||
import { CodeQLCliServer } from "../../cli";
|
||||
import { removeWorkspaceRefs } from "../../remote-queries/run-remote-query";
|
||||
|
||||
@@ -26,98 +19,8 @@ export const dbLoc = path.join(
|
||||
);
|
||||
export let storagePath: string;
|
||||
|
||||
export default function (mocha: Mocha) {
|
||||
// create an extension storage location
|
||||
let removeStorage: tmp.DirResult["removeCallback"] | undefined;
|
||||
|
||||
// ensure the test database is downloaded
|
||||
(mocha.options as any).globalSetup.push(async () => {
|
||||
fs.mkdirpSync(path.dirname(dbLoc));
|
||||
if (!fs.existsSync(dbLoc)) {
|
||||
try {
|
||||
await new Promise((resolve, reject) => {
|
||||
return fetch(DB_URL).then((response) => {
|
||||
const dest = fs.createWriteStream(dbLoc);
|
||||
response.body.pipe(dest);
|
||||
|
||||
response.body.on("error", reject);
|
||||
dest.on("error", reject);
|
||||
dest.on("close", () => {
|
||||
resolve(dbLoc);
|
||||
});
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
fail("Failed to download test database: " + e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Set the CLI version here before activation to ensure we don't accidentally try to download a cli
|
||||
(mocha.options as any).globalSetup.push(async () => {
|
||||
await getTestSetting(CUSTOM_CODEQL_PATH_SETTING)?.setInitialTestValue(
|
||||
process.env.CLI_PATH,
|
||||
);
|
||||
});
|
||||
|
||||
// Create the temp directory to be used as extension local storage.
|
||||
(mocha.options as any).globalSetup.push(() => {
|
||||
const dir = tmp.dirSync();
|
||||
storagePath = fs.realpathSync(dir.name);
|
||||
if (storagePath.substring(0, 2).match(/[A-Z]:/)) {
|
||||
storagePath =
|
||||
storagePath.substring(0, 1).toLocaleLowerCase() +
|
||||
storagePath.substring(1);
|
||||
}
|
||||
|
||||
removeStorage = dir.removeCallback;
|
||||
});
|
||||
|
||||
// ensure extension is cleaned up.
|
||||
(mocha.options as any).globalTeardown.push(async () => {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
// This shuts down the extension and can only be run after all tests have completed.
|
||||
// If this is not called, then the test process will hang.
|
||||
if ("dispose" in extension) {
|
||||
try {
|
||||
extension.dispose();
|
||||
} catch (e) {
|
||||
console.warn("Failed to dispose extension", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// ensure temp directory is cleaned up.
|
||||
(mocha.options as any).globalTeardown.push(() => {
|
||||
try {
|
||||
removeStorage?.();
|
||||
} catch (e) {
|
||||
// we are exiting anyway so don't worry about it.
|
||||
// most likely the directory this is a test on Windows and some files are locked.
|
||||
console.warn(`Failed to remove storage directory '${storagePath}': ${e}`);
|
||||
}
|
||||
});
|
||||
|
||||
// check that the codeql folder is found in the workspace
|
||||
(mocha.options as any).globalSetup.push(async () => {
|
||||
const folders = workspace.workspaceFolders;
|
||||
if (!folders) {
|
||||
fail(
|
||||
'\n\n\nNo workspace folders found.\nYou will need a local copy of the codeql repo.\nMake sure you specify the path to it in launch.json.\nIt should be something along the lines of "${workspaceRoot}/../codeql" depending on where you have your local copy of the codeql repo.\n\n\n',
|
||||
);
|
||||
} else {
|
||||
const codeqlFolder = folders.find((folder) => folder.name === "codeql");
|
||||
if (!codeqlFolder) {
|
||||
fail(
|
||||
'\n\n\nNo workspace folders found.\nYou will need a local copy of the codeql repo.\nMake sure you specify the path to it in launch.json.\nIt should be something along the lines of "${workspaceRoot}/../codeql" depending on where you have your local copy of the codeql repo.\n\n\n',
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
export function setStoragePath(path: string) {
|
||||
storagePath = path;
|
||||
}
|
||||
|
||||
export async function cleanDatabases(databaseManager: DatabaseManager) {
|
||||
|
||||
@@ -4,17 +4,16 @@ import { extensions } from "vscode";
|
||||
import { CodeQLCliServer } from "../../cli";
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { tryGetQueryMetadata } from "../../helpers";
|
||||
import { expect } from "chai";
|
||||
|
||||
describe("helpers (with CLI)", function () {
|
||||
// up to 3 minutes per test
|
||||
jest.setTimeout(3 * 60 * 1000);
|
||||
|
||||
describe("helpers (with CLI)", () => {
|
||||
const baseDir = path.join(
|
||||
__dirname,
|
||||
"../../../src/vscode-tests/cli-integration",
|
||||
);
|
||||
|
||||
// up to 3 minutes per test
|
||||
this.timeout(3 * 60 * 1000);
|
||||
|
||||
let cli: CodeQLCliServer;
|
||||
|
||||
beforeEach(async () => {
|
||||
@@ -39,9 +38,9 @@ describe("helpers (with CLI)", function () {
|
||||
path.join(baseDir, "data", "simple-javascript-query.ql"),
|
||||
);
|
||||
|
||||
expect(metadata!.name).to.equal("This is the name");
|
||||
expect(metadata!.kind).to.equal("problem");
|
||||
expect(metadata!.id).to.equal("javascript/example/test-query");
|
||||
expect(metadata!.name).toBe("This is the name");
|
||||
expect(metadata!.kind).toBe("problem");
|
||||
expect(metadata!.id).toBe("javascript/example/test-query");
|
||||
});
|
||||
|
||||
it("should handle query with no metadata", async () => {
|
||||
@@ -51,6 +50,6 @@ describe("helpers (with CLI)", function () {
|
||||
path.join(baseDir, "data", "simple-query.ql"),
|
||||
);
|
||||
|
||||
expect(noMetadata).to.deep.equal({});
|
||||
expect(noMetadata).toEqual({});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import "source-map-support/register";
|
||||
import { runTestsInDirectory } from "../index-template";
|
||||
import "mocha";
|
||||
import * as sinonChai from "sinon-chai";
|
||||
import * as chai from "chai";
|
||||
import "chai/register-should";
|
||||
import * as chaiAsPromised from "chai-as-promised";
|
||||
chai.use(chaiAsPromised);
|
||||
chai.use(sinonChai);
|
||||
|
||||
export function run(): Promise<void> {
|
||||
return runTestsInDirectory(__dirname, true);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import * as cp from "child_process";
|
||||
import * as path from "path";
|
||||
|
||||
import type * as JestRunner from "jest-runner";
|
||||
import VSCodeTestRunner, { RunnerOptions } from "jest-runner-vscode";
|
||||
import { cosmiconfig } from "cosmiconfig";
|
||||
import {
|
||||
downloadAndUnzipVSCode,
|
||||
resolveCliArgsFromVSCodeExecutablePath,
|
||||
} from "@vscode/test-electron";
|
||||
import { ensureCli } from "../ensureCli";
|
||||
|
||||
export default class JestRunnerCliIntegration extends VSCodeTestRunner {
|
||||
async runTests(
|
||||
tests: JestRunner.Test[],
|
||||
watcher: JestRunner.TestWatcher,
|
||||
onStart: JestRunner.OnTestStart,
|
||||
onResult: JestRunner.OnTestSuccess,
|
||||
onFailure: JestRunner.OnTestFailure,
|
||||
): Promise<void> {
|
||||
// The CLI integration tests require certain extensions to be installed, which needs to happen before the tests are
|
||||
// actually run. The below code will resolve the path to the VSCode executable, and then use that to install the
|
||||
// required extensions.
|
||||
|
||||
const installedOnVsCodeVersions =
|
||||
new Set<`${RunnerOptions["version"]}-${RunnerOptions["platform"]}`>();
|
||||
|
||||
for (const test of tests) {
|
||||
const testDir = path.dirname(test.path);
|
||||
|
||||
const options: RunnerOptions =
|
||||
((await cosmiconfig("jest-runner-vscode").search(testDir))
|
||||
?.config as RunnerOptions) ?? {};
|
||||
|
||||
const { version, platform } = options;
|
||||
const versionKey = `${version}-${platform}`;
|
||||
|
||||
if (installedOnVsCodeVersions.has(versionKey)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const vscodeExecutablePath = await downloadAndUnzipVSCode(
|
||||
version,
|
||||
platform,
|
||||
);
|
||||
|
||||
console.log(`Installing required extensions for ${vscodeExecutablePath}`);
|
||||
|
||||
const [cli, ...args] =
|
||||
resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath);
|
||||
|
||||
cp.spawnSync(
|
||||
cli,
|
||||
[
|
||||
...args,
|
||||
"--install-extension",
|
||||
"hbenl.vscode-test-explorer",
|
||||
"--install-extension",
|
||||
"ms-vscode.test-adapter-converter",
|
||||
],
|
||||
{
|
||||
encoding: "utf-8",
|
||||
stdio: "inherit",
|
||||
},
|
||||
);
|
||||
|
||||
installedOnVsCodeVersions.add(versionKey);
|
||||
}
|
||||
|
||||
await ensureCli(true);
|
||||
|
||||
return super.runTests(tests, watcher, onStart, onResult, onFailure);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
const path = require("path");
|
||||
|
||||
const {
|
||||
config: baseConfig,
|
||||
rootDir,
|
||||
} = require("../jest-runner-vscode.config.base");
|
||||
|
||||
/** @type import("jest-runner-vscode").RunnerOptions */
|
||||
const config = {
|
||||
...baseConfig,
|
||||
launchArgs: [
|
||||
...(baseConfig.launchArgs ?? []),
|
||||
// explicitly disable extensions that are known to interfere with the CLI integration tests
|
||||
"--disable-extension",
|
||||
"eamodio.gitlens",
|
||||
"--disable-extension",
|
||||
"github.codespaces",
|
||||
"--disable-extension",
|
||||
"github.copilot",
|
||||
path.resolve(rootDir, "test/data"),
|
||||
// CLI integration tests requires a multi-root workspace so that the data and the QL sources are accessible.
|
||||
...(process.env.TEST_CODEQL_PATH ? [process.env.TEST_CODEQL_PATH] : []),
|
||||
],
|
||||
extensionTestsEnv: {
|
||||
...baseConfig.extensionTestsEnv,
|
||||
INTEGRATION_TEST_MODE: "true",
|
||||
},
|
||||
retries: 3,
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { Config } from "jest";
|
||||
|
||||
import baseConfig from "../jest.config.base";
|
||||
|
||||
const config: Config = {
|
||||
...baseConfig,
|
||||
runner: "<rootDir>/jest-runner-cli-integration.ts",
|
||||
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,84 @@
|
||||
import * as fs from "fs-extra";
|
||||
import * as path from "path";
|
||||
import fetch from "node-fetch";
|
||||
import { DB_URL, dbLoc, setStoragePath, storagePath } from "./global.helper";
|
||||
import * as tmp from "tmp";
|
||||
import { getTestSetting } from "../test-config";
|
||||
import { CUSTOM_CODEQL_PATH_SETTING } from "../../config";
|
||||
import { extensions, workspace } from "vscode";
|
||||
|
||||
import baseJestSetup from "../jest.setup";
|
||||
|
||||
export default baseJestSetup;
|
||||
|
||||
// create an extension storage location
|
||||
let removeStorage: tmp.DirResult["removeCallback"] | undefined;
|
||||
|
||||
beforeAll(async () => {
|
||||
// Set the CLI version here before activation to ensure we don't accidentally try to download a cli
|
||||
await getTestSetting(CUSTOM_CODEQL_PATH_SETTING)?.setInitialTestValue(
|
||||
process.env.CLI_PATH,
|
||||
);
|
||||
await getTestSetting(CUSTOM_CODEQL_PATH_SETTING)?.setup();
|
||||
|
||||
// ensure the test database is downloaded
|
||||
fs.mkdirpSync(path.dirname(dbLoc));
|
||||
if (!fs.existsSync(dbLoc)) {
|
||||
console.log(`Downloading test database to ${dbLoc}`);
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
return fetch(DB_URL).then((response) => {
|
||||
const dest = fs.createWriteStream(dbLoc);
|
||||
response.body.pipe(dest);
|
||||
|
||||
response.body.on("error", reject);
|
||||
dest.on("error", reject);
|
||||
dest.on("close", () => {
|
||||
resolve(dbLoc);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// Create the temp directory to be used as extension local storage.
|
||||
const dir = tmp.dirSync();
|
||||
let storagePath = fs.realpathSync(dir.name);
|
||||
if (storagePath.substring(0, 2).match(/[A-Z]:/)) {
|
||||
storagePath =
|
||||
storagePath.substring(0, 1).toLocaleLowerCase() +
|
||||
storagePath.substring(1);
|
||||
}
|
||||
setStoragePath(storagePath);
|
||||
|
||||
removeStorage = dir.removeCallback;
|
||||
|
||||
// check that the codeql folder is found in the workspace
|
||||
const folders = workspace.workspaceFolders;
|
||||
if (!folders) {
|
||||
throw new Error(
|
||||
'No workspace folders found.\nYou will need a local copy of the codeql repo.\nMake sure you specify the path to it in launch.json.\nIt should be something along the lines of "${workspaceRoot}/../codeql" depending on where you have your local copy of the codeql repo.',
|
||||
);
|
||||
} else {
|
||||
const codeqlFolder = folders.find((folder) => folder.name === "codeql");
|
||||
if (!codeqlFolder) {
|
||||
throw new Error(
|
||||
'No workspace folders found.\nYou will need a local copy of the codeql repo.\nMake sure you specify the path to it in launch.json.\nIt should be something along the lines of "${workspaceRoot}/../codeql" depending on where you have your local copy of the codeql repo.\n\n\n',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Activate the extension
|
||||
await extensions.getExtension("GitHub.vscode-codeql")?.activate();
|
||||
});
|
||||
|
||||
// ensure extension is cleaned up.
|
||||
afterAll(async () => {
|
||||
// ensure temp directory is cleaned up.
|
||||
try {
|
||||
removeStorage?.();
|
||||
} catch (e) {
|
||||
// we are exiting anyway so don't worry about it.
|
||||
// most likely the directory this is a test on Windows and some files are locked.
|
||||
console.warn(`Failed to remove storage directory '${storagePath}': ${e}`);
|
||||
}
|
||||
});
|
||||
@@ -1,4 +1,3 @@
|
||||
import { expect } from "chai";
|
||||
import * as fs from "fs-extra";
|
||||
import * as path from "path";
|
||||
import * as tmp from "tmp";
|
||||
@@ -10,10 +9,9 @@ import * as cli from "../../cli";
|
||||
import { CellValue } from "../../pure/bqrs-cli-types";
|
||||
import { extensions } from "vscode";
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { fail } from "assert";
|
||||
import { skipIfNoCodeQL } from "../ensureCli";
|
||||
import { describeWithCodeQL } from "../cli";
|
||||
import { QueryServerClient } from "../../legacy-query-server/queryserver-client";
|
||||
import { logger, ProgressReporter } from "../../logging";
|
||||
import { extLogger, ProgressReporter } from "../../common";
|
||||
|
||||
const baseDir = path.join(__dirname, "../../../test/data");
|
||||
|
||||
@@ -96,19 +94,13 @@ const queryTestCases: QueryTestCase[] = [
|
||||
];
|
||||
|
||||
const db: messages.Dataset = {
|
||||
dbDir: path.join(__dirname, "../test-db"),
|
||||
dbDir: path.join(__dirname, "../../../.vscode-test/test-db"),
|
||||
workingSet: "default",
|
||||
};
|
||||
|
||||
describe("using the legacy query server", function () {
|
||||
before(function () {
|
||||
skipIfNoCodeQL(this);
|
||||
});
|
||||
|
||||
// Note this does not work with arrow functions as the test case bodies:
|
||||
// ensure they are all written with standard anonymous functions.
|
||||
this.timeout(20000);
|
||||
jest.setTimeout(60_000);
|
||||
|
||||
describeWithCodeQL()("using the legacy query server", () => {
|
||||
const nullProgressReporter: ProgressReporter = {
|
||||
report: () => {
|
||||
/** ignore */
|
||||
@@ -118,44 +110,40 @@ describe("using the legacy query server", function () {
|
||||
let qs: qsClient.QueryServerClient;
|
||||
let cliServer: cli.CodeQLCliServer;
|
||||
|
||||
before(async () => {
|
||||
try {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("cliServer" in extension) {
|
||||
cliServer = extension.cliServer;
|
||||
cliServer.quiet = true;
|
||||
beforeAll(async () => {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("cliServer" in extension) {
|
||||
cliServer = extension.cliServer;
|
||||
cliServer.quiet = true;
|
||||
|
||||
qs = new QueryServerClient(
|
||||
{
|
||||
codeQlPath:
|
||||
(await extension.distributionManager.getCodeQlPathWithoutVersionCheck()) ||
|
||||
"",
|
||||
debug: false,
|
||||
cacheSize: 0,
|
||||
numThreads: 1,
|
||||
saveCache: false,
|
||||
timeoutSecs: 0,
|
||||
},
|
||||
cliServer,
|
||||
{
|
||||
contextStoragePath: tmpDir.name,
|
||||
logger,
|
||||
},
|
||||
(task) =>
|
||||
task(nullProgressReporter, new CancellationTokenSource().token),
|
||||
);
|
||||
await qs.startQueryServer();
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
qs = new QueryServerClient(
|
||||
{
|
||||
codeQlPath:
|
||||
(await extension.distributionManager.getCodeQlPathWithoutVersionCheck()) ||
|
||||
"",
|
||||
debug: false,
|
||||
cacheSize: 0,
|
||||
numThreads: 1,
|
||||
saveCache: false,
|
||||
timeoutSecs: 0,
|
||||
},
|
||||
cliServer,
|
||||
{
|
||||
contextStoragePath: tmpDir.name,
|
||||
logger: extLogger,
|
||||
},
|
||||
(task) =>
|
||||
task(nullProgressReporter, new CancellationTokenSource().token),
|
||||
);
|
||||
await qs.startQueryServer();
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -178,8 +166,8 @@ describe("using the legacy query server", function () {
|
||||
}
|
||||
});
|
||||
|
||||
it(`should be able to compile query ${queryName}`, async function () {
|
||||
expect(fs.existsSync(queryTestCase.queryPath)).to.be.true;
|
||||
it(`should be able to compile query ${queryName}`, async () => {
|
||||
expect(fs.existsSync(queryTestCase.queryPath)).toBe(true);
|
||||
try {
|
||||
const qlProgram: messages.QlProgram = {
|
||||
libraryPath: [],
|
||||
@@ -210,14 +198,14 @@ describe("using the legacy query server", function () {
|
||||
/**/
|
||||
},
|
||||
);
|
||||
expect(result.messages!.length).to.equal(0);
|
||||
expect(result.messages!.length).toBe(0);
|
||||
await compilationSucceeded.resolve();
|
||||
} catch (e) {
|
||||
await compilationSucceeded.reject(e as Error);
|
||||
}
|
||||
});
|
||||
|
||||
it(`should be able to run query ${queryName}`, async function () {
|
||||
it(`should be able to run query ${queryName}`, async () => {
|
||||
try {
|
||||
await compilationSucceeded.done();
|
||||
const callbackId = qs.registerCallback((_res) => {
|
||||
@@ -246,7 +234,7 @@ describe("using the legacy query server", function () {
|
||||
});
|
||||
|
||||
const actualResultSets: ResultSets = {};
|
||||
it(`should be able to parse results of query ${queryName}`, async function () {
|
||||
it(`should be able to parse results of query ${queryName}`, async () => {
|
||||
await evaluationSucceeded.done();
|
||||
const info = await cliServer.bqrsInfo(RESULTS_PATH);
|
||||
|
||||
@@ -260,16 +248,15 @@ describe("using the legacy query server", function () {
|
||||
await parsedResults.resolve();
|
||||
});
|
||||
|
||||
it(`should have correct results for query ${queryName}`, async function () {
|
||||
it(`should have correct results for query ${queryName}`, async () => {
|
||||
await parsedResults.done();
|
||||
expect(actualResultSets!).not.to.be.empty;
|
||||
expect(Object.keys(actualResultSets!).sort()).to.eql(
|
||||
expect(actualResultSets).not.toEqual({});
|
||||
expect(Object.keys(actualResultSets!).sort()).toEqual(
|
||||
Object.keys(queryTestCase.expectedResultSets).sort(),
|
||||
);
|
||||
for (const name in queryTestCase.expectedResultSets) {
|
||||
expect(actualResultSets![name]).to.eql(
|
||||
expect(actualResultSets![name]).toEqual(
|
||||
queryTestCase.expectedResultSets[name],
|
||||
`Results for query predicate ${name} do not match`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { expect } from "chai";
|
||||
import * as path from "path";
|
||||
import * as tmp from "tmp";
|
||||
import { CancellationTokenSource } from "vscode-jsonrpc";
|
||||
@@ -8,10 +7,9 @@ import * as cli from "../../cli";
|
||||
import { CellValue } from "../../pure/bqrs-cli-types";
|
||||
import { extensions, Uri } from "vscode";
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { fail } from "assert";
|
||||
import { skipIfNoCodeQL } from "../ensureCli";
|
||||
import { describeWithCodeQL } from "../cli";
|
||||
import { QueryServerClient } from "../../query-server/queryserver-client";
|
||||
import { logger, ProgressReporter } from "../../logging";
|
||||
import { extLogger, ProgressReporter } from "../../common";
|
||||
import { QueryResultType } from "../../pure/new-messages";
|
||||
import { cleanDatabases, dbLoc, storagePath } from "./global.helper";
|
||||
import { importArchiveDatabase } from "../../databaseFetcher";
|
||||
@@ -101,80 +99,71 @@ const nullProgressReporter: ProgressReporter = {
|
||||
},
|
||||
};
|
||||
|
||||
describe("using the new query server", function () {
|
||||
before(function () {
|
||||
skipIfNoCodeQL(this);
|
||||
});
|
||||
|
||||
// Note this does not work with arrow functions as the test case bodies:
|
||||
// ensure they are all written with standard anonymous functions.
|
||||
this.timeout(20000);
|
||||
jest.setTimeout(20_000);
|
||||
|
||||
describeWithCodeQL()("using the new query server", () => {
|
||||
let qs: qsClient.QueryServerClient;
|
||||
let cliServer: cli.CodeQLCliServer;
|
||||
let db: string;
|
||||
before(async () => {
|
||||
try {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("cliServer" in extension && "databaseManager" in extension) {
|
||||
cliServer = extension.cliServer;
|
||||
|
||||
cliServer.quiet = true;
|
||||
if (
|
||||
!(await cliServer.cliConstraints.supportsNewQueryServerForTests())
|
||||
) {
|
||||
this.ctx.skip();
|
||||
}
|
||||
qs = new QueryServerClient(
|
||||
{
|
||||
codeQlPath:
|
||||
(await extension.distributionManager.getCodeQlPathWithoutVersionCheck()) ||
|
||||
"",
|
||||
debug: false,
|
||||
cacheSize: 0,
|
||||
numThreads: 1,
|
||||
saveCache: false,
|
||||
timeoutSecs: 0,
|
||||
},
|
||||
cliServer,
|
||||
{
|
||||
contextStoragePath: tmpDir.name,
|
||||
logger,
|
||||
},
|
||||
(task) =>
|
||||
task(nullProgressReporter, new CancellationTokenSource().token),
|
||||
);
|
||||
await qs.startQueryServer();
|
||||
let supportNewQueryServer = true;
|
||||
|
||||
// Unlike the old query sevre the new one wants a database and the empty direcrtory is not valid.
|
||||
// Add a database, but make sure the database manager is empty first
|
||||
await cleanDatabases(extension.databaseManager);
|
||||
const uri = Uri.file(dbLoc);
|
||||
const maybeDbItem = await importArchiveDatabase(
|
||||
uri.toString(true),
|
||||
extension.databaseManager,
|
||||
storagePath,
|
||||
() => {
|
||||
/**ignore progress */
|
||||
},
|
||||
token,
|
||||
);
|
||||
beforeAll(async () => {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("cliServer" in extension && "databaseManager" in extension) {
|
||||
cliServer = extension.cliServer;
|
||||
|
||||
if (!maybeDbItem) {
|
||||
throw new Error("Could not import database");
|
||||
}
|
||||
db = maybeDbItem.databaseUri.fsPath;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
cliServer.quiet = true;
|
||||
if (!(await cliServer.cliConstraints.supportsNewQueryServerForTests())) {
|
||||
supportNewQueryServer = false;
|
||||
}
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
qs = new QueryServerClient(
|
||||
{
|
||||
codeQlPath:
|
||||
(await extension.distributionManager.getCodeQlPathWithoutVersionCheck()) ||
|
||||
"",
|
||||
debug: false,
|
||||
cacheSize: 0,
|
||||
numThreads: 1,
|
||||
saveCache: false,
|
||||
timeoutSecs: 0,
|
||||
},
|
||||
cliServer,
|
||||
{
|
||||
contextStoragePath: tmpDir.name,
|
||||
logger: extLogger,
|
||||
},
|
||||
(task) =>
|
||||
task(nullProgressReporter, new CancellationTokenSource().token),
|
||||
);
|
||||
await qs.startQueryServer();
|
||||
|
||||
// Unlike the old query sevre the new one wants a database and the empty direcrtory is not valid.
|
||||
// Add a database, but make sure the database manager is empty first
|
||||
await cleanDatabases(extension.databaseManager);
|
||||
const uri = Uri.file(dbLoc);
|
||||
const maybeDbItem = await importArchiveDatabase(
|
||||
uri.toString(true),
|
||||
extension.databaseManager,
|
||||
storagePath,
|
||||
() => {
|
||||
/**ignore progress */
|
||||
},
|
||||
token,
|
||||
);
|
||||
|
||||
if (!maybeDbItem) {
|
||||
throw new Error("Could not import database");
|
||||
}
|
||||
db = maybeDbItem.databaseUri.fsPath;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -184,6 +173,10 @@ describe("using the new query server", function () {
|
||||
const parsedResults = new Checkpoint<void>();
|
||||
|
||||
it("should register the database", async () => {
|
||||
if (!supportNewQueryServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
await qs.sendRequest(
|
||||
messages.registerDatabases,
|
||||
{ databases: [db] },
|
||||
@@ -194,7 +187,11 @@ describe("using the new query server", function () {
|
||||
);
|
||||
});
|
||||
|
||||
it(`should be able to run query ${queryName}`, async function () {
|
||||
it(`should be able to run query ${queryName}`, async () => {
|
||||
if (!supportNewQueryServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const params: messages.RunQueryParams = {
|
||||
db,
|
||||
@@ -213,7 +210,7 @@ describe("using the new query server", function () {
|
||||
/**/
|
||||
},
|
||||
);
|
||||
expect(result.resultType).to.equal(QueryResultType.SUCCESS);
|
||||
expect(result.resultType).toBe(QueryResultType.SUCCESS);
|
||||
await evaluationSucceeded.resolve();
|
||||
} catch (e) {
|
||||
await evaluationSucceeded.reject(e as Error);
|
||||
@@ -221,7 +218,11 @@ describe("using the new query server", function () {
|
||||
});
|
||||
|
||||
const actualResultSets: ResultSets = {};
|
||||
it(`should be able to parse results of query ${queryName}`, async function () {
|
||||
it(`should be able to parse results of query ${queryName}`, async () => {
|
||||
if (!supportNewQueryServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
await evaluationSucceeded.done();
|
||||
const info = await cliServer.bqrsInfo(RESULTS_PATH);
|
||||
|
||||
@@ -235,16 +236,19 @@ describe("using the new query server", function () {
|
||||
await parsedResults.resolve();
|
||||
});
|
||||
|
||||
it(`should have correct results for query ${queryName}`, async function () {
|
||||
it(`should have correct results for query ${queryName}`, async () => {
|
||||
if (!supportNewQueryServer) {
|
||||
return;
|
||||
}
|
||||
|
||||
await parsedResults.done();
|
||||
expect(actualResultSets!).not.to.be.empty;
|
||||
expect(Object.keys(actualResultSets!).sort()).to.eql(
|
||||
expect(actualResultSets).not.toEqual({});
|
||||
expect(Object.keys(actualResultSets!).sort()).toEqual(
|
||||
Object.keys(queryTestCase.expectedResultSets).sort(),
|
||||
);
|
||||
for (const name in queryTestCase.expectedResultSets) {
|
||||
expect(actualResultSets![name]).to.eql(
|
||||
expect(actualResultSets![name]).toEqual(
|
||||
queryTestCase.expectedResultSets[name],
|
||||
`Results for query predicate ${name} do not match`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,43 +1,44 @@
|
||||
import * as sinon from "sinon";
|
||||
import { extensions, window } from "vscode";
|
||||
import { extensions, QuickPickItem, window } from "vscode";
|
||||
import * as path from "path";
|
||||
|
||||
import * as pq from "proxyquire";
|
||||
|
||||
import { CliVersionConstraint, CodeQLCliServer } from "../../cli";
|
||||
import { CodeQLCliServer } from "../../cli";
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { expect } from "chai";
|
||||
import { getErrorMessage } from "../../pure/helpers-pure";
|
||||
|
||||
const proxyquire = pq.noPreserveCache();
|
||||
import * as helpers from "../../helpers";
|
||||
import {
|
||||
handleDownloadPacks,
|
||||
handleInstallPackDependencies,
|
||||
} from "../../packaging";
|
||||
|
||||
describe("Packaging commands", function () {
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
|
||||
// up to 3 minutes per test
|
||||
this.timeout(3 * 60 * 1000);
|
||||
// up to 3 minutes per test
|
||||
jest.setTimeout(3 * 60 * 1000);
|
||||
|
||||
describe("Packaging commands", () => {
|
||||
let cli: CodeQLCliServer;
|
||||
let progress: sinon.SinonSpy;
|
||||
let quickPickSpy: sinon.SinonStub;
|
||||
let inputBoxSpy: sinon.SinonStub;
|
||||
let showAndLogErrorMessageSpy: sinon.SinonStub;
|
||||
let showAndLogInformationMessageSpy: sinon.SinonStub;
|
||||
let mod: any;
|
||||
const progress = jest.fn();
|
||||
let quickPickSpy: jest.SpiedFunction<typeof window.showQuickPick>;
|
||||
let inputBoxSpy: jest.SpiedFunction<typeof window.showInputBox>;
|
||||
let showAndLogErrorMessageSpy: jest.SpiedFunction<
|
||||
typeof helpers.showAndLogErrorMessage
|
||||
>;
|
||||
let showAndLogInformationMessageSpy: jest.SpiedFunction<
|
||||
typeof helpers.showAndLogInformationMessage
|
||||
>;
|
||||
|
||||
beforeEach(async function () {
|
||||
sandbox = sinon.createSandbox();
|
||||
progress = sandbox.spy();
|
||||
quickPickSpy = sandbox.stub(window, "showQuickPick");
|
||||
inputBoxSpy = sandbox.stub(window, "showInputBox");
|
||||
showAndLogErrorMessageSpy = sandbox.stub();
|
||||
showAndLogInformationMessageSpy = sandbox.stub();
|
||||
mod = proxyquire("../../packaging", {
|
||||
"./helpers": {
|
||||
showAndLogErrorMessage: showAndLogErrorMessageSpy,
|
||||
showAndLogInformationMessage: showAndLogInformationMessageSpy,
|
||||
},
|
||||
});
|
||||
beforeEach(async () => {
|
||||
quickPickSpy = jest
|
||||
.spyOn(window, "showQuickPick")
|
||||
.mockResolvedValue(undefined);
|
||||
inputBoxSpy = jest
|
||||
.spyOn(window, "showInputBox")
|
||||
.mockResolvedValue(undefined);
|
||||
showAndLogErrorMessageSpy = jest
|
||||
.spyOn(helpers, "showAndLogErrorMessage")
|
||||
.mockResolvedValue(undefined);
|
||||
showAndLogInformationMessageSpy = jest
|
||||
.spyOn(helpers, "showAndLogInformationMessage")
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
@@ -51,45 +52,41 @@ describe("Packaging commands", function () {
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
if (!(await cli.cliConstraints.supportsPackaging())) {
|
||||
console.log(
|
||||
`Packaging commands are not supported on CodeQL CLI v${CliVersionConstraint.CLI_VERSION_WITH_PACKAGING}. Skipping this test.`,
|
||||
);
|
||||
this.skip();
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
it("should download all core query packs", async () => {
|
||||
quickPickSpy.resolves("Download all core query packs");
|
||||
quickPickSpy.mockResolvedValue(
|
||||
"Download all core query packs" as unknown as QuickPickItem,
|
||||
);
|
||||
|
||||
await mod.handleDownloadPacks(cli, progress);
|
||||
expect(showAndLogInformationMessageSpy.firstCall.args[0]).to.contain(
|
||||
"Finished downloading packs.",
|
||||
await handleDownloadPacks(cli, progress);
|
||||
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Finished downloading packs."),
|
||||
);
|
||||
});
|
||||
|
||||
it("should download valid user-specified pack", async () => {
|
||||
quickPickSpy.resolves("Download custom specified pack");
|
||||
inputBoxSpy.resolves("codeql/csharp-solorigate-queries");
|
||||
quickPickSpy.mockResolvedValue(
|
||||
"Download custom specified pack" as unknown as QuickPickItem,
|
||||
);
|
||||
inputBoxSpy.mockResolvedValue("codeql/csharp-solorigate-queries");
|
||||
|
||||
await mod.handleDownloadPacks(cli, progress);
|
||||
expect(showAndLogInformationMessageSpy.firstCall.args[0]).to.contain(
|
||||
"Finished downloading packs.",
|
||||
await handleDownloadPacks(cli, progress);
|
||||
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Finished downloading packs."),
|
||||
);
|
||||
});
|
||||
|
||||
it("should show error when downloading invalid user-specified pack", async () => {
|
||||
quickPickSpy.resolves("Download custom specified pack");
|
||||
inputBoxSpy.resolves("foo/not-a-real-pack@0.0.1");
|
||||
quickPickSpy.mockResolvedValue(
|
||||
"Download custom specified pack" as unknown as QuickPickItem,
|
||||
);
|
||||
inputBoxSpy.mockResolvedValue("foo/not-a-real-pack@0.0.1");
|
||||
|
||||
await mod.handleDownloadPacks(cli, progress);
|
||||
await handleDownloadPacks(cli, progress);
|
||||
|
||||
expect(showAndLogErrorMessageSpy.firstCall.args[0]).to.contain(
|
||||
"Unable to download all packs.",
|
||||
expect(showAndLogErrorMessageSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Unable to download all packs."),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -98,16 +95,16 @@ describe("Packaging commands", function () {
|
||||
__dirname,
|
||||
"../../../src/vscode-tests/cli-integration/data",
|
||||
);
|
||||
quickPickSpy.resolves([
|
||||
quickPickSpy.mockResolvedValue([
|
||||
{
|
||||
label: "integration-test-queries-javascript",
|
||||
packRootDir: [rootDir],
|
||||
},
|
||||
]);
|
||||
] as unknown as QuickPickItem);
|
||||
|
||||
await mod.handleInstallPackDependencies(cli, progress);
|
||||
expect(showAndLogInformationMessageSpy.firstCall.args[0]).to.contain(
|
||||
"Finished installing pack dependencies.",
|
||||
await handleInstallPackDependencies(cli, progress);
|
||||
expect(showAndLogInformationMessageSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("Finished installing pack dependencies."),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -116,20 +113,20 @@ describe("Packaging commands", function () {
|
||||
__dirname,
|
||||
"../../../src/vscode-tests/cli-integration/data-invalid-pack",
|
||||
);
|
||||
quickPickSpy.resolves([
|
||||
quickPickSpy.mockResolvedValue([
|
||||
{
|
||||
label: "foo/bar",
|
||||
packRootDir: [rootDir],
|
||||
},
|
||||
]);
|
||||
] as unknown as QuickPickItem);
|
||||
|
||||
try {
|
||||
// expect this to throw an error
|
||||
await mod.handleInstallPackDependencies(cli, progress);
|
||||
await handleInstallPackDependencies(cli, progress);
|
||||
// This line should not be reached
|
||||
expect(true).to.be.false;
|
||||
expect(true).toBe(false);
|
||||
} catch (e) {
|
||||
expect(getErrorMessage(e)).to.contain(
|
||||
expect(getErrorMessage(e)).toContain(
|
||||
"Unable to install pack dependencies",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { fail } from "assert";
|
||||
import {
|
||||
CancellationToken,
|
||||
commands,
|
||||
@@ -6,10 +5,8 @@ import {
|
||||
extensions,
|
||||
Uri,
|
||||
} from "vscode";
|
||||
import * as sinon from "sinon";
|
||||
import * as path from "path";
|
||||
import * as fs from "fs-extra";
|
||||
import { expect } from "chai";
|
||||
import * as yaml from "js-yaml";
|
||||
|
||||
import { DatabaseItem, DatabaseManager } from "../../databases";
|
||||
@@ -17,27 +14,22 @@ import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { cleanDatabases, dbLoc, storagePath } from "./global.helper";
|
||||
import { importArchiveDatabase } from "../../databaseFetcher";
|
||||
import { CodeQLCliServer } from "../../cli";
|
||||
import { skipIfNoCodeQL } from "../ensureCli";
|
||||
import { describeWithCodeQL } from "../cli";
|
||||
import { tmpDir } from "../../helpers";
|
||||
import { createInitialQueryInfo } from "../../run-queries-shared";
|
||||
import { QueryRunner } from "../../queryRunner";
|
||||
|
||||
jest.setTimeout(20_000);
|
||||
|
||||
/**
|
||||
* Integration tests for queries
|
||||
*/
|
||||
describe("Queries", function () {
|
||||
this.timeout(20_000);
|
||||
|
||||
before(function () {
|
||||
skipIfNoCodeQL(this);
|
||||
});
|
||||
|
||||
describeWithCodeQL()("Queries", () => {
|
||||
let dbItem: DatabaseItem;
|
||||
let databaseManager: DatabaseManager;
|
||||
let cli: CodeQLCliServer;
|
||||
let qs: QueryRunner;
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
let progress: sinon.SinonSpy;
|
||||
const progress = jest.fn();
|
||||
let token: CancellationToken;
|
||||
let ctx: ExtensionContext;
|
||||
|
||||
@@ -46,124 +38,99 @@ describe("Queries", function () {
|
||||
let oldQlpackLockFile: string; // codeql v2.6.3 and earlier
|
||||
let qlFile: string;
|
||||
|
||||
beforeEach(async function () {
|
||||
this.timeout(20_000);
|
||||
|
||||
sandbox = sinon.createSandbox();
|
||||
|
||||
try {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("databaseManager" in extension) {
|
||||
databaseManager = extension.databaseManager;
|
||||
cli = extension.cliServer;
|
||||
qs = extension.qs;
|
||||
cli.quiet = true;
|
||||
ctx = extension.ctx;
|
||||
qlpackFile = `${ctx.storageUri?.fsPath}/quick-queries/qlpack.yml`;
|
||||
qlpackLockFile = `${ctx.storageUri?.fsPath}/quick-queries/codeql-pack.lock.yml`;
|
||||
oldQlpackLockFile = `${ctx.storageUri?.fsPath}/quick-queries/qlpack.lock.yml`;
|
||||
qlFile = `${ctx.storageUri?.fsPath}/quick-queries/quick-query.ql`;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
}
|
||||
|
||||
// Ensure we are starting from a clean slate.
|
||||
safeDel(qlFile);
|
||||
safeDel(qlpackFile);
|
||||
|
||||
progress = sandbox.spy();
|
||||
token = {} as CancellationToken;
|
||||
|
||||
// Add a database, but make sure the database manager is empty first
|
||||
await cleanDatabases(databaseManager);
|
||||
const uri = Uri.file(dbLoc);
|
||||
const maybeDbItem = await importArchiveDatabase(
|
||||
uri.toString(true),
|
||||
databaseManager,
|
||||
storagePath,
|
||||
progress,
|
||||
token,
|
||||
cli,
|
||||
beforeEach(async () => {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
if ("databaseManager" in extension) {
|
||||
databaseManager = extension.databaseManager;
|
||||
cli = extension.cliServer;
|
||||
qs = extension.qs;
|
||||
cli.quiet = true;
|
||||
ctx = extension.ctx;
|
||||
qlpackFile = `${ctx.storageUri?.fsPath}/quick-queries/qlpack.yml`;
|
||||
qlpackLockFile = `${ctx.storageUri?.fsPath}/quick-queries/codeql-pack.lock.yml`;
|
||||
oldQlpackLockFile = `${ctx.storageUri?.fsPath}/quick-queries/qlpack.lock.yml`;
|
||||
qlFile = `${ctx.storageUri?.fsPath}/quick-queries/quick-query.ql`;
|
||||
} else {
|
||||
throw new Error(
|
||||
"Extension not initialized. Make sure cli is downloaded and installed properly.",
|
||||
);
|
||||
|
||||
if (!maybeDbItem) {
|
||||
throw new Error("Could not import database");
|
||||
}
|
||||
dbItem = maybeDbItem;
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
|
||||
// Ensure we are starting from a clean slate.
|
||||
safeDel(qlFile);
|
||||
safeDel(qlpackFile);
|
||||
|
||||
token = {} as CancellationToken;
|
||||
|
||||
// Add a database, but make sure the database manager is empty first
|
||||
await cleanDatabases(databaseManager);
|
||||
const uri = Uri.file(dbLoc);
|
||||
const maybeDbItem = await importArchiveDatabase(
|
||||
uri.toString(true),
|
||||
databaseManager,
|
||||
storagePath,
|
||||
progress,
|
||||
token,
|
||||
cli,
|
||||
);
|
||||
|
||||
if (!maybeDbItem) {
|
||||
throw new Error("Could not import database");
|
||||
}
|
||||
dbItem = maybeDbItem;
|
||||
});
|
||||
|
||||
afterEach(async function () {
|
||||
this.timeout(20_000);
|
||||
try {
|
||||
sandbox.restore();
|
||||
safeDel(qlpackFile);
|
||||
safeDel(qlFile);
|
||||
await cleanDatabases(databaseManager);
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
afterEach(async () => {
|
||||
safeDel(qlpackFile);
|
||||
safeDel(qlFile);
|
||||
await cleanDatabases(databaseManager);
|
||||
});
|
||||
|
||||
it("should run a query", async () => {
|
||||
try {
|
||||
const queryPath = path.join(__dirname, "data", "simple-query.ql");
|
||||
const result = qs.compileAndRunQueryAgainstDatabase(
|
||||
dbItem,
|
||||
await mockInitialQueryInfo(queryPath),
|
||||
path.join(tmpDir.name, "mock-storage-path"),
|
||||
progress,
|
||||
token,
|
||||
);
|
||||
const queryPath = path.join(__dirname, "data", "simple-query.ql");
|
||||
const result = qs.compileAndRunQueryAgainstDatabase(
|
||||
dbItem,
|
||||
await mockInitialQueryInfo(queryPath),
|
||||
path.join(tmpDir.name, "mock-storage-path"),
|
||||
progress,
|
||||
token,
|
||||
);
|
||||
|
||||
// just check that the query was successful
|
||||
expect((await result).successful).to.eq(true);
|
||||
} catch (e) {
|
||||
console.error("Test Failed");
|
||||
fail(e as Error);
|
||||
}
|
||||
// just check that the query was successful
|
||||
expect((await result).successful).toBe(true);
|
||||
});
|
||||
|
||||
// Asserts a fix for bug https://github.com/github/vscode-codeql/issues/733
|
||||
it("should restart the database and run a query", async () => {
|
||||
try {
|
||||
await commands.executeCommand("codeQL.restartQueryServer");
|
||||
const queryPath = path.join(__dirname, "data", "simple-query.ql");
|
||||
const result = await qs.compileAndRunQueryAgainstDatabase(
|
||||
dbItem,
|
||||
await mockInitialQueryInfo(queryPath),
|
||||
path.join(tmpDir.name, "mock-storage-path"),
|
||||
progress,
|
||||
token,
|
||||
);
|
||||
await commands.executeCommand("codeQL.restartQueryServer");
|
||||
const queryPath = path.join(__dirname, "data", "simple-query.ql");
|
||||
const result = await qs.compileAndRunQueryAgainstDatabase(
|
||||
dbItem,
|
||||
await mockInitialQueryInfo(queryPath),
|
||||
path.join(tmpDir.name, "mock-storage-path"),
|
||||
progress,
|
||||
token,
|
||||
);
|
||||
|
||||
expect(result.successful).to.eq(true);
|
||||
} catch (e) {
|
||||
console.error("Test Failed");
|
||||
fail(e as Error);
|
||||
}
|
||||
expect(result.successful).toBe(true);
|
||||
});
|
||||
|
||||
it("should create a quick query", async () => {
|
||||
await commands.executeCommand("codeQL.quickQuery");
|
||||
|
||||
// should have created the quick query file and query pack file
|
||||
expect(fs.pathExistsSync(qlFile)).to.be.true;
|
||||
expect(fs.pathExistsSync(qlpackFile)).to.be.true;
|
||||
expect(fs.pathExistsSync(qlFile)).toBe(true);
|
||||
expect(fs.pathExistsSync(qlpackFile)).toBe(true);
|
||||
|
||||
const qlpackContents: any = await yaml.load(
|
||||
fs.readFileSync(qlpackFile, "utf8"),
|
||||
);
|
||||
// Should have chosen the js libraries
|
||||
expect(qlpackContents.dependencies["codeql/javascript-all"]).to.eq("*");
|
||||
expect(qlpackContents.dependencies["codeql/javascript-all"]).toBe("*");
|
||||
|
||||
// Should also have a codeql-pack.lock.yml file
|
||||
const packFileToUse = fs.pathExistsSync(qlpackLockFile)
|
||||
@@ -172,8 +139,9 @@ describe("Queries", function () {
|
||||
const qlpackLock: any = await yaml.load(
|
||||
fs.readFileSync(packFileToUse, "utf8"),
|
||||
);
|
||||
expect(!!qlpackLock.dependencies["codeql/javascript-all"].version).to.be
|
||||
.true;
|
||||
expect(!!qlpackLock.dependencies["codeql/javascript-all"].version).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("should avoid creating a quick query", async () => {
|
||||
@@ -192,7 +160,7 @@ describe("Queries", function () {
|
||||
await commands.executeCommand("codeQL.quickQuery");
|
||||
|
||||
// should not have created the quick query file because database schema hasn't changed
|
||||
expect(fs.readFileSync(qlFile, "utf8")).to.eq("xxx");
|
||||
expect(fs.readFileSync(qlFile, "utf8")).toBe("xxx");
|
||||
});
|
||||
|
||||
function safeDel(file: string) {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import { assert, expect } from "chai";
|
||||
import * as path from "path";
|
||||
import * as sinon from "sinon";
|
||||
import {
|
||||
CancellationTokenSource,
|
||||
commands,
|
||||
@@ -10,11 +8,10 @@ import {
|
||||
Uri,
|
||||
window,
|
||||
} from "vscode";
|
||||
import * as os from "os";
|
||||
import * as yaml from "js-yaml";
|
||||
|
||||
import { QlPack } from "../../../remote-queries/run-remote-query";
|
||||
import { CliVersionConstraint, CodeQLCliServer } from "../../../cli";
|
||||
import { CodeQLCliServer } from "../../../cli";
|
||||
import { CodeQLExtensionInterface } from "../../../extension";
|
||||
import {
|
||||
setRemoteControllerRepo,
|
||||
@@ -22,10 +19,9 @@ import {
|
||||
} from "../../../config";
|
||||
import { UserCancellationException } from "../../../commandRunner";
|
||||
import * as ghApiClient from "../../../remote-queries/gh-api/gh-api-client";
|
||||
import { lte } from "semver";
|
||||
import { Repository } from "../../../remote-queries/gh-api/repository";
|
||||
import { createMockExtensionContext } from "../../no-workspace";
|
||||
import { OutputChannelLogger } from "../../../logging";
|
||||
import { OutputChannelLogger } from "../../../common";
|
||||
import { RemoteQueriesSubmission } from "../../../remote-queries/shared/remote-queries";
|
||||
import { readBundledPack } from "../../utils/bundled-pack-helpers";
|
||||
import { RemoteQueriesManager } from "../../../remote-queries/remote-queries-manager";
|
||||
@@ -35,7 +31,10 @@ import {
|
||||
restoreWorkspaceReferences,
|
||||
} from "../global.helper";
|
||||
|
||||
describe("Remote queries", function () {
|
||||
// up to 3 minutes per test
|
||||
jest.setTimeout(3 * 60 * 1000);
|
||||
|
||||
describe("Remote queries", () => {
|
||||
const baseDir = path.join(
|
||||
__dirname,
|
||||
"../../../../src/vscode-tests/cli-integration",
|
||||
@@ -45,25 +44,22 @@ describe("Remote queries", function () {
|
||||
"data-remote-qlpack/qlpack.yml",
|
||||
).fsPath;
|
||||
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
|
||||
// up to 3 minutes per test
|
||||
this.timeout(3 * 60 * 1000);
|
||||
|
||||
let cli: CodeQLCliServer;
|
||||
let cancellationTokenSource: CancellationTokenSource;
|
||||
let progress: sinon.SinonSpy;
|
||||
let showQuickPickSpy: sinon.SinonStub;
|
||||
let getRepositoryFromNwoStub: sinon.SinonStub;
|
||||
const progress = jest.fn();
|
||||
let showQuickPickSpy: jest.SpiedFunction<typeof window.showQuickPick>;
|
||||
let getRepositoryFromNwoStub: jest.SpiedFunction<
|
||||
typeof ghApiClient.getRepositoryFromNwo
|
||||
>;
|
||||
let ctx: ExtensionContext;
|
||||
let logger: any;
|
||||
let remoteQueriesManager: RemoteQueriesManager;
|
||||
|
||||
let originalDeps: Record<string, string> | undefined;
|
||||
|
||||
// use `function` so we have access to `this`
|
||||
beforeEach(async function () {
|
||||
sandbox = sinon.createSandbox();
|
||||
beforeEach(async () => {
|
||||
showQuickPickSpy = jest.spyOn(window, "showQuickPick");
|
||||
getRepositoryFromNwoStub = jest.spyOn(ghApiClient, "getRepositoryFromNwo");
|
||||
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
@@ -80,13 +76,6 @@ describe("Remote queries", function () {
|
||||
|
||||
ctx = createMockExtensionContext();
|
||||
|
||||
if (!(await cli.cliConstraints.supportsRemoteQueries())) {
|
||||
console.log(
|
||||
`Remote queries are not supported on CodeQL CLI v${CliVersionConstraint.CLI_VERSION_REMOTE_QUERIES}. Skipping this test.`,
|
||||
);
|
||||
this.skip();
|
||||
}
|
||||
|
||||
logger = new OutputChannelLogger("test-logger");
|
||||
remoteQueriesManager = new RemoteQueriesManager(
|
||||
ctx,
|
||||
@@ -97,16 +86,12 @@ describe("Remote queries", function () {
|
||||
|
||||
cancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
progress = sandbox.spy();
|
||||
// Should not have asked for a language
|
||||
showQuickPickSpy = sandbox
|
||||
.stub(window, "showQuickPick")
|
||||
.onFirstCall()
|
||||
.resolves({
|
||||
showQuickPickSpy
|
||||
.mockResolvedValueOnce({
|
||||
repositories: ["github/vscode-codeql"],
|
||||
} as unknown as QuickPickItem)
|
||||
.onSecondCall()
|
||||
.resolves("javascript" as unknown as QuickPickItem);
|
||||
.mockResolvedValue("javascript" as unknown as QuickPickItem);
|
||||
|
||||
const dummyRepository: Repository = {
|
||||
id: 123,
|
||||
@@ -114,9 +99,7 @@ describe("Remote queries", function () {
|
||||
full_name: "github/vscode-codeql",
|
||||
private: false,
|
||||
};
|
||||
getRepositoryFromNwoStub = sandbox
|
||||
.stub(ghApiClient, "getRepositoryFromNwo")
|
||||
.resolves(dummyRepository);
|
||||
getRepositoryFromNwoStub.mockResolvedValue(dummyRepository);
|
||||
|
||||
// always run in the vscode-codeql repo
|
||||
await setRemoteControllerRepo("github/vscode-codeql");
|
||||
@@ -130,7 +113,7 @@ describe("Remote queries", function () {
|
||||
request: undefined,
|
||||
}),
|
||||
} as unknown as Credentials;
|
||||
sandbox.stub(Credentials, "initialize").resolves(mockCredentials);
|
||||
jest.spyOn(Credentials, "initialize").mockResolvedValue(mockCredentials);
|
||||
|
||||
// Only new version support `${workspace}` in qlpack.yml
|
||||
originalDeps = await fixWorkspaceReferences(
|
||||
@@ -140,25 +123,24 @@ describe("Remote queries", function () {
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
sandbox.restore();
|
||||
await restoreWorkspaceReferences(qlpackFileWithWorkspaceRefs, originalDeps);
|
||||
});
|
||||
|
||||
describe("runRemoteQuery", () => {
|
||||
let mockSubmitRemoteQueries: sinon.SinonStub;
|
||||
let executeCommandSpy: sinon.SinonStub;
|
||||
let mockSubmitRemoteQueries: jest.SpiedFunction<
|
||||
typeof ghApiClient.submitRemoteQueries
|
||||
>;
|
||||
let executeCommandSpy: jest.SpiedFunction<typeof commands.executeCommand>;
|
||||
|
||||
beforeEach(() => {
|
||||
executeCommandSpy = sandbox
|
||||
.stub(commands, "executeCommand")
|
||||
.callThrough();
|
||||
|
||||
mockSubmitRemoteQueries = sandbox
|
||||
.stub(ghApiClient, "submitRemoteQueries")
|
||||
.resolves({
|
||||
mockSubmitRemoteQueries = jest
|
||||
.spyOn(ghApiClient, "submitRemoteQueries")
|
||||
.mockResolvedValue({
|
||||
workflow_run_id: 20,
|
||||
repositories_queried: ["octodemo/hello-world-1"],
|
||||
});
|
||||
|
||||
executeCommandSpy = jest.spyOn(commands, "executeCommand");
|
||||
});
|
||||
|
||||
it("should run a remote query that is part of a qlpack", async () => {
|
||||
@@ -170,56 +152,49 @@ describe("Remote queries", function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockSubmitRemoteQueries).to.have.been.calledOnce;
|
||||
expect(executeCommandSpy).to.have.been.calledWith(
|
||||
expect(mockSubmitRemoteQueries).toBeCalledTimes(1);
|
||||
expect(executeCommandSpy).toBeCalledWith(
|
||||
"codeQL.monitorRemoteQuery",
|
||||
sinon.match.string,
|
||||
sinon.match.has("queryFilePath", fileUri.fsPath),
|
||||
expect.any(String),
|
||||
expect.objectContaining({ queryFilePath: fileUri.fsPath }),
|
||||
);
|
||||
|
||||
const request: RemoteQueriesSubmission =
|
||||
mockSubmitRemoteQueries.getCall(0).lastArg;
|
||||
mockSubmitRemoteQueries.mock.calls[0][1];
|
||||
|
||||
const packFS = await readBundledPack(request.queryPack);
|
||||
|
||||
// to retrieve the list of repositories
|
||||
expect(showQuickPickSpy).to.have.been.calledOnce;
|
||||
expect(showQuickPickSpy).toBeCalledTimes(1);
|
||||
|
||||
expect(getRepositoryFromNwoStub).to.have.been.calledOnce;
|
||||
expect(getRepositoryFromNwoStub).toBeCalledTimes(1);
|
||||
|
||||
// check a few files that we know should exist and others that we know should not
|
||||
expect(packFS.fileExists("in-pack.ql")).to.be.true;
|
||||
expect(packFS.fileExists("lib.qll")).to.be.true;
|
||||
expect(packFS.fileExists("qlpack.yml")).to.be.true;
|
||||
expect(packFS.fileExists("in-pack.ql")).toBe(true);
|
||||
expect(packFS.fileExists("lib.qll")).toBe(true);
|
||||
expect(packFS.fileExists("qlpack.yml")).toBe(true);
|
||||
|
||||
// depending on the cli version, we should have one of these files
|
||||
expect(
|
||||
packFS.fileExists("qlpack.lock.yml") ||
|
||||
packFS.fileExists("codeql-pack.lock.yml"),
|
||||
).to.be.true;
|
||||
expect(packFS.fileExists("not-in-pack.ql")).to.be.false;
|
||||
).toBe(true);
|
||||
expect(packFS.fileExists("not-in-pack.ql")).toBe(false);
|
||||
|
||||
// should have generated a correct qlpack file
|
||||
const qlpackContents: any = yaml.load(
|
||||
packFS.fileContents("qlpack.yml").toString("utf-8"),
|
||||
);
|
||||
expect(qlpackContents.name).to.equal("codeql-remote/query");
|
||||
expect(qlpackContents.name).toBe("codeql-remote/query");
|
||||
|
||||
verifyQlPack(
|
||||
"in-pack.ql",
|
||||
packFS.fileContents("qlpack.yml"),
|
||||
"0.0.0",
|
||||
await pathSerializationBroken(),
|
||||
);
|
||||
verifyQlPack("in-pack.ql", packFS.fileContents("qlpack.yml"), "0.0.0");
|
||||
|
||||
const libraryDir = ".codeql/libraries/codeql";
|
||||
const packNames = packFS.directoryContents(libraryDir).sort();
|
||||
|
||||
// check dependencies.
|
||||
// 2.7.4 and earlier have ['javascript-all', 'javascript-upgrades']
|
||||
// later only have ['javascript-all']. ensure this test can handle either
|
||||
expect(packNames.length).to.be.lessThan(3).and.greaterThan(0);
|
||||
expect(packNames[0]).to.deep.equal("javascript-all");
|
||||
expect(packNames).toContain("javascript-all");
|
||||
expect(packNames.length).toBeLessThan(3);
|
||||
});
|
||||
|
||||
it("should run a remote query that is not part of a qlpack", async () => {
|
||||
@@ -231,61 +206,52 @@ describe("Remote queries", function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockSubmitRemoteQueries).to.have.been.calledOnce;
|
||||
expect(executeCommandSpy).to.have.been.calledWith(
|
||||
expect(mockSubmitRemoteQueries).toBeCalledTimes(1);
|
||||
expect(executeCommandSpy).toBeCalledWith(
|
||||
"codeQL.monitorRemoteQuery",
|
||||
sinon.match.string,
|
||||
sinon.match.has("queryFilePath", fileUri.fsPath),
|
||||
expect.any(String),
|
||||
expect.objectContaining({ queryFilePath: fileUri.fsPath }),
|
||||
);
|
||||
|
||||
const request: RemoteQueriesSubmission =
|
||||
mockSubmitRemoteQueries.getCall(0).lastArg;
|
||||
mockSubmitRemoteQueries.mock.calls[0][1];
|
||||
|
||||
const packFS = await readBundledPack(request.queryPack);
|
||||
|
||||
// to retrieve the list of repositories
|
||||
// and a second time to ask for the language
|
||||
expect(showQuickPickSpy).to.have.been.calledTwice;
|
||||
expect(showQuickPickSpy).toBeCalledTimes(2);
|
||||
|
||||
expect(getRepositoryFromNwoStub).to.have.been.calledOnce;
|
||||
expect(getRepositoryFromNwoStub).toBeCalledTimes(1);
|
||||
|
||||
// check a few files that we know should exist and others that we know should not
|
||||
expect(packFS.fileExists("in-pack.ql")).to.be.true;
|
||||
expect(packFS.fileExists("qlpack.yml")).to.be.true;
|
||||
expect(packFS.fileExists("in-pack.ql")).toBe(true);
|
||||
expect(packFS.fileExists("qlpack.yml")).toBe(true);
|
||||
// depending on the cli version, we should have one of these files
|
||||
expect(
|
||||
packFS.fileExists("qlpack.lock.yml") ||
|
||||
packFS.fileExists("codeql-pack.lock.yml"),
|
||||
).to.be.true;
|
||||
expect(packFS.fileExists("lib.qll")).to.be.false;
|
||||
expect(packFS.fileExists("not-in-pack.ql")).to.be.false;
|
||||
).toBe(true);
|
||||
expect(packFS.fileExists("lib.qll")).toBe(false);
|
||||
expect(packFS.fileExists("not-in-pack.ql")).toBe(false);
|
||||
|
||||
// the compiled pack
|
||||
verifyQlPack(
|
||||
"in-pack.ql",
|
||||
packFS.fileContents("qlpack.yml"),
|
||||
"0.0.0",
|
||||
await pathSerializationBroken(),
|
||||
);
|
||||
verifyQlPack("in-pack.ql", packFS.fileContents("qlpack.yml"), "0.0.0");
|
||||
|
||||
// should have generated a correct qlpack file
|
||||
const qlpackContents: any = yaml.load(
|
||||
packFS.fileContents("qlpack.yml").toString("utf-8"),
|
||||
);
|
||||
expect(qlpackContents.name).to.equal("codeql-remote/query");
|
||||
expect(qlpackContents.version).to.equal("0.0.0");
|
||||
expect(qlpackContents.dependencies?.["codeql/javascript-all"]).to.equal(
|
||||
"*",
|
||||
);
|
||||
expect(qlpackContents.name).toBe("codeql-remote/query");
|
||||
expect(qlpackContents.version).toBe("0.0.0");
|
||||
expect(qlpackContents.dependencies?.["codeql/javascript-all"]).toBe("*");
|
||||
|
||||
const libraryDir = ".codeql/libraries/codeql";
|
||||
const packNames = packFS.directoryContents(libraryDir).sort();
|
||||
|
||||
// check dependencies.
|
||||
// 2.7.4 and earlier have ['javascript-all', 'javascript-upgrades']
|
||||
// later only have ['javascript-all']. ensure this test can handle either
|
||||
expect(packNames.length).to.be.lessThan(3).and.greaterThan(0);
|
||||
expect(packNames[0]).to.deep.equal("javascript-all");
|
||||
expect(packNames).toContain("javascript-all");
|
||||
expect(packNames.length).toBeLessThan(3);
|
||||
});
|
||||
|
||||
it("should run a remote query that is nested inside a qlpack", async () => {
|
||||
@@ -297,60 +263,55 @@ describe("Remote queries", function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockSubmitRemoteQueries).to.have.been.calledOnce;
|
||||
expect(executeCommandSpy).to.have.been.calledWith(
|
||||
expect(mockSubmitRemoteQueries).toBeCalledTimes(1);
|
||||
expect(executeCommandSpy).toBeCalledWith(
|
||||
"codeQL.monitorRemoteQuery",
|
||||
sinon.match.string,
|
||||
sinon.match.has("queryFilePath", fileUri.fsPath),
|
||||
expect.any(String),
|
||||
expect.objectContaining({ queryFilePath: fileUri.fsPath }),
|
||||
);
|
||||
|
||||
const request: RemoteQueriesSubmission =
|
||||
mockSubmitRemoteQueries.getCall(0).lastArg;
|
||||
mockSubmitRemoteQueries.mock.calls[0][1];
|
||||
|
||||
const packFS = await readBundledPack(request.queryPack);
|
||||
|
||||
// to retrieve the list of repositories
|
||||
expect(showQuickPickSpy).to.have.been.calledOnce;
|
||||
expect(showQuickPickSpy).toBeCalledTimes(1);
|
||||
|
||||
expect(getRepositoryFromNwoStub).to.have.been.calledOnce;
|
||||
expect(getRepositoryFromNwoStub).toBeCalledTimes(1);
|
||||
|
||||
// check a few files that we know should exist and others that we know should not
|
||||
expect(packFS.fileExists("subfolder/in-pack.ql")).to.be.true;
|
||||
expect(packFS.fileExists("qlpack.yml")).to.be.true;
|
||||
expect(packFS.fileExists("subfolder/in-pack.ql")).toBe(true);
|
||||
expect(packFS.fileExists("qlpack.yml")).toBe(true);
|
||||
// depending on the cli version, we should have one of these files
|
||||
expect(
|
||||
packFS.fileExists("qlpack.lock.yml") ||
|
||||
packFS.fileExists("codeql-pack.lock.yml"),
|
||||
).to.be.true;
|
||||
expect(packFS.fileExists("otherfolder/lib.qll")).to.be.true;
|
||||
expect(packFS.fileExists("not-in-pack.ql")).to.be.false;
|
||||
).toBe(true);
|
||||
expect(packFS.fileExists("otherfolder/lib.qll")).toBe(true);
|
||||
expect(packFS.fileExists("not-in-pack.ql")).toBe(false);
|
||||
|
||||
// the compiled pack
|
||||
verifyQlPack(
|
||||
"subfolder/in-pack.ql",
|
||||
packFS.fileContents("qlpack.yml"),
|
||||
"0.0.0",
|
||||
await pathSerializationBroken(),
|
||||
);
|
||||
|
||||
// should have generated a correct qlpack file
|
||||
const qlpackContents: any = yaml.load(
|
||||
packFS.fileContents("qlpack.yml").toString("utf-8"),
|
||||
);
|
||||
expect(qlpackContents.name).to.equal("codeql-remote/query");
|
||||
expect(qlpackContents.version).to.equal("0.0.0");
|
||||
expect(qlpackContents.dependencies?.["codeql/javascript-all"]).to.equal(
|
||||
"*",
|
||||
);
|
||||
expect(qlpackContents.name).toBe("codeql-remote/query");
|
||||
expect(qlpackContents.version).toBe("0.0.0");
|
||||
expect(qlpackContents.dependencies?.["codeql/javascript-all"]).toBe("*");
|
||||
|
||||
const libraryDir = ".codeql/libraries/codeql";
|
||||
const packNames = packFS.directoryContents(libraryDir).sort();
|
||||
|
||||
// check dependencies.
|
||||
// 2.7.4 and earlier have ['javascript-all', 'javascript-upgrades']
|
||||
// later only have ['javascript-all']. ensure this test can handle either
|
||||
expect(packNames.length).to.be.lessThan(3).and.greaterThan(0);
|
||||
expect(packNames[0]).to.deep.equal("javascript-all");
|
||||
expect(packNames).toContain("javascript-all");
|
||||
expect(packNames.length).toBeLessThan(3);
|
||||
});
|
||||
|
||||
it("should cancel a run before uploading", async () => {
|
||||
@@ -364,12 +325,7 @@ describe("Remote queries", function () {
|
||||
|
||||
cancellationTokenSource.cancel();
|
||||
|
||||
try {
|
||||
await promise;
|
||||
assert.fail("should have thrown");
|
||||
} catch (e) {
|
||||
expect(e).to.be.instanceof(UserCancellationException);
|
||||
}
|
||||
await expect(promise).rejects.toThrow(UserCancellationException);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -377,19 +333,13 @@ describe("Remote queries", function () {
|
||||
queryPath: string,
|
||||
contents: Buffer,
|
||||
packVersion: string,
|
||||
pathSerializationBroken: boolean,
|
||||
) {
|
||||
const qlPack = yaml.load(contents.toString("utf-8")) as QlPack;
|
||||
|
||||
if (pathSerializationBroken) {
|
||||
// the path serialization is broken, so we force it to be the path in the pack to be same as the query path
|
||||
qlPack.defaultSuite![1].query = queryPath;
|
||||
}
|
||||
|
||||
// don't check the build metadata since it is variable
|
||||
delete (qlPack as any).buildMetadata;
|
||||
|
||||
expect(qlPack).to.deep.equal({
|
||||
expect(qlPack).toEqual({
|
||||
name: "codeql-remote/query",
|
||||
version: packVersion,
|
||||
dependencies: {
|
||||
@@ -407,15 +357,6 @@ describe("Remote queries", function () {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* In version 2.7.2 and earlier, relative paths were not serialized correctly inside the qlpack.yml file.
|
||||
* So, ignore part of the test for these versions.
|
||||
*
|
||||
* @returns true if path serialization is broken in this run
|
||||
*/
|
||||
async function pathSerializationBroken() {
|
||||
return lte(await cli.getVersion(), "2.7.2") && os.platform() === "win32";
|
||||
}
|
||||
function getFile(file: string): Uri {
|
||||
return Uri.file(path.join(baseDir, file));
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,3 @@
|
||||
import * as sinon from "sinon";
|
||||
import { expect } from "chai";
|
||||
import { CancellationTokenSource, commands, extensions } from "vscode";
|
||||
import { CodeQLExtensionInterface } from "../../../extension";
|
||||
import * as config from "../../../config";
|
||||
@@ -29,58 +27,63 @@ import { Credentials } from "../../../authentication";
|
||||
import { createMockVariantAnalysis } from "../../factories/remote-queries/shared/variant-analysis";
|
||||
import { VariantAnalysisManager } from "../../../remote-queries/variant-analysis-manager";
|
||||
|
||||
describe("Variant Analysis Monitor", async function () {
|
||||
this.timeout(60000);
|
||||
jest.setTimeout(60_000);
|
||||
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
describe("Variant Analysis Monitor", () => {
|
||||
let extension: CodeQLExtensionInterface | Record<string, never>;
|
||||
let mockGetVariantAnalysis: sinon.SinonStub;
|
||||
let mockGetVariantAnalysis: jest.SpiedFunction<
|
||||
typeof ghApiClient.getVariantAnalysis
|
||||
>;
|
||||
let cancellationTokenSource: CancellationTokenSource;
|
||||
let variantAnalysisMonitor: VariantAnalysisMonitor;
|
||||
let shouldCancelMonitor: sinon.SinonStub;
|
||||
let shouldCancelMonitor: jest.Mock<Promise<boolean>, [number]>;
|
||||
let variantAnalysis: VariantAnalysis;
|
||||
let variantAnalysisManager: VariantAnalysisManager;
|
||||
let mockGetDownloadResult: sinon.SinonStub;
|
||||
let mockGetDownloadResult: jest.SpiedFunction<
|
||||
typeof variantAnalysisManager.autoDownloadVariantAnalysisResult
|
||||
>;
|
||||
|
||||
const onVariantAnalysisChangeSpy = jest.fn();
|
||||
|
||||
beforeEach(async () => {
|
||||
sandbox = sinon.createSandbox();
|
||||
sandbox.stub(config, "isVariantAnalysisLiveResultsEnabled").returns(false);
|
||||
shouldCancelMonitor = sinon.stub();
|
||||
jest
|
||||
.spyOn(config, "isVariantAnalysisLiveResultsEnabled")
|
||||
.mockReturnValue(false);
|
||||
|
||||
cancellationTokenSource = new CancellationTokenSource();
|
||||
|
||||
variantAnalysis = createMockVariantAnalysis({});
|
||||
|
||||
try {
|
||||
extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
variantAnalysisMonitor = new VariantAnalysisMonitor(
|
||||
extension.ctx,
|
||||
shouldCancelMonitor,
|
||||
);
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
shouldCancelMonitor = jest.fn();
|
||||
|
||||
extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
variantAnalysisMonitor = new VariantAnalysisMonitor(
|
||||
extension.ctx,
|
||||
shouldCancelMonitor,
|
||||
);
|
||||
variantAnalysisMonitor.onVariantAnalysisChange(onVariantAnalysisChangeSpy);
|
||||
|
||||
variantAnalysisManager = extension.variantAnalysisManager;
|
||||
mockGetDownloadResult = sandbox.stub(
|
||||
variantAnalysisManager,
|
||||
"autoDownloadVariantAnalysisResult",
|
||||
);
|
||||
mockGetDownloadResult = jest
|
||||
.spyOn(variantAnalysisManager, "autoDownloadVariantAnalysisResult")
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
mockGetVariantAnalysis = jest
|
||||
.spyOn(ghApiClient, "getVariantAnalysis")
|
||||
.mockRejectedValue(new Error("Not mocked"));
|
||||
|
||||
limitNumberOfAttemptsToMonitor();
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
describe("when credentials are invalid", async () => {
|
||||
describe("when credentials are invalid", () => {
|
||||
beforeEach(async () => {
|
||||
sandbox.stub(Credentials, "initialize").resolves(undefined);
|
||||
jest
|
||||
.spyOn(Credentials, "initialize")
|
||||
.mockResolvedValue(undefined as unknown as Credentials);
|
||||
});
|
||||
|
||||
it("should return early if credentials are wrong", async () => {
|
||||
@@ -90,92 +93,78 @@ describe("Variant Analysis Monitor", async function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
} catch (error: any) {
|
||||
expect(error.message).to.equal("Error authenticating with GitHub");
|
||||
expect(error.message).toBe("Error authenticating with GitHub");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("when credentials are valid", async () => {
|
||||
describe("when credentials are valid", () => {
|
||||
beforeEach(async () => {
|
||||
const mockCredentials = {
|
||||
getOctokit: () =>
|
||||
Promise.resolve({
|
||||
request: mockGetVariantAnalysis,
|
||||
request: jest.fn(),
|
||||
}),
|
||||
} as unknown as Credentials;
|
||||
sandbox.stub(Credentials, "initialize").resolves(mockCredentials);
|
||||
jest.spyOn(Credentials, "initialize").mockResolvedValue(mockCredentials);
|
||||
});
|
||||
|
||||
it("should return early if variant analysis is cancelled", async () => {
|
||||
cancellationTokenSource.cancel();
|
||||
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(result).to.eql({ status: "Canceled" });
|
||||
expect(onVariantAnalysisChangeSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return early if variant analysis should be cancelled", async () => {
|
||||
shouldCancelMonitor.resolves(true);
|
||||
shouldCancelMonitor.mockResolvedValue(true);
|
||||
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(result).to.eql({ status: "Canceled" });
|
||||
expect(onVariantAnalysisChangeSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
describe("when the variant analysis fails", async () => {
|
||||
describe("when the variant analysis fails", () => {
|
||||
let mockFailedApiResponse: VariantAnalysisApiResponse;
|
||||
|
||||
beforeEach(async function () {
|
||||
beforeEach(async () => {
|
||||
mockFailedApiResponse = createFailedMockApiResponse();
|
||||
mockGetVariantAnalysis = sandbox
|
||||
.stub(ghApiClient, "getVariantAnalysis")
|
||||
.resolves(mockFailedApiResponse);
|
||||
mockGetVariantAnalysis.mockResolvedValue(mockFailedApiResponse);
|
||||
});
|
||||
|
||||
it("should mark as failed locally and stop monitoring", async () => {
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
it("should mark as failed and stop monitoring", async () => {
|
||||
await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockGetVariantAnalysis.calledOnce).to.be.true;
|
||||
expect(result.status).to.eql("Completed");
|
||||
expect(result.variantAnalysis?.status).to.equal(
|
||||
VariantAnalysisStatus.Failed,
|
||||
);
|
||||
expect(result.variantAnalysis?.failureReason).to.equal(
|
||||
processFailureReason(
|
||||
mockFailedApiResponse.failure_reason as VariantAnalysisFailureReason,
|
||||
),
|
||||
);
|
||||
});
|
||||
expect(mockGetVariantAnalysis).toHaveBeenCalledTimes(1);
|
||||
|
||||
it("should emit `onVariantAnalysisChange`", async () => {
|
||||
const spy = sandbox.spy();
|
||||
variantAnalysisMonitor.onVariantAnalysisChange(spy);
|
||||
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
expect(onVariantAnalysisChangeSpy).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
status: VariantAnalysisStatus.Failed,
|
||||
failureReason: processFailureReason(
|
||||
mockFailedApiResponse.failure_reason as VariantAnalysisFailureReason,
|
||||
),
|
||||
}),
|
||||
);
|
||||
|
||||
expect(spy).to.have.been.calledWith(result.variantAnalysis);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the variant analysis is in progress", async () => {
|
||||
describe("when the variant analysis is in progress", () => {
|
||||
let mockApiResponse: VariantAnalysisApiResponse;
|
||||
let scannedRepos: ApiVariantAnalysisScannedRepository[];
|
||||
let succeededRepos: ApiVariantAnalysisScannedRepository[];
|
||||
|
||||
describe("when there are successfully scanned repos", async () => {
|
||||
beforeEach(async function () {
|
||||
describe("when there are successfully scanned repos", () => {
|
||||
beforeEach(async () => {
|
||||
scannedRepos = createMockScannedRepos([
|
||||
"pending",
|
||||
"pending",
|
||||
@@ -186,47 +175,32 @@ describe("Variant Analysis Monitor", async function () {
|
||||
"succeeded",
|
||||
]);
|
||||
mockApiResponse = createMockApiResponse("succeeded", scannedRepos);
|
||||
mockGetVariantAnalysis = sandbox
|
||||
.stub(ghApiClient, "getVariantAnalysis")
|
||||
.resolves(mockApiResponse);
|
||||
mockGetVariantAnalysis.mockResolvedValue(mockApiResponse);
|
||||
succeededRepos = scannedRepos.filter(
|
||||
(r) => r.analysis_status === "succeeded",
|
||||
);
|
||||
});
|
||||
|
||||
it("should succeed and return a list of scanned repo ids", async () => {
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(result.status).to.equal("Completed");
|
||||
expect(result.scannedReposDownloaded).to.eql(
|
||||
succeededRepos.map((r) => r.repository.id),
|
||||
);
|
||||
});
|
||||
|
||||
it("should trigger a download extension command for each repo", async () => {
|
||||
const succeededRepos = scannedRepos.filter(
|
||||
(r) => r.analysis_status === "succeeded",
|
||||
);
|
||||
const commandSpy = sandbox.spy(commands, "executeCommand");
|
||||
const commandSpy = jest
|
||||
.spyOn(commands, "executeCommand")
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(commandSpy).to.have.callCount(succeededRepos.length);
|
||||
expect(commandSpy).toBeCalledTimes(succeededRepos.length);
|
||||
|
||||
succeededRepos.forEach((succeededRepo, index) => {
|
||||
expect(commandSpy.getCall(index).args[0]).to.eq(
|
||||
expect(commandSpy).toHaveBeenNthCalledWith(
|
||||
index + 1,
|
||||
"codeQL.autoDownloadVariantAnalysisResult",
|
||||
);
|
||||
expect(commandSpy.getCall(index).args[1]).to.deep.eq(
|
||||
processScannedRepository(succeededRepo),
|
||||
);
|
||||
expect(commandSpy.getCall(index).args[2]).to.deep.eq(
|
||||
processUpdatedVariantAnalysis(variantAnalysis, mockApiResponse),
|
||||
);
|
||||
});
|
||||
@@ -238,40 +212,39 @@ describe("Variant Analysis Monitor", async function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockGetDownloadResult).to.have.callCount(
|
||||
succeededRepos.length,
|
||||
);
|
||||
expect(mockGetDownloadResult).toBeCalledTimes(succeededRepos.length);
|
||||
|
||||
succeededRepos.forEach((succeededRepo, index) => {
|
||||
expect(mockGetDownloadResult.getCall(index).args[0]).to.deep.eq(
|
||||
expect(mockGetDownloadResult).toHaveBeenNthCalledWith(
|
||||
index + 1,
|
||||
processScannedRepository(succeededRepo),
|
||||
);
|
||||
expect(mockGetDownloadResult.getCall(index).args[1]).to.deep.eq(
|
||||
processUpdatedVariantAnalysis(variantAnalysis, mockApiResponse),
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("when there are only in progress repos", async () => {
|
||||
describe("when there are only in progress repos", () => {
|
||||
let scannedRepos: ApiVariantAnalysisScannedRepository[];
|
||||
|
||||
beforeEach(async function () {
|
||||
beforeEach(async () => {
|
||||
scannedRepos = createMockScannedRepos(["pending", "in_progress"]);
|
||||
mockApiResponse = createMockApiResponse("in_progress", scannedRepos);
|
||||
mockGetVariantAnalysis = sandbox
|
||||
.stub(ghApiClient, "getVariantAnalysis")
|
||||
.resolves(mockApiResponse);
|
||||
mockGetVariantAnalysis.mockResolvedValue(mockApiResponse);
|
||||
});
|
||||
|
||||
it("should succeed and return an empty list of scanned repo ids", async () => {
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
it("should succeed and not download any repos via a command", async () => {
|
||||
const commandSpy = jest
|
||||
.spyOn(commands, "executeCommand")
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(result.status).to.equal("Completed");
|
||||
expect(result.scannedReposDownloaded).to.eql([]);
|
||||
expect(commandSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should not try to download any repos", async () => {
|
||||
@@ -280,27 +253,15 @@ describe("Variant Analysis Monitor", async function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockGetDownloadResult).to.not.have.been.called;
|
||||
expect(mockGetDownloadResult).not.toBeCalled();
|
||||
});
|
||||
});
|
||||
|
||||
describe("when there are no repos to scan", async () => {
|
||||
beforeEach(async function () {
|
||||
describe("when there are no repos to scan", () => {
|
||||
beforeEach(async () => {
|
||||
scannedRepos = [];
|
||||
mockApiResponse = createMockApiResponse("succeeded", scannedRepos);
|
||||
mockGetVariantAnalysis = sandbox
|
||||
.stub(ghApiClient, "getVariantAnalysis")
|
||||
.resolves(mockApiResponse);
|
||||
});
|
||||
|
||||
it("should succeed and return an empty list of scanned repo ids", async () => {
|
||||
const result = await variantAnalysisMonitor.monitorVariantAnalysis(
|
||||
variantAnalysis,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(result.status).to.equal("Completed");
|
||||
expect(result.scannedReposDownloaded).to.eql([]);
|
||||
mockGetVariantAnalysis.mockResolvedValue(mockApiResponse);
|
||||
});
|
||||
|
||||
it("should not try to download any repos", async () => {
|
||||
@@ -309,7 +270,7 @@ describe("Variant Analysis Monitor", async function () {
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
||||
expect(mockGetDownloadResult).to.not.have.been.called;
|
||||
expect(mockGetDownloadResult).not.toBeCalled();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import * as sinon from "sinon";
|
||||
import { expect } from "chai";
|
||||
import { extensions } from "vscode";
|
||||
import { CodeQLExtensionInterface } from "../../../extension";
|
||||
import { logger } from "../../../logging";
|
||||
import { extLogger } from "../../../common";
|
||||
import { Credentials } from "../../../authentication";
|
||||
import * as fs from "fs-extra";
|
||||
import * as path from "path";
|
||||
@@ -15,49 +13,37 @@ import * as ghApiClient from "../../../remote-queries/gh-api/gh-api-client";
|
||||
import { createMockVariantAnalysisRepositoryTask } from "../../factories/remote-queries/shared/variant-analysis-repo-tasks";
|
||||
import { VariantAnalysisRepositoryTask } from "../../../remote-queries/shared/variant-analysis";
|
||||
|
||||
describe(VariantAnalysisResultsManager.name, function () {
|
||||
this.timeout(10000);
|
||||
jest.setTimeout(10_000);
|
||||
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
describe(VariantAnalysisResultsManager.name, () => {
|
||||
let cli: CodeQLCliServer;
|
||||
let variantAnalysisId: number;
|
||||
let variantAnalysisResultsManager: VariantAnalysisResultsManager;
|
||||
let getVariantAnalysisRepoResultStub: sinon.SinonStub;
|
||||
|
||||
beforeEach(async () => {
|
||||
sandbox = sinon.createSandbox();
|
||||
sandbox.stub(logger, "log");
|
||||
sandbox.stub(fs, "mkdirSync");
|
||||
sandbox.stub(fs, "writeFile");
|
||||
jest.spyOn(extLogger, "log").mockResolvedValue(undefined);
|
||||
jest.spyOn(fs, "mkdirSync").mockReturnValue(undefined);
|
||||
jest.spyOn(fs, "writeFile").mockReturnValue(undefined);
|
||||
|
||||
variantAnalysisId = faker.datatype.number();
|
||||
|
||||
try {
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
cli = extension.cliServer;
|
||||
variantAnalysisResultsManager = new VariantAnalysisResultsManager(
|
||||
cli,
|
||||
logger,
|
||||
);
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
sandbox.restore();
|
||||
const extension = await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
cli = extension.cliServer;
|
||||
variantAnalysisResultsManager = new VariantAnalysisResultsManager(
|
||||
cli,
|
||||
extLogger,
|
||||
);
|
||||
});
|
||||
|
||||
describe("download", () => {
|
||||
let getOctokitStub: sinon.SinonStub;
|
||||
const mockCredentials = {
|
||||
getOctokit: () =>
|
||||
Promise.resolve({
|
||||
request: getOctokitStub,
|
||||
request: jest.fn(),
|
||||
}),
|
||||
} as unknown as Credentials;
|
||||
let dummyRepoTask: VariantAnalysisRepositoryTask;
|
||||
@@ -91,33 +77,33 @@ describe(VariantAnalysisResultsManager.name, function () {
|
||||
variantAnalysisStoragePath,
|
||||
dummyRepoTask.repository.fullName,
|
||||
),
|
||||
).to.equal(false);
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the artifact_url is missing", async () => {
|
||||
describe("when the artifact_url is missing", () => {
|
||||
it("should not try to download the result", async () => {
|
||||
const dummyRepoTask = createMockVariantAnalysisRepositoryTask();
|
||||
delete dummyRepoTask.artifactUrl;
|
||||
|
||||
try {
|
||||
await variantAnalysisResultsManager.download(
|
||||
await expect(
|
||||
variantAnalysisResultsManager.download(
|
||||
mockCredentials,
|
||||
variantAnalysisId,
|
||||
dummyRepoTask,
|
||||
variantAnalysisStoragePath,
|
||||
);
|
||||
|
||||
expect.fail("Expected an error to be thrown");
|
||||
} catch (e: any) {
|
||||
expect(e.message).to.equal("Missing artifact URL");
|
||||
}
|
||||
),
|
||||
).rejects.toThrow("Missing artifact URL");
|
||||
});
|
||||
});
|
||||
|
||||
describe("when the artifact_url is present", async () => {
|
||||
describe("when the artifact_url is present", () => {
|
||||
let arrayBuffer: ArrayBuffer;
|
||||
|
||||
let getVariantAnalysisRepoResultStub: jest.SpiedFunction<
|
||||
typeof ghApiClient.getVariantAnalysisRepoResult
|
||||
>;
|
||||
|
||||
beforeEach(async () => {
|
||||
const sourceFilePath = path.join(
|
||||
__dirname,
|
||||
@@ -125,10 +111,16 @@ describe(VariantAnalysisResultsManager.name, function () {
|
||||
);
|
||||
arrayBuffer = fs.readFileSync(sourceFilePath).buffer;
|
||||
|
||||
getVariantAnalysisRepoResultStub = sandbox
|
||||
.stub(ghApiClient, "getVariantAnalysisRepoResult")
|
||||
.withArgs(mockCredentials, dummyRepoTask.artifactUrl as string)
|
||||
.resolves(arrayBuffer);
|
||||
getVariantAnalysisRepoResultStub = jest
|
||||
.spyOn(ghApiClient, "getVariantAnalysisRepoResult")
|
||||
.mockImplementation(
|
||||
(_credentials: Credentials, downloadUrl: string) => {
|
||||
if (downloadUrl === dummyRepoTask.artifactUrl) {
|
||||
return Promise.resolve(arrayBuffer);
|
||||
}
|
||||
return Promise.reject(new Error("Unexpected artifact URL"));
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("should call the API to download the results", async () => {
|
||||
@@ -139,7 +131,7 @@ describe(VariantAnalysisResultsManager.name, function () {
|
||||
variantAnalysisStoragePath,
|
||||
);
|
||||
|
||||
expect(getVariantAnalysisRepoResultStub.calledOnce).to.be.true;
|
||||
expect(getVariantAnalysisRepoResultStub).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should save the results zip file to disk", async () => {
|
||||
@@ -150,8 +142,9 @@ describe(VariantAnalysisResultsManager.name, function () {
|
||||
variantAnalysisStoragePath,
|
||||
);
|
||||
|
||||
expect(fs.existsSync(`${repoTaskStorageDirectory}/results.zip`)).to.be
|
||||
.true;
|
||||
expect(fs.existsSync(`${repoTaskStorageDirectory}/results.zip`)).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("should unzip the results in a `results/` folder", async () => {
|
||||
@@ -164,7 +157,7 @@ describe(VariantAnalysisResultsManager.name, function () {
|
||||
|
||||
expect(
|
||||
fs.existsSync(`${repoTaskStorageDirectory}/results/results.sarif`),
|
||||
).to.be.true;
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
describe("isVariantAnalysisRepoDownloaded", () => {
|
||||
@@ -181,7 +174,7 @@ describe(VariantAnalysisResultsManager.name, function () {
|
||||
variantAnalysisStoragePath,
|
||||
dummyRepoTask.repository.fullName,
|
||||
),
|
||||
).to.equal(true);
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
import * as path from "path";
|
||||
|
||||
import * as sinon from "sinon";
|
||||
|
||||
import { commands, extensions, TextDocument, window, workspace } from "vscode";
|
||||
import {
|
||||
authentication,
|
||||
commands,
|
||||
extensions,
|
||||
QuickPickItem,
|
||||
TextDocument,
|
||||
window,
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import * as Octokit from "@octokit/rest";
|
||||
import { retry } from "@octokit/plugin-retry";
|
||||
|
||||
import { CodeQLExtensionInterface } from "../../../extension";
|
||||
import * as config from "../../../config";
|
||||
import { Credentials } from "../../../authentication";
|
||||
import { MockGitHubApiServer } from "../../../mocks/mock-gh-api-server";
|
||||
|
||||
jest.setTimeout(10_000);
|
||||
|
||||
const mockServer = new MockGitHubApiServer();
|
||||
before(() => mockServer.startServer());
|
||||
beforeAll(() => mockServer.startServer());
|
||||
afterEach(() => mockServer.unloadScenario());
|
||||
after(() => mockServer.stopServer());
|
||||
afterAll(() => mockServer.stopServer());
|
||||
|
||||
async function showQlDocument(name: string): Promise<TextDocument> {
|
||||
const folderPath = workspace.workspaceFolders![0].uri.fsPath;
|
||||
@@ -24,49 +31,89 @@ async function showQlDocument(name: string): Promise<TextDocument> {
|
||||
return document;
|
||||
}
|
||||
|
||||
describe("Variant Analysis Submission Integration", function () {
|
||||
this.timeout(10_000);
|
||||
|
||||
let sandbox: sinon.SinonSandbox;
|
||||
let quickPickSpy: sinon.SinonStub;
|
||||
let inputBoxSpy: sinon.SinonStub;
|
||||
let executeCommandSpy: sinon.SinonStub;
|
||||
let showErrorMessageSpy: sinon.SinonStub;
|
||||
describe("Variant Analysis Submission Integration", () => {
|
||||
let quickPickSpy: jest.SpiedFunction<typeof window.showQuickPick>;
|
||||
let inputBoxSpy: jest.SpiedFunction<typeof window.showInputBox>;
|
||||
let executeCommandSpy: jest.SpiedFunction<typeof commands.executeCommand>;
|
||||
let showErrorMessageSpy: jest.SpiedFunction<typeof window.showErrorMessage>;
|
||||
|
||||
beforeEach(async () => {
|
||||
sandbox = sinon.createSandbox();
|
||||
const originalGetConfiguration = workspace.getConfiguration;
|
||||
|
||||
sandbox.stub(config, "isCanary").returns(true);
|
||||
sandbox.stub(config, "isVariantAnalysisLiveResultsEnabled").returns(true);
|
||||
jest
|
||||
.spyOn(workspace, "getConfiguration")
|
||||
.mockImplementation((section, scope) => {
|
||||
const configuration = originalGetConfiguration(section, scope);
|
||||
|
||||
return {
|
||||
get(key: string, defaultValue?: unknown) {
|
||||
if (section === "codeQL.variantAnalysis" && key === "liveResults") {
|
||||
return true;
|
||||
}
|
||||
if (section === "codeQL" && key == "canary") {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
section === "codeQL.variantAnalysis" &&
|
||||
key === "controllerRepo"
|
||||
) {
|
||||
return "github/vscode-codeql";
|
||||
}
|
||||
return configuration.get(key, defaultValue);
|
||||
},
|
||||
has(key: string) {
|
||||
return configuration.has(key);
|
||||
},
|
||||
inspect(key: string) {
|
||||
return configuration.inspect(key);
|
||||
},
|
||||
update(
|
||||
key: string,
|
||||
value: unknown,
|
||||
configurationTarget?: boolean,
|
||||
overrideInLanguage?: boolean,
|
||||
) {
|
||||
return configuration.update(
|
||||
key,
|
||||
value,
|
||||
configurationTarget,
|
||||
overrideInLanguage,
|
||||
);
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
jest.spyOn(authentication, "getSession").mockResolvedValue({
|
||||
id: "test",
|
||||
accessToken: "test-token",
|
||||
scopes: [],
|
||||
account: {
|
||||
id: "test",
|
||||
label: "test",
|
||||
},
|
||||
});
|
||||
|
||||
const mockCredentials = {
|
||||
getOctokit: () => Promise.resolve(new Octokit.Octokit({ retry })),
|
||||
} as unknown as Credentials;
|
||||
sandbox.stub(Credentials, "initialize").resolves(mockCredentials);
|
||||
jest.spyOn(Credentials, "initialize").mockResolvedValue(mockCredentials);
|
||||
|
||||
await config.setRemoteControllerRepo("github/vscode-codeql");
|
||||
quickPickSpy = jest
|
||||
.spyOn(window, "showQuickPick")
|
||||
.mockResolvedValue(undefined);
|
||||
inputBoxSpy = jest
|
||||
.spyOn(window, "showInputBox")
|
||||
.mockResolvedValue(undefined);
|
||||
executeCommandSpy = jest.spyOn(commands, "executeCommand");
|
||||
showErrorMessageSpy = jest
|
||||
.spyOn(window, "showErrorMessage")
|
||||
.mockResolvedValue(undefined);
|
||||
|
||||
quickPickSpy = sandbox.stub(window, "showQuickPick").resolves(undefined);
|
||||
inputBoxSpy = sandbox.stub(window, "showInputBox").resolves(undefined);
|
||||
|
||||
executeCommandSpy = sandbox.stub(commands, "executeCommand").callThrough();
|
||||
showErrorMessageSpy = sandbox
|
||||
.stub(window, "showErrorMessage")
|
||||
.resolves(undefined);
|
||||
|
||||
try {
|
||||
await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
sandbox.restore();
|
||||
await extensions
|
||||
.getExtension<CodeQLExtensionInterface | Record<string, never>>(
|
||||
"GitHub.vscode-codeql",
|
||||
)!
|
||||
.activate();
|
||||
});
|
||||
|
||||
describe("Successful scenario", () => {
|
||||
@@ -78,18 +125,19 @@ describe("Variant Analysis Submission Integration", function () {
|
||||
await showQlDocument("query.ql");
|
||||
|
||||
// Select a repository list
|
||||
quickPickSpy.onFirstCall().resolves({
|
||||
quickPickSpy.mockResolvedValueOnce({
|
||||
useCustomRepo: true,
|
||||
});
|
||||
} as unknown as QuickPickItem);
|
||||
// Enter a GitHub repository
|
||||
inputBoxSpy.onFirstCall().resolves("github/codeql");
|
||||
inputBoxSpy.mockResolvedValueOnce("github/codeql");
|
||||
// Select target language for your query
|
||||
quickPickSpy.onSecondCall().resolves("javascript");
|
||||
quickPickSpy.mockResolvedValueOnce(
|
||||
"javascript" as unknown as QuickPickItem,
|
||||
);
|
||||
|
||||
await commands.executeCommand("codeQL.runVariantAnalysis");
|
||||
|
||||
sinon.assert.calledWith(
|
||||
executeCommandSpy,
|
||||
expect(executeCommandSpy).toHaveBeenCalledWith(
|
||||
"codeQL.openVariantAnalysisView",
|
||||
146,
|
||||
);
|
||||
@@ -105,18 +153,19 @@ describe("Variant Analysis Submission Integration", function () {
|
||||
await showQlDocument("query.ql");
|
||||
|
||||
// Select a repository list
|
||||
quickPickSpy.onFirstCall().resolves({
|
||||
quickPickSpy.mockResolvedValueOnce({
|
||||
useCustomRepo: true,
|
||||
});
|
||||
} as unknown as QuickPickItem);
|
||||
// Enter a GitHub repository
|
||||
inputBoxSpy.onFirstCall().resolves("github/codeql");
|
||||
inputBoxSpy.mockResolvedValueOnce("github/codeql");
|
||||
|
||||
await commands.executeCommand("codeQL.runVariantAnalysis");
|
||||
|
||||
sinon.assert.calledWith(
|
||||
showErrorMessageSpy,
|
||||
sinon.match('Controller repository "github/vscode-codeql" not found'),
|
||||
sinon.match.string,
|
||||
expect(showErrorMessageSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
'Controller repository "github/vscode-codeql" not found',
|
||||
),
|
||||
expect.any(String),
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -130,20 +179,21 @@ describe("Variant Analysis Submission Integration", function () {
|
||||
await showQlDocument("query.ql");
|
||||
|
||||
// Select a repository list
|
||||
quickPickSpy.onFirstCall().resolves({
|
||||
quickPickSpy.mockResolvedValueOnce({
|
||||
useCustomRepo: true,
|
||||
});
|
||||
} as unknown as QuickPickItem);
|
||||
// Enter a GitHub repository
|
||||
inputBoxSpy.onFirstCall().resolves("github/codeql");
|
||||
inputBoxSpy.mockResolvedValueOnce("github/codeql");
|
||||
// Select target language for your query
|
||||
quickPickSpy.onSecondCall().resolves("javascript");
|
||||
quickPickSpy.mockResolvedValueOnce(
|
||||
"javascript" as unknown as QuickPickItem,
|
||||
);
|
||||
|
||||
await commands.executeCommand("codeQL.runVariantAnalysis");
|
||||
|
||||
sinon.assert.calledWith(
|
||||
showErrorMessageSpy,
|
||||
sinon.match("No repositories could be queried."),
|
||||
sinon.match.string,
|
||||
expect(showErrorMessageSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("No repositories could be queried."),
|
||||
expect.any(String),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { expect } from "chai";
|
||||
import { extensions, Uri } from "vscode";
|
||||
import * as path from "path";
|
||||
import { SemVer } from "semver";
|
||||
|
||||
import { CodeQLCliServer, QueryInfoByLanguage } from "../../cli";
|
||||
import { CodeQLExtensionInterface } from "../../extension";
|
||||
import { skipIfNoCodeQL } from "../ensureCli";
|
||||
import { itWithCodeQL } from "../cli";
|
||||
import {
|
||||
getOnDiskWorkspaceFolders,
|
||||
getQlPackForDbscheme,
|
||||
@@ -13,14 +12,13 @@ import {
|
||||
} from "../../helpers";
|
||||
import { resolveQueries } from "../../contextual/queryResolver";
|
||||
import { KeyType } from "../../contextual/keyType";
|
||||
import { fail } from "assert";
|
||||
|
||||
jest.setTimeout(60_000);
|
||||
|
||||
/**
|
||||
* Perform proper integration tests by running the CLI
|
||||
*/
|
||||
describe("Use cli", function () {
|
||||
this.timeout(60000);
|
||||
|
||||
describe("Use cli", () => {
|
||||
let cli: CodeQLCliServer;
|
||||
let supportedLanguages: string[];
|
||||
|
||||
@@ -42,7 +40,7 @@ describe("Use cli", function () {
|
||||
|
||||
if (process.env.CLI_VERSION && process.env.CLI_VERSION !== "nightly") {
|
||||
it("should have the correct version of the cli", async () => {
|
||||
expect((await cli.getVersion()).toString()).to.eq(
|
||||
expect((await cli.getVersion()).toString()).toBe(
|
||||
new SemVer(process.env.CLI_VERSION || "").toString(),
|
||||
);
|
||||
});
|
||||
@@ -50,11 +48,10 @@ describe("Use cli", function () {
|
||||
|
||||
it("should resolve ram", async () => {
|
||||
const result = await (cli as any).resolveRam(8192);
|
||||
expect(result).to.deep.eq(["-J-Xmx4096M", "--off-heap-ram=4096"]);
|
||||
expect(result).toEqual(["-J-Xmx4096M", "--off-heap-ram=4096"]);
|
||||
});
|
||||
|
||||
it("should resolve query packs", async function () {
|
||||
skipIfNoCodeQL(this);
|
||||
itWithCodeQL()("should resolve query packs", async () => {
|
||||
const qlpacks = await cli.resolveQlpacks(getOnDiskWorkspaceFolders());
|
||||
// Depending on the version of the CLI, the qlpacks may have different names
|
||||
// (e.g. "codeql/javascript-all" vs "codeql-javascript"),
|
||||
@@ -64,19 +61,17 @@ describe("Use cli", function () {
|
||||
}
|
||||
});
|
||||
|
||||
it("should support the expected languages", async function () {
|
||||
skipIfNoCodeQL(this);
|
||||
itWithCodeQL()("should support the expected languages", async () => {
|
||||
// Just check a few examples that definitely are/aren't supported.
|
||||
expect(supportedLanguages).to.include.members([
|
||||
"go",
|
||||
"javascript",
|
||||
"python",
|
||||
]);
|
||||
expect(supportedLanguages).to.not.include.members(["xml", "properties"]);
|
||||
expect(supportedLanguages).toEqual(
|
||||
expect.arrayContaining(["go", "javascript", "python"]),
|
||||
);
|
||||
expect(supportedLanguages).not.toEqual(
|
||||
expect.arrayContaining(["xml", "properties"]),
|
||||
);
|
||||
});
|
||||
|
||||
it("should resolve query by language", async function () {
|
||||
skipIfNoCodeQL(this);
|
||||
itWithCodeQL()("should resolve query by language", async () => {
|
||||
const queryPath = path.join(
|
||||
__dirname,
|
||||
"data",
|
||||
@@ -86,12 +81,12 @@ describe("Use cli", function () {
|
||||
getOnDiskWorkspaceFolders(),
|
||||
Uri.file(queryPath),
|
||||
);
|
||||
expect(Object.keys(queryInfo.byLanguage)[0]).to.eql("javascript");
|
||||
expect(Object.keys(queryInfo.byLanguage)[0]).toEqual("javascript");
|
||||
});
|
||||
|
||||
it("should resolve printAST queries for supported languages", async function () {
|
||||
skipIfNoCodeQL(this);
|
||||
try {
|
||||
itWithCodeQL()(
|
||||
"should resolve printAST queries for supported languages",
|
||||
async () => {
|
||||
for (const lang of supportedLanguages) {
|
||||
if (lang === "go") {
|
||||
// The codeql-go submodule is not available in the integration tests.
|
||||
@@ -100,19 +95,17 @@ describe("Use cli", function () {
|
||||
|
||||
console.log(`resolving printAST queries for ${lang}`);
|
||||
const pack = await getQlPackForDbscheme(cli, languageToDbScheme[lang]);
|
||||
expect(pack.dbschemePack).to.contain(lang);
|
||||
expect(pack.dbschemePack).toContain(lang);
|
||||
if (pack.dbschemePackIsLibraryPack) {
|
||||
expect(pack.queryPack).to.contain(lang);
|
||||
expect(pack.queryPack).toContain(lang);
|
||||
}
|
||||
|
||||
const result = await resolveQueries(cli, pack, KeyType.PrintAstQuery);
|
||||
|
||||
// It doesn't matter what the name or path of the query is, only
|
||||
// that we have found exactly one query.
|
||||
expect(result.length).to.eq(1);
|
||||
expect(result.length).toBe(1);
|
||||
}
|
||||
} catch (e) {
|
||||
fail(e as Error);
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user