Skip to content

Commit 2dd5dd9

Browse files
committed
Merge branch 'main' of https://github.com/github/vscode-codeql into tuan-nguen/replace-vscode-webview
2 parents 3b1e929 + 6b53395 commit 2dd5dd9

File tree

8 files changed

+125
-113
lines changed

8 files changed

+125
-113
lines changed

extensions/ql-vscode/package-lock.json

Lines changed: 96 additions & 96 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

extensions/ql-vscode/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,8 +2054,8 @@
20542054
"@types/tmp": "^0.2.6",
20552055
"@types/vscode": "1.90.0",
20562056
"@types/yauzl": "^2.10.3",
2057-
"@typescript-eslint/eslint-plugin": "^8.26.1",
2058-
"@typescript-eslint/parser": "^8.26.1",
2057+
"@typescript-eslint/eslint-plugin": "^8.28.0",
2058+
"@typescript-eslint/parser": "^8.28.0",
20592059
"@vscode/test-electron": "^2.3.9",
20602060
"@vscode/vsce": "^3.2.1",
20612061
"ansi-colors": "^4.1.1",

extensions/ql-vscode/src/view/common/CodePaths/ThreadPath.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { styled } from "styled-components";
2-
import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
2+
import { Tag } from "../Tag";
33

44
import type {
55
AnalysisMessage,
@@ -56,12 +56,12 @@ export const ThreadPath = ({
5656
</TitleContainer>
5757
{isSource && (
5858
<TagContainer>
59-
<VSCodeTag>Source</VSCodeTag>
59+
<Tag>Source</Tag>
6060
</TagContainer>
6161
)}
6262
{isSink && (
6363
<TagContainer>
64-
<VSCodeTag>Sink</VSCodeTag>
64+
<Tag>Sink</Tag>
6565
</TagContainer>
6666
)}
6767
</HeaderContainer>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { styled } from "styled-components";
2+
3+
export const Tag = styled.span`
4+
background-color: var(--vscode-badge-background);
5+
border: 1px solid var(--vscode-button-border, transparent);
6+
border-radius: 2px;
7+
color: var(--vscode-badge-foreground);
8+
padding: 2px 4px;
9+
text-transform: uppercase;
10+
box-sizing: border-box;
11+
font-family: var(--vscode-font-family);
12+
font-size: 11px;
13+
line-height: 16px;
14+
`;

extensions/ql-vscode/src/view/method-modeling/MethodModeling.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ModelingStatusIndicator } from "../model-editor/ModelingStatusIndicator
44
import type { Method } from "../../model-editor/method";
55
import { MethodName } from "../model-editor/MethodName";
66
import type { ModeledMethod } from "../../model-editor/modeled-method";
7-
import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
7+
import { Tag } from "../common/Tag";
88
import { ReviewInEditorButton } from "./ReviewInEditorButton";
99
import { MultipleModeledMethodsPanel } from "./MultipleModeledMethodsPanel";
1010
import type { QueryLanguage } from "../../common/query-language";
@@ -39,14 +39,12 @@ const DependencyContainer = styled.div`
3939
margin-bottom: 0.8rem;
4040
`;
4141

42-
const StyledVSCodeTag = styled(VSCodeTag)<{ $visible: boolean }>`
42+
const StyledTag = styled(Tag)<{ $visible: boolean }>`
4343
visibility: ${(props) => (props.$visible ? "visible" : "hidden")};
4444
`;
4545

4646
const UnsavedTag = ({ modelingStatus }: { modelingStatus: ModelingStatus }) => (
47-
<StyledVSCodeTag $visible={modelingStatus === "unsaved"}>
48-
Unsaved
49-
</StyledVSCodeTag>
47+
<StyledTag $visible={modelingStatus === "unsaved"}>Unsaved</StyledTag>
5048
);
5149

5250
export type MethodModelingProps = {

extensions/ql-vscode/src/view/model-editor/LibraryRow.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import { calculateModeledPercentage } from "../../model-editor/shared/modeled-pe
77
import { percentFormatter } from "./formatters";
88
import { Codicon } from "../common";
99
import { Mode } from "../../model-editor/shared/mode";
10-
import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
1110
import { VscodeButton, VscodeDivider } from "@vscode-elements/react-elements";
1211
import type { ModelEditorViewState } from "../../model-editor/shared/view-state";
1312
import type { AccessPathSuggestionOptions } from "../../model-editor/suggestions";
1413
import type { ModelEvaluationRunState } from "../../model-editor/shared/model-evaluation-run-state";
14+
import { Tag } from "../common/Tag";
1515

1616
const LibraryContainer = styled.div`
1717
background-color: var(--vscode-peekViewResult-background);
@@ -166,7 +166,7 @@ export const LibraryRow = ({
166166
<ModeledPercentage>
167167
{percentFormatter.format(modeledPercentage / 100)} modeled
168168
</ModeledPercentage>
169-
{hasUnsavedChanges ? <VSCodeTag>UNSAVED</VSCodeTag> : null}
169+
{hasUnsavedChanges ? <Tag>UNSAVED</Tag> : null}
170170
</NameContainer>
171171
{viewState.showGenerateButton &&
172172
viewState.mode === Mode.Application && (

extensions/ql-vscode/src/view/model-editor/MethodClassifications.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { useMemo } from "react";
22
import type { Method } from "../../model-editor/method";
33
import { CallClassification } from "../../model-editor/method";
4-
import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
54
import { styled } from "styled-components";
5+
import { Tag } from "../common/Tag";
66

77
const ClassificationsContainer = styled.div`
88
display: inline-flex;
99
flex-direction: row;
1010
gap: 0.5rem;
1111
`;
1212

13-
const ClassificationTag = styled(VSCodeTag)`
13+
const ClassificationTag = styled(Tag)`
1414
font-size: 0.75em;
1515
white-space: nowrap;
1616
`;

extensions/ql-vscode/src/view/model-editor/ModelEditor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { useCallback, useEffect, useMemo, useState } from "react";
22
import type { ToModelEditorMessage } from "../../common/interface-types";
3-
import { VSCodeTag } from "@vscode/webview-ui-toolkit/react";
43
import { VscodeButton, VscodeCheckbox } from "@vscode-elements/react-elements";
54
import { styled } from "styled-components";
65
import type { Method } from "../../model-editor/method";
@@ -19,6 +18,7 @@ import type { AccessPathSuggestionOptions } from "../../model-editor/suggestions
1918
import type { ModelEvaluationRunState } from "../../model-editor/shared/model-evaluation-run-state";
2019
import { ModelEvaluation } from "./ModelEvaluation";
2120
import { useMessageFromExtension } from "../common/useMessageFromExtension";
21+
import { Tag } from "../common/Tag";
2222

2323
const LoadingContainer = styled.div`
2424
text-align: center;
@@ -302,9 +302,9 @@ export function ModelEditor({
302302
<ViewTitle>
303303
{getLanguageDisplayName(viewState.extensionPack.language)}
304304
</ViewTitle>
305-
<VSCodeTag>
305+
<Tag>
306306
{percentFormatter.format(modeledPercentage / 100)} modeled
307-
</VSCodeTag>
307+
</Tag>
308308
</HeaderRow>
309309
<HeaderRow>
310310
<>{viewState.extensionPack.name}</>

0 commit comments

Comments
 (0)