Skip to content

Commit 152e194

Browse files
Merge branch 'main' into location-url-column
2 parents f12ba96 + add3296 commit 152e194

62 files changed

Lines changed: 31299 additions & 49306 deletions

File tree

Some content is hidden

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

docs/test-plan.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,21 @@ choose to go through some of the Optional Test Cases.
4444

4545
#### Test case 2: Running a problem query and viewing results
4646

47-
1. Open the [javascript UnsafeJQueryPlugin query](https://github.com/github/codeql/blob/main/javascript/ql/src/Security/CWE-079/UnsafeJQueryPlugin.ql).
47+
1. Open the [javascript ReDoS query](https://github.com/github/codeql/blob/main/javascript/ql/src/Performance/ReDoS.ql).
4848
2. Select the `babel/babel` database (or download it if you don't have one already)
4949
3. Run a local query.
5050
4. Once the query completes:
5151
- Check that the result messages are rendered
5252
- Check that alert locations can be clicked on
5353

54-
#### Test case 3: Running a non-probem query and viewing results
54+
#### Test case 3: Running a non-problem query and viewing results
5555

5656
1. Open the [cpp FunLinesOfCode query](https://github.com/github/codeql/blob/main/cpp/ql/src/Metrics/Functions/FunLinesOfCode.ql).
5757
2. Select the `google/brotli` database (or download it if you don't have one already)
5858
3. Run a local query.
5959
4. Once the query completes:
6060
- Check that the results table is rendered
61-
- Check that alert locations can be clicked on
61+
- Check that result locations can be clicked on
6262

6363
#### Test case 3: Can use AST viewer
6464

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { StorybookConfig } from "@storybook/core-common";
1+
import type { StorybookConfig } from "@storybook/react-webpack5";
22

33
const config: StorybookConfig = {
44
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
@@ -8,13 +8,13 @@ const config: StorybookConfig = {
88
"@storybook/addon-interactions",
99
"./vscode-theme-addon/preset.ts",
1010
],
11-
framework: "@storybook/react",
12-
core: {
13-
builder: "@storybook/builder-webpack5",
11+
framework: {
12+
name: "@storybook/react-webpack5",
13+
options: {},
1414
},
15-
features: {
16-
babelModeV7: true,
15+
docs: {
16+
autodocs: "tag",
1717
},
1818
};
1919

20-
module.exports = config;
20+
export default config;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from "@storybook/addons";
1+
import { addons } from "@storybook/manager-api";
22
import { themes } from "@storybook/theming";
33

44
addons.setConfig({
Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
1+
import { Preview } from "@storybook/react";
12
import { themes } from "@storybook/theming";
23
import { action } from "@storybook/addon-actions";
34

45
// Allow all stories/components to use Codicons
56
import "@vscode/codicons/dist/codicon.css";
67

8+
(window as any).acquireVsCodeApi = () => ({
9+
postMessage: action("post-vscode-message"),
10+
setState: action("set-vscode-state"),
11+
});
12+
713
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
8-
export const parameters = {
9-
// All props starting with `on` will automatically receive an action as a prop
10-
actions: { argTypesRegex: "^on[A-Z].*" },
11-
// All props matching these names will automatically get the correct control
12-
controls: {
13-
matchers: {
14-
color: /(background|color)$/i,
15-
date: /Date$/,
14+
const preview: Preview = {
15+
parameters: {
16+
// All props starting with `on` will automatically receive an action as a prop
17+
actions: { argTypesRegex: "^on[A-Z].*" },
18+
// All props matching these names will automatically get the correct control
19+
controls: {
20+
matchers: {
21+
color: /(background|color)$/i,
22+
date: /Date$/,
23+
},
24+
},
25+
// Use a dark theme to be aligned with VSCode
26+
docs: {
27+
theme: themes.dark,
28+
},
29+
backgrounds: {
30+
// The background is injected by our theme CSS files
31+
disable: true,
1632
},
17-
},
18-
// Use a dark theme to be aligned with VSCode
19-
docs: {
20-
theme: themes.dark,
21-
},
22-
backgrounds: {
23-
// The background is injected by our theme CSS files
24-
disable: true,
2533
},
2634
};
2735

28-
(window as any).acquireVsCodeApi = () => ({
29-
postMessage: action("post-vscode-message"),
30-
setState: action("set-vscode-state"),
31-
});
36+
export default preview;

extensions/ql-vscode/.storybook/vscode-theme-addon/ThemeSelector.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import * as React from "react";
22
import { FunctionComponent, useCallback } from "react";
33

4-
import { useGlobals } from "@storybook/api";
4+
import { useGlobals } from "@storybook/manager-api";
55
import {
66
IconButton,
77
Icons,
8-
WithTooltip,
98
TooltipLinkList,
10-
Link,
11-
WithHideFn,
9+
WithTooltip,
1210
} from "@storybook/components";
1311

1412
import { themeNames, VSCodeTheme } from "./theme";
@@ -26,7 +24,7 @@ export const ThemeSelector: FunctionComponent = () => {
2624
);
2725

2826
const createLinks = useCallback(
29-
(onHide: () => void): Link[] =>
27+
(onHide: () => void) =>
3028
Object.values(VSCodeTheme).map((theme) => ({
3129
id: theme,
3230
onClick() {
@@ -44,8 +42,8 @@ export const ThemeSelector: FunctionComponent = () => {
4442
<WithTooltip
4543
placement="top"
4644
trigger="click"
47-
closeOnClick
48-
tooltip={({ onHide }: WithHideFn) => (
45+
closeOnOutsideClick
46+
tooltip={({ onHide }: { onHide: () => void }) => (
4947
<TooltipLinkList links={createLinks(onHide)} />
5048
)}
5149
>

extensions/ql-vscode/.storybook/vscode-theme-addon/manager.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from "react";
2-
import { addons, types } from "@storybook/addons";
2+
import { addons, types } from "@storybook/manager-api";
33
import { ThemeSelector } from "./ThemeSelector";
44

55
const ADDON_ID = "vscode-theme-addon";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export function config(entry = []) {
1+
export function previewAnnotations(entry = []) {
22
return [...entry, require.resolve("./preview.ts")];
33
}
44

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { useEffect, useGlobals } from "@storybook/addons";
1+
import { useEffect } from "react";
22
import type {
3-
AnyFramework,
43
PartialStoryFn as StoryFunction,
54
StoryContext,
65
} from "@storybook/csf";
@@ -34,11 +33,8 @@ const themeFiles: { [key in VSCodeTheme]: string } = {
3433
.default,
3534
};
3635

37-
export const withTheme = (
38-
StoryFn: StoryFunction<AnyFramework>,
39-
context: StoryContext<AnyFramework>,
40-
) => {
41-
const [{ vscodeTheme }] = useGlobals();
36+
export const withTheme = (StoryFn: StoryFunction, context: StoryContext) => {
37+
const { vscodeTheme } = context.globals;
4238

4339
useEffect(() => {
4440
const styleSelectorId =

extensions/ql-vscode/CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
## [UNRELEASED]
44

55
- Links to code on GitHub now include column numbers as well as line numbers. [#2406](https://github.com/github/vscode-codeql/pull/2406)
6+
- No longer highlight trailing commas for jump to definition. [#2615](https://github.com/github/vscode-codeql/pull/2615)
7+
8+
## 1.8.8 - 17 July 2023
9+
610
- Remove support for CodeQL CLI versions older than 2.9.4. [#2610](https://github.com/github/vscode-codeql/pull/2610)
711
- Implement syntax highlighting for the `additional` and `default` keywords. [#2609](https://github.com/github/vscode-codeql/pull/2609)
812

913
## 1.8.7 - 29 June 2023
1014

1115
- Show a run button on the file tab for query files, that will start a local query. This button will only show when a local database is selected in the extension. [#2544](https://github.com/github/vscode-codeql/pull/2544)
12-
- Add `CodeQL: Quick Evaluation Count` command to generate the count summary statistics of the results set
13-
without spending the time to compute locations and strings.
16+
- Add a `CodeQL: Quick Evaluation Count` command to generate the count summary statistics of the results set
17+
without spending the time to compute locations and strings. [#2475](https://github.com/github/vscode-codeql/pull/2475)
1418

1519
## 1.8.6 - 14 June 2023
1620

extensions/ql-vscode/language-configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
"end": "^\\s*//\\s*#?endregion\\b"
3131
}
3232
},
33-
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\.\\<\\>\\/\\?\\s]+)"
33+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\.\\<\\>\\/\\?\\s\\,]+)"
3434
}

0 commit comments

Comments
 (0)