Enforce consistent type imports
This commit is contained in:
@@ -49,6 +49,7 @@ const baseConfig = {
|
||||
"@typescript-eslint/no-shadow": "off",
|
||||
"prefer-const": ["warn", { destructuring: "all" }],
|
||||
"@typescript-eslint/no-throw-literal": "error",
|
||||
"@typescript-eslint/consistent-type-imports": "error",
|
||||
"no-useless-escape": 0,
|
||||
camelcase: "off",
|
||||
curly: ["error", "all"],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Preview } from "@storybook/react";
|
||||
import type { Preview } from "@storybook/react";
|
||||
import { themes } from "@storybook/theming";
|
||||
import { action } from "@storybook/addon-actions";
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
import { FunctionComponent, useCallback } from "react";
|
||||
import type { FunctionComponent } from "react";
|
||||
import { useCallback } from "react";
|
||||
|
||||
import { useGlobals } from "@storybook/manager-api";
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,7 @@ import { dest, src } from "gulp";
|
||||
import { load } from "js-yaml";
|
||||
import { obj } from "through2";
|
||||
import PluginError from "plugin-error";
|
||||
import Vinyl from "vinyl";
|
||||
import type Vinyl from "vinyl";
|
||||
|
||||
/**
|
||||
* Replaces all rule references with the match pattern of the referenced rule.
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { gray, red } from "ansi-colors";
|
||||
import { dest, src, watch } from "gulp";
|
||||
import esbuild from "gulp-esbuild";
|
||||
import { createProject, reporter } from "gulp-typescript";
|
||||
import type { reporter } from "gulp-typescript";
|
||||
import { createProject } from "gulp-typescript";
|
||||
import del from "del";
|
||||
|
||||
export function goodReporter(): reporter.Reporter {
|
||||
|
||||
@@ -14,15 +14,15 @@
|
||||
import { pathExists, readJson, writeJson } from "fs-extra";
|
||||
import { resolve, relative } from "path";
|
||||
|
||||
import { Octokit } from "@octokit/core";
|
||||
import type { Octokit } from "@octokit/core";
|
||||
import { type RestEndpointMethodTypes } from "@octokit/rest";
|
||||
import { throttling } from "@octokit/plugin-throttling";
|
||||
|
||||
import { getFiles } from "./util/files";
|
||||
import type { GitHubApiRequest } from "../src/common/mock-gh-api/gh-api-request";
|
||||
import { isGetVariantAnalysisRequest } from "../src/common/mock-gh-api/gh-api-request";
|
||||
import { VariantAnalysis } from "../src/variant-analysis/gh-api/variant-analysis";
|
||||
import { RepositoryWithMetadata } from "../src/variant-analysis/gh-api/repository";
|
||||
import type { VariantAnalysis } from "../src/variant-analysis/gh-api/variant-analysis";
|
||||
import type { RepositoryWithMetadata } from "../src/variant-analysis/gh-api/repository";
|
||||
import { AppOctokit } from "../src/common/octokit";
|
||||
|
||||
const extensionDirectory = resolve(__dirname, "..");
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
import { spawnSync } from "child_process";
|
||||
import { basename, resolve } from "path";
|
||||
import { pathExists, readJSON } from "fs-extra";
|
||||
import { RawSourceMap, SourceMapConsumer } from "source-map";
|
||||
import type { RawSourceMap } from "source-map";
|
||||
import { SourceMapConsumer } from "source-map";
|
||||
import { unzipToDirectorySequentially } from "../src/common/unzip";
|
||||
|
||||
if (process.argv.length !== 4) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AppCommandManager } from "../common/commands";
|
||||
import type { AppCommandManager } from "../common/commands";
|
||||
import { Uri, workspace } from "vscode";
|
||||
import { join } from "path";
|
||||
import { pathExists } from "fs-extra";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { parse, SemVer } from "semver";
|
||||
import type { SemVer } from "semver";
|
||||
import { parse } from "semver";
|
||||
import { runCodeQlCliCommand } from "./cli";
|
||||
import { Logger } from "../common/logging";
|
||||
import type { Logger } from "../common/logging";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
import { EOL } from "os";
|
||||
import { spawn } from "child-process-promise";
|
||||
import {
|
||||
ChildProcessWithoutNullStreams,
|
||||
execFile,
|
||||
spawn as spawnChildProcess,
|
||||
} from "child_process";
|
||||
import type { ChildProcessWithoutNullStreams } from "child_process";
|
||||
import { execFile, spawn as spawnChildProcess } from "child_process";
|
||||
import { readFile } from "fs-extra";
|
||||
import { delimiter, dirname, join } from "path";
|
||||
import { Log } from "sarif";
|
||||
import type { Log } from "sarif";
|
||||
import { SemVer } from "semver";
|
||||
import { Readable } from "stream";
|
||||
import type { Readable } from "stream";
|
||||
import tk from "tree-kill";
|
||||
import { promisify } from "util";
|
||||
import { CancellationToken, Disposable, Uri } from "vscode";
|
||||
import type { CancellationToken, Disposable, Uri } from "vscode";
|
||||
|
||||
import {
|
||||
import type {
|
||||
BqrsInfo,
|
||||
DecodedBqrs,
|
||||
DecodedBqrsChunk,
|
||||
} from "../common/bqrs-cli-types";
|
||||
import { CliConfig } from "../config";
|
||||
import {
|
||||
DistributionProvider,
|
||||
FindDistributionResultKind,
|
||||
} from "./distribution";
|
||||
import type { CliConfig } from "../config";
|
||||
import type { DistributionProvider } from "./distribution";
|
||||
import { FindDistributionResultKind } from "./distribution";
|
||||
import {
|
||||
assertNever,
|
||||
getChildProcessErrorMessage,
|
||||
@@ -31,14 +26,15 @@ import {
|
||||
getErrorStack,
|
||||
} from "../common/helpers-pure";
|
||||
import { walkDirectory } from "../common/files";
|
||||
import { QueryMetadata, SortDirection } from "../common/interface-types";
|
||||
import { BaseLogger, Logger } from "../common/logging";
|
||||
import { ProgressReporter } from "../common/logging/vscode";
|
||||
import type { QueryMetadata } from "../common/interface-types";
|
||||
import { SortDirection } from "../common/interface-types";
|
||||
import type { BaseLogger, Logger } from "../common/logging";
|
||||
import type { ProgressReporter } from "../common/logging/vscode";
|
||||
import { sarifParser } from "../common/sarif-parser";
|
||||
import { App } from "../common/app";
|
||||
import type { App } from "../common/app";
|
||||
import { QueryLanguage } from "../common/query-language";
|
||||
import { LINE_ENDINGS, splitStreamAtSeparators } from "../common/split-stream";
|
||||
import { Position } from "../query-server/messages";
|
||||
import type { Position } from "../query-server/messages";
|
||||
|
||||
/**
|
||||
* The version of the SARIF format that we are using.
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import { createWriteStream, mkdtemp, pathExists, remove } from "fs-extra";
|
||||
import { tmpdir } from "os";
|
||||
import { delimiter, dirname, join } from "path";
|
||||
import { Range, satisfies, SemVer } from "semver";
|
||||
import { Event, ExtensionContext } from "vscode";
|
||||
import { DistributionConfig } from "../config";
|
||||
import type { SemVer } from "semver";
|
||||
import { Range, satisfies } from "semver";
|
||||
import type { Event, ExtensionContext } from "vscode";
|
||||
import type { DistributionConfig } from "../config";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getCodeQlCliVersion } from "./cli-version";
|
||||
import {
|
||||
ProgressCallback,
|
||||
reportStreamProgress,
|
||||
} from "../common/vscode/progress";
|
||||
import type { ProgressCallback } from "../common/vscode/progress";
|
||||
import { reportStreamProgress } from "../common/vscode/progress";
|
||||
import {
|
||||
codeQlLauncherName,
|
||||
deprecatedCodeQlLauncherName,
|
||||
@@ -25,7 +24,7 @@ import {
|
||||
} from "../common/logging";
|
||||
import { unzipToDirectoryConcurrently } from "../common/unzip-concurrently";
|
||||
import { reportUnzipProgress } from "../common/vscode/unzip-progress";
|
||||
import { Release } from "./distribution/release";
|
||||
import type { Release } from "./distribution/release";
|
||||
import { ReleasesApiConsumer } from "./distribution/releases-api-consumer";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { default as fetch, Response } from "node-fetch";
|
||||
import { compare, parse, Range, satisfies } from "semver";
|
||||
import type { Response } from "node-fetch";
|
||||
import { default as fetch } from "node-fetch";
|
||||
import type { Range } from "semver";
|
||||
import { compare, parse, satisfies } from "semver";
|
||||
import { URL } from "url";
|
||||
import { Release, ReleaseAsset } from "./release";
|
||||
import type { Release, ReleaseAsset } from "./release";
|
||||
import { GithubApiError, GithubRateLimitedError } from "./github-api-error";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { CodeQLCliServer } from "./cli";
|
||||
import { Uri, window } from "vscode";
|
||||
import type { CodeQLCliServer } from "./cli";
|
||||
import type { Uri } from "vscode";
|
||||
import { window } from "vscode";
|
||||
import {
|
||||
getLanguageDisplayName,
|
||||
isQueryLanguage,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { CodeQLCliServer } from "./cli";
|
||||
import { QueryMetadata } from "../common/interface-types";
|
||||
import type { CodeQLCliServer } from "./cli";
|
||||
import type { QueryMetadata } from "../common/interface-types";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Credentials } from "./authentication";
|
||||
import { Disposable } from "./disposable-object";
|
||||
import { AppEventEmitter } from "./events";
|
||||
import { NotificationLogger } from "./logging";
|
||||
import { Memento } from "./memento";
|
||||
import { AppCommandManager } from "./commands";
|
||||
import { AppTelemetry } from "./telemetry";
|
||||
import type { Credentials } from "./authentication";
|
||||
import type { Disposable } from "./disposable-object";
|
||||
import type { AppEventEmitter } from "./events";
|
||||
import type { NotificationLogger } from "./logging";
|
||||
import type { Memento } from "./memento";
|
||||
import type { AppCommandManager } from "./commands";
|
||||
import type { AppTelemetry } from "./telemetry";
|
||||
|
||||
export interface App {
|
||||
createEventEmitter<T>(): AppEventEmitter<T>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
|
||||
/**
|
||||
* An interface providing methods for obtaining access tokens
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import {
|
||||
import type {
|
||||
BqrsCellValue as BqrsCellValue,
|
||||
BqrsColumnKind as BqrsColumnKind,
|
||||
BqrsColumnKindCode,
|
||||
DecodedBqrsChunk,
|
||||
BqrsEntityValue as BqrsEntityValue,
|
||||
BqrsLineColumnLocation,
|
||||
@@ -10,16 +9,17 @@ import {
|
||||
BqrsWholeFileLocation,
|
||||
BqrsSchemaColumn,
|
||||
} from "./bqrs-cli-types";
|
||||
import {
|
||||
import { BqrsColumnKindCode } from "./bqrs-cli-types";
|
||||
import type {
|
||||
CellValue,
|
||||
Column,
|
||||
ColumnKind,
|
||||
EntityValue,
|
||||
RawResultSet,
|
||||
Row,
|
||||
UrlValue,
|
||||
UrlValueResolvable,
|
||||
} from "./raw-result-types";
|
||||
import { ColumnKind } from "./raw-result-types";
|
||||
import { assertNever } from "./helpers-pure";
|
||||
import { isEmptyPath } from "./bqrs-utils";
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { createRemoteFileRef } from "../common/location-link-utils";
|
||||
import { isUrlValueResolvable, UrlValue } from "./raw-result-types";
|
||||
import type { UrlValue } from "./raw-result-types";
|
||||
import { isUrlValueResolvable } from "./raw-result-types";
|
||||
|
||||
/**
|
||||
* Checks whether the file path is empty. If so, we do not want to render this location
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DisposableObject } from "./disposable-object";
|
||||
import { getErrorMessage } from "./helpers-pure";
|
||||
import { BaseLogger } from "./logging";
|
||||
import type { BaseLogger } from "./logging";
|
||||
|
||||
/**
|
||||
* Base class for "discovery" operations, which scan the file system to find specific kinds of
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Disposable } from "./disposable-object";
|
||||
import type { Disposable } from "./disposable-object";
|
||||
|
||||
export interface AppEvent<T> {
|
||||
(listener: (event: T) => void): Disposable;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { basename, dirname, join } from "path";
|
||||
import { EnvironmentContext } from "./app";
|
||||
import type { EnvironmentContext } from "./app";
|
||||
|
||||
/**
|
||||
* A node in the tree of files. This will be either a `FileTreeDirectory` or a `FileTreeLeaf`.
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
import { Log, Result } from "sarif";
|
||||
import {
|
||||
import type { Log, Result } from "sarif";
|
||||
import type {
|
||||
VariantAnalysis,
|
||||
VariantAnalysisScannedRepositoryResult,
|
||||
VariantAnalysisScannedRepositoryState,
|
||||
} from "../variant-analysis/shared/variant-analysis";
|
||||
import {
|
||||
import type {
|
||||
RepositoriesFilterSortState,
|
||||
RepositoriesFilterSortStateWithIds,
|
||||
} from "../variant-analysis/shared/variant-analysis-filter-sort";
|
||||
import { ErrorLike } from "../common/errors";
|
||||
import { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
|
||||
import { Method } from "../model-editor/method";
|
||||
import { ModeledMethod } from "../model-editor/modeled-method";
|
||||
import {
|
||||
import type { ErrorLike } from "../common/errors";
|
||||
import type { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
|
||||
import type { Method } from "../model-editor/method";
|
||||
import type { ModeledMethod } from "../model-editor/modeled-method";
|
||||
import type {
|
||||
MethodModelingPanelViewState,
|
||||
ModelEditorViewState,
|
||||
} from "../model-editor/shared/view-state";
|
||||
import { Mode } from "../model-editor/shared/mode";
|
||||
import { QueryLanguage } from "./query-language";
|
||||
import {
|
||||
import type { Mode } from "../model-editor/shared/mode";
|
||||
import type { QueryLanguage } from "./query-language";
|
||||
import type {
|
||||
Column,
|
||||
RawResultSet,
|
||||
Row,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Memento } from "./memento";
|
||||
import type { Memento } from "./memento";
|
||||
|
||||
/**
|
||||
* Provides a utility method to invoke a function only if a minimum time interval has elapsed since
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FileLink } from "../variant-analysis/shared/analysis-result";
|
||||
import type { FileLink } from "../variant-analysis/shared/analysis-result";
|
||||
|
||||
export function createRemoteFileRef(
|
||||
fileLink: FileLink,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Logger } from "./logger";
|
||||
import type { Logger } from "./logger";
|
||||
|
||||
export interface NotificationLogger extends Logger {
|
||||
showErrorMessage(message: string): Promise<void>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NotificationLogger } from "./notification-logger";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
import { RedactableError } from "../errors";
|
||||
import type { NotificationLogger } from "./notification-logger";
|
||||
import type { AppTelemetry } from "../telemetry";
|
||||
import type { RedactableError } from "../errors";
|
||||
|
||||
interface ShowAndLogOptions {
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { appendFile, ensureFile } from "fs-extra";
|
||||
import { isAbsolute } from "path";
|
||||
import { getErrorMessage } from "../helpers-pure";
|
||||
import { Logger, LogOptions } from "./logger";
|
||||
import type { Logger, LogOptions } from "./logger";
|
||||
|
||||
/**
|
||||
* An implementation of {@link Logger} that sends the output both to another {@link Logger}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { window as Window, OutputChannel, Progress } from "vscode";
|
||||
import { Logger, LogOptions } from "../logger";
|
||||
import type { OutputChannel, Progress } from "vscode";
|
||||
import { window as Window } from "vscode";
|
||||
import type { Logger, LogOptions } from "../logger";
|
||||
import { DisposableObject } from "../../disposable-object";
|
||||
import { NotificationLogger } from "../notification-logger";
|
||||
import type { NotificationLogger } from "../notification-logger";
|
||||
|
||||
/**
|
||||
* A logger that writes messages to an output channel in the VS Code Output tab.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Repository } from "../../variant-analysis/gh-api/repository";
|
||||
import {
|
||||
import type { Repository } from "../../variant-analysis/gh-api/repository";
|
||||
import type {
|
||||
VariantAnalysis,
|
||||
VariantAnalysisRepoTask,
|
||||
} from "../../variant-analysis/gh-api/variant-analysis";
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { join, resolve } from "path";
|
||||
import { pathExists } from "fs-extra";
|
||||
import { setupServer, SetupServer } from "msw/node";
|
||||
import type { SetupServer } from "msw/node";
|
||||
import { setupServer } from "msw/node";
|
||||
|
||||
import { DisposableObject } from "../disposable-object";
|
||||
|
||||
|
||||
@@ -2,24 +2,24 @@ import { ensureDir, writeFile } from "fs-extra";
|
||||
import { join } from "path";
|
||||
|
||||
import fetch from "node-fetch";
|
||||
import { SetupServer } from "msw/node";
|
||||
import type { SetupServer } from "msw/node";
|
||||
|
||||
import { DisposableObject } from "../disposable-object";
|
||||
import { gzipDecode } from "../zlib";
|
||||
|
||||
import {
|
||||
import type {
|
||||
AutoModelResponse,
|
||||
BasicErrorResponse,
|
||||
CodeSearchResponse,
|
||||
GetVariantAnalysisRepoResultRequest,
|
||||
GitHubApiRequest,
|
||||
RequestKind,
|
||||
} from "./gh-api-request";
|
||||
import {
|
||||
import { RequestKind } from "./gh-api-request";
|
||||
import type {
|
||||
VariantAnalysis,
|
||||
VariantAnalysisRepoTask,
|
||||
} from "../../variant-analysis/gh-api/variant-analysis";
|
||||
import { Repository } from "../../variant-analysis/gh-api/repository";
|
||||
import type { Repository } from "../../variant-analysis/gh-api/repository";
|
||||
|
||||
export class Recorder extends DisposableObject {
|
||||
private currentRecordedScenario: GitHubApiRequest[] = [];
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { join } from "path";
|
||||
import { readdir, readJson, readFile } from "fs-extra";
|
||||
import { http, RequestHandler } from "msw";
|
||||
import type { RequestHandler } from "msw";
|
||||
import { http } from "msw";
|
||||
import type { GitHubApiRequest } from "./gh-api-request";
|
||||
import {
|
||||
GitHubApiRequest,
|
||||
isAutoModelRequest,
|
||||
isCodeSearchRequest,
|
||||
isGetRepoRequest,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { pathExists } from "fs-extra";
|
||||
import { env, QuickPickItem, Uri, window } from "vscode";
|
||||
import type { QuickPickItem } from "vscode";
|
||||
import { env, Uri, window } from "vscode";
|
||||
|
||||
import {
|
||||
getMockGitHubApiServerScenariosPath,
|
||||
@@ -7,8 +8,9 @@ import {
|
||||
} from "../../../config";
|
||||
import { DisposableObject } from "../../disposable-object";
|
||||
import { MockGitHubApiServer } from "../mock-gh-api-server";
|
||||
import { MockGitHubApiServerCommands } from "../../commands";
|
||||
import { App, AppMode } from "../../app";
|
||||
import type { MockGitHubApiServerCommands } from "../../commands";
|
||||
import type { App } from "../../app";
|
||||
import { AppMode } from "../../app";
|
||||
import path from "path";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Log, Tool } from "sarif";
|
||||
import type { Log, Tool } from "sarif";
|
||||
import { createReadStream } from "fs-extra";
|
||||
import { connectTo } from "stream-json/Assembler";
|
||||
import { getErrorMessage } from "./helpers-pure";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Location, Region } from "sarif";
|
||||
import type { Location, Region } from "sarif";
|
||||
import type { HighlightedRegion } from "../variant-analysis/shared/analysis-result";
|
||||
import { UrlValueResolvable } from "./raw-result-types";
|
||||
import type { UrlValueResolvable } from "./raw-result-types";
|
||||
import { isEmptyPath } from "./bqrs-utils";
|
||||
|
||||
export interface SarifLink {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Readable } from "stream";
|
||||
import type { Readable } from "stream";
|
||||
import { StringDecoder } from "string_decoder";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RedactableError } from "./errors";
|
||||
import type { RedactableError } from "./errors";
|
||||
|
||||
export interface AppTelemetry {
|
||||
sendCommandUsage(name: string, executionTime: number, error?: Error): void;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { availableParallelism } from "os";
|
||||
import { UnzipProgressCallback, unzipToDirectory } from "./unzip";
|
||||
import type { UnzipProgressCallback } from "./unzip";
|
||||
import { unzipToDirectory } from "./unzip";
|
||||
import PQueue from "p-queue";
|
||||
|
||||
export async function unzipToDirectoryConcurrently(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { Entry as ZipEntry, open, Options as ZipOptions, ZipFile } from "yauzl";
|
||||
import { Readable, Transform } from "stream";
|
||||
import type { Entry as ZipEntry, Options as ZipOptions, ZipFile } from "yauzl";
|
||||
import { open } from "yauzl";
|
||||
import type { Readable } from "stream";
|
||||
import { Transform } from "stream";
|
||||
import { dirname, join } from "path";
|
||||
import { WriteStream } from "fs";
|
||||
import type { WriteStream } from "fs";
|
||||
import { createWriteStream, ensureDir } from "fs-extra";
|
||||
|
||||
// We can't use promisify because it picks up the wrong overload.
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import {
|
||||
import type {
|
||||
CancellationToken,
|
||||
Uri,
|
||||
WebviewView,
|
||||
WebviewViewProvider,
|
||||
WebviewViewResolveContext,
|
||||
} from "vscode";
|
||||
import { getHtmlForWebview, WebviewKind, WebviewMessage } from "./webview-html";
|
||||
import { Disposable } from "../disposable-object";
|
||||
import { App } from "../app";
|
||||
import { DeepReadonly } from "../readonly";
|
||||
import { Uri } from "vscode";
|
||||
import type { WebviewKind, WebviewMessage } from "./webview-html";
|
||||
import { getHtmlForWebview } from "./webview-html";
|
||||
import type { Disposable } from "../disposable-object";
|
||||
import type { App } from "../app";
|
||||
import type { DeepReadonly } from "../readonly";
|
||||
|
||||
export abstract class AbstractWebviewViewProvider<
|
||||
ToMessage extends WebviewMessage,
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import {
|
||||
import type {
|
||||
WebviewPanel,
|
||||
window as Window,
|
||||
ViewColumn,
|
||||
Uri,
|
||||
WebviewPanelOptions,
|
||||
WebviewOptions,
|
||||
} from "vscode";
|
||||
import { window as Window, Uri } from "vscode";
|
||||
import { join } from "path";
|
||||
|
||||
import { App } from "../app";
|
||||
import { Disposable } from "../disposable-object";
|
||||
import type { App } from "../app";
|
||||
import type { Disposable } from "../disposable-object";
|
||||
import { tmpDir } from "../../tmp-dir";
|
||||
import { getHtmlForWebview, WebviewMessage, WebviewKind } from "./webview-html";
|
||||
import { DeepReadonly } from "../readonly";
|
||||
import type { WebviewMessage, WebviewKind } from "./webview-html";
|
||||
import { getHtmlForWebview } from "./webview-html";
|
||||
import type { DeepReadonly } from "../readonly";
|
||||
|
||||
export type WebviewPanelConfig = {
|
||||
viewId: string;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
import { pathExists } from "fs-extra";
|
||||
import { Entry as ZipEntry, ZipFile } from "yauzl";
|
||||
import {
|
||||
Disposable,
|
||||
import type { Entry as ZipEntry, ZipFile } from "yauzl";
|
||||
import type {
|
||||
Event,
|
||||
EventEmitter,
|
||||
ExtensionContext,
|
||||
FileChangeEvent,
|
||||
FileStat,
|
||||
FileSystemError,
|
||||
FileSystemProvider,
|
||||
} from "vscode";
|
||||
import {
|
||||
Disposable,
|
||||
EventEmitter,
|
||||
FileSystemError,
|
||||
FileType,
|
||||
Uri,
|
||||
workspace,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { authentication } from "vscode";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { Credentials } from "../authentication";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
import type { Credentials } from "../authentication";
|
||||
import { AppOctokit } from "../octokit";
|
||||
|
||||
export const GITHUB_AUTH_PROVIDER_ID = "github";
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import { commands, Disposable } from "vscode";
|
||||
import { CommandFunction, CommandManager } from "../../packages/commands";
|
||||
import type { Disposable } from "vscode";
|
||||
import { commands } from "vscode";
|
||||
import type { CommandFunction } from "../../packages/commands";
|
||||
import { CommandManager } from "../../packages/commands";
|
||||
import type { NotificationLogger } from "../logging";
|
||||
import {
|
||||
NotificationLogger,
|
||||
showAndLogWarningMessage,
|
||||
showAndLogExceptionWithTelemetry,
|
||||
} from "../logging";
|
||||
@@ -10,7 +12,7 @@ import { asError, getErrorMessage } from "../../common/helpers-pure";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { UserCancellationException } from "./progress";
|
||||
import { telemetryListener } from "./telemetry";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
import type { AppTelemetry } from "../telemetry";
|
||||
|
||||
/**
|
||||
* Create a command manager for VSCode, wrapping registerCommandWithErrorHandling
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { env } from "vscode";
|
||||
import { EnvironmentContext } from "../app";
|
||||
import type { EnvironmentContext } from "../app";
|
||||
|
||||
export class AppEnvironmentContext implements EnvironmentContext {
|
||||
public get language(): string {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { EventEmitter } from "vscode";
|
||||
import { AppEventEmitter } from "../events";
|
||||
import type { AppEventEmitter } from "../events";
|
||||
|
||||
export class VSCodeAppEventEmitter<T>
|
||||
extends EventEmitter<T>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import {
|
||||
import type {
|
||||
Uri,
|
||||
Event,
|
||||
Disposable,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Uri, window } from "vscode";
|
||||
import { AppCommandManager } from "../commands";
|
||||
import type { AppCommandManager } from "../commands";
|
||||
import { showBinaryChoiceDialog } from "./dialog";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import {
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
import { Discovery } from "../discovery";
|
||||
import {
|
||||
Event,
|
||||
EventEmitter,
|
||||
RelativePattern,
|
||||
Uri,
|
||||
WorkspaceFoldersChangeEvent,
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import type { Event, Uri, WorkspaceFoldersChangeEvent } from "vscode";
|
||||
import { EventEmitter, RelativePattern, workspace } from "vscode";
|
||||
import { MultiFileSystemWatcher } from "./multi-file-system-watcher";
|
||||
import { AppEventEmitter } from "../events";
|
||||
import type { AppEventEmitter } from "../events";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
import { lstat } from "fs-extra";
|
||||
import { containsPath, isIOError } from "../files";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CancellationToken, Disposable } from "vscode";
|
||||
import type { CancellationToken, Disposable } from "vscode";
|
||||
import { DisposableObject } from "../disposable-object";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DisposableObject } from "../disposable-object";
|
||||
import { EventEmitter, Event, Uri, GlobPattern, workspace } from "vscode";
|
||||
import type { Event, Uri, GlobPattern } from "vscode";
|
||||
import { EventEmitter, workspace } from "vscode";
|
||||
|
||||
/**
|
||||
* A collection of `FileSystemWatcher` objects. Disposing this object disposes all of the individual
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import {
|
||||
import type {
|
||||
CancellationToken,
|
||||
ProgressLocation,
|
||||
ProgressOptions as VSCodeProgressOptions,
|
||||
window as Window,
|
||||
} from "vscode";
|
||||
import { ProgressLocation, window as Window } from "vscode";
|
||||
import { readableBytesMb } from "../bytes";
|
||||
|
||||
export class UserCancellationException extends Error {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import {
|
||||
import type {
|
||||
ExplorerSelectionCommandFunction,
|
||||
TreeViewContextMultiSelectionCommandFunction,
|
||||
TreeViewContextSingleSelectionCommandFunction,
|
||||
} from "../commands";
|
||||
import { showAndLogErrorMessage, NotificationLogger } from "../logging";
|
||||
import type { NotificationLogger } from "../logging";
|
||||
import { showAndLogErrorMessage } from "../logging";
|
||||
|
||||
// A hack to match types that are not an array, which is useful to help avoid
|
||||
// misusing createSingleSelectionCommand, e.g. where T accidentally gets instantiated
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import {
|
||||
ConfigurationTarget,
|
||||
import type {
|
||||
Extension,
|
||||
ExtensionContext,
|
||||
ConfigurationChangeEvent,
|
||||
env,
|
||||
} from "vscode";
|
||||
import { ConfigurationTarget, env } from "vscode";
|
||||
import TelemetryReporter from "vscode-extension-telemetry";
|
||||
import {
|
||||
ConfigListener,
|
||||
@@ -14,13 +13,13 @@ import {
|
||||
isIntegrationTestMode,
|
||||
isCanary,
|
||||
} from "../../config";
|
||||
import { TelemetryClient } from "applicationinsights";
|
||||
import type { TelemetryClient } from "applicationinsights";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
import { UserCancellationException } from "./progress";
|
||||
import { showBinaryChoiceWithUrlDialog } from "./dialog";
|
||||
import { RedactableError } from "../errors";
|
||||
import { SemVer } from "semver";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
import type { RedactableError } from "../errors";
|
||||
import type { SemVer } from "semver";
|
||||
import type { AppTelemetry } from "../telemetry";
|
||||
|
||||
// Key is injected at build time through the APP_INSIGHTS_KEY environment variable.
|
||||
const key = "REPLACE-APP-INSIGHTS-KEY";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { readableBytesMb } from "../bytes";
|
||||
import { UnzipProgressCallback } from "../unzip";
|
||||
import { ProgressCallback } from "./progress";
|
||||
import type { UnzipProgressCallback } from "../unzip";
|
||||
import type { ProgressCallback } from "./progress";
|
||||
|
||||
export function reportUnzipProgress(
|
||||
messagePrefix: string,
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
import { ExtensionContext, ExtensionMode } from "vscode";
|
||||
import type { ExtensionContext } from "vscode";
|
||||
import { ExtensionMode } from "vscode";
|
||||
import { VSCodeCredentials } from "./authentication";
|
||||
import { Disposable } from "../disposable-object";
|
||||
import { App, AppMode, EnvironmentContext } from "../app";
|
||||
import { AppEventEmitter } from "../events";
|
||||
import { NotificationLogger } from "../logging";
|
||||
import type { Disposable } from "../disposable-object";
|
||||
import type { App, EnvironmentContext } from "../app";
|
||||
import { AppMode } from "../app";
|
||||
import type { AppEventEmitter } from "../events";
|
||||
import type { NotificationLogger } from "../logging";
|
||||
import { extLogger, queryServerLogger } from "../logging/vscode";
|
||||
import { Memento } from "../memento";
|
||||
import type { Memento } from "../memento";
|
||||
import { VSCodeAppEventEmitter } from "./events";
|
||||
import { AppCommandManager, QueryServerCommandManager } from "../commands";
|
||||
import type { AppCommandManager, QueryServerCommandManager } from "../commands";
|
||||
import { createVSCodeCommandManager } from "./commands";
|
||||
import { AppEnvironmentContext } from "./environment-context";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
import type { AppTelemetry } from "../telemetry";
|
||||
import { telemetryListener } from "./telemetry";
|
||||
|
||||
export class ExtensionApp implements App {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { Uri, Webview } from "vscode";
|
||||
import type { Webview } from "vscode";
|
||||
import { Uri } from "vscode";
|
||||
import { randomBytes } from "crypto";
|
||||
import { EOL } from "os";
|
||||
import { App } from "../app";
|
||||
import type { App } from "../app";
|
||||
|
||||
export type WebviewKind =
|
||||
| "results"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { dirname, join } from "path";
|
||||
import { workspace, WorkspaceFolder } from "vscode";
|
||||
import type { WorkspaceFolder } from "vscode";
|
||||
import { workspace } from "vscode";
|
||||
|
||||
/** Returns true if the specified workspace folder is on the file system. */
|
||||
export function isWorkspaceFolderOnDisk(
|
||||
|
||||
@@ -1,34 +1,33 @@
|
||||
import { ViewColumn } from "vscode";
|
||||
|
||||
import {
|
||||
ALERTS_TABLE_NAME,
|
||||
import type {
|
||||
FromCompareViewMessage,
|
||||
InterpretedQueryCompareResult,
|
||||
QueryCompareResult,
|
||||
RawQueryCompareResult,
|
||||
ToCompareViewMessage,
|
||||
} from "../common/interface-types";
|
||||
import { Logger, showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { ALERTS_TABLE_NAME } from "../common/interface-types";
|
||||
import type { Logger } from "../common/logging";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { DatabaseManager } from "../databases/local-databases";
|
||||
import type { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import type { DatabaseManager } from "../databases/local-databases";
|
||||
import { jumpToLocation } from "../databases/local-databases/locations";
|
||||
import { BqrsInfo } from "../common/bqrs-cli-types";
|
||||
import type { BqrsInfo } from "../common/bqrs-cli-types";
|
||||
import resultsDiff from "./resultsDiff";
|
||||
import { CompletedLocalQueryInfo } from "../query-results";
|
||||
import type { CompletedLocalQueryInfo } from "../query-results";
|
||||
import { assertNever, getErrorMessage } from "../common/helpers-pure";
|
||||
import { HistoryItemLabelProvider } from "../query-history/history-item-label-provider";
|
||||
import {
|
||||
AbstractWebview,
|
||||
WebviewPanelConfig,
|
||||
} from "../common/vscode/abstract-webview";
|
||||
import type { HistoryItemLabelProvider } from "../query-history/history-item-label-provider";
|
||||
import type { WebviewPanelConfig } from "../common/vscode/abstract-webview";
|
||||
import { AbstractWebview } from "../common/vscode/abstract-webview";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { App } from "../common/app";
|
||||
import type { App } from "../common/app";
|
||||
import { bqrsToResultSet } from "../common/bqrs-raw-results-mapper";
|
||||
import { RawResultSet } from "../common/raw-result-types";
|
||||
import type { RawResultSet } from "../common/raw-result-types";
|
||||
import type { CompareQueryInfo } from "./result-set-names";
|
||||
import {
|
||||
CompareQueryInfo,
|
||||
findCommonResultSetNames,
|
||||
findResultSetNames,
|
||||
getResultSetNames,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Uri } from "vscode";
|
||||
import { Log } from "sarif";
|
||||
import type { Log } from "sarif";
|
||||
import { pathExists } from "fs-extra";
|
||||
import { sarifParser } from "../common/sarif-parser";
|
||||
import { CompletedLocalQueryInfo } from "../query-results";
|
||||
import { DatabaseManager } from "../databases/local-databases";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { InterpretedQueryCompareResult } from "../common/interface-types";
|
||||
import type { CompletedLocalQueryInfo } from "../query-results";
|
||||
import type { DatabaseManager } from "../databases/local-databases";
|
||||
import type { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import type { InterpretedQueryCompareResult } from "../common/interface-types";
|
||||
|
||||
import { sarifDiff } from "./sarif-diff";
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { pathExists } from "fs-extra";
|
||||
import { BqrsInfo } from "../common/bqrs-cli-types";
|
||||
import type { BqrsInfo } from "../common/bqrs-cli-types";
|
||||
import type { QueryMetadata } from "../common/interface-types";
|
||||
import {
|
||||
ALERTS_TABLE_NAME,
|
||||
getDefaultResultSetName,
|
||||
QueryMetadata,
|
||||
} from "../common/interface-types";
|
||||
|
||||
export async function getResultSetNames(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RawQueryCompareResult } from "../common/interface-types";
|
||||
import { RawResultSet } from "../common/raw-result-types";
|
||||
import type { RawQueryCompareResult } from "../common/interface-types";
|
||||
import type { RawResultSet } from "../common/raw-result-types";
|
||||
|
||||
/**
|
||||
* Compare the rows of two queries. Use deep equality to determine if
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Result } from "sarif";
|
||||
import type { Result } from "sarif";
|
||||
|
||||
/**
|
||||
* Compare the alerts of two queries. Use deep equality to determine if
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { DisposableObject } from "./common/disposable-object";
|
||||
import {
|
||||
import type {
|
||||
ConfigurationChangeEvent,
|
||||
ConfigurationScope,
|
||||
ConfigurationTarget,
|
||||
Event,
|
||||
EventEmitter,
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import { DistributionManager } from "./codeql-cli/distribution";
|
||||
import { ConfigurationTarget, EventEmitter, workspace } from "vscode";
|
||||
import type { DistributionManager } from "./codeql-cli/distribution";
|
||||
import { extLogger } from "./common/logging/vscode";
|
||||
import { ONE_DAY_IN_MS } from "./common/time";
|
||||
import {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { throttling } from "@octokit/plugin-throttling";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { CancellationToken } from "vscode";
|
||||
import { Credentials } from "../common/authentication";
|
||||
import { BaseLogger } from "../common/logging";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
import type { CancellationToken } from "vscode";
|
||||
import type { Credentials } from "../common/authentication";
|
||||
import type { BaseLogger } from "../common/logging";
|
||||
import { AppOctokit } from "../common/octokit";
|
||||
import {
|
||||
ProgressCallback,
|
||||
UserCancellationException,
|
||||
} from "../common/vscode/progress";
|
||||
import type { ProgressCallback } from "../common/vscode/progress";
|
||||
import { UserCancellationException } from "../common/vscode/progress";
|
||||
|
||||
export async function getCodeSearchRepositories(
|
||||
query: string,
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
import { pathExists, outputJSON, readJSON, readJSONSync } from "fs-extra";
|
||||
import { join } from "path";
|
||||
import type { DbConfig, SelectedDbItem } from "./db-config";
|
||||
import {
|
||||
cloneDbConfig,
|
||||
DbConfig,
|
||||
removeRemoteList,
|
||||
removeRemoteOwner,
|
||||
removeRemoteRepo,
|
||||
renameRemoteList,
|
||||
SelectedDbItem,
|
||||
DB_CONFIG_VERSION,
|
||||
SelectedDbItemKind,
|
||||
} from "./db-config";
|
||||
import { FSWatcher, watch } from "chokidar";
|
||||
import {
|
||||
DisposableObject,
|
||||
DisposeHandler,
|
||||
} from "../../common/disposable-object";
|
||||
import type { FSWatcher } from "chokidar";
|
||||
import { watch } from "chokidar";
|
||||
import type { DisposeHandler } from "../../common/disposable-object";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import { DbConfigValidator } from "./db-config-validator";
|
||||
import { App } from "../../common/app";
|
||||
import { AppEvent, AppEventEmitter } from "../../common/events";
|
||||
import {
|
||||
DbConfigValidationError,
|
||||
DbConfigValidationErrorKind,
|
||||
} from "../db-validation-errors";
|
||||
import type { App } from "../../common/app";
|
||||
import type { AppEvent, AppEventEmitter } from "../../common/events";
|
||||
import type { DbConfigValidationError } from "../db-validation-errors";
|
||||
import { DbConfigValidationErrorKind } from "../db-validation-errors";
|
||||
import { ValueResult } from "../../common/value-result";
|
||||
import { RemoteUserDefinedListDbItem, DbItem, DbItemKind } from "../db-item";
|
||||
import type { RemoteUserDefinedListDbItem, DbItem } from "../db-item";
|
||||
import { DbItemKind } from "../db-item";
|
||||
|
||||
export class DbConfigStore extends DisposableObject {
|
||||
public static readonly databaseConfigFileName = "databases.json";
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { readJsonSync } from "fs-extra";
|
||||
import { resolve } from "path";
|
||||
import Ajv, { ValidateFunction } from "ajv";
|
||||
import { DbConfig } from "./db-config";
|
||||
import type { ValidateFunction } from "ajv";
|
||||
import Ajv from "ajv";
|
||||
import type { DbConfig } from "./db-config";
|
||||
import { findDuplicateStrings } from "../../common/text-utils";
|
||||
import {
|
||||
DbConfigValidationError,
|
||||
DbConfigValidationErrorKind,
|
||||
} from "../db-validation-errors";
|
||||
import type { DbConfigValidationError } from "../db-validation-errors";
|
||||
import { DbConfigValidationErrorKind } from "../db-validation-errors";
|
||||
|
||||
export class DbConfigValidator {
|
||||
private readonly validateSchemaFn: ValidateFunction;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import fetch, { Response } from "node-fetch";
|
||||
import type { Response } from "node-fetch";
|
||||
import fetch from "node-fetch";
|
||||
import { zip } from "zip-a-folder";
|
||||
import { Uri, window, InputBoxOptions } from "vscode";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import type { InputBoxOptions } from "vscode";
|
||||
import { Uri, window } from "vscode";
|
||||
import type { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import {
|
||||
ensureDir,
|
||||
realpath as fs_realpath,
|
||||
@@ -12,27 +14,25 @@ import {
|
||||
readdir,
|
||||
} from "fs-extra";
|
||||
import { basename, join } from "path";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
|
||||
import { DatabaseManager, DatabaseItem } from "./local-databases";
|
||||
import type { DatabaseManager, DatabaseItem } from "./local-databases";
|
||||
import { tmpDir } from "../tmp-dir";
|
||||
import {
|
||||
reportStreamProgress,
|
||||
ProgressCallback,
|
||||
} from "../common/vscode/progress";
|
||||
import type { ProgressCallback } from "../common/vscode/progress";
|
||||
import { reportStreamProgress } from "../common/vscode/progress";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import {
|
||||
getNwoFromGitHubUrl,
|
||||
isValidGitHubNwo,
|
||||
} from "../common/github-url-identifier-helper";
|
||||
import { Credentials } from "../common/authentication";
|
||||
import { AppCommandManager } from "../common/commands";
|
||||
import type { Credentials } from "../common/authentication";
|
||||
import type { AppCommandManager } from "../common/commands";
|
||||
import { addDatabaseSourceToWorkspace, allowHttp } from "../config";
|
||||
import { showAndLogInformationMessage } from "../common/logging";
|
||||
import { AppOctokit } from "../common/octokit";
|
||||
import { getLanguageDisplayName } from "../common/query-language";
|
||||
import { DatabaseOrigin } from "./local-databases/database-origin";
|
||||
import type { DatabaseOrigin } from "./local-databases/database-origin";
|
||||
|
||||
/**
|
||||
* Prompts a user to fetch a database from a remote location. Database is assumed to be an archive file.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DbItem, DbItemKind, flattenDbItems } from "./db-item";
|
||||
import type { DbItem } from "./db-item";
|
||||
import { DbItemKind, flattenDbItems } from "./db-item";
|
||||
|
||||
export type ExpandedDbItem =
|
||||
| RootRemoteExpandedDbItem
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DbItem, DbItemKind } from "./db-item";
|
||||
import type { DbItem } from "./db-item";
|
||||
import { DbItemKind } from "./db-item";
|
||||
|
||||
export function getDbItemName(dbItem: DbItem): string | undefined {
|
||||
switch (dbItem.kind) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { DbItem, DbItemKind, RemoteDbItem } from "./db-item";
|
||||
import { SelectedDbItem, SelectedDbItemKind } from "./config/db-config";
|
||||
import type { DbItem, RemoteDbItem } from "./db-item";
|
||||
import { DbItemKind } from "./db-item";
|
||||
import type { SelectedDbItem } from "./config/db-config";
|
||||
import { SelectedDbItemKind } from "./config/db-config";
|
||||
|
||||
export function getSelectedDbItem(dbItems: DbItem[]): DbItem | undefined {
|
||||
for (const dbItem of dbItems) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { App } from "../common/app";
|
||||
import { AppEvent, AppEventEmitter } from "../common/events";
|
||||
import type { App } from "../common/app";
|
||||
import type { AppEvent, AppEventEmitter } from "../common/events";
|
||||
import { ValueResult } from "../common/value-result";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { DbConfigStore } from "./config/db-config-store";
|
||||
import { DbItem, RemoteUserDefinedListDbItem } from "./db-item";
|
||||
import type { DbConfigStore } from "./config/db-config-store";
|
||||
import type { DbItem, RemoteUserDefinedListDbItem } from "./db-item";
|
||||
import type { ExpandedDbItem } from "./db-item-expansion";
|
||||
import {
|
||||
updateExpandedItem,
|
||||
replaceExpandedItem,
|
||||
ExpandedDbItem,
|
||||
cleanNonExistentExpandedItems,
|
||||
} from "./db-item-expansion";
|
||||
import {
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
mapDbItemToSelectedDbItem,
|
||||
} from "./db-item-selection";
|
||||
import { createRemoteTree } from "./db-tree-creator";
|
||||
import { DbConfigValidationError } from "./db-validation-errors";
|
||||
import type { DbConfigValidationError } from "./db-validation-errors";
|
||||
|
||||
export class DbManager extends DisposableObject {
|
||||
public readonly onDbItemsChanged: AppEvent<void>;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { window } from "vscode";
|
||||
import { App } from "../common/app";
|
||||
import type { App } from "../common/app";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { DbConfigStore } from "./config/db-config-store";
|
||||
import { DbManager } from "./db-manager";
|
||||
import { DbPanel } from "./ui/db-panel";
|
||||
import { DbSelectionDecorationProvider } from "./ui/db-selection-decoration-provider";
|
||||
import { DatabasePanelCommands } from "../common/commands";
|
||||
import type { DatabasePanelCommands } from "../common/commands";
|
||||
|
||||
export class DbModule extends DisposableObject {
|
||||
public readonly dbManager: DbManager;
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
import {
|
||||
DbConfig,
|
||||
RemoteRepositoryList,
|
||||
SelectedDbItemKind,
|
||||
} from "./config/db-config";
|
||||
import {
|
||||
DbItemKind,
|
||||
import type { DbConfig, RemoteRepositoryList } from "./config/db-config";
|
||||
import { SelectedDbItemKind } from "./config/db-config";
|
||||
import type {
|
||||
RemoteOwnerDbItem,
|
||||
RemoteRepoDbItem,
|
||||
RemoteSystemDefinedListDbItem,
|
||||
RemoteUserDefinedListDbItem,
|
||||
RootRemoteDbItem,
|
||||
} from "./db-item";
|
||||
import { ExpandedDbItem, ExpandedDbItemKind } from "./db-item-expansion";
|
||||
import { DbItemKind } from "./db-item";
|
||||
import type { ExpandedDbItem } from "./db-item-expansion";
|
||||
import { ExpandedDbItemKind } from "./db-item-expansion";
|
||||
|
||||
export function createRemoteTree(
|
||||
dbConfig: DbConfig,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { RequestError } from "@octokit/request-error";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
import type { RestEndpointMethodTypes } from "@octokit/plugin-rest-endpoint-methods";
|
||||
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
|
||||
import { GitHubDatabaseConfig } from "../../config";
|
||||
import { Credentials } from "../../common/authentication";
|
||||
import type { GitHubDatabaseConfig } from "../../config";
|
||||
import type { Credentials } from "../../common/authentication";
|
||||
import { AppOctokit } from "../../common/octokit";
|
||||
|
||||
export type CodeqlDatabase =
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { window } from "vscode";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
|
||||
import { getLanguageDisplayName } from "../../common/query-language";
|
||||
import { downloadGitHubDatabaseFromUrl } from "../database-fetcher";
|
||||
import { withProgress } from "../../common/vscode/progress";
|
||||
import { DatabaseManager } from "../local-databases";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { AppCommandManager } from "../../common/commands";
|
||||
import { GitHubDatabaseConfig } from "../../config";
|
||||
import type { DatabaseManager } from "../local-databases";
|
||||
import type { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import type { AppCommandManager } from "../../common/commands";
|
||||
import type { GitHubDatabaseConfig } from "../../config";
|
||||
import type { CodeqlDatabase } from "./api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { window } from "vscode";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import { App } from "../../common/app";
|
||||
import type { App } from "../../common/app";
|
||||
import { findGitHubRepositoryForWorkspace } from "../github-repository-finder";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import {
|
||||
@@ -12,17 +12,18 @@ import {
|
||||
askForGitHubDatabaseDownload,
|
||||
downloadDatabaseFromGitHub,
|
||||
} from "./download";
|
||||
import { GitHubDatabaseConfig } from "../../config";
|
||||
import { DatabaseManager } from "../local-databases";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { CodeqlDatabase, listDatabases, ListDatabasesResult } from "./api";
|
||||
import type { GitHubDatabaseConfig } from "../../config";
|
||||
import type { DatabaseManager } from "../local-databases";
|
||||
import type { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import type { CodeqlDatabase, ListDatabasesResult } from "./api";
|
||||
import { listDatabases } from "./api";
|
||||
import type { DatabaseUpdate } from "./updates";
|
||||
import {
|
||||
askForGitHubDatabaseUpdate,
|
||||
DatabaseUpdate,
|
||||
downloadDatabaseUpdateFromGitHub,
|
||||
isNewerDatabaseAvailable,
|
||||
} from "./updates";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
|
||||
export class GitHubDatabasesModule extends DisposableObject {
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { CodeqlDatabase } from "./api";
|
||||
import { DatabaseItem, DatabaseManager } from "../local-databases";
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { AppCommandManager } from "../../common/commands";
|
||||
import type { CodeqlDatabase } from "./api";
|
||||
import type { DatabaseItem, DatabaseManager } from "../local-databases";
|
||||
import type { Octokit } from "@octokit/rest";
|
||||
import type { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import type { AppCommandManager } from "../../common/commands";
|
||||
import { getLanguageDisplayName } from "../../common/query-language";
|
||||
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
|
||||
import { downloadGitHubDatabaseFromUrl } from "../database-fetcher";
|
||||
import { withProgress } from "../../common/vscode/progress";
|
||||
import { window } from "vscode";
|
||||
import { GitHubDatabaseConfig } from "../../config";
|
||||
import type { GitHubDatabaseConfig } from "../../config";
|
||||
import { joinLanguages, promptForDatabases } from "./download";
|
||||
|
||||
export type DatabaseUpdate = {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import {
|
||||
import type {
|
||||
API as GitExtensionAPI,
|
||||
GitExtension,
|
||||
Repository,
|
||||
} from "../common/vscode/extension/git";
|
||||
import { extensions, Uri } from "vscode";
|
||||
import type { Uri } from "vscode";
|
||||
import { extensions } from "vscode";
|
||||
import { getOnDiskWorkspaceFoldersObjects } from "../common/vscode/workspace-folders";
|
||||
import { ValueResult } from "../common/value-result";
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import { join, basename, dirname as path_dirname } from "path";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import {
|
||||
import type {
|
||||
Event,
|
||||
EventEmitter,
|
||||
ProviderResult,
|
||||
TreeDataProvider,
|
||||
CancellationToken,
|
||||
} from "vscode";
|
||||
import {
|
||||
EventEmitter,
|
||||
TreeItem,
|
||||
Uri,
|
||||
window,
|
||||
env,
|
||||
CancellationToken,
|
||||
ThemeIcon,
|
||||
ThemeColor,
|
||||
workspace,
|
||||
@@ -17,17 +19,16 @@ import {
|
||||
} from "vscode";
|
||||
import { pathExists, stat, readdir, remove } from "fs-extra";
|
||||
|
||||
import {
|
||||
import type {
|
||||
DatabaseChangedEvent,
|
||||
DatabaseItem,
|
||||
DatabaseManager,
|
||||
} from "./local-databases";
|
||||
import {
|
||||
import type {
|
||||
ProgressCallback,
|
||||
ProgressContext,
|
||||
withInheritedProgress,
|
||||
withProgress,
|
||||
} from "../common/vscode/progress";
|
||||
import { withInheritedProgress, withProgress } from "../common/vscode/progress";
|
||||
import {
|
||||
isLikelyDatabaseRoot,
|
||||
isLikelyDbLanguageFolder,
|
||||
@@ -42,17 +43,17 @@ import {
|
||||
promptImportInternetDatabase,
|
||||
} from "./database-fetcher";
|
||||
import { asError, asyncFilter, getErrorMessage } from "../common/helpers-pure";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import type { QueryRunner } from "../query-server";
|
||||
import { isCanary } from "../config";
|
||||
import { App } from "../common/app";
|
||||
import type { App } from "../common/app";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { LocalDatabasesCommands } from "../common/commands";
|
||||
import type { LocalDatabasesCommands } from "../common/commands";
|
||||
import {
|
||||
createMultiSelectionCommand,
|
||||
createSingleSelectionCommand,
|
||||
} from "../common/vscode/selection-commands";
|
||||
import { tryGetQueryLanguage } from "../common/query-language";
|
||||
import { LanguageContextStore } from "../language-context-store";
|
||||
import type { LanguageContextStore } from "../language-context-store";
|
||||
|
||||
enum SortOrder {
|
||||
NameAsc = "NameAsc",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Uri } from "vscode";
|
||||
import type { Uri } from "vscode";
|
||||
|
||||
/**
|
||||
* The layout of the database.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DatabaseItem } from "./database-item";
|
||||
import type { DatabaseItem } from "./database-item";
|
||||
|
||||
export enum DatabaseEventKind {
|
||||
Add = "Add",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Exported for testing
|
||||
import { CodeQLCliServer, DbInfo } from "../../codeql-cli/cli";
|
||||
import type { CodeQLCliServer, DbInfo } from "../../codeql-cli/cli";
|
||||
import { Uri, workspace } from "vscode";
|
||||
import { FullDatabaseOptions } from "./database-options";
|
||||
import type { FullDatabaseOptions } from "./database-options";
|
||||
import { basename, dirname, extname, join } from "path";
|
||||
import {
|
||||
decodeSourceArchiveUri,
|
||||
@@ -9,12 +9,12 @@ import {
|
||||
encodeSourceArchiveUri,
|
||||
zipArchiveScheme,
|
||||
} from "../../common/vscode/archive-filesystem-provider";
|
||||
import { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import type { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import { isLikelyDatabaseRoot } from "./db-contents-heuristics";
|
||||
import { stat } from "fs-extra";
|
||||
import { containsPath, pathsEqual } from "../../common/files";
|
||||
import { DatabaseContents } from "./database-contents";
|
||||
import { DatabaseOrigin } from "./database-origin";
|
||||
import type { DatabaseContents } from "./database-contents";
|
||||
import type { DatabaseOrigin } from "./database-origin";
|
||||
|
||||
export class DatabaseItemImpl implements DatabaseItem {
|
||||
// These are only public in the implementation, they are readonly in the interface
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Uri } from "vscode";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { DatabaseContents } from "./database-contents";
|
||||
import { DatabaseOptions } from "./database-options";
|
||||
import { DatabaseOrigin } from "./database-origin";
|
||||
import type { Uri } from "vscode";
|
||||
import type { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import type { DatabaseContents } from "./database-contents";
|
||||
import type { DatabaseOptions } from "./database-options";
|
||||
import type { DatabaseOrigin } from "./database-origin";
|
||||
|
||||
/** An item in the list of available databases */
|
||||
export interface DatabaseItem {
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
import vscode, { ExtensionContext } from "vscode";
|
||||
import { Logger, showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
import type { ExtensionContext } from "vscode";
|
||||
import vscode from "vscode";
|
||||
import type { Logger } from "../../common/logging";
|
||||
import { showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
import { extLogger } from "../../common/logging/vscode";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import { App } from "../../common/app";
|
||||
import { QueryRunner } from "../../query-server";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { ProgressCallback, withProgress } from "../../common/vscode/progress";
|
||||
import type { App } from "../../common/app";
|
||||
import type { QueryRunner } from "../../query-server";
|
||||
import type { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import type { ProgressCallback } from "../../common/vscode/progress";
|
||||
import { withProgress } from "../../common/vscode/progress";
|
||||
import {
|
||||
addDatabaseSourceToWorkspace,
|
||||
getAutogenerateQlPacks,
|
||||
@@ -13,7 +16,7 @@ import {
|
||||
setAutogenerateQlPacks,
|
||||
} from "../../config";
|
||||
import { join } from "path";
|
||||
import { FullDatabaseOptions } from "./database-options";
|
||||
import type { FullDatabaseOptions } from "./database-options";
|
||||
import { DatabaseItemImpl } from "./database-item-impl";
|
||||
import { showNeverAskAgainDialog } from "../../common/vscode/dialog";
|
||||
import {
|
||||
@@ -27,15 +30,16 @@ import {
|
||||
import { existsSync } from "fs";
|
||||
import { QlPackGenerator } from "../../local-queries/qlpack-generator";
|
||||
import { asError, getErrorMessage } from "../../common/helpers-pure";
|
||||
import { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import type { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { remove } from "fs-extra";
|
||||
import { containsPath } from "../../common/files";
|
||||
import { DatabaseChangedEvent, DatabaseEventKind } from "./database-events";
|
||||
import type { DatabaseChangedEvent } from "./database-events";
|
||||
import { DatabaseEventKind } from "./database-events";
|
||||
import { DatabaseResolver } from "./database-resolver";
|
||||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
import { LanguageContextStore } from "../../language-context-store";
|
||||
import { DatabaseOrigin } from "./database-origin";
|
||||
import type { LanguageContextStore } from "../../language-context-store";
|
||||
import type { DatabaseOrigin } from "./database-origin";
|
||||
|
||||
/**
|
||||
* The name of the key in the workspaceState dictionary in which we
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DatabaseOrigin } from "./database-origin";
|
||||
import type { DatabaseOrigin } from "./database-origin";
|
||||
|
||||
export interface DatabaseOptions {
|
||||
displayName?: string;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Uri } from "vscode";
|
||||
import { pathExists } from "fs-extra";
|
||||
import { basename, join, resolve } from "path";
|
||||
import {
|
||||
import type {
|
||||
DatabaseContents,
|
||||
DatabaseContentsWithDbScheme,
|
||||
DatabaseKind,
|
||||
} from "./database-contents";
|
||||
import { DatabaseKind } from "./database-contents";
|
||||
import { glob } from "glob";
|
||||
import { encodeArchiveBasePath } from "../../common/vscode/archive-filesystem-provider";
|
||||
import {
|
||||
|
||||
@@ -10,10 +10,10 @@ import {
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import { assertNever, getErrorMessage } from "../../common/helpers-pure";
|
||||
import { Logger } from "../../common/logging";
|
||||
import { DatabaseItem } from "./database-item";
|
||||
import { DatabaseManager } from "./database-manager";
|
||||
import {
|
||||
import type { Logger } from "../../common/logging";
|
||||
import type { DatabaseItem } from "./database-item";
|
||||
import type { DatabaseManager } from "./database-manager";
|
||||
import type {
|
||||
UrlValueLineColumnLocation,
|
||||
UrlValueResolvable,
|
||||
UrlValueWholeFileLocation,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { basename } from "path";
|
||||
import { load } from "js-yaml";
|
||||
import { readFile } from "fs-extra";
|
||||
import { getQlPackPath } from "../common/ql";
|
||||
import { CodeQLCliServer, QlpacksInfo } from "../codeql-cli/cli";
|
||||
import type { CodeQLCliServer, QlpacksInfo } from "../codeql-cli/cli";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { DbItem, DbItemKind } from "../db-item";
|
||||
import type { DbItem } from "../db-item";
|
||||
import { DbItemKind } from "../db-item";
|
||||
import type { DbTreeViewItem } from "./db-tree-view-item";
|
||||
import {
|
||||
createDbTreeViewItemOwner,
|
||||
createDbTreeViewItemRepo,
|
||||
createDbTreeViewItemRoot,
|
||||
createDbTreeViewItemSystemDefinedList,
|
||||
createDbTreeViewItemUserDefinedList,
|
||||
DbTreeViewItem,
|
||||
} from "./db-tree-view-item";
|
||||
|
||||
export function mapDbItemToTreeViewItem(dbItem: DbItem): DbTreeViewItem {
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import {
|
||||
QuickPickItem,
|
||||
TreeView,
|
||||
TreeViewExpansionEvent,
|
||||
Uri,
|
||||
window,
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import type { QuickPickItem, TreeView, TreeViewExpansionEvent } from "vscode";
|
||||
import { Uri, window, workspace } from "vscode";
|
||||
import {
|
||||
UserCancellationException,
|
||||
withProgress,
|
||||
@@ -17,16 +11,17 @@ import {
|
||||
isValidGitHubOwner,
|
||||
} from "../../common/github-url-identifier-helper";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import { DbItem, DbItemKind, RemoteUserDefinedListDbItem } from "../db-item";
|
||||
import type { DbItem, RemoteUserDefinedListDbItem } from "../db-item";
|
||||
import { DbItemKind } from "../db-item";
|
||||
import { getDbItemName } from "../db-item-naming";
|
||||
import { DbManager } from "../db-manager";
|
||||
import type { DbManager } from "../db-manager";
|
||||
import { DbTreeDataProvider } from "./db-tree-data-provider";
|
||||
import { DbTreeViewItem } from "./db-tree-view-item";
|
||||
import type { DbTreeViewItem } from "./db-tree-view-item";
|
||||
import { getGitHubUrl } from "./db-tree-view-item-action";
|
||||
import { getControllerRepo } from "../../variant-analysis/run-remote-query";
|
||||
import { getErrorMessage } from "../../common/helpers-pure";
|
||||
import { DatabasePanelCommands } from "../../common/commands";
|
||||
import { App } from "../../common/app";
|
||||
import type { DatabasePanelCommands } from "../../common/commands";
|
||||
import type { App } from "../../common/app";
|
||||
import { QueryLanguage } from "../../common/query-language";
|
||||
import { getCodeSearchRepositories } from "../code-search-api";
|
||||
import { showAndLogErrorMessage } from "../../common/logging";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {
|
||||
import type {
|
||||
CancellationToken,
|
||||
FileDecoration,
|
||||
FileDecorationProvider,
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
import {
|
||||
Event,
|
||||
EventEmitter,
|
||||
ProviderResult,
|
||||
TreeDataProvider,
|
||||
TreeItem,
|
||||
} from "vscode";
|
||||
import { createDbTreeViewItemError, DbTreeViewItem } from "./db-tree-view-item";
|
||||
import { DbManager } from "../db-manager";
|
||||
import type { Event, ProviderResult, TreeDataProvider, TreeItem } from "vscode";
|
||||
import { EventEmitter } from "vscode";
|
||||
import type { DbTreeViewItem } from "./db-tree-view-item";
|
||||
import { createDbTreeViewItemError } from "./db-tree-view-item";
|
||||
import type { DbManager } from "../db-manager";
|
||||
import { mapDbItemToTreeViewItem } from "./db-item-mapper";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import {
|
||||
DbConfigValidationError,
|
||||
DbConfigValidationErrorKind,
|
||||
} from "../db-validation-errors";
|
||||
import type { DbConfigValidationError } from "../db-validation-errors";
|
||||
import { DbConfigValidationErrorKind } from "../db-validation-errors";
|
||||
import { VariantAnalysisConfigListener } from "../../config";
|
||||
|
||||
export class DbTreeDataProvider
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { DbItem, DbItemKind, isSelectableDbItem } from "../db-item";
|
||||
import type { DbItem } from "../db-item";
|
||||
import { DbItemKind, isSelectableDbItem } from "../db-item";
|
||||
|
||||
type DbTreeViewItemAction =
|
||||
| "canBeSelected"
|
||||
|
||||
@@ -5,15 +5,15 @@ import {
|
||||
TreeItemCollapsibleState,
|
||||
Uri,
|
||||
} from "vscode";
|
||||
import {
|
||||
import type {
|
||||
DbItem,
|
||||
isSelectableDbItem,
|
||||
RemoteOwnerDbItem,
|
||||
RemoteRepoDbItem,
|
||||
RemoteSystemDefinedListDbItem,
|
||||
RemoteUserDefinedListDbItem,
|
||||
RootRemoteDbItem,
|
||||
} from "../db-item";
|
||||
import { isSelectableDbItem } from "../db-item";
|
||||
import { getDbItemActions } from "./db-tree-view-item-action";
|
||||
|
||||
export const SELECTED_DB_ITEM_RESOURCE_URI = "codeql://databases?selected=true";
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {
|
||||
import type {
|
||||
CancellationToken,
|
||||
DebugConfiguration,
|
||||
DebugConfigurationProvider,
|
||||
WorkspaceFolder,
|
||||
} from "vscode";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
import { LocalQueries } from "../local-queries";
|
||||
import type { LocalQueries } from "../local-queries";
|
||||
import { getQuickEvalContext, validateQueryPath } from "../run-queries-shared";
|
||||
import { LaunchConfig } from "./debug-protocol";
|
||||
import type { LaunchConfig } from "./debug-protocol";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { showAndLogErrorMessage } from "../common/logging";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DebugProtocol } from "@vscode/debugprotocol";
|
||||
import { QueryResultType } from "../query-server/messages";
|
||||
import { QuickEvalContext } from "../run-queries-shared";
|
||||
import type { DebugProtocol } from "@vscode/debugprotocol";
|
||||
import type { QueryResultType } from "../query-server/messages";
|
||||
import type { QuickEvalContext } from "../run-queries-shared";
|
||||
|
||||
// Events
|
||||
|
||||
|
||||
@@ -9,16 +9,20 @@ import {
|
||||
StoppedEvent,
|
||||
TerminatedEvent,
|
||||
} from "@vscode/debugadapter";
|
||||
import { DebugProtocol as Protocol } from "@vscode/debugprotocol";
|
||||
import { Disposable } from "vscode";
|
||||
import type { DebugProtocol as Protocol } from "@vscode/debugprotocol";
|
||||
import type { Disposable } from "vscode";
|
||||
import { CancellationTokenSource } from "vscode-jsonrpc";
|
||||
import { BaseLogger, LogOptions } from "../common/logging";
|
||||
import type { BaseLogger, LogOptions } from "../common/logging";
|
||||
import { queryServerLogger } from "../common/logging/vscode";
|
||||
import { QueryResultType } from "../query-server/messages";
|
||||
import { CoreQueryResults, CoreQueryRun, QueryRunner } from "../query-server";
|
||||
import type {
|
||||
CoreQueryResults,
|
||||
CoreQueryRun,
|
||||
QueryRunner,
|
||||
} from "../query-server";
|
||||
// eslint-disable-next-line import/no-namespace -- There are two different debug protocols, so we should make a distinction.
|
||||
import * as CodeQLProtocol from "./debug-protocol";
|
||||
import { QuickEvalContext } from "../run-queries-shared";
|
||||
import type * as CodeQLProtocol from "./debug-protocol";
|
||||
import type { QuickEvalContext } from "../run-queries-shared";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import {
|
||||
debug,
|
||||
import type {
|
||||
DebugAdapterDescriptor,
|
||||
DebugAdapterDescriptorFactory,
|
||||
DebugAdapterExecutable,
|
||||
DebugAdapterInlineImplementation,
|
||||
DebugConfigurationProviderTriggerKind,
|
||||
DebugSession,
|
||||
ProviderResult,
|
||||
} from "vscode";
|
||||
import {
|
||||
debug,
|
||||
DebugAdapterInlineImplementation,
|
||||
DebugConfigurationProviderTriggerKind,
|
||||
} from "vscode";
|
||||
import { isCanary } from "../config";
|
||||
import { LocalQueries } from "../local-queries";
|
||||
import type { LocalQueries } from "../local-queries";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import type { QueryRunner } from "../query-server";
|
||||
import { QLDebugConfigurationProvider } from "./debug-configuration";
|
||||
import { QLDebugSession } from "./debug-session";
|
||||
|
||||
|
||||
@@ -1,31 +1,29 @@
|
||||
import { basename } from "path";
|
||||
import {
|
||||
import type {
|
||||
DebugAdapterTracker,
|
||||
DebugAdapterTrackerFactory,
|
||||
DebugSession,
|
||||
debug,
|
||||
Uri,
|
||||
CancellationTokenSource,
|
||||
} from "vscode";
|
||||
import { DebuggerCommands } from "../common/commands";
|
||||
import { DatabaseManager } from "../databases/local-databases";
|
||||
import { debug, Uri, CancellationTokenSource } from "vscode";
|
||||
import type { DebuggerCommands } from "../common/commands";
|
||||
import type { DatabaseManager } from "../databases/local-databases";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { CoreQueryResults } from "../query-server";
|
||||
import type { CoreQueryResults } from "../query-server";
|
||||
import {
|
||||
getQuickEvalContext,
|
||||
QueryOutputDir,
|
||||
saveBeforeStart,
|
||||
validateQueryUri,
|
||||
} from "../run-queries-shared";
|
||||
import { QLResolvedDebugConfiguration } from "./debug-configuration";
|
||||
import {
|
||||
import type { QLResolvedDebugConfiguration } from "./debug-configuration";
|
||||
import type {
|
||||
AnyProtocolMessage,
|
||||
EvaluationCompletedEvent,
|
||||
EvaluationStartedEvent,
|
||||
QuickEvalRequest,
|
||||
} from "./debug-protocol";
|
||||
import { App } from "../common/app";
|
||||
import { LocalQueryRun, LocalQueries } from "../local-queries";
|
||||
import type { App } from "../common/app";
|
||||
import type { LocalQueryRun, LocalQueries } from "../local-queries";
|
||||
|
||||
/**
|
||||
* Listens to messages passing between VS Code and the debug adapter, so that we can supplement the
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user