This commit is contained in:
Koen Vlaswinkel 2023-12-21 16:19:22 +01:00
Родитель d0f122ad87
Коммит 82c7dd52be
3 изменённых файлов: 20 добавлений и 126 удалений

Просмотреть файл

@ -30,11 +30,11 @@ import { walkDirectory } from "../common/files";
import { QueryMetadata, SortDirection } from "../common/interface-types"; import { QueryMetadata, SortDirection } from "../common/interface-types";
import { BaseLogger, Logger } from "../common/logging"; import { BaseLogger, Logger } from "../common/logging";
import { ProgressReporter } from "../common/logging/vscode"; import { ProgressReporter } from "../common/logging/vscode";
import { CompilationMessage } from "../query-server/legacy-messages";
import { sarifParser } from "../common/sarif-parser"; import { sarifParser } from "../common/sarif-parser";
import { App } from "../common/app"; import { App } from "../common/app";
import { QueryLanguage } from "../common/query-language"; import { QueryLanguage } from "../common/query-language";
import { LINE_ENDINGS, splitStreamAtSeparators } from "../common/split-stream"; import { LINE_ENDINGS, splitStreamAtSeparators } from "../common/split-stream";
import { Position } from "../query-server/new-messages";
/** /**
* The version of the SARIF format that we are using. * The version of the SARIF format that we are using.
@ -159,6 +159,24 @@ export type ResolvedQueries = string[];
*/ */
export type ResolvedTests = string[]; export type ResolvedTests = string[];
/**
* A compilation message for a test message (either an error or a warning)
*/
export interface CompilationMessage {
/**
* The text of the message
*/
message: string;
/**
* The source position associated with the message
*/
position: Position;
/**
* The severity of the message
*/
severity: number;
}
/** /**
* Event fired by `codeql test run`. * Event fired by `codeql test run`.
*/ */

Просмотреть файл

@ -1,124 +0,0 @@
/**
* Types for messages exchanged during jsonrpc communication with the
* the CodeQL query server.
*
* This file only contains types for messages that are still in use by
* the extension. Communication with the query server happens through
* messages in new-messages.ts.
*
* A note about the namespaces below, which look like they are
* essentially enums, namely Severity and QueryResultType.
* By design, for the sake of extensibility, clients
* receiving messages of this protocol are supposed to accept any
* number for any of these types. We commit to the given meaning of
* the numbers listed in constants in the namespaces, and we commit to
* the fact that any unknown QueryResultType value counts as an error.
*/
import * as shared from "./messages-shared";
/**
* A compilation message (either an error or a warning)
*/
export interface CompilationMessage {
/**
* The text of the message
*/
message: string;
/**
* The source position associated with the message
*/
position: Position;
/**
* The severity of the message
*/
severity: Severity;
}
export type Severity = number;
/**
* Severity of different messages. This namespace is intentionally not
* an enum, see "for the sake of extensibility" comment above.
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace Severity {
/**
* The message is a compilation error.
*/
export const ERROR = 0;
/**
* The message is a compilation warning.
*/
export const WARNING = 1;
}
/**
* The result of a single query
*/
export interface EvaluationResult {
/**
* The id of the run that this query was in
*/
runId: number;
/**
* The id of the query within the run
*/
queryId: number;
/**
* The type of the result. See QueryResultType for
* possible meanings. Any other result should be interpreted as an error.
*/
resultType: QueryResultType;
/**
* The wall clock time it took to evaluate the query.
* The time is from when we initially tried to evaluate the query
* to when we get the results. Hence with parallel evaluation the times may
* look odd.
*/
evaluationTime: number;
/**
* An error message if an error happened
*/
message?: string;
/**
* Full path to file with all log messages emitted while this query was active, if one exists
*/
logFileLocation?: string;
}
export type QueryResultType = number;
/**
* The result of running a query. This namespace is intentionally not
* an enum, see "for the sake of extensibility" comment above.
*/
// eslint-disable-next-line @typescript-eslint/no-namespace
export namespace QueryResultType {
/**
* The query ran successfully
*/
export const SUCCESS = 0;
/**
* The query failed due to an reason
* that isn't listed
*/
export const OTHER_ERROR = 1;
/**
* The query failed due to running out of
* memory
*/
export const OOM = 2;
/**
* The query failed due to exceeding the timeout
*/
export const TIMEOUT = 3;
/**
* The query failed because it was cancelled.
*/
export const CANCELLATION = 4;
}
/**
* A position within a QL file.
*/
export type Position = shared.Position;

Просмотреть файл

@ -9,7 +9,7 @@ import {
} from "vscode"; } from "vscode";
import * as CodeQLProtocol from "../../../../src/debugger/debug-protocol"; import * as CodeQLProtocol from "../../../../src/debugger/debug-protocol";
import { DisposableObject } from "../../../../src/common/disposable-object"; import { DisposableObject } from "../../../../src/common/disposable-object";
import { QueryResultType } from "../../../../src/query-server/legacy-messages"; import { QueryResultType } from "../../../../src/query-server/new-messages";
import { CoreCompletedQuery } from "../../../../src/query-server/query-runner"; import { CoreCompletedQuery } from "../../../../src/query-server/query-runner";
import { QueryOutputDir } from "../../../../src/run-queries-shared"; import { QueryOutputDir } from "../../../../src/run-queries-shared";
import { import {