Skip to content

Commit 0b7b6f1

Browse files
committed
Merge remote-tracking branch 'origin/main' into koesie10/npm-upgrade
2 parents 3a8beb9 + 8b2fd1a commit 0b7b6f1

115 files changed

Lines changed: 1694 additions & 3546 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.

extensions/ql-vscode/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## [UNRELEASED]
44

5+
## 1.11.0 - 13 December 2023
6+
7+
- Add a new method modeling panel to classify methods as sources/sinks/summaries while in the context of the source code. [#3128](https://github.com/github/vscode-codeql/pull/3128)
8+
- Adds the ability to add multiple classifications per method in the CodeQL Model Editor. [#3128](https://github.com/github/vscode-codeql/pull/3128)
9+
- Switch add and delete button positions in the CodeQL Model Editor. [#3123](https://github.com/github/vscode-codeql/pull/3123)
510
- Add a prompt to the "Quick query" command to encourage users in single-folder workspaces to use "Create query" instead. [#3082](https://github.com/github/vscode-codeql/pull/3082)
611
- Remove support for CodeQL CLI versions older than 2.11.6. [#3087](https://github.com/github/vscode-codeql/pull/3087)
712
- Preserve focus on results viewer when showing a location in a file. [#3088](https://github.com/github/vscode-codeql/pull/3088)

extensions/ql-vscode/package-lock.json

Lines changed: 8 additions & 8 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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "CodeQL for Visual Studio Code",
55
"author": "GitHub",
66
"private": true,
7-
"version": "1.10.1",
7+
"version": "1.11.1",
88
"publisher": "GitHub",
99
"license": "MIT",
1010
"icon": "media/VS-marketplace-CodeQL-icon.png",
@@ -1840,15 +1840,14 @@
18401840
{
18411841
"id": "codeQLMethodModeling",
18421842
"type": "webview",
1843-
"name": "CodeQL Method Modeling",
1844-
"when": "config.codeQL.canary"
1843+
"name": "CodeQL Method Modeling"
18451844
}
18461845
],
18471846
"codeql-methods-usage": [
18481847
{
18491848
"id": "codeQLMethodsUsage",
18501849
"name": "CodeQL Methods Usage",
1851-
"when": "config.codeQL.canary && codeql.modelEditorOpen"
1850+
"when": "codeql.modelEditorOpen"
18521851
}
18531852
]
18541853
},

extensions/ql-vscode/src/codeql-cli/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { promisify } from "util";
1111
import { CancellationToken, Disposable, Uri } from "vscode";
1212

1313
import {
14-
BQRSInfo,
14+
BqrsInfo,
1515
DecodedBqrs,
1616
DecodedBqrsChunk,
1717
} from "../common/bqrs-cli-types";
@@ -928,11 +928,11 @@ export class CodeQLCliServer implements Disposable {
928928
* @param bqrsPath The path to the bqrs.
929929
* @param pageSize The page size to precompute offsets into the binary file for.
930930
*/
931-
async bqrsInfo(bqrsPath: string, pageSize?: number): Promise<BQRSInfo> {
931+
async bqrsInfo(bqrsPath: string, pageSize?: number): Promise<BqrsInfo> {
932932
const subcommandArgs = (
933933
pageSize ? ["--paginate-rows", pageSize.toString()] : []
934934
).concat(bqrsPath);
935-
return await this.runJsonCodeQlCliCommand<BQRSInfo>(
935+
return await this.runJsonCodeQlCliCommand<BqrsInfo>(
936936
["bqrs", "info"],
937937
subcommandArgs,
938938
"Reading bqrs header",

extensions/ql-vscode/src/common/bqrs-cli-types.ts

Lines changed: 28 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* the "for the sake of extensibility" comment in messages.ts.
55
*/
66
// eslint-disable-next-line @typescript-eslint/no-namespace
7-
export namespace ColumnKindCode {
7+
export namespace BqrsColumnKindCode {
88
export const FLOAT = "f";
99
export const INTEGER = "i";
1010
export const STRING = "s";
@@ -13,111 +13,81 @@ export namespace ColumnKindCode {
1313
export const ENTITY = "e";
1414
}
1515

16-
type ColumnKind =
17-
| typeof ColumnKindCode.FLOAT
18-
| typeof ColumnKindCode.INTEGER
19-
| typeof ColumnKindCode.STRING
20-
| typeof ColumnKindCode.BOOLEAN
21-
| typeof ColumnKindCode.DATE
22-
| typeof ColumnKindCode.ENTITY;
16+
export type BqrsColumnKind =
17+
| typeof BqrsColumnKindCode.FLOAT
18+
| typeof BqrsColumnKindCode.INTEGER
19+
| typeof BqrsColumnKindCode.STRING
20+
| typeof BqrsColumnKindCode.BOOLEAN
21+
| typeof BqrsColumnKindCode.DATE
22+
| typeof BqrsColumnKindCode.ENTITY;
2323

24-
interface Column {
24+
export interface BqrsSchemaColumn {
2525
name?: string;
26-
kind: ColumnKind;
26+
kind: BqrsColumnKind;
2727
}
2828

29-
export interface ResultSetSchema {
29+
export interface BqrsResultSetSchema {
3030
name: string;
3131
rows: number;
32-
columns: Column[];
33-
pagination?: PaginationInfo;
32+
columns: BqrsSchemaColumn[];
33+
pagination?: BqrsPaginationInfo;
3434
}
3535

36-
export function getResultSetSchema(
37-
resultSetName: string,
38-
resultSets: BQRSInfo,
39-
): ResultSetSchema | undefined {
40-
for (const schema of resultSets["result-sets"]) {
41-
if (schema.name === resultSetName) {
42-
return schema;
43-
}
44-
}
45-
return undefined;
46-
}
47-
interface PaginationInfo {
36+
interface BqrsPaginationInfo {
4837
"step-size": number;
4938
offsets: number[];
5039
}
5140

52-
export interface BQRSInfo {
53-
"result-sets": ResultSetSchema[];
41+
export interface BqrsInfo {
42+
"result-sets": BqrsResultSetSchema[];
5443
}
5544

5645
export type BqrsId = number;
5746

58-
export interface EntityValue {
59-
url?: UrlValue;
47+
export interface BqrsEntityValue {
48+
url?: BqrsUrlValue;
6049
label?: string;
6150
id?: BqrsId;
6251
}
6352

64-
export interface LineColumnLocation {
53+
export interface BqrsLineColumnLocation {
6554
uri: string;
6655
startLine: number;
6756
startColumn: number;
6857
endLine: number;
6958
endColumn: number;
7059
}
7160

72-
export interface WholeFileLocation {
61+
export interface BqrsWholeFileLocation {
7362
uri: string;
7463
startLine: never;
7564
startColumn: never;
7665
endLine: never;
7766
endColumn: never;
7867
}
7968

80-
export type ResolvableLocationValue = WholeFileLocation | LineColumnLocation;
81-
82-
export type UrlValue = ResolvableLocationValue | string;
83-
84-
export type CellValue = EntityValue | number | string | boolean;
69+
export type BqrsUrlValue =
70+
| BqrsWholeFileLocation
71+
| BqrsLineColumnLocation
72+
| string;
8573

86-
export type ResultRow = CellValue[];
87-
88-
export interface RawResultSet {
89-
readonly schema: ResultSetSchema;
90-
readonly rows: readonly ResultRow[];
91-
}
92-
93-
// TODO: This function is not necessary. It generates a tuple that is slightly easier
94-
// to handle than the ResultSetSchema and DecodedBqrsChunk. But perhaps it is unnecessary
95-
// boilerplate.
96-
export function transformBqrsResultSet(
97-
schema: ResultSetSchema,
98-
page: DecodedBqrsChunk,
99-
): RawResultSet {
100-
return {
101-
schema,
102-
rows: Array.from(page.tuples),
103-
};
104-
}
74+
export type BqrsCellValue = BqrsEntityValue | number | string | boolean;
10575

10676
export type BqrsKind =
10777
| "String"
10878
| "Float"
10979
| "Integer"
110-
| "String"
11180
| "Boolean"
11281
| "Date"
11382
| "Entity";
11483

115-
export interface BqrsColumn {
84+
interface BqrsColumn {
11685
name?: string;
11786
kind: BqrsKind;
11887
}
88+
11989
export interface DecodedBqrsChunk {
120-
tuples: CellValue[][];
90+
tuples: BqrsCellValue[][];
12191
next?: number;
12292
columns: BqrsColumn[];
12393
}

0 commit comments

Comments
 (0)