Merge pull request #3647 from d10c/d10c/bigint-quick-eval
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
## [UNRELEASED]
|
||||
|
||||
- Support result columns of type `QlBuiltins::BigInt` in quick evaluations. [#3647](https://github.com/github/vscode-codeql/pull/3647)
|
||||
|
||||
## 1.16.0 - 10 October 2024
|
||||
|
||||
- Increase the required version of VS Code to 1.90.0. [#3737](https://github.com/github/vscode-codeql/pull/3737)
|
||||
|
||||
@@ -11,6 +11,7 @@ export namespace BqrsColumnKindCode {
|
||||
export const BOOLEAN = "b";
|
||||
export const DATE = "d";
|
||||
export const ENTITY = "e";
|
||||
export const BIGINT = "z";
|
||||
}
|
||||
|
||||
export type BqrsColumnKind =
|
||||
@@ -19,7 +20,8 @@ export type BqrsColumnKind =
|
||||
| typeof BqrsColumnKindCode.STRING
|
||||
| typeof BqrsColumnKindCode.BOOLEAN
|
||||
| typeof BqrsColumnKindCode.DATE
|
||||
| typeof BqrsColumnKindCode.ENTITY;
|
||||
| typeof BqrsColumnKindCode.ENTITY
|
||||
| typeof BqrsColumnKindCode.BIGINT;
|
||||
|
||||
export interface BqrsSchemaColumn {
|
||||
name?: string;
|
||||
@@ -79,7 +81,8 @@ export type BqrsKind =
|
||||
| "Integer"
|
||||
| "Boolean"
|
||||
| "Date"
|
||||
| "Entity";
|
||||
| "Entity"
|
||||
| "BigInt";
|
||||
|
||||
interface BqrsColumn {
|
||||
name?: string;
|
||||
|
||||
@@ -76,6 +76,8 @@ function mapColumnKind(kind: BqrsColumnKind): ColumnKind {
|
||||
return ColumnKind.Date;
|
||||
case BqrsColumnKindCode.ENTITY:
|
||||
return ColumnKind.Entity;
|
||||
case BqrsColumnKindCode.BIGINT:
|
||||
return ColumnKind.BigInt;
|
||||
default:
|
||||
assertNever(kind);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ export enum ColumnKind {
|
||||
Boolean = "boolean",
|
||||
Date = "date",
|
||||
Entity = "entity",
|
||||
BigInt = "bigint",
|
||||
}
|
||||
|
||||
export type Column = {
|
||||
@@ -61,6 +62,11 @@ type CellValueNumber = {
|
||||
value: number;
|
||||
};
|
||||
|
||||
type CellValueBigInt = {
|
||||
type: "number";
|
||||
value: number;
|
||||
};
|
||||
|
||||
type CellValueString = {
|
||||
type: "string";
|
||||
value: string;
|
||||
@@ -75,7 +81,8 @@ export type CellValue =
|
||||
| CellValueEntity
|
||||
| CellValueNumber
|
||||
| CellValueString
|
||||
| CellValueBoolean;
|
||||
| CellValueBoolean
|
||||
| CellValueBigInt;
|
||||
|
||||
export type Row = CellValue[];
|
||||
|
||||
|
||||
@@ -17,4 +17,8 @@ abstract class InterestingNumber extends TNumber
|
||||
final int getValue() {
|
||||
result = value
|
||||
}
|
||||
|
||||
QlBuiltins::BigInt getBigIntValue() {
|
||||
result = value.toBigInt()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,6 +144,25 @@ describeWithCodeQL()("Debugger", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("should run a quick evaluation with a bigint-valued result column", async () => {
|
||||
await withDebugController(appCommands, async (controller) => {
|
||||
await selectForQuickEval(quickEvalLibPath, 20, 23, 20, 37);
|
||||
|
||||
await controller.startDebuggingSelection({
|
||||
query: quickEvalQueryPath, // The query context. This query extends the abstract class.
|
||||
});
|
||||
await controller.expectLaunched();
|
||||
const result = await controller.expectSucceeded();
|
||||
expect(result.started.quickEvalContext).toBeDefined();
|
||||
expect(result.started.quickEvalContext!.quickEvalText).toBe(
|
||||
"getBigIntValue",
|
||||
);
|
||||
expect(result.results.queryTarget.quickEvalPosition).toBeDefined();
|
||||
expect(await getResultCount(result.results.outputDir, cli)).toBe(8);
|
||||
await controller.expectStopped();
|
||||
});
|
||||
});
|
||||
|
||||
it("should save dirty documents before launching a debug session", async () => {
|
||||
await withDebugController(appCommands, async (controller) => {
|
||||
const editor = await selectForQuickEval(quickEvalLibPath, 4, 15, 4, 32);
|
||||
|
||||
Reference in New Issue
Block a user