Merge remote-tracking branch 'origin/main' into koesie10/auto-name-extension-pack
This commit is contained in:
@@ -4,7 +4,7 @@ import { join } from "path";
|
||||
import { pathExists } from "fs-extra";
|
||||
import { isCodespacesTemplate } from "./config";
|
||||
import { showBinaryChoiceDialog } from "./common/vscode/dialog";
|
||||
import { extLogger } from "./common";
|
||||
import { extLogger } from "./common/logging/vscode";
|
||||
|
||||
/**
|
||||
* Check if the current workspace is the CodeTour and open the workspace folder.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as semver from "semver";
|
||||
import { runCodeQlCliCommand } from "./cli";
|
||||
import { Logger } from "../common";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { Logger } from "../common/logging";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
|
||||
/**
|
||||
* Get the version of a CodeQL CLI.
|
||||
|
||||
@@ -11,7 +11,7 @@ import tk from "tree-kill";
|
||||
import { promisify } from "util";
|
||||
import { CancellationToken, Disposable, Uri } from "vscode";
|
||||
|
||||
import { BQRSInfo, DecodedBqrsChunk } from "../pure/bqrs-cli-types";
|
||||
import { BQRSInfo, DecodedBqrsChunk } from "../common/bqrs-cli-types";
|
||||
import { allowCanaryQueryServer, CliConfig } from "../config";
|
||||
import {
|
||||
DistributionProvider,
|
||||
@@ -21,10 +21,11 @@ import {
|
||||
assertNever,
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "../pure/helpers-pure";
|
||||
import { walkDirectory } from "../pure/files";
|
||||
import { QueryMetadata, SortDirection } from "../pure/interface-types";
|
||||
import { BaseLogger, Logger, ProgressReporter } from "../common";
|
||||
} 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 { CompilationMessage } from "../pure/legacy-messages";
|
||||
import { sarifParser } from "../common/sarif-parser";
|
||||
import { App } from "../common/app";
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as semver from "semver";
|
||||
import { URL } from "url";
|
||||
import { ExtensionContext, Event } from "vscode";
|
||||
import { DistributionConfig } from "../config";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getCodeQlCliVersion } from "./cli-version";
|
||||
import {
|
||||
ProgressCallback,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
deprecatedCodeQlLauncherName,
|
||||
extractZipArchive,
|
||||
getRequiredAssetName,
|
||||
} from "../pure/distribution";
|
||||
} from "../common/distribution";
|
||||
import {
|
||||
InvocationRateLimiter,
|
||||
InvocationRateLimiterResultKind,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CodeQLCliServer } from "./cli";
|
||||
import { Uri, window } from "vscode";
|
||||
import { isQueryLanguage, QueryLanguage } from "../common/query-language";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { UserCancellationException } from "../common/vscode/progress";
|
||||
import { showAndLogErrorMessage } from "../common/logging";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CodeQLCliServer } from "./cli";
|
||||
import { QueryMetadata } from "../pure/interface-types";
|
||||
import { extLogger } from "../common";
|
||||
import { QueryMetadata } from "../common/interface-types";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
|
||||
/**
|
||||
* Gets metadata for a query, if it exists.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Credentials } from "./authentication";
|
||||
import { Disposable } from "../pure/disposable-object";
|
||||
import { Disposable } from "./disposable-object";
|
||||
import { AppEventEmitter } from "./events";
|
||||
import { NotificationLogger } from "./logging";
|
||||
import { Memento } from "./memento";
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
LineColumnLocation,
|
||||
WholeFileLocation,
|
||||
} from "./bqrs-cli-types";
|
||||
import { createRemoteFileRef } from "./location-link-utils";
|
||||
import { createRemoteFileRef } from "../common/location-link-utils";
|
||||
|
||||
/**
|
||||
* The CodeQL filesystem libraries use this pattern in `getURL()` predicates
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { DisposableObject } from "./disposable-object";
|
||||
import { getErrorMessage } from "./helpers-pure";
|
||||
import { Logger } from "./logging";
|
||||
|
||||
/**
|
||||
@@ -11,7 +11,10 @@ export abstract class Discovery extends DisposableObject {
|
||||
private restartWhenFinished = false;
|
||||
private currentDiscoveryPromise: Promise<void> | undefined;
|
||||
|
||||
constructor(private readonly name: string, private readonly logger: Logger) {
|
||||
constructor(
|
||||
protected readonly name: string,
|
||||
private readonly logger: Logger,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Disposable } from "../pure/disposable-object";
|
||||
import { Disposable } from "./disposable-object";
|
||||
|
||||
export interface AppEvent<T> {
|
||||
(listener: (event: T) => void): Disposable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { OWNER_REGEX, REPO_REGEX } from "../pure/helpers-pure";
|
||||
import { OWNER_REGEX, REPO_REGEX } from "./helpers-pure";
|
||||
|
||||
/**
|
||||
* Checks if a string is a valid GitHub NWO.
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
export * from "./logging";
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
ResultSetSchema,
|
||||
Column,
|
||||
ResolvableLocationValue,
|
||||
} from "./bqrs-cli-types";
|
||||
} from "../common/bqrs-cli-types";
|
||||
import {
|
||||
VariantAnalysis,
|
||||
VariantAnalysisScannedRepositoryResult,
|
||||
@@ -14,8 +14,8 @@ import {
|
||||
import {
|
||||
RepositoriesFilterSortState,
|
||||
RepositoriesFilterSortStateWithIds,
|
||||
} from "./variant-analysis-filter-sort";
|
||||
import { ErrorLike } from "./errors";
|
||||
} from "../pure/variant-analysis-filter-sort";
|
||||
import { ErrorLike } from "../common/errors";
|
||||
import { DataFlowPaths } from "../variant-analysis/shared/data-flow-paths";
|
||||
import { ExternalApiUsage } from "../data-extensions-editor/external-api-usage";
|
||||
import { ModeledMethod } from "../data-extensions-editor/modeled-method";
|
||||
@@ -2,5 +2,3 @@ export * from "./logger";
|
||||
export * from "./notification-logger";
|
||||
export * from "./notifications";
|
||||
export * from "./tee-logger";
|
||||
export * from "./vscode/loggers";
|
||||
export * from "./vscode/output-channel-logger";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NotificationLogger } from "./notification-logger";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
import { RedactableError } from "../../pure/errors";
|
||||
import { RedactableError } from "../errors";
|
||||
|
||||
export interface ShowAndLogOptions {
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { appendFile, ensureFile } from "fs-extra";
|
||||
import { isAbsolute } from "path";
|
||||
import { getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { getErrorMessage } from "../helpers-pure";
|
||||
import { Logger, LogOptions } from "./logger";
|
||||
|
||||
/**
|
||||
|
||||
2
extensions/ql-vscode/src/common/logging/vscode/index.ts
Normal file
2
extensions/ql-vscode/src/common/logging/vscode/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from "./loggers";
|
||||
export * from "./output-channel-logger";
|
||||
@@ -1,6 +1,6 @@
|
||||
import { window as Window, OutputChannel, Progress } from "vscode";
|
||||
import { Logger, LogOptions } from "../logger";
|
||||
import { DisposableObject } from "../../../pure/disposable-object";
|
||||
import { DisposableObject } from "../../disposable-object";
|
||||
import { NotificationLogger } from "../notification-logger";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as Sarif from "sarif";
|
||||
import { createReadStream } from "fs-extra";
|
||||
import { connectTo } from "stream-json/Assembler";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { getErrorMessage } from "./helpers-pure";
|
||||
import { withParser } from "stream-json/filters/Pick";
|
||||
|
||||
const DUMMY_TOOL: Sarif.Tool = { driver: { name: "" } };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as Sarif from "sarif";
|
||||
import type { HighlightedRegion } from "../variant-analysis/shared/analysis-result";
|
||||
import { ResolvableLocationValue } from "./bqrs-cli-types";
|
||||
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
|
||||
|
||||
export interface SarifLink {
|
||||
dest: number;
|
||||
@@ -1,4 +1,4 @@
|
||||
import { RedactableError } from "../pure/errors";
|
||||
import { RedactableError } from "./errors";
|
||||
|
||||
export interface AppTelemetry {
|
||||
sendCommandUsage(name: string, executionTime: number, error?: Error): void;
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from "vscode";
|
||||
import { join } from "path";
|
||||
|
||||
import { DisposableObject, DisposeHandler } from "../../pure/disposable-object";
|
||||
import { DisposableObject, DisposeHandler } from "../disposable-object";
|
||||
import { tmpDir } from "../../tmp-dir";
|
||||
import { getHtmlForWebview, WebviewMessage, WebviewView } from "./webview-html";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { pathExists } from "fs-extra";
|
||||
import * as unzipper from "unzipper";
|
||||
import * as vscode from "vscode";
|
||||
import { extLogger } from "..";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
|
||||
// All path operations in this file must be on paths *within* the zip
|
||||
// archive.
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { commands, Disposable } from "vscode";
|
||||
import { CommandFunction, CommandManager } from "../../packages/commands";
|
||||
import {
|
||||
extLogger,
|
||||
NotificationLogger,
|
||||
showAndLogWarningMessage,
|
||||
showAndLogExceptionWithTelemetry,
|
||||
} from "../logging";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
import {
|
||||
asError,
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "../../pure/helpers-pure";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
} from "../../common/helpers-pure";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { UserCancellationException } from "./progress";
|
||||
import { telemetryListener } from "./telemetry";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import { Uri, window } from "vscode";
|
||||
import { AppCommandManager } from "../commands";
|
||||
import { showBinaryChoiceDialog } from "./dialog";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import {
|
||||
asError,
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "../../pure/helpers-pure";
|
||||
import { extLogger, showAndLogExceptionWithTelemetry } from "../logging";
|
||||
} from "../../common/helpers-pure";
|
||||
import { showAndLogExceptionWithTelemetry } from "../logging";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
import { telemetryListener } from "./telemetry";
|
||||
|
||||
export async function tryOpenExternalFile(
|
||||
|
||||
@@ -9,13 +9,14 @@ import {
|
||||
} from "vscode";
|
||||
import { MultiFileSystemWatcher } from "./multi-file-system-watcher";
|
||||
import { AppEventEmitter } from "../events";
|
||||
import { extLogger } from "..";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
import { lstat } from "fs-extra";
|
||||
import { containsPath, isIOError } from "../../pure/files";
|
||||
import { containsPath, isIOError } from "../files";
|
||||
import {
|
||||
getOnDiskWorkspaceFolders,
|
||||
getOnDiskWorkspaceFoldersObjects,
|
||||
} from "./workspace-folders";
|
||||
import { getErrorMessage } from "../../common/helpers-pure";
|
||||
|
||||
interface PathData {
|
||||
path: string;
|
||||
@@ -152,9 +153,21 @@ export abstract class FilePathDiscovery<T extends PathData> extends Discovery {
|
||||
protected async discover() {
|
||||
let pathsUpdated = false;
|
||||
for (const path of this.changedFilePaths) {
|
||||
this.changedFilePaths.delete(path);
|
||||
if (await this.handleChangedPath(path)) {
|
||||
pathsUpdated = true;
|
||||
try {
|
||||
this.changedFilePaths.delete(path);
|
||||
if (await this.handleChangedPath(path)) {
|
||||
pathsUpdated = true;
|
||||
}
|
||||
} catch (e) {
|
||||
// If we get an error while processing a path, just log it and continue.
|
||||
// There aren't any network operations happening here or anything else
|
||||
// that's likely to succeed on a retry, so don't bother adding it back
|
||||
// to the changedFilePaths set.
|
||||
void extLogger.log(
|
||||
`${
|
||||
this.name
|
||||
} failed while processing path "${path}": ${getErrorMessage(e)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DisposableObject } from "../../pure/disposable-object";
|
||||
import { DisposableObject } from "../disposable-object";
|
||||
import { EventEmitter, Event, Uri, GlobPattern, workspace } from "vscode";
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,10 +15,10 @@ import {
|
||||
isCanary,
|
||||
} from "../../config";
|
||||
import * as appInsights from "applicationinsights";
|
||||
import { extLogger } from "../index";
|
||||
import { extLogger } from "../logging/vscode";
|
||||
import { UserCancellationException } from "./progress";
|
||||
import { showBinaryChoiceWithUrlDialog } from "./dialog";
|
||||
import { RedactableError } from "../../pure/errors";
|
||||
import { RedactableError } from "../errors";
|
||||
import { SemVer } from "semver";
|
||||
import { AppTelemetry } from "../telemetry";
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import * as vscode from "vscode";
|
||||
import { VSCodeCredentials } from "./authentication";
|
||||
import { Disposable } from "../../pure/disposable-object";
|
||||
import { Disposable } from "../disposable-object";
|
||||
import { App, AppMode, EnvironmentContext } from "../app";
|
||||
import { AppEventEmitter } from "../events";
|
||||
import { extLogger, NotificationLogger, queryServerLogger } from "../logging";
|
||||
import { NotificationLogger } from "../logging";
|
||||
import { extLogger, queryServerLogger } from "../logging/vscode";
|
||||
import { Memento } from "../memento";
|
||||
import { VSCodeAppEventEmitter } from "./events";
|
||||
import { AppCommandManager, QueryServerCommandManager } from "../commands";
|
||||
|
||||
@@ -7,8 +7,9 @@ export function pluralize(
|
||||
numItems: number | undefined,
|
||||
singular: string,
|
||||
plural: string,
|
||||
numberFormatter: (value: number) => string = (value) => value.toString(),
|
||||
): string {
|
||||
return numItems !== undefined
|
||||
? `${numItems} ${numItems === 1 ? singular : plural}`
|
||||
? `${numberFormatter(numItems)} ${numItems === 1 ? singular : plural}`
|
||||
: "";
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import {
|
||||
FromCompareViewMessage,
|
||||
ToCompareViewMessage,
|
||||
QueryCompareResult,
|
||||
} from "../pure/interface-types";
|
||||
import { extLogger, Logger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
} from "../common/interface-types";
|
||||
import { Logger, showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { DatabaseManager } from "../databases/local-databases";
|
||||
import { jumpToLocation } from "../databases/local-databases/locations";
|
||||
@@ -14,17 +14,17 @@ import {
|
||||
transformBqrsResultSet,
|
||||
RawResultSet,
|
||||
BQRSInfo,
|
||||
} from "../pure/bqrs-cli-types";
|
||||
} from "../common/bqrs-cli-types";
|
||||
import resultsDiff from "./resultsDiff";
|
||||
import { CompletedLocalQueryInfo } from "../query-results";
|
||||
import { assertNever, getErrorMessage } from "../pure/helpers-pure";
|
||||
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 { telemetryListener } from "../common/vscode/telemetry";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
|
||||
interface ComparePair {
|
||||
from: CompletedLocalQueryInfo;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { RawResultSet } from "../pure/bqrs-cli-types";
|
||||
import { QueryCompareResult } from "../pure/interface-types";
|
||||
import { RawResultSet } from "../common/bqrs-cli-types";
|
||||
import { QueryCompareResult } from "../common/interface-types";
|
||||
|
||||
/**
|
||||
* Compare the rows of two queries. Use deep equality to determine if
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DisposableObject } from "./pure/disposable-object";
|
||||
import { DisposableObject } from "./common/disposable-object";
|
||||
import {
|
||||
workspace,
|
||||
Event,
|
||||
@@ -7,8 +7,8 @@ import {
|
||||
ConfigurationTarget,
|
||||
} from "vscode";
|
||||
import { DistributionManager } from "./codeql-cli/distribution";
|
||||
import { extLogger } from "./common";
|
||||
import { ONE_DAY_IN_MS } from "./pure/time";
|
||||
import { extLogger } from "./common/logging/vscode";
|
||||
import { ONE_DAY_IN_MS } from "./common/time";
|
||||
import {
|
||||
FilterKey,
|
||||
SortKey,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DecodedBqrsChunk } from "../pure/bqrs-cli-types";
|
||||
import { DecodedBqrsChunk } from "../common/bqrs-cli-types";
|
||||
import { Call, ExternalApiUsage } from "./external-api-usage";
|
||||
|
||||
export function decodeBqrsToExternalApiUsages(
|
||||
@@ -47,17 +47,5 @@ export function decodeBqrsToExternalApiUsages(
|
||||
method.usages.push(usage);
|
||||
});
|
||||
|
||||
const externalApiUsages = Array.from(methodsByApiName.values());
|
||||
externalApiUsages.sort((a, b) => {
|
||||
// Sort first by supported, putting unmodeled methods first.
|
||||
if (a.supported && !b.supported) {
|
||||
return 1;
|
||||
}
|
||||
if (!a.supported && b.supported) {
|
||||
return -1;
|
||||
}
|
||||
// Then sort by number of usages descending
|
||||
return b.usages.length - a.usages.length;
|
||||
});
|
||||
return externalApiUsages;
|
||||
return Array.from(methodsByApiName.values());
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
import {
|
||||
FromDataExtensionsEditorMessage,
|
||||
ToDataExtensionsEditorMessage,
|
||||
} from "../pure/interface-types";
|
||||
} from "../common/interface-types";
|
||||
import { ProgressUpdate } from "../common/vscode/progress";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import {
|
||||
@@ -25,14 +25,14 @@ import { outputFile, pathExists, readFile } from "fs-extra";
|
||||
import { load as loadYaml } from "js-yaml";
|
||||
import { DatabaseItem, DatabaseManager } from "../databases/local-databases";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { asError, assertNever, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { asError, assertNever, getErrorMessage } from "../common/helpers-pure";
|
||||
import { generateFlowModel } from "./generate-flow-model";
|
||||
import { promptImportGithubDatabase } from "../databases/database-fetcher";
|
||||
import { App } from "../common/app";
|
||||
import { ResolvableLocationValue } from "../pure/bqrs-cli-types";
|
||||
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
|
||||
import { showResolvableLocation } from "../databases/local-databases/locations";
|
||||
import { decodeBqrsToExternalApiUsages } from "./bqrs";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { readQueryResults, runQuery } from "./external-api-usage-query";
|
||||
import { createDataExtensionYaml, loadDataExtensionYaml } from "./yaml";
|
||||
import { ExternalApiUsage } from "./external-api-usage";
|
||||
@@ -300,7 +300,6 @@ export class DataExtensionsEditorView extends AbstractWebview<
|
||||
this.app.workspaceStoragePath ?? this.app.globalStoragePath,
|
||||
this.app.credentials,
|
||||
(update) => this.showProgress(update),
|
||||
tokenSource.token,
|
||||
this.cliServer,
|
||||
);
|
||||
if (!database) {
|
||||
@@ -354,16 +353,12 @@ export class DataExtensionsEditorView extends AbstractWebview<
|
||||
|
||||
// After the flow model has been generated, we can remove the temporary database
|
||||
// which we used for generating the flow model.
|
||||
await this.databaseManager.removeDatabaseItem(
|
||||
() =>
|
||||
this.showProgress({
|
||||
step: 3900,
|
||||
maxStep: 4000,
|
||||
message: "Removing temporary database",
|
||||
}),
|
||||
tokenSource.token,
|
||||
database,
|
||||
);
|
||||
await this.showProgress({
|
||||
step: 3900,
|
||||
maxStep: 4000,
|
||||
message: "Removing temporary database",
|
||||
});
|
||||
await this.databaseManager.removeDatabaseItem(database);
|
||||
|
||||
await this.clearProgress();
|
||||
}
|
||||
|
||||
@@ -7,11 +7,11 @@ import { CodeQLCliServer, QlpacksInfo } from "../codeql-cli/cli";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
import { ProgressCallback } from "../common/vscode/progress";
|
||||
import { DatabaseItem } from "../databases/local-databases";
|
||||
import { getQlPackPath, QLPACK_FILENAMES } from "../pure/ql";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { getQlPackPath, QLPACK_FILENAMES } from "../common/ql";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { ExtensionPack, ExtensionPackModelFile } from "./shared/extension-pack";
|
||||
import { NotificationLogger, showAndLogErrorMessage } from "../common/logging";
|
||||
import { containsPath } from "../pure/files";
|
||||
import { containsPath } from "../common/files";
|
||||
import { disableAutoNameExtensionPack } from "../config";
|
||||
import {
|
||||
autoNameExtensionPack,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { FileType, Uri, window, workspace, WorkspaceFolder } from "vscode";
|
||||
import { getOnDiskWorkspaceFoldersObjects } from "../common/vscode/workspace-folders";
|
||||
import { extLogger } from "../common";
|
||||
import { tmpdir } from "../pure/files";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { tmpdir } from "../common/files";
|
||||
|
||||
/**
|
||||
* Returns the ancestors of this path in order from furthest to closest (i.e. root of filesystem to parent directory)
|
||||
|
||||
@@ -3,8 +3,8 @@ import { dir } from "tmp-promise";
|
||||
import { writeFile } from "fs-extra";
|
||||
import { dump as dumpYaml } from "js-yaml";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
import { extLogger, TeeLogger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { showAndLogExceptionWithTelemetry, TeeLogger } from "../common/logging";
|
||||
import { isQueryLanguage } from "../common/query-language";
|
||||
import { CancellationToken } from "vscode";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
@@ -13,7 +13,7 @@ import { ProgressCallback } from "../common/vscode/progress";
|
||||
import { fetchExternalApiQueries } from "./queries";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { join } from "path";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
export type RunQueryOptions = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ResolvableLocationValue } from "../pure/bqrs-cli-types";
|
||||
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
|
||||
|
||||
export type Call = {
|
||||
label: string;
|
||||
|
||||
@@ -3,8 +3,8 @@ import { DatabaseItem } from "../databases/local-databases";
|
||||
import { basename } from "path";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { extLogger, TeeLogger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { showAndLogExceptionWithTelemetry, TeeLogger } from "../common/logging";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { extensiblePredicateDefinitions } from "./predicates";
|
||||
import { ProgressCallback } from "../common/vscode/progress";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ModeledMethodType,
|
||||
ModeledMethodWithSignature,
|
||||
} from "./modeled-method";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { file } from "tmp-promise";
|
||||
import { writeFile } from "fs-extra";
|
||||
|
||||
@@ -18,7 +18,10 @@ import {
|
||||
SelectedDbItemKind,
|
||||
} from "./db-config";
|
||||
import * as chokidar from "chokidar";
|
||||
import { DisposableObject, DisposeHandler } from "../../pure/disposable-object";
|
||||
import {
|
||||
DisposableObject,
|
||||
DisposeHandler,
|
||||
} from "../../common/disposable-object";
|
||||
import { DbConfigValidator } from "./db-config-validator";
|
||||
import { App } from "../../common/app";
|
||||
import { AppEvent, AppEventEmitter } from "../../common/events";
|
||||
|
||||
@@ -2,7 +2,7 @@ import { readJsonSync } from "fs-extra";
|
||||
import { resolve } from "path";
|
||||
import Ajv, { ValidateFunction } from "ajv";
|
||||
import { clearLocalDbConfig, DbConfig } from "./db-config";
|
||||
import { findDuplicateStrings } from "../../pure/text-utils";
|
||||
import { findDuplicateStrings } from "../../common/text-utils";
|
||||
import {
|
||||
DbConfigValidationError,
|
||||
DbConfigValidationErrorKind,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import fetch, { Response } from "node-fetch";
|
||||
import { zip } from "zip-a-folder";
|
||||
import { Open } from "unzipper";
|
||||
import { Uri, CancellationToken, window, InputBoxOptions } from "vscode";
|
||||
import { Uri, window, InputBoxOptions } from "vscode";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import {
|
||||
ensureDir,
|
||||
@@ -22,8 +22,8 @@ import {
|
||||
reportStreamProgress,
|
||||
ProgressCallback,
|
||||
} from "../common/vscode/progress";
|
||||
import { extLogger } from "../common";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import {
|
||||
getNwoFromGitHubUrl,
|
||||
isValidGitHubNwo,
|
||||
@@ -44,7 +44,6 @@ export async function promptImportInternetDatabase(
|
||||
databaseManager: DatabaseManager,
|
||||
storagePath: string,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
cli?: CodeQLCliServer,
|
||||
): Promise<DatabaseItem | undefined> {
|
||||
const databaseUrl = await window.showInputBox({
|
||||
@@ -63,7 +62,6 @@ export async function promptImportInternetDatabase(
|
||||
storagePath,
|
||||
undefined,
|
||||
progress,
|
||||
token,
|
||||
cli,
|
||||
);
|
||||
|
||||
@@ -86,7 +84,6 @@ export async function promptImportInternetDatabase(
|
||||
* @param storagePath where to store the unzipped database.
|
||||
* @param credentials the credentials to use to authenticate with GitHub
|
||||
* @param progress the progress callback
|
||||
* @param token the cancellation token
|
||||
* @param cli the CodeQL CLI server
|
||||
*/
|
||||
export async function promptImportGithubDatabase(
|
||||
@@ -95,7 +92,6 @@ export async function promptImportGithubDatabase(
|
||||
storagePath: string,
|
||||
credentials: Credentials | undefined,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
cli?: CodeQLCliServer,
|
||||
): Promise<DatabaseItem | undefined> {
|
||||
const githubRepo = await askForGitHubRepo(progress);
|
||||
@@ -109,7 +105,6 @@ export async function promptImportGithubDatabase(
|
||||
storagePath,
|
||||
credentials,
|
||||
progress,
|
||||
token,
|
||||
cli,
|
||||
);
|
||||
|
||||
@@ -157,7 +152,6 @@ export async function askForGitHubRepo(
|
||||
* @param storagePath where to store the unzipped database.
|
||||
* @param credentials the credentials to use to authenticate with GitHub
|
||||
* @param progress the progress callback
|
||||
* @param token the cancellation token
|
||||
* @param cli the CodeQL CLI server
|
||||
* @param language the language to download. If undefined, the user will be prompted to choose a language.
|
||||
**/
|
||||
@@ -167,7 +161,6 @@ export async function downloadGitHubDatabase(
|
||||
storagePath: string,
|
||||
credentials: Credentials | undefined,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
cli?: CodeQLCliServer,
|
||||
language?: string,
|
||||
): Promise<DatabaseItem | undefined> {
|
||||
@@ -213,7 +206,6 @@ export async function downloadGitHubDatabase(
|
||||
storagePath,
|
||||
`${owner}/${name}`,
|
||||
progress,
|
||||
token,
|
||||
cli,
|
||||
);
|
||||
}
|
||||
@@ -231,7 +223,6 @@ export async function importArchiveDatabase(
|
||||
databaseManager: DatabaseManager,
|
||||
storagePath: string,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
cli?: CodeQLCliServer,
|
||||
): Promise<DatabaseItem | undefined> {
|
||||
try {
|
||||
@@ -242,7 +233,6 @@ export async function importArchiveDatabase(
|
||||
storagePath,
|
||||
undefined,
|
||||
progress,
|
||||
token,
|
||||
cli,
|
||||
);
|
||||
if (item) {
|
||||
@@ -275,7 +265,6 @@ export async function importArchiveDatabase(
|
||||
* @param storagePath where to store the unzipped database.
|
||||
* @param nameOverride a name for the database that overrides the default
|
||||
* @param progress callback to send progress messages to
|
||||
* @param token cancellation token
|
||||
*/
|
||||
async function databaseArchiveFetcher(
|
||||
databaseUrl: string,
|
||||
@@ -284,7 +273,6 @@ async function databaseArchiveFetcher(
|
||||
storagePath: string,
|
||||
nameOverride: string | undefined,
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
cli?: CodeQLCliServer,
|
||||
): Promise<DatabaseItem> {
|
||||
progress({
|
||||
@@ -327,8 +315,6 @@ async function databaseArchiveFetcher(
|
||||
const makeSelected = true;
|
||||
|
||||
const item = await databaseManager.openDatabase(
|
||||
progress,
|
||||
token,
|
||||
Uri.file(dbPath),
|
||||
makeSelected,
|
||||
nameOverride,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { App } from "../common/app";
|
||||
import { AppEvent, AppEventEmitter } from "../common/events";
|
||||
import { ValueResult } from "../common/value-result";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { DbConfigStore } from "./config/db-config-store";
|
||||
import {
|
||||
DbItem,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { window } from "vscode";
|
||||
import { App } from "../common/app";
|
||||
import { extLogger } from "../common";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
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";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { join, basename, dirname as path_dirname } from "path";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import {
|
||||
Event,
|
||||
EventEmitter,
|
||||
@@ -41,11 +41,11 @@ import {
|
||||
promptImportGithubDatabase,
|
||||
promptImportInternetDatabase,
|
||||
} from "./database-fetcher";
|
||||
import { asError, asyncFilter, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { asError, asyncFilter, getErrorMessage } from "../common/helpers-pure";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import { isCanary } from "../config";
|
||||
import { App } from "../common/app";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { LocalDatabasesCommands } from "../common/commands";
|
||||
import {
|
||||
createMultiSelectionCommand,
|
||||
@@ -314,7 +314,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
private async handleSetDefaultTourDatabase(): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
async () => {
|
||||
try {
|
||||
if (!workspace.workspaceFolders?.length) {
|
||||
throw new Error("No workspace folder is open.");
|
||||
@@ -332,8 +332,6 @@ export class DatabaseUI extends DisposableObject {
|
||||
const isTutorialDatabase = true;
|
||||
|
||||
await this.databaseManager.openDatabase(
|
||||
progress,
|
||||
token,
|
||||
uri,
|
||||
makeSelected,
|
||||
nameOverride,
|
||||
@@ -485,13 +483,12 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
private async handleChooseDatabaseInternet(): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
async (progress) => {
|
||||
await promptImportInternetDatabase(
|
||||
this.app.commands,
|
||||
this.databaseManager,
|
||||
this.storagePath,
|
||||
progress,
|
||||
token,
|
||||
this.queryServer?.cliServer,
|
||||
);
|
||||
},
|
||||
@@ -503,7 +500,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
private async handleChooseDatabaseGithub(): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
async (progress) => {
|
||||
const credentials = isCanary() ? this.app.credentials : undefined;
|
||||
|
||||
await promptImportGithubDatabase(
|
||||
@@ -512,7 +509,6 @@ export class DatabaseUI extends DisposableObject {
|
||||
this.storagePath,
|
||||
credentials,
|
||||
progress,
|
||||
token,
|
||||
this.queryServer?.cliServer,
|
||||
);
|
||||
},
|
||||
@@ -608,14 +604,13 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
private async handleClearCache(): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
async (_progress, token) => {
|
||||
if (
|
||||
this.queryServer !== undefined &&
|
||||
this.databaseManager.currentDatabaseItem !== undefined
|
||||
) {
|
||||
await this.queryServer.clearCacheInDatabase(
|
||||
this.databaseManager.currentDatabaseItem,
|
||||
progress,
|
||||
token,
|
||||
);
|
||||
}
|
||||
@@ -633,7 +628,7 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
private async handleSetCurrentDatabase(uri: Uri): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
async (progress) => {
|
||||
try {
|
||||
// Assume user has selected an archive if the file has a .zip extension
|
||||
if (uri.path.endsWith(".zip")) {
|
||||
@@ -643,11 +638,10 @@ export class DatabaseUI extends DisposableObject {
|
||||
this.databaseManager,
|
||||
this.storagePath,
|
||||
progress,
|
||||
token,
|
||||
this.queryServer?.cliServer,
|
||||
);
|
||||
} else {
|
||||
await this.databaseManager.openDatabase(progress, token, uri);
|
||||
await this.databaseManager.openDatabase(uri);
|
||||
}
|
||||
} catch (e) {
|
||||
// rethrow and let this be handled by default error handling.
|
||||
@@ -668,10 +662,10 @@ export class DatabaseUI extends DisposableObject {
|
||||
databaseItems: DatabaseItem[],
|
||||
): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
async () => {
|
||||
await Promise.all(
|
||||
databaseItems.map((dbItem) =>
|
||||
this.databaseManager.removeDatabaseItem(progress, token, dbItem),
|
||||
this.databaseManager.removeDatabaseItem(dbItem),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -758,15 +752,11 @@ export class DatabaseUI extends DisposableObject {
|
||||
|
||||
return await withInheritedProgress(
|
||||
progress,
|
||||
async (progress, token) => {
|
||||
async (progress) => {
|
||||
if (byFolder) {
|
||||
const fixedUri = await this.fixDbUri(uri);
|
||||
// we are selecting a database folder
|
||||
return await this.databaseManager.openDatabase(
|
||||
progress,
|
||||
token,
|
||||
fixedUri,
|
||||
);
|
||||
return await this.databaseManager.openDatabase(fixedUri);
|
||||
} else {
|
||||
// we are selecting a database archive. Must unzip into a workspace-controlled area
|
||||
// before importing.
|
||||
@@ -776,7 +766,6 @@ export class DatabaseUI extends DisposableObject {
|
||||
this.databaseManager,
|
||||
this.storagePath,
|
||||
progress,
|
||||
token,
|
||||
this.queryServer?.cliServer,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
import { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import { isLikelyDatabaseRoot } from "./db-contents-heuristics";
|
||||
import { stat } from "fs-extra";
|
||||
import { containsPath, pathsEqual } from "../../pure/files";
|
||||
import { containsPath, pathsEqual } from "../../common/files";
|
||||
import { DatabaseContents } from "./database-contents";
|
||||
|
||||
export class DatabaseItemImpl implements DatabaseItem {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import vscode, { ExtensionContext } from "vscode";
|
||||
import { extLogger, Logger } from "../../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
import { DisposableObject } from "../../pure/disposable-object";
|
||||
import { Logger, 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 * as cli from "../../codeql-cli/cli";
|
||||
@@ -22,11 +22,11 @@ import {
|
||||
import { isQueryLanguage } from "../../common/query-language";
|
||||
import { existsSync } from "fs";
|
||||
import { QlPackGenerator } from "../../qlpack-generator";
|
||||
import { asError, getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { asError, getErrorMessage } from "../../common/helpers-pure";
|
||||
import { DatabaseItem, PersistedDatabaseItem } from "./database-item";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { remove } from "fs-extra";
|
||||
import { containsPath } from "../../pure/files";
|
||||
import { containsPath } from "../../common/files";
|
||||
import { DatabaseChangedEvent, DatabaseEventKind } from "./database-events";
|
||||
import { DatabaseResolver } from "./database-resolver";
|
||||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
@@ -104,8 +104,6 @@ export class DatabaseManager extends DisposableObject {
|
||||
* databases.
|
||||
*/
|
||||
public async openDatabase(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
uri: vscode.Uri,
|
||||
makeSelected = true,
|
||||
displayName?: string,
|
||||
@@ -115,9 +113,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
|
||||
return await this.addExistingDatabaseItem(
|
||||
databaseItem,
|
||||
progress,
|
||||
makeSelected,
|
||||
token,
|
||||
isTutorialDatabase,
|
||||
);
|
||||
}
|
||||
@@ -130,9 +126,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
*/
|
||||
private async addExistingDatabaseItem(
|
||||
databaseItem: DatabaseItemImpl,
|
||||
progress: ProgressCallback,
|
||||
makeSelected: boolean,
|
||||
token: vscode.CancellationToken,
|
||||
isTutorialDatabase?: boolean,
|
||||
): Promise<DatabaseItem> {
|
||||
const existingItem = this.findDatabaseItem(databaseItem.databaseUri);
|
||||
@@ -143,7 +137,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
return existingItem;
|
||||
}
|
||||
|
||||
await this.addDatabaseItem(progress, token, databaseItem);
|
||||
await this.addDatabaseItem(databaseItem);
|
||||
if (makeSelected) {
|
||||
await this.setCurrentDatabaseItem(databaseItem);
|
||||
}
|
||||
@@ -260,14 +254,11 @@ export class DatabaseManager extends DisposableObject {
|
||||
}
|
||||
}
|
||||
|
||||
private async reregisterDatabases(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
) {
|
||||
private async reregisterDatabases(progress: ProgressCallback) {
|
||||
let completed = 0;
|
||||
await Promise.all(
|
||||
this._databaseItems.map(async (databaseItem) => {
|
||||
await this.registerDatabase(progress, token, databaseItem);
|
||||
await this.registerDatabase(databaseItem);
|
||||
completed++;
|
||||
progress({
|
||||
maxStep: this._databaseItems.length,
|
||||
@@ -324,8 +315,6 @@ export class DatabaseManager extends DisposableObject {
|
||||
}
|
||||
|
||||
private async createDatabaseItemFromPersistedState(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
state: PersistedDatabaseItem,
|
||||
): Promise<DatabaseItemImpl> {
|
||||
let displayName: string | undefined = undefined;
|
||||
@@ -356,12 +345,12 @@ export class DatabaseManager extends DisposableObject {
|
||||
|
||||
// Avoid persisting the database state after adding since that should happen only after
|
||||
// all databases have been added.
|
||||
await this.addDatabaseItem(progress, token, item, false);
|
||||
await this.addDatabaseItem(item, false);
|
||||
return item;
|
||||
}
|
||||
|
||||
public async loadPersistedState(): Promise<void> {
|
||||
return withProgress(async (progress, token) => {
|
||||
return withProgress(async (progress) => {
|
||||
const currentDatabaseUri =
|
||||
this.ctx.workspaceState.get<string>(CURRENT_DB);
|
||||
const databases = this.ctx.workspaceState.get<PersistedDatabaseItem[]>(
|
||||
@@ -388,13 +377,11 @@ export class DatabaseManager extends DisposableObject {
|
||||
});
|
||||
|
||||
const databaseItem = await this.createDatabaseItemFromPersistedState(
|
||||
progress,
|
||||
token,
|
||||
database,
|
||||
);
|
||||
try {
|
||||
await this.refreshDatabase(databaseItem);
|
||||
await this.registerDatabase(progress, token, databaseItem);
|
||||
await this.registerDatabase(databaseItem);
|
||||
if (currentDatabaseUri === database.uri) {
|
||||
await this.setCurrentDatabaseItem(databaseItem, true);
|
||||
}
|
||||
@@ -489,8 +476,6 @@ export class DatabaseManager extends DisposableObject {
|
||||
}
|
||||
|
||||
private async addDatabaseItem(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
item: DatabaseItemImpl,
|
||||
updatePersistedState = true,
|
||||
) {
|
||||
@@ -504,7 +489,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
// Database items reconstituted from persisted state
|
||||
// will not have their contents yet.
|
||||
if (item.contents?.datasetUri) {
|
||||
await this.registerDatabase(progress, token, item);
|
||||
await this.registerDatabase(item);
|
||||
}
|
||||
// note that we use undefined as the item in order to reset the entire tree
|
||||
this._onDidChangeDatabaseItem.fire({
|
||||
@@ -523,11 +508,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
});
|
||||
}
|
||||
|
||||
public async removeDatabaseItem(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
item: DatabaseItem,
|
||||
) {
|
||||
public async removeDatabaseItem(item: DatabaseItem) {
|
||||
if (this._currentDatabaseItem === item) {
|
||||
this._currentDatabaseItem = undefined;
|
||||
}
|
||||
@@ -549,7 +530,7 @@ export class DatabaseManager extends DisposableObject {
|
||||
}
|
||||
|
||||
// Remove this database item from the allow-list
|
||||
await this.deregisterDatabase(progress, token, item);
|
||||
await this.deregisterDatabase(item);
|
||||
|
||||
// Delete folder from file system only if it is controlled by the extension
|
||||
if (this.isExtensionControlledLocation(item.databaseUri)) {
|
||||
@@ -572,22 +553,15 @@ export class DatabaseManager extends DisposableObject {
|
||||
});
|
||||
}
|
||||
|
||||
public async removeAllDatabases(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
) {
|
||||
public async removeAllDatabases() {
|
||||
for (const item of this.databaseItems) {
|
||||
await this.removeDatabaseItem(progress, token, item);
|
||||
await this.removeDatabaseItem(item);
|
||||
}
|
||||
}
|
||||
|
||||
private async deregisterDatabase(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
dbItem: DatabaseItem,
|
||||
) {
|
||||
private async deregisterDatabase(dbItem: DatabaseItem) {
|
||||
try {
|
||||
await this.qs.deregisterDatabase(progress, token, dbItem);
|
||||
await this.qs.deregisterDatabase(dbItem);
|
||||
} catch (e) {
|
||||
const message = getErrorMessage(e);
|
||||
if (message === "Connection is disposed.") {
|
||||
@@ -600,12 +574,8 @@ export class DatabaseManager extends DisposableObject {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
private async registerDatabase(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
dbItem: DatabaseItem,
|
||||
) {
|
||||
await this.qs.registerDatabase(progress, token, dbItem);
|
||||
private async registerDatabase(dbItem: DatabaseItem) {
|
||||
await this.qs.registerDatabase(dbItem);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
showAndLogInformationMessage,
|
||||
showAndLogWarningMessage,
|
||||
} from "../../common/logging";
|
||||
import { extLogger } from "../../common";
|
||||
import { extLogger } from "../../common/logging/vscode";
|
||||
|
||||
export class DatabaseResolver {
|
||||
public static async resolveDatabaseContents(
|
||||
|
||||
@@ -14,13 +14,13 @@ import {
|
||||
ResolvableLocationValue,
|
||||
UrlValue,
|
||||
WholeFileLocation,
|
||||
} from "../../pure/bqrs-cli-types";
|
||||
} from "../../common/bqrs-cli-types";
|
||||
import {
|
||||
isLineColumnLoc,
|
||||
tryGetResolvableLocation,
|
||||
} from "../../pure/bqrs-utils";
|
||||
import { getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { Logger } from "../../common";
|
||||
} from "../../common/bqrs-utils";
|
||||
import { getErrorMessage } from "../../common/helpers-pure";
|
||||
import { Logger } from "../../common/logging";
|
||||
import { DatabaseItem } from "./database-item";
|
||||
import { DatabaseManager } from "./database-manager";
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ import { glob } from "glob";
|
||||
import { basename } from "path";
|
||||
import { load } from "js-yaml";
|
||||
import { readFile } from "fs-extra";
|
||||
import { getQlPackPath } from "../pure/ql";
|
||||
import { getQlPackPath } from "../common/ql";
|
||||
import { CodeQLCliServer, QlpacksInfo } from "../codeql-cli/cli";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
|
||||
export interface QlPacksForLanguage {
|
||||
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
getOwnerFromGitHubUrl,
|
||||
isValidGitHubOwner,
|
||||
} from "../../common/github-url-identifier-helper";
|
||||
import { DisposableObject } from "../../pure/disposable-object";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import {
|
||||
DbItem,
|
||||
DbItemKind,
|
||||
@@ -29,7 +29,7 @@ import { DbTreeDataProvider } from "./db-tree-data-provider";
|
||||
import { 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 "../../pure/helpers-pure";
|
||||
import { getErrorMessage } from "../../common/helpers-pure";
|
||||
import { DatabasePanelCommands } from "../../common/commands";
|
||||
import { App } from "../../common/app";
|
||||
import { QueryLanguage } from "../../common/query-language";
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { createDbTreeViewItemError, DbTreeViewItem } from "./db-tree-view-item";
|
||||
import { DbManager } from "../db-manager";
|
||||
import { mapDbItemToTreeViewItem } from "./db-item-mapper";
|
||||
import { DisposableObject } from "../../pure/disposable-object";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import {
|
||||
DbConfigValidationError,
|
||||
DbConfigValidationErrorKind,
|
||||
|
||||
@@ -8,9 +8,9 @@ import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
import { LocalQueries } from "../local-queries";
|
||||
import { getQuickEvalContext, validateQueryPath } from "../run-queries-shared";
|
||||
import * as CodeQLProtocol from "./debug-protocol";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { showAndLogErrorMessage } from "../common/logging";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
|
||||
/**
|
||||
* The CodeQL launch arguments, as specified in "launch.json".
|
||||
|
||||
@@ -12,13 +12,14 @@ import {
|
||||
import { DebugProtocol as Protocol } from "@vscode/debugprotocol";
|
||||
import { Disposable } from "vscode";
|
||||
import { CancellationTokenSource } from "vscode-jsonrpc";
|
||||
import { BaseLogger, LogOptions, queryServerLogger } from "../common";
|
||||
import { BaseLogger, LogOptions } from "../common/logging";
|
||||
import { queryServerLogger } from "../common/logging/vscode";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { CoreQueryResults, CoreQueryRun, QueryRunner } from "../query-server";
|
||||
import * as CodeQLProtocol from "./debug-protocol";
|
||||
import { QuickEvalContext } from "../run-queries-shared";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
|
||||
// More complete implementations of `Event` for certain events, because the classes from
|
||||
// `@vscode/debugadapter` make it more difficult to provide some of the message values.
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
} from "vscode";
|
||||
import { isCanary } from "../config";
|
||||
import { LocalQueries } from "../local-queries";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import { QLDebugConfigurationProvider } from "./debug-configuration";
|
||||
import { QLDebugSession } from "./debug-session";
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from "vscode";
|
||||
import { DebuggerCommands } from "../common/commands";
|
||||
import { DatabaseManager } from "../databases/local-databases";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { CoreQueryResults } from "../query-server";
|
||||
import {
|
||||
getQuickEvalContext,
|
||||
|
||||
@@ -66,7 +66,7 @@ import {
|
||||
assertNever,
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "./pure/helpers-pure";
|
||||
} from "./common/helpers-pure";
|
||||
import {
|
||||
ResultsView,
|
||||
WebviewReveal,
|
||||
@@ -75,17 +75,17 @@ import {
|
||||
} from "./local-queries";
|
||||
import {
|
||||
BaseLogger,
|
||||
extLogger,
|
||||
ideServerLogger,
|
||||
ProgressReporter,
|
||||
queryServerLogger,
|
||||
} from "./common";
|
||||
import {
|
||||
showAndLogExceptionWithTelemetry,
|
||||
showAndLogErrorMessage,
|
||||
showAndLogInformationMessage,
|
||||
showAndLogWarningMessage,
|
||||
} from "./common/logging";
|
||||
import {
|
||||
extLogger,
|
||||
ideServerLogger,
|
||||
ProgressReporter,
|
||||
queryServerLogger,
|
||||
} from "./common/logging/vscode";
|
||||
import { QueryHistoryManager } from "./query-history/query-history-manager";
|
||||
import { CompletedLocalQueryInfo } from "./query-results";
|
||||
import {
|
||||
@@ -115,7 +115,7 @@ import { VSCodeMockGitHubApiServer } from "./variant-analysis/gh-api/mocks/vscod
|
||||
import { VariantAnalysisResultsManager } from "./variant-analysis/variant-analysis-results-manager";
|
||||
import { ExtensionApp } from "./common/vscode/vscode-app";
|
||||
import { DbModule } from "./databases/db-module";
|
||||
import { redactableError } from "./pure/errors";
|
||||
import { redactableError } from "./common/errors";
|
||||
import { QLDebugAdapterDescriptorFactory } from "./debugger/debugger-factory";
|
||||
import { QueryHistoryDirs } from "./query-history/query-history-dirs";
|
||||
import {
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
DecodedBqrsChunk,
|
||||
BqrsId,
|
||||
EntityValue,
|
||||
} from "../../pure/bqrs-cli-types";
|
||||
} from "../../common/bqrs-cli-types";
|
||||
import { DatabaseItem } from "../../databases/local-databases";
|
||||
import { ChildAstItem, AstItem } from "./ast-viewer";
|
||||
import { Uri } from "vscode";
|
||||
|
||||
@@ -16,18 +16,18 @@ import {
|
||||
import { basename } from "path";
|
||||
|
||||
import { DatabaseItem } from "../../databases/local-databases";
|
||||
import { UrlValue, BqrsId } from "../../pure/bqrs-cli-types";
|
||||
import { UrlValue, BqrsId } from "../../common/bqrs-cli-types";
|
||||
import { showLocation } from "../../databases/local-databases/locations";
|
||||
import {
|
||||
isStringLoc,
|
||||
isWholeFileLoc,
|
||||
isLineColumnLoc,
|
||||
} from "../../pure/bqrs-utils";
|
||||
import { DisposableObject } from "../../pure/disposable-object";
|
||||
import { asError, getErrorMessage } from "../../pure/helpers-pure";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
} from "../../common/bqrs-utils";
|
||||
import { DisposableObject } from "../../common/disposable-object";
|
||||
import { asError, getErrorMessage } from "../../common/helpers-pure";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { AstViewerCommands } from "../../common/commands";
|
||||
import { extLogger } from "../../common";
|
||||
import { extLogger } from "../../common/logging/vscode";
|
||||
import { showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as vscode from "vscode";
|
||||
|
||||
import { UrlValue, LineColumnLocation } from "../../pure/bqrs-cli-types";
|
||||
import { isEmptyPath } from "../../pure/bqrs-utils";
|
||||
import { UrlValue, LineColumnLocation } from "../../common/bqrs-cli-types";
|
||||
import { isEmptyPath } from "../../common/bqrs-utils";
|
||||
import { DatabaseItem } from "../../databases/local-databases";
|
||||
|
||||
export function fileRangeFromURI(
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
EntityValue,
|
||||
getResultSetSchema,
|
||||
ResultSetSchema,
|
||||
} from "../../pure/bqrs-cli-types";
|
||||
} from "../../common/bqrs-cli-types";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { DatabaseManager, DatabaseItem } from "../../databases/local-databases";
|
||||
import { ProgressCallback } from "../../common/vscode/progress";
|
||||
|
||||
@@ -17,13 +17,16 @@ import {
|
||||
} from "./key-type";
|
||||
import { CodeQLCliServer } from "../../codeql-cli/cli";
|
||||
import { DatabaseItem } from "../../databases/local-databases";
|
||||
import { extLogger, TeeLogger } from "../../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../../common/logging";
|
||||
import { extLogger } from "../../common/logging/vscode";
|
||||
import {
|
||||
showAndLogExceptionWithTelemetry,
|
||||
TeeLogger,
|
||||
} from "../../common/logging";
|
||||
import { CancellationToken } from "vscode";
|
||||
import { ProgressCallback } from "../../common/vscode/progress";
|
||||
import { CoreCompletedQuery, QueryRunner } from "../../query-server";
|
||||
import { redactableError } from "../../pure/errors";
|
||||
import { QLPACK_FILENAMES } from "../../pure/ql";
|
||||
import { redactableError } from "../../common/errors";
|
||||
import { QLPACK_FILENAMES } from "../../common/ql";
|
||||
import { telemetryListener } from "../../common/vscode/telemetry";
|
||||
|
||||
export async function qlpackOfDatabase(
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ProgressLocation, window } from "vscode";
|
||||
import { StreamInfo } from "vscode-languageclient/node";
|
||||
import { shouldDebugIdeServer, spawnServer } from "../codeql-cli/cli";
|
||||
import { QueryServerConfig } from "../config";
|
||||
import { ideServerLogger } from "../common";
|
||||
import { ideServerLogger } from "../common/logging/vscode";
|
||||
|
||||
/**
|
||||
* Managing the language server for CodeQL.
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Uri, window } from "vscode";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { QueryRunner } from "../query-server";
|
||||
import { basename, join } from "path";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { AppCommandManager, QueryEditorCommands } from "../common/commands";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
|
||||
@@ -12,9 +12,13 @@ import {
|
||||
window,
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import { TeeLogger } from "../common";
|
||||
import {
|
||||
TeeLogger,
|
||||
showAndLogErrorMessage,
|
||||
showAndLogWarningMessage,
|
||||
} from "../common/logging";
|
||||
import { isCanary, MAX_QUERIES } from "../config";
|
||||
import { gatherQlFiles } from "../pure/files";
|
||||
import { gatherQlFiles } from "../common/files";
|
||||
import { basename } from "path";
|
||||
import { showBinaryChoiceDialog } from "../common/vscode/dialog";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
@@ -35,18 +39,14 @@ import {
|
||||
} from "../run-queries-shared";
|
||||
import { CompletedLocalQueryInfo, LocalQueryInfo } from "../query-results";
|
||||
import { WebviewReveal } from "./webview";
|
||||
import { asError, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { asError, getErrorMessage } from "../common/helpers-pure";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { LocalQueryCommands } from "../common/commands";
|
||||
import { App } from "../common/app";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { SkeletonQueryWizard } from "../skeleton-query-wizard";
|
||||
import { LocalQueryRun } from "./local-query-run";
|
||||
import { createMultiSelectionCommand } from "../common/vscode/selection-commands";
|
||||
import {
|
||||
showAndLogErrorMessage,
|
||||
showAndLogWarningMessage,
|
||||
} from "../common/logging";
|
||||
import { findLanguage } from "../codeql-cli/query-language";
|
||||
|
||||
interface DatabaseQuickPickItem extends QuickPickItem {
|
||||
@@ -284,7 +284,7 @@ export class LocalQueries extends DisposableObject {
|
||||
|
||||
private async createSkeletonQuery(): Promise<void> {
|
||||
await withProgress(
|
||||
async (progress: ProgressCallback, token: CancellationToken) => {
|
||||
async (progress: ProgressCallback) => {
|
||||
const credentials = isCanary() ? this.app.credentials : undefined;
|
||||
const contextStoragePath =
|
||||
this.app.workspaceStoragePath || this.app.globalStoragePath;
|
||||
@@ -294,7 +294,6 @@ export class LocalQueries extends DisposableObject {
|
||||
credentials,
|
||||
this.app.logger,
|
||||
this.databaseManager,
|
||||
token,
|
||||
contextStoragePath,
|
||||
);
|
||||
await skeletonQueryWizard.execute();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { BaseLogger, extLogger, Logger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import {
|
||||
BaseLogger,
|
||||
Logger,
|
||||
showAndLogExceptionWithTelemetry,
|
||||
showAndLogWarningMessage,
|
||||
} from "../common/logging";
|
||||
@@ -18,7 +20,7 @@ import { CompletedLocalQueryInfo, LocalQueryInfo } from "../query-results";
|
||||
import { WebviewReveal } from "./webview";
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { QueryResultType } from "../pure/new-messages";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { LocalQueries } from "./local-queries";
|
||||
import { tryGetQueryMetadata } from "../codeql-cli/query-metadata";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
@@ -12,8 +12,8 @@ import {
|
||||
ProgressCallback,
|
||||
UserCancellationException,
|
||||
} from "../common/vscode/progress";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { FALLBACK_QLPACK_FILENAME, getQlPackPath } from "../pure/ql";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { FALLBACK_QLPACK_FILENAME, getQlPackPath } from "../common/ql";
|
||||
import { App } from "../common/app";
|
||||
|
||||
const QUICK_QUERIES_DIR_NAME = "quick-queries";
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
assertNever,
|
||||
getErrorMessage,
|
||||
getErrorStack,
|
||||
} from "../pure/helpers-pure";
|
||||
} from "../common/helpers-pure";
|
||||
import {
|
||||
FromResultsViewMsg,
|
||||
Interpretation,
|
||||
@@ -39,9 +39,9 @@ import {
|
||||
NavigationDirection,
|
||||
getDefaultResultSetName,
|
||||
ParsedResultSets,
|
||||
} from "../pure/interface-types";
|
||||
import { extLogger, Logger } from "../common";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
} from "../common/interface-types";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { Logger, showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import {
|
||||
CompletedQueryInfo,
|
||||
interpretResultsSarif,
|
||||
@@ -52,7 +52,7 @@ import { QueryEvaluationInfo } from "../run-queries-shared";
|
||||
import {
|
||||
parseSarifLocation,
|
||||
parseSarifPlainTextMessage,
|
||||
} from "../pure/sarif-utils";
|
||||
} from "../common/sarif-utils";
|
||||
import { WebviewReveal, fileUriToWebviewUri } from "./webview";
|
||||
import {
|
||||
tryResolveLocation,
|
||||
@@ -64,7 +64,7 @@ import {
|
||||
RawResultSet,
|
||||
transformBqrsResultSet,
|
||||
ResultSetSchema,
|
||||
} from "../pure/bqrs-cli-types";
|
||||
} from "../common/bqrs-cli-types";
|
||||
import {
|
||||
AbstractWebview,
|
||||
WebviewPanelConfig,
|
||||
@@ -72,7 +72,7 @@ import {
|
||||
import { isCanary, PAGE_SIZE } from "../config";
|
||||
import { HistoryItemLabelProvider } from "../query-history/history-item-label-provider";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { ResultsViewCommands } from "../common/commands";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Diagnostic, DiagnosticSeverity, languages, Range, Uri } from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { QueryHistoryInfo } from "../query-history/query-history-info";
|
||||
import {
|
||||
EvaluationLogProblemReporter,
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "./log-scanner";
|
||||
import { PipelineInfo, SummarySymbols } from "./summary-parser";
|
||||
import { readFile } from "fs-extra";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { QueryHistoryManager } from "../query-history/query-history-manager";
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,9 +11,9 @@ import {
|
||||
window,
|
||||
workspace,
|
||||
} from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { extLogger } from "../common";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { SummaryLanguageSupportCommands } from "../common/commands";
|
||||
import { App } from "../common/app";
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ import {
|
||||
UserCancellationException,
|
||||
withProgress,
|
||||
} from "../common/vscode/progress";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import {
|
||||
showAndLogExceptionWithTelemetry,
|
||||
showAndLogInformationMessage,
|
||||
} from "../common/logging";
|
||||
import { asError, getErrorStack } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { asError, getErrorStack } from "../common/helpers-pure";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { PACKS_BY_QUERY_LANGUAGE } from "../common/query-language";
|
||||
import { PackagingCommands } from "../common/commands";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
@@ -2,8 +2,8 @@ import {
|
||||
Repository,
|
||||
RepositoryWithMetadata,
|
||||
} from "../variant-analysis/shared/repository";
|
||||
import { parseDate } from "./date";
|
||||
import { assertNever } from "./helpers-pure";
|
||||
import { parseDate } from "../common/date";
|
||||
import { assertNever } from "../common/helpers-pure";
|
||||
|
||||
export enum FilterKey {
|
||||
All = "all",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { CodeQLCliServer } from "../codeql-cli/cli";
|
||||
import { extLogger } from "../common";
|
||||
import { App, AppMode } from "../common/app";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { App } from "../common/app";
|
||||
import { isCanary, showQueriesPanel } from "../config";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { QueriesPanel } from "./queries-panel";
|
||||
import { QueryDiscovery } from "./query-discovery";
|
||||
import { QueryPackDiscovery } from "./query-pack-discovery";
|
||||
@@ -13,9 +13,9 @@ export class QueriesModule extends DisposableObject {
|
||||
}
|
||||
|
||||
private initialize(app: App, cliServer: CodeQLCliServer): void {
|
||||
if (app.mode === AppMode.Production || !isCanary() || !showQueriesPanel()) {
|
||||
// Currently, we only want to expose the new panel when we are in development and canary mode
|
||||
// and the developer has enabled the "Show queries panel" flag.
|
||||
if (!isCanary() || !showQueriesPanel()) {
|
||||
// Currently, we only want to expose the new panel when we are in canary mode
|
||||
// and the user has enabled the "Show queries panel" flag.
|
||||
return;
|
||||
}
|
||||
void extLogger.log("Initializing queries panel.");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as vscode from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { QueryTreeDataProvider } from "./query-tree-data-provider";
|
||||
import { QueryDiscovery } from "./query-discovery";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "../common/file-tree-nodes";
|
||||
import { QueryDiscoverer } from "./query-tree-data-provider";
|
||||
import { FilePathDiscovery } from "../common/vscode/file-path-discovery";
|
||||
import { containsPath } from "../pure/files";
|
||||
import { containsPath } from "../common/files";
|
||||
import { getOnDiskWorkspaceFoldersObjects } from "../common/vscode/workspace-folders";
|
||||
import { QueryLanguage } from "../common/query-language";
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ import { basename, dirname } from "path";
|
||||
import { CodeQLCliServer, QuerySetup } from "../codeql-cli/cli";
|
||||
import { Event } from "vscode";
|
||||
import { QueryLanguage, dbSchemeToLanguage } from "../common/query-language";
|
||||
import { FALLBACK_QLPACK_FILENAME, QLPACK_FILENAMES } from "../pure/ql";
|
||||
import { FALLBACK_QLPACK_FILENAME, QLPACK_FILENAMES } from "../common/ql";
|
||||
import { FilePathDiscovery } from "../common/vscode/file-path-discovery";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { extLogger } from "../common";
|
||||
import { getErrorMessage } from "../common/helpers-pure";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { EOL } from "os";
|
||||
import { containsPath } from "../pure/files";
|
||||
import { containsPath } from "../common/files";
|
||||
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
|
||||
|
||||
export interface QueryPack {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Event, EventEmitter, TreeDataProvider, TreeItem } from "vscode";
|
||||
import { QueryTreeViewItem } from "./query-tree-view-item";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { FileTreeNode } from "../common/file-tree-nodes";
|
||||
|
||||
export interface QueryDiscoverer {
|
||||
|
||||
@@ -8,11 +8,11 @@ import {
|
||||
EventEmitter,
|
||||
TreeItemCollapsibleState,
|
||||
} from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { asError, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { redactableError } from "../pure/errors";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { asError, getErrorMessage } from "../common/helpers-pure";
|
||||
import { redactableError } from "../common/errors";
|
||||
import { EvalLogViewerCommands } from "../common/commands";
|
||||
import { extLogger } from "../common";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { showAndLogExceptionWithTelemetry } from "../common/logging";
|
||||
import { telemetryListener } from "../common/vscode/telemetry";
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
QueryHistoryInfo,
|
||||
} from "./query-history-info";
|
||||
import { VariantAnalysisHistoryItem } from "./variant-analysis-history-item";
|
||||
import { assertNever } from "../pure/helpers-pure";
|
||||
import { pluralize } from "../pure/word";
|
||||
import { assertNever } from "../common/helpers-pure";
|
||||
import { pluralize } from "../common/word";
|
||||
import { humanizeQueryStatus } from "../query-status";
|
||||
|
||||
interface InterpolateReplacements {
|
||||
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
TreeDataProvider,
|
||||
TreeItem,
|
||||
} from "vscode";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { assertNever } from "../pure/helpers-pure";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { assertNever } from "../common/helpers-pure";
|
||||
import { QueryHistoryInfo } from "./query-history-info";
|
||||
import { QueryStatus } from "../query-status";
|
||||
import { HistoryItemLabelProvider } from "./history-item-label-provider";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { VariantAnalysisHistoryItem } from "./variant-analysis-history-item";
|
||||
import { LocalQueryInfo } from "../query-results";
|
||||
import { assertNever } from "../pure/helpers-pure";
|
||||
import { pluralize } from "../pure/word";
|
||||
import { assertNever } from "../common/helpers-pure";
|
||||
import { pluralize } from "../common/word";
|
||||
import {
|
||||
hasRepoScanCompleted,
|
||||
getActionsWorkflowRunUrl as getVariantAnalysisActionsWorkflowRunUrl,
|
||||
|
||||
@@ -18,9 +18,9 @@ import {
|
||||
showInformationMessageWithAction,
|
||||
} from "../common/vscode/dialog";
|
||||
import { URLSearchParams } from "url";
|
||||
import { DisposableObject } from "../pure/disposable-object";
|
||||
import { ONE_HOUR_IN_MS, TWO_HOURS_IN_MS } from "../pure/time";
|
||||
import { assertNever, getErrorMessage } from "../pure/helpers-pure";
|
||||
import { DisposableObject } from "../common/disposable-object";
|
||||
import { ONE_HOUR_IN_MS, TWO_HOURS_IN_MS } from "../common/time";
|
||||
import { assertNever, getErrorMessage } from "../common/helpers-pure";
|
||||
import { CompletedLocalQueryInfo, LocalQueryInfo } from "../query-results";
|
||||
import {
|
||||
getActionsWorkflowRunUrl,
|
||||
|
||||
@@ -2,8 +2,8 @@ import { pathExists, stat, remove, readFile } from "fs-extra";
|
||||
import { EOL } from "os";
|
||||
import { join } from "path";
|
||||
import { Disposable, ExtensionContext } from "vscode";
|
||||
import { extLogger } from "../common";
|
||||
import { readDirFullPaths } from "../pure/files";
|
||||
import { extLogger } from "../common/logging/vscode";
|
||||
import { readDirFullPaths } from "../common/files";
|
||||
import { QueryHistoryDirs } from "./query-history-dirs";
|
||||
import { QueryHistoryManager } from "./query-history-manager";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { assertNever } from "../../pure/helpers-pure";
|
||||
import { assertNever } from "../../common/helpers-pure";
|
||||
import { QueryHistoryInfo } from "../query-history-info";
|
||||
import { mapLocalQueryInfoToDto } from "./query-history-local-query-domain-mapper";
|
||||
import { QueryHistoryItemDto } from "./query-history-dto";
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
RawResultsSortState,
|
||||
SortDirection,
|
||||
SortedResultSetInfo,
|
||||
} from "../../pure/interface-types";
|
||||
} from "../../common/interface-types";
|
||||
|
||||
export function mapLocalQueryInfoToDto(
|
||||
query: LocalQueryInfo,
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
RawResultsSortState,
|
||||
SortDirection,
|
||||
SortedResultSetInfo,
|
||||
} from "../../pure/interface-types";
|
||||
} from "../../common/interface-types";
|
||||
|
||||
export function mapLocalQueryItemToDomainModel(
|
||||
localQuery: QueryHistoryLocalQueryDto,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user