Unexport types that are unused outside of their source file

This commit is contained in:
Robert
2023-07-21 15:43:17 +01:00
parent 41ce5086e7
commit 8e8e0faa9e
44 changed files with 138 additions and 140 deletions

View File

@@ -718,7 +718,7 @@ export enum DistributionKind {
PathEnvironmentVariable,
}
export interface Distribution {
interface Distribution {
codeQlPath: string;
kind: DistributionKind;
}
@@ -776,22 +776,22 @@ type DistributionUpdateCheckResult =
| InvalidLocationResult
| UpdateAvailableResult;
export interface AlreadyCheckedRecentlyResult {
interface AlreadyCheckedRecentlyResult {
kind: DistributionUpdateCheckResultKind.AlreadyCheckedRecentlyResult;
}
export interface AlreadyUpToDateResult {
interface AlreadyUpToDateResult {
kind: DistributionUpdateCheckResultKind.AlreadyUpToDate;
}
/**
* The distribution could not be installed or updated because it is not managed by the extension.
*/
export interface InvalidLocationResult {
interface InvalidLocationResult {
kind: DistributionUpdateCheckResultKind.InvalidLocation;
}
export interface UpdateAvailableResult {
interface UpdateAvailableResult {
kind: DistributionUpdateCheckResultKind.UpdateAvailable;
updatedRelease: Release;
}
@@ -862,7 +862,7 @@ function warnDeprecatedLauncher() {
/**
* A release on GitHub.
*/
export interface Release {
interface Release {
assets: ReleaseAsset[];
/**
@@ -884,7 +884,7 @@ export interface Release {
/**
* An asset corresponding to a release on GitHub.
*/
export interface ReleaseAsset {
interface ReleaseAsset {
/**
* The id associated with the asset on GitHub.
*/

View File

@@ -13,7 +13,7 @@ export namespace ColumnKindCode {
export const ENTITY = "e";
}
export type ColumnKind =
type ColumnKind =
| typeof ColumnKindCode.FLOAT
| typeof ColumnKindCode.INTEGER
| typeof ColumnKindCode.STRING
@@ -44,7 +44,7 @@ export function getResultSetSchema(
}
return undefined;
}
export interface PaginationInfo {
interface PaginationInfo {
"step-size": number;
offsets: number[];
}

View File

@@ -56,7 +56,7 @@ export type ExplorerSelectionCommandFunction<Item> = (
// Builtin commands where the implementation is provided by VS Code and not by this extension.
// See https://code.visualstudio.com/api/references/commands
export type BuiltInVsCodeCommands = {
type BuiltInVsCodeCommands = {
// The codeQLDatabases.focus command is provided by VS Code because we've registered the custom view
"codeQLDatabases.focus": () => Promise<void>;
"markdown.showPreviewToSide": (uri: Uri) => Promise<void>;

View File

@@ -76,11 +76,9 @@ export type GraphInterpretationData = {
dot: string[];
};
export type InterpretationData =
| SarifInterpretationData
| GraphInterpretationData;
type InterpretationData = SarifInterpretationData | GraphInterpretationData;
export interface InterpretationT<T> {
interface InterpretationT<T> {
sourceLocationPrefix: string;
numTruncatedResults: number;
numTotalResults: number;
@@ -106,7 +104,7 @@ export type SortedResultsMap = { [resultSet: string]: SortedResultSetInfo };
*
* As a result of receiving this message, listeners might want to display a loading indicator.
*/
export interface ResultsUpdatingMsg {
interface ResultsUpdatingMsg {
t: "resultsUpdating";
}
@@ -114,7 +112,7 @@ export interface ResultsUpdatingMsg {
* Message to set the initial state of the results view with a new
* query.
*/
export interface SetStateMsg {
interface SetStateMsg {
t: "setState";
resultsPath: string;
origResultsPaths: ResultsPaths;
@@ -143,7 +141,7 @@ export interface SetStateMsg {
* Message indicating that the results view should display interpreted
* results.
*/
export interface ShowInterpretedPageMsg {
interface ShowInterpretedPageMsg {
t: "showInterpretedPage";
interpretation: Interpretation;
database: DatabaseInfo;
@@ -173,7 +171,7 @@ export interface NavigateMsg {
* A message indicating that the results view should untoggle the
* "Show results in Problems view" checkbox.
*/
export interface UntoggleShowProblemsMsg {
interface UntoggleShowProblemsMsg {
t: "untoggleShowProblems";
}
@@ -203,7 +201,7 @@ export type FromResultsViewMsg =
* Message from the results view to open a database source
* file at the provided location.
*/
export interface ViewSourceFileMsg {
interface ViewSourceFileMsg {
t: "viewSourceFile";
loc: ResolvableLocationValue;
databaseUri: string;
@@ -212,7 +210,7 @@ export interface ViewSourceFileMsg {
/**
* Message from the results view to open a file in an editor.
*/
export interface OpenFileMsg {
interface OpenFileMsg {
t: "openFile";
/* Full path to the file to open. */
filePath: string;
@@ -274,7 +272,7 @@ export interface RawResultsSortState {
sortDirection: SortDirection;
}
export type InterpretedResultsSortColumn = "alert-message";
type InterpretedResultsSortColumn = "alert-message";
export interface InterpretedResultsSortState {
sortBy: InterpretedResultsSortColumn;
@@ -318,7 +316,7 @@ export type FromCompareViewMessage =
/**
* Message from the compare view to request opening a query.
*/
export interface OpenQueryMessage {
interface OpenQueryMessage {
readonly t: "openQuery";
readonly kind: "from" | "to";
}
@@ -406,12 +404,12 @@ export interface ParsedResultSets {
resultSet: ResultSet;
}
export interface SetVariantAnalysisMessage {
interface SetVariantAnalysisMessage {
t: "setVariantAnalysis";
variantAnalysis: VariantAnalysis;
}
export interface SetFilterSortStateMessage {
interface SetFilterSortStateMessage {
t: "setFilterSortState";
filterSortState: RepositoriesFilterSortState;
}
@@ -420,48 +418,48 @@ export type VariantAnalysisState = {
variantAnalysisId: number;
};
export interface SetRepoResultsMessage {
interface SetRepoResultsMessage {
t: "setRepoResults";
repoResults: VariantAnalysisScannedRepositoryResult[];
}
export interface SetRepoStatesMessage {
interface SetRepoStatesMessage {
t: "setRepoStates";
repoStates: VariantAnalysisScannedRepositoryState[];
}
export interface RequestRepositoryResultsMessage {
interface RequestRepositoryResultsMessage {
t: "requestRepositoryResults";
repositoryFullName: string;
}
export interface OpenQueryFileMessage {
interface OpenQueryFileMessage {
t: "openQueryFile";
}
export interface OpenQueryTextMessage {
interface OpenQueryTextMessage {
t: "openQueryText";
}
export interface CopyRepositoryListMessage {
interface CopyRepositoryListMessage {
t: "copyRepositoryList";
filterSort?: RepositoriesFilterSortStateWithIds;
}
export interface ExportResultsMessage {
interface ExportResultsMessage {
t: "exportResults";
filterSort?: RepositoriesFilterSortStateWithIds;
}
export interface OpenLogsMessage {
interface OpenLogsMessage {
t: "openLogs";
}
export interface CancelVariantAnalysisMessage {
interface CancelVariantAnalysisMessage {
t: "cancelVariantAnalysis";
}
export interface ShowDataFlowPathsMessage {
interface ShowDataFlowPathsMessage {
t: "showDataFlowPaths";
dataFlowPaths: DataFlowPaths;
}
@@ -483,7 +481,7 @@ export type FromVariantAnalysisMessage =
| CancelVariantAnalysisMessage
| ShowDataFlowPathsMessage;
export interface SetDataFlowPathsMessage {
interface SetDataFlowPathsMessage {
t: "setDataFlowPaths";
dataFlowPaths: DataFlowPaths;
}
@@ -492,12 +490,12 @@ export type ToDataFlowPathsMessage = SetDataFlowPathsMessage;
export type FromDataFlowPathsMessage = CommonFromViewMessages;
export interface SetExtensionPackStateMessage {
interface SetExtensionPackStateMessage {
t: "setDataExtensionEditorViewState";
viewState: DataExtensionEditorViewState;
}
export interface SetExternalApiUsagesMessage {
interface SetExternalApiUsagesMessage {
t: "setExternalApiUsages";
externalApiUsages: ExternalApiUsage[];
}
@@ -509,51 +507,51 @@ export interface ShowProgressMessage {
message: string;
}
export interface LoadModeledMethodsMessage {
interface LoadModeledMethodsMessage {
t: "loadModeledMethods";
modeledMethods: Record<string, ModeledMethod>;
}
export interface AddModeledMethodsMessage {
interface AddModeledMethodsMessage {
t: "addModeledMethods";
modeledMethods: Record<string, ModeledMethod>;
}
export interface SwitchModeMessage {
interface SwitchModeMessage {
t: "switchMode";
mode: Mode;
}
export interface JumpToUsageMessage {
interface JumpToUsageMessage {
t: "jumpToUsage";
location: ResolvableLocationValue;
}
export interface OpenExtensionPackMessage {
interface OpenExtensionPackMessage {
t: "openExtensionPack";
}
export interface RefreshExternalApiUsages {
interface RefreshExternalApiUsages {
t: "refreshExternalApiUsages";
}
export interface SaveModeledMethods {
interface SaveModeledMethods {
t: "saveModeledMethods";
externalApiUsages: ExternalApiUsage[];
modeledMethods: Record<string, ModeledMethod>;
}
export interface GenerateExternalApiMessage {
interface GenerateExternalApiMessage {
t: "generateExternalApi";
}
export interface GenerateExternalApiFromLlmMessage {
interface GenerateExternalApiFromLlmMessage {
t: "generateExternalApiFromLlm";
externalApiUsages: ExternalApiUsage[];
modeledMethods: Record<string, ModeledMethod>;
}
export interface ModelDependencyMessage {
interface ModelDependencyMessage {
t: "modelDependency";
}

View File

@@ -2,7 +2,7 @@ import { NotificationLogger } from "./notification-logger";
import { AppTelemetry } from "../telemetry";
import { RedactableError } from "../errors";
export interface ShowAndLogOptions {
interface ShowAndLogOptions {
/**
* An alternate message that is added to the log, but not displayed in the popup.
* This is useful for adding extra detail to the logs that would be too noisy for the popup.

View File

@@ -2,7 +2,7 @@ import * as Sarif from "sarif";
import type { HighlightedRegion } from "../variant-analysis/shared/analysis-result";
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
export interface SarifLink {
interface SarifLink {
dest: number;
text: string;
}
@@ -24,7 +24,7 @@ type ParsedSarifLocation =
// that, and is appropriate for display in the UI.
| NoLocation;
export type SarifMessageComponent = string | SarifLink;
type SarifMessageComponent = string | SarifLink;
/**
* Unescape "[", "]" and "\\" like in sarif plain text messages
@@ -203,7 +203,7 @@ export function shouldHighlightLine(
* A line of code split into: plain text before the highlighted section, the highlighted
* text itself, and plain text after the highlighted section.
*/
export interface PartiallyHighlightedLine {
interface PartiallyHighlightedLine {
plainSection1: string;
highlightedSection: string;
plainSection2: string;

View File

@@ -2,16 +2,16 @@
* Contains an assortment of helper constants and functions for working with time, dates, and durations.
*/
export const ONE_SECOND_IN_MS = 1000;
export const ONE_MINUTE_IN_MS = ONE_SECOND_IN_MS * 60;
const ONE_SECOND_IN_MS = 1000;
const ONE_MINUTE_IN_MS = ONE_SECOND_IN_MS * 60;
export const ONE_HOUR_IN_MS = ONE_MINUTE_IN_MS * 60;
export const TWO_HOURS_IN_MS = ONE_HOUR_IN_MS * 2;
export const THREE_HOURS_IN_MS = ONE_HOUR_IN_MS * 3;
export const ONE_DAY_IN_MS = ONE_HOUR_IN_MS * 24;
// These are approximations
export const ONE_MONTH_IN_MS = ONE_DAY_IN_MS * 30;
export const ONE_YEAR_IN_MS = ONE_DAY_IN_MS * 365;
const ONE_MONTH_IN_MS = ONE_DAY_IN_MS * 30;
const ONE_YEAR_IN_MS = ONE_DAY_IN_MS * 365;
const durationFormatter = new Intl.RelativeTimeFormat("en", {
numeric: "auto",

View File

@@ -8,7 +8,7 @@ import { extLogger } from "../logging/vscode";
import { posix } from "path";
const path = posix;
export class File implements vscode.FileStat {
class File implements vscode.FileStat {
type: vscode.FileType;
ctime: number;
mtime: number;
@@ -26,7 +26,7 @@ export class File implements vscode.FileStat {
}
}
export class Directory implements vscode.FileStat {
class Directory implements vscode.FileStat {
type: vscode.FileType;
ctime: number;
mtime: number;
@@ -41,7 +41,7 @@ export class Directory implements vscode.FileStat {
}
}
export type Entry = File | Directory;
type Entry = File | Directory;
/**
* A map containing directory hierarchy information in a convenient form.
@@ -52,7 +52,7 @@ export type Entry = File | Directory;
* dirMap['/foo'] = {'bar': vscode.FileType.Directory}
* dirMap['/foo/bar'] = {'baz': vscode.FileType.File}
*/
export type DirectoryHierarchyMap = Map<string, Map<string, vscode.FileType>>;
type DirectoryHierarchyMap = Map<string, Map<string, vscode.FileType>>;
export type ZipFileReference = {
sourceArchiveZipPath: string;

View File

@@ -38,7 +38,7 @@ export type ProgressCallback = (p: ProgressUpdate) => void;
// Make certain properties within a type optional
type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export type ProgressOptions = Optional<VSCodeProgressOptions, "location">;
type ProgressOptions = Optional<VSCodeProgressOptions, "location">;
/**
* A task that reports progress.

View File

@@ -25,7 +25,7 @@ import { AppTelemetry } from "../telemetry";
// Key is injected at build time through the APP_INSIGHTS_KEY environment variable.
const key = "REPLACE-APP-INSIGHTS-KEY";
export enum CommandCompletion {
enum CommandCompletion {
Success = "Success",
Failed = "Failed",
Cancelled = "Cancelled",

View File

@@ -17,7 +17,7 @@ import { redactableError } from "../common/errors";
import { telemetryListener } from "../common/vscode/telemetry";
import { Query } from "./queries/query";
export type RunQueryOptions = {
type RunQueryOptions = {
cliServer: Pick<CodeQLCliServer, "resolveQlpacks">;
queryRunner: Pick<QueryRunner, "createQueryRun" | "logger">;
databaseItem: Pick<DatabaseItem, "contents" | "databaseUri" | "language">;
@@ -125,7 +125,7 @@ export async function runQuery(
return completedQuery;
}
export type GetResultsOptions = {
type GetResultsOptions = {
cliServer: Pick<CodeQLCliServer, "bqrsInfo" | "bqrsDecode">;
bqrsPath: string;
};

View File

@@ -13,7 +13,7 @@ export enum CallClassification {
Generated = "generated",
}
export type Usage = Call & {
type Usage = Call & {
classification: CallClassification;
};

View File

@@ -14,7 +14,7 @@ import { basename, extname } from "../common/path";
const semverRegex =
/-[v=\s]*(?<version>([0-9]+)(\.([0-9]+)(?:(\.([0-9]+))?(?:[-.]?((?:[0-9]+|\d*[a-zA-Z-][a-zA-Z0-9-]*)(?:\.(?:[0-9]+|\d*[a-zA-Z-][a-zA-Z0-9-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?)?)?)/g;
export interface Library {
interface Library {
name: string;
version?: string;
}

View File

@@ -9,7 +9,7 @@ export interface DbConfig {
selected?: SelectedDbItem;
}
export interface DbConfigDatabases {
interface DbConfigDatabases {
variantAnalysis: RemoteDbConfig;
local: LocalDbConfig;
}
@@ -31,39 +31,39 @@ export enum SelectedDbItemKind {
VariantAnalysisRepository = "variantAnalysisRepository",
}
export interface SelectedLocalUserDefinedList {
interface SelectedLocalUserDefinedList {
kind: SelectedDbItemKind.LocalUserDefinedList;
listName: string;
}
export interface SelectedLocalDatabase {
interface SelectedLocalDatabase {
kind: SelectedDbItemKind.LocalDatabase;
databaseName: string;
listName?: string;
}
export interface SelectedRemoteSystemDefinedList {
interface SelectedRemoteSystemDefinedList {
kind: SelectedDbItemKind.VariantAnalysisSystemDefinedList;
listName: string;
}
export interface SelectedVariantAnalysisUserDefinedList {
interface SelectedVariantAnalysisUserDefinedList {
kind: SelectedDbItemKind.VariantAnalysisUserDefinedList;
listName: string;
}
export interface SelectedRemoteOwner {
interface SelectedRemoteOwner {
kind: SelectedDbItemKind.VariantAnalysisOwner;
ownerName: string;
}
export interface SelectedRemoteRepository {
interface SelectedRemoteRepository {
kind: SelectedDbItemKind.VariantAnalysisRepository;
repositoryName: string;
listName?: string;
}
export interface RemoteDbConfig {
interface RemoteDbConfig {
repositoryLists: RemoteRepositoryList[];
owners: string[];
repositories: string[];
@@ -74,7 +74,7 @@ export interface RemoteRepositoryList {
repositories: string[];
}
export interface LocalDbConfig {
interface LocalDbConfig {
lists: LocalList[];
databases: LocalDatabase[];
}

View File

@@ -13,16 +13,16 @@ export enum ExpandedDbItemKind {
RemoteUserDefinedList = "remoteUserDefinedList",
}
export interface RootLocalExpandedDbItem {
interface RootLocalExpandedDbItem {
kind: ExpandedDbItemKind.RootLocal;
}
export interface LocalUserDefinedListExpandedDbItem {
interface LocalUserDefinedListExpandedDbItem {
kind: ExpandedDbItemKind.LocalUserDefinedList;
listName: string;
}
export interface RootRemoteExpandedDbItem {
interface RootRemoteExpandedDbItem {
kind: ExpandedDbItemKind.RootRemote;
}

View File

@@ -115,7 +115,7 @@ export function isLocalDatabaseDbItem(
return dbItem.kind === DbItemKind.LocalDatabase;
}
export type SelectableDbItem = RemoteDbItem | LocalDbItem;
type SelectableDbItem = RemoteDbItem | LocalDbItem;
export function isSelectableDbItem(dbItem: DbItem): dbItem is SelectableDbItem {
return SelectableDbItemKinds.includes(dbItem.kind);

View File

@@ -47,7 +47,7 @@ export interface AddListQuickPickItem extends QuickPickItem {
databaseKind: DbListKind;
}
export interface CodeSearchQuickPickItem extends QuickPickItem {
interface CodeSearchQuickPickItem extends QuickPickItem {
language: string;
}

View File

@@ -1,6 +1,6 @@
import { DbItem, DbItemKind, isSelectableDbItem } from "../db-item";
export type DbTreeViewItemAction =
type DbTreeViewItemAction =
| "canBeSelected"
| "canBeRemoved"
| "canBeRenamed"

View File

@@ -4,11 +4,11 @@ export interface PipelineRun {
duplicationPercentages: number[];
}
export interface Ra {
interface Ra {
[key: string]: string[];
}
export type EvaluationStrategy =
type EvaluationStrategy =
| "COMPUTE_SIMPLE"
| "COMPUTE_RECURSIVE"
| "IN_LAYER"
@@ -58,30 +58,30 @@ export interface InLayer extends ResultEventBase {
predicateIterationMillis: number[];
}
export interface ComputedExtensional extends ResultEventBase {
interface ComputedExtensional extends ResultEventBase {
evaluationStrategy: "COMPUTED_EXTENSIONAL";
queryCausingWork?: string;
}
export interface NonComputedExtensional extends ResultEventBase {
interface NonComputedExtensional extends ResultEventBase {
evaluationStrategy: "EXTENSIONAL";
queryCausingWork?: string;
}
export interface SentinelEmpty extends SummaryEventBase {
interface SentinelEmpty extends SummaryEventBase {
evaluationStrategy: "SENTINEL_EMPTY";
sentinelRaHash: string;
}
export interface Cachaca extends ResultEventBase {
interface Cachaca extends ResultEventBase {
evaluationStrategy: "CACHACA";
}
export interface CacheHit extends ResultEventBase {
interface CacheHit extends ResultEventBase {
evaluationStrategy: "CACHE_HIT";
}
export type Extensional = ComputedExtensional | NonComputedExtensional;
type Extensional = ComputedExtensional | NonComputedExtensional;
export type SummaryEvent =
| ComputeSimple

View File

@@ -12,7 +12,7 @@ export interface PipelineInfo {
/**
* Location information for a single predicate in the RA.
*/
export interface PredicateSymbol {
interface PredicateSymbol {
/**
* `PipelineInfo` for each iteration. A non-recursive predicate will have a single iteration `0`.
*/

View File

@@ -10,7 +10,7 @@ import { EOL } from "os";
import { containsPath } from "../common/files";
import { getOnDiskWorkspaceFolders } from "../common/vscode/workspace-folders";
export interface QueryPack {
interface QueryPack {
path: string;
language: QueryLanguage | undefined;
}

View File

@@ -94,7 +94,7 @@ const SHOW_QUERY_TEXT_QUICK_EVAL_MSG = `\
`;
export enum SortOrder {
enum SortOrder {
NameAsc = "NameAsc",
NameDesc = "NameDesc",
DateAsc = "DateAsc",

View File

@@ -7,7 +7,7 @@ import { basename } from "path";
import { App } from "../common/app";
import { TestTreeNode } from "./test-tree-node";
export type TestNode = TestTreeNode | TestItem;
type TestNode = TestTreeNode | TestItem;
/**
* Base class for both the legacy and new test services. Implements commands that are common to

View File

@@ -157,7 +157,7 @@ export async function exportVariantAnalysisResults(
);
}
export async function exportVariantAnalysisAnalysisResults(
async function exportVariantAnalysisAnalysisResults(
exportedResultsPath: string,
variantAnalysis: VariantAnalysis,
analysesResults: AsyncIterable<
@@ -236,7 +236,7 @@ async function determineExportFormat(): Promise<"gist" | "local" | undefined> {
return undefined;
}
export async function exportResults(
async function exportResults(
exportedResultsPath: string,
description: string,
markdownFiles: MarkdownFile[],
@@ -270,7 +270,7 @@ export async function exportResults(
}
}
export async function exportToGist(
async function exportToGist(
description: string,
markdownFiles: MarkdownFile[],
commandManager: AppCommandManager,

View File

@@ -13,11 +13,11 @@ export enum RequestKind {
CodeSearch = "codeSearch",
}
export interface BasicErorResponse {
interface BasicErorResponse {
message: string;
}
export interface GetRepoRequest {
interface GetRepoRequest {
request: {
kind: RequestKind.GetRepo;
};
@@ -27,7 +27,7 @@ export interface GetRepoRequest {
};
}
export interface SubmitVariantAnalysisRequest {
interface SubmitVariantAnalysisRequest {
request: {
kind: RequestKind.SubmitVariantAnalysis;
};
@@ -37,7 +37,7 @@ export interface SubmitVariantAnalysisRequest {
};
}
export interface GetVariantAnalysisRequest {
interface GetVariantAnalysisRequest {
request: {
kind: RequestKind.GetVariantAnalysis;
};
@@ -47,7 +47,7 @@ export interface GetVariantAnalysisRequest {
};
}
export interface GetVariantAnalysisRepoRequest {
interface GetVariantAnalysisRepoRequest {
request: {
kind: RequestKind.GetVariantAnalysisRepo;
repositoryId: number;
@@ -70,7 +70,7 @@ export interface GetVariantAnalysisRepoResultRequest {
};
}
export interface CodeSearchRequest {
interface CodeSearchRequest {
request: {
kind: RequestKind.CodeSearch;
query: string;

View File

@@ -13,7 +13,7 @@ import {
const baseUrl = "https://api.github.com";
export type RequestHandler = RestHandler<MockedRequest<DefaultBodyType>>;
type RequestHandler = RestHandler<MockedRequest<DefaultBodyType>>;
export async function createRequestHandlers(
scenarioDirPath: string,

View File

@@ -20,7 +20,7 @@ import type {
} from "./shared/variant-analysis";
import type { RepositoryWithMetadata } from "./shared/repository";
export type MarkdownLinkType = "local" | "gist";
type MarkdownLinkType = "local" | "gist";
export interface MarkdownFile {
fileName: string;
@@ -33,7 +33,7 @@ export interface RepositorySummary {
resultCount: number;
}
export interface VariantAnalysisMarkdown {
interface VariantAnalysisMarkdown {
markdownFiles: MarkdownFile[];
summaries: RepositorySummary[];
}
@@ -105,7 +105,7 @@ export async function generateVariantAnalysisMarkdown(
};
}
export function generateVariantAnalysisMarkdownSummary(
function generateVariantAnalysisMarkdownSummary(
query: VariantAnalysis["query"],
summaries: RepositorySummary[],
linkType: MarkdownLinkType,
@@ -356,7 +356,7 @@ function generateMarkdownForRawTableCell(
* Creates a markdown link to a remote file.
* If the "link text" is not provided, we use the file path.
*/
export function createMarkdownRemoteFileRef(
function createMarkdownRemoteFileRef(
fileLink: FileLink,
region?: HighlightedRegion,
linkText?: string,

View File

@@ -38,7 +38,7 @@ import { QueryLanguage } from "../common/query-language";
import { tryGetQueryMetadata } from "../codeql-cli/query-metadata";
import { askForLanguage, findLanguage } from "../codeql-cli/query-language";
export interface QlPack {
interface QlPack {
name: string;
version: string;
library?: boolean;
@@ -52,7 +52,7 @@ export interface QlPack {
*/
const QUERY_PACK_NAME = "codeql-remote/query";
export interface GeneratedQueryPack {
interface GeneratedQueryPack {
base64Pack: string;
language: string;
}
@@ -240,7 +240,7 @@ function isFileSystemRoot(dir: string): boolean {
return pathObj.root === dir && pathObj.base === "";
}
export async function createRemoteQueriesTempDirectory() {
async function createRemoteQueriesTempDirectory() {
const remoteQueryDir = await dir({
dir: tmpDir.name,
unsafeCleanup: true,
@@ -258,7 +258,7 @@ async function getPackedBundlePath(queryPackDir: string) {
});
}
export interface PreparedRemoteQuery {
interface PreparedRemoteQuery {
actionBranch: string;
base64Pack: string;
repoSelection: RepositorySelection;

View File

@@ -55,7 +55,7 @@ export type AnalysisMessageToken =
| AnalysisMessageTextToken
| AnalysisMessageLocationToken;
export interface AnalysisMessageTextToken {
interface AnalysisMessageTextToken {
t: "text";
text: string;
}

View File

@@ -26,7 +26,7 @@ const createCacheKey = (
repositoryFullName: string,
): CacheKey => `${variantAnalysisId}/${repositoryFullName}`;
export type ResultDownloadedEvent = {
type ResultDownloadedEvent = {
variantAnalysisId: number;
repoTask: VariantAnalysisRepositoryTask;
};

View File

@@ -23,10 +23,10 @@ import { AlertTableHeader } from "./alert-table-header";
import { SarifMessageWithLocations } from "./locations/SarifMessageWithLocations";
import { SarifLocation } from "./locations/SarifLocation";
export type AlertTableProps = ResultTableProps & {
type AlertTableProps = ResultTableProps & {
resultSet: InterpretedResultSet<SarifInterpretationData>;
};
export interface AlertTableState {
interface AlertTableState {
expanded: Set<string>;
selectedItem: undefined | Keys.ResultKey;
}

View File

@@ -1,4 +1,4 @@
export type EventHandler<T> = (event: T) => void;
type EventHandler<T> = (event: T) => void;
/**
* A set of listeners for events of type `T`.

View File

@@ -21,7 +21,7 @@ import { ScrollIntoViewHelper } from "./scroll-into-view-helper";
import { sendTelemetry } from "../common/telemetry";
import { assertNever } from "../../common/helpers-pure";
export type RawTableProps = {
type RawTableProps = {
databaseUri: string;
resultSet: RawTableResultSet;
sortState?: RawResultsSortState;

View File

@@ -37,8 +37,8 @@ export const tableHeaderItemClassName =
"vscode-codeql__table-selection-header-item";
export const alertExtrasClassName = `${className}-alert-extras`;
export const toggleDiagnosticsClassName = `${className}-toggle-diagnostics`;
export const evenRowClassName = "vscode-codeql__result-table-row--even";
export const oddRowClassName = "vscode-codeql__result-table-row--odd";
const evenRowClassName = "vscode-codeql__result-table-row--even";
const oddRowClassName = "vscode-codeql__result-table-row--odd";
export const selectedRowClassName = "vscode-codeql__result-table-row--selected";
export function jumpToLocation(

View File

@@ -33,7 +33,7 @@ const FILE_PATH_REGEX = /^(?:.+[\\/])*(.+)$/;
/**
* Properties for the `ResultTables` component.
*/
export interface ResultTablesProps {
interface ResultTablesProps {
parsedResultSets: ParsedResultSets;
rawResultSets: readonly ResultSet[];
interpretation: Interpretation | undefined;
@@ -440,7 +440,7 @@ export class ResultTables extends React.Component<
}
}
export function ResultTable(props: ResultTableProps) {
function ResultTable(props: ResultTableProps) {
const { resultSet } = props;
switch (resultSet.t) {
case "RawResultSet":

View File

@@ -21,7 +21,7 @@ import {
RepositoriesFilterSortState,
} from "../../variant-analysis/shared/variant-analysis-filter-sort";
export type VariantAnalysisHeaderProps = {
type VariantAnalysisHeaderProps = {
variantAnalysis: VariantAnalysis;
repositoryStates?: VariantAnalysisScannedRepositoryState[];
filterSortState?: RepositoriesFilterSortState;

View File

@@ -6,7 +6,7 @@ import {
VariantAnalysisState,
} from "../common/interface-types";
export interface VsCodeApi {
interface VsCodeApi {
/**
* Post message back to vscode extension.
*/

View File

@@ -51,7 +51,7 @@ export function createMockApp({
};
}
export class MockAppEventEmitter<T> implements AppEventEmitter<T> {
class MockAppEventEmitter<T> implements AppEventEmitter<T> {
public event: AppEvent<T>;
constructor() {

View File

@@ -15,7 +15,7 @@ export function createMockSkippedRepos(): VariantAnalysisSkippedRepositories {
};
}
export function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGroup {
function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGroup {
return {
repository_count: 2,
repositories: [
@@ -25,7 +25,7 @@ export function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGr
};
}
export function createMockNotFoundSkippedRepoGroup(): VariantAnalysisNotFoundRepositoryGroup {
function createMockNotFoundSkippedRepoGroup(): VariantAnalysisNotFoundRepositoryGroup {
const repoName1 = `github/${faker.word.sample()}`;
const repoName2 = `github/${faker.word.sample()}`;

View File

@@ -14,7 +14,7 @@ export function createMockSkippedRepos(): VariantAnalysisSkippedRepositories {
};
}
export function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGroup {
function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGroup {
return {
repositoryCount: 2,
repositories: [
@@ -24,7 +24,7 @@ export function createMockSkippedRepoGroup(): VariantAnalysisSkippedRepositoryGr
};
}
export function createMockNotFoundRepoGroup(): VariantAnalysisSkippedRepositoryGroup {
function createMockNotFoundRepoGroup(): VariantAnalysisSkippedRepositoryGroup {
return {
repositoryCount: 2,
repositories: [

View File

@@ -4,7 +4,7 @@ export function createMockMemento(): Memento {
return new MockMemento();
}
export class MockMemento<T> implements Memento {
class MockMemento<T> implements Memento {
private readonly map: Map<string, T>;
constructor() {

View File

@@ -118,7 +118,7 @@ class Tracker implements DebugAdapterTracker {
* code consumes these events and asserts that they are in the correct order and have the correct
* data.
*/
export type DebugEventKind =
type DebugEventKind =
| "launched"
| "evaluationCompleted"
| "terminated"
@@ -126,39 +126,39 @@ export type DebugEventKind =
| "exited"
| "sessionClosed";
export interface DebugEvent {
interface DebugEvent {
kind: DebugEventKind;
}
export interface LaunchedEvent extends DebugEvent {
interface LaunchedEvent extends DebugEvent {
kind: "launched";
request: CodeQLProtocol.LaunchRequest;
}
export interface EvaluationCompletedEvent extends DebugEvent {
interface EvaluationCompletedEvent extends DebugEvent {
kind: "evaluationCompleted";
started: CodeQLProtocol.EvaluationStartedEvent["body"];
results: CoreCompletedQuery;
}
export interface TerminatedEvent extends DebugEvent {
interface TerminatedEvent extends DebugEvent {
kind: "terminated";
}
export interface StoppedEvent extends DebugEvent {
interface StoppedEvent extends DebugEvent {
kind: "stopped";
}
export interface ExitedEvent extends DebugEvent {
interface ExitedEvent extends DebugEvent {
kind: "exited";
body: CodeQLProtocol.ExitedEvent["body"];
}
export interface SessionClosedEvent extends DebugEvent {
interface SessionClosedEvent extends DebugEvent {
kind: "sessionClosed";
}
export type AnyDebugEvent =
type AnyDebugEvent =
| LaunchedEvent
| EvaluationCompletedEvent
| StoppedEvent
@@ -171,7 +171,7 @@ export type AnyDebugEvent =
* async functions, and consumes events reported by the session to ensure the correct sequence and
* data.
*/
export class DebugController
class DebugController
extends DisposableObject
implements DebugAdapterTrackerFactory
{

View File

@@ -3,7 +3,7 @@ import { extract as tar_extract, Headers } from "tar-stream";
import { pipeline } from "stream/promises";
import { createGunzip } from "zlib";
export interface QueryPackFS {
interface QueryPackFS {
fileExists: (name: string) => boolean;
fileContents: (name: string) => Buffer;
directoryContents: (name: string) => string[];

View File

@@ -7,7 +7,7 @@ export type DeepPartial<T> = T extends object
}
: T;
export type DynamicProperties<T extends object> = {
type DynamicProperties<T extends object> = {
[P in keyof T]?: () => T[P];
};