Skip to content

Commit abee109

Browse files
Merge branch 'main' into robertbrignull/deadcode_ci
2 parents 10c6708 + ef27730 commit abee109

53 files changed

Lines changed: 148 additions & 201 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extensions/ql-vscode/src/codeql-cli/distribution.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ export enum DistributionKind {
718718
PathEnvironmentVariable,
719719
}
720720

721-
export interface Distribution {
721+
interface Distribution {
722722
codeQlPath: string;
723723
kind: DistributionKind;
724724
}
@@ -776,22 +776,22 @@ type DistributionUpdateCheckResult =
776776
| InvalidLocationResult
777777
| UpdateAvailableResult;
778778

779-
export interface AlreadyCheckedRecentlyResult {
779+
interface AlreadyCheckedRecentlyResult {
780780
kind: DistributionUpdateCheckResultKind.AlreadyCheckedRecentlyResult;
781781
}
782782

783-
export interface AlreadyUpToDateResult {
783+
interface AlreadyUpToDateResult {
784784
kind: DistributionUpdateCheckResultKind.AlreadyUpToDate;
785785
}
786786

787787
/**
788788
* The distribution could not be installed or updated because it is not managed by the extension.
789789
*/
790-
export interface InvalidLocationResult {
790+
interface InvalidLocationResult {
791791
kind: DistributionUpdateCheckResultKind.InvalidLocation;
792792
}
793793

794-
export interface UpdateAvailableResult {
794+
interface UpdateAvailableResult {
795795
kind: DistributionUpdateCheckResultKind.UpdateAvailable;
796796
updatedRelease: Release;
797797
}
@@ -862,7 +862,7 @@ function warnDeprecatedLauncher() {
862862
/**
863863
* A release on GitHub.
864864
*/
865-
export interface Release {
865+
interface Release {
866866
assets: ReleaseAsset[];
867867

868868
/**
@@ -884,7 +884,7 @@ export interface Release {
884884
/**
885885
* An asset corresponding to a release on GitHub.
886886
*/
887-
export interface ReleaseAsset {
887+
interface ReleaseAsset {
888888
/**
889889
* The id associated with the asset on GitHub.
890890
*/

extensions/ql-vscode/src/common/bqrs-cli-types.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
export const PAGE_SIZE = 1000;
2-
31
/**
42
* The single-character codes used in the bqrs format for the the kind
53
* of a result column. This namespace is intentionally not an enum, see
@@ -15,7 +13,7 @@ export namespace ColumnKindCode {
1513
export const ENTITY = "e";
1614
}
1715

18-
export type ColumnKind =
16+
type ColumnKind =
1917
| typeof ColumnKindCode.FLOAT
2018
| typeof ColumnKindCode.INTEGER
2119
| typeof ColumnKindCode.STRING
@@ -46,7 +44,7 @@ export function getResultSetSchema(
4644
}
4745
return undefined;
4846
}
49-
export interface PaginationInfo {
47+
interface PaginationInfo {
5048
"step-size": number;
5149
offsets: number[];
5250
}

extensions/ql-vscode/src/common/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export type ExplorerSelectionCommandFunction<Item> = (
5656

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

extensions/ql-vscode/src/common/interface-types.ts

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ export type GraphInterpretationData = {
7676
dot: string[];
7777
};
7878

79-
export type InterpretationData =
80-
| SarifInterpretationData
81-
| GraphInterpretationData;
79+
type InterpretationData = SarifInterpretationData | GraphInterpretationData;
8280

83-
export interface InterpretationT<T> {
81+
interface InterpretationT<T> {
8482
sourceLocationPrefix: string;
8583
numTruncatedResults: number;
8684
numTotalResults: number;
@@ -106,15 +104,15 @@ export type SortedResultsMap = { [resultSet: string]: SortedResultSetInfo };
106104
*
107105
* As a result of receiving this message, listeners might want to display a loading indicator.
108106
*/
109-
export interface ResultsUpdatingMsg {
107+
interface ResultsUpdatingMsg {
110108
t: "resultsUpdating";
111109
}
112110

113111
/**
114112
* Message to set the initial state of the results view with a new
115113
* query.
116114
*/
117-
export interface SetStateMsg {
115+
interface SetStateMsg {
118116
t: "setState";
119117
resultsPath: string;
120118
origResultsPaths: ResultsPaths;
@@ -143,7 +141,7 @@ export interface SetStateMsg {
143141
* Message indicating that the results view should display interpreted
144142
* results.
145143
*/
146-
export interface ShowInterpretedPageMsg {
144+
interface ShowInterpretedPageMsg {
147145
t: "showInterpretedPage";
148146
interpretation: Interpretation;
149147
database: DatabaseInfo;
@@ -173,7 +171,7 @@ export interface NavigateMsg {
173171
* A message indicating that the results view should untoggle the
174172
* "Show results in Problems view" checkbox.
175173
*/
176-
export interface UntoggleShowProblemsMsg {
174+
interface UntoggleShowProblemsMsg {
177175
t: "untoggleShowProblems";
178176
}
179177

@@ -203,7 +201,7 @@ export type FromResultsViewMsg =
203201
* Message from the results view to open a database source
204202
* file at the provided location.
205203
*/
206-
export interface ViewSourceFileMsg {
204+
interface ViewSourceFileMsg {
207205
t: "viewSourceFile";
208206
loc: ResolvableLocationValue;
209207
databaseUri: string;
@@ -212,7 +210,7 @@ export interface ViewSourceFileMsg {
212210
/**
213211
* Message from the results view to open a file in an editor.
214212
*/
215-
export interface OpenFileMsg {
213+
interface OpenFileMsg {
216214
t: "openFile";
217215
/* Full path to the file to open. */
218216
filePath: string;
@@ -274,7 +272,7 @@ export interface RawResultsSortState {
274272
sortDirection: SortDirection;
275273
}
276274

277-
export type InterpretedResultsSortColumn = "alert-message";
275+
type InterpretedResultsSortColumn = "alert-message";
278276

279277
export interface InterpretedResultsSortState {
280278
sortBy: InterpretedResultsSortColumn;
@@ -318,7 +316,7 @@ export type FromCompareViewMessage =
318316
/**
319317
* Message from the compare view to request opening a query.
320318
*/
321-
export interface OpenQueryMessage {
319+
interface OpenQueryMessage {
322320
readonly t: "openQuery";
323321
readonly kind: "from" | "to";
324322
}
@@ -406,12 +404,12 @@ export interface ParsedResultSets {
406404
resultSet: ResultSet;
407405
}
408406

409-
export interface SetVariantAnalysisMessage {
407+
interface SetVariantAnalysisMessage {
410408
t: "setVariantAnalysis";
411409
variantAnalysis: VariantAnalysis;
412410
}
413411

414-
export interface SetFilterSortStateMessage {
412+
interface SetFilterSortStateMessage {
415413
t: "setFilterSortState";
416414
filterSortState: RepositoriesFilterSortState;
417415
}
@@ -420,48 +418,48 @@ export type VariantAnalysisState = {
420418
variantAnalysisId: number;
421419
};
422420

423-
export interface SetRepoResultsMessage {
421+
interface SetRepoResultsMessage {
424422
t: "setRepoResults";
425423
repoResults: VariantAnalysisScannedRepositoryResult[];
426424
}
427425

428-
export interface SetRepoStatesMessage {
426+
interface SetRepoStatesMessage {
429427
t: "setRepoStates";
430428
repoStates: VariantAnalysisScannedRepositoryState[];
431429
}
432430

433-
export interface RequestRepositoryResultsMessage {
431+
interface RequestRepositoryResultsMessage {
434432
t: "requestRepositoryResults";
435433
repositoryFullName: string;
436434
}
437435

438-
export interface OpenQueryFileMessage {
436+
interface OpenQueryFileMessage {
439437
t: "openQueryFile";
440438
}
441439

442-
export interface OpenQueryTextMessage {
440+
interface OpenQueryTextMessage {
443441
t: "openQueryText";
444442
}
445443

446-
export interface CopyRepositoryListMessage {
444+
interface CopyRepositoryListMessage {
447445
t: "copyRepositoryList";
448446
filterSort?: RepositoriesFilterSortStateWithIds;
449447
}
450448

451-
export interface ExportResultsMessage {
449+
interface ExportResultsMessage {
452450
t: "exportResults";
453451
filterSort?: RepositoriesFilterSortStateWithIds;
454452
}
455453

456-
export interface OpenLogsMessage {
454+
interface OpenLogsMessage {
457455
t: "openLogs";
458456
}
459457

460-
export interface CancelVariantAnalysisMessage {
458+
interface CancelVariantAnalysisMessage {
461459
t: "cancelVariantAnalysis";
462460
}
463461

464-
export interface ShowDataFlowPathsMessage {
462+
interface ShowDataFlowPathsMessage {
465463
t: "showDataFlowPaths";
466464
dataFlowPaths: DataFlowPaths;
467465
}
@@ -483,7 +481,7 @@ export type FromVariantAnalysisMessage =
483481
| CancelVariantAnalysisMessage
484482
| ShowDataFlowPathsMessage;
485483

486-
export interface SetDataFlowPathsMessage {
484+
interface SetDataFlowPathsMessage {
487485
t: "setDataFlowPaths";
488486
dataFlowPaths: DataFlowPaths;
489487
}
@@ -492,12 +490,12 @@ export type ToDataFlowPathsMessage = SetDataFlowPathsMessage;
492490

493491
export type FromDataFlowPathsMessage = CommonFromViewMessages;
494492

495-
export interface SetExtensionPackStateMessage {
493+
interface SetExtensionPackStateMessage {
496494
t: "setDataExtensionEditorViewState";
497495
viewState: DataExtensionEditorViewState;
498496
}
499497

500-
export interface SetExternalApiUsagesMessage {
498+
interface SetExternalApiUsagesMessage {
501499
t: "setExternalApiUsages";
502500
externalApiUsages: ExternalApiUsage[];
503501
}
@@ -509,51 +507,51 @@ export interface ShowProgressMessage {
509507
message: string;
510508
}
511509

512-
export interface LoadModeledMethodsMessage {
510+
interface LoadModeledMethodsMessage {
513511
t: "loadModeledMethods";
514512
modeledMethods: Record<string, ModeledMethod>;
515513
}
516514

517-
export interface AddModeledMethodsMessage {
515+
interface AddModeledMethodsMessage {
518516
t: "addModeledMethods";
519517
modeledMethods: Record<string, ModeledMethod>;
520518
}
521519

522-
export interface SwitchModeMessage {
520+
interface SwitchModeMessage {
523521
t: "switchMode";
524522
mode: Mode;
525523
}
526524

527-
export interface JumpToUsageMessage {
525+
interface JumpToUsageMessage {
528526
t: "jumpToUsage";
529527
location: ResolvableLocationValue;
530528
}
531529

532-
export interface OpenExtensionPackMessage {
530+
interface OpenExtensionPackMessage {
533531
t: "openExtensionPack";
534532
}
535533

536-
export interface RefreshExternalApiUsages {
534+
interface RefreshExternalApiUsages {
537535
t: "refreshExternalApiUsages";
538536
}
539537

540-
export interface SaveModeledMethods {
538+
interface SaveModeledMethods {
541539
t: "saveModeledMethods";
542540
externalApiUsages: ExternalApiUsage[];
543541
modeledMethods: Record<string, ModeledMethod>;
544542
}
545543

546-
export interface GenerateExternalApiMessage {
544+
interface GenerateExternalApiMessage {
547545
t: "generateExternalApi";
548546
}
549547

550-
export interface GenerateExternalApiFromLlmMessage {
548+
interface GenerateExternalApiFromLlmMessage {
551549
t: "generateExternalApiFromLlm";
552550
externalApiUsages: ExternalApiUsage[];
553551
modeledMethods: Record<string, ModeledMethod>;
554552
}
555553

556-
export interface ModelDependencyMessage {
554+
interface ModelDependencyMessage {
557555
t: "modelDependency";
558556
}
559557

extensions/ql-vscode/src/common/logging/notifications.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { NotificationLogger } from "./notification-logger";
22
import { AppTelemetry } from "../telemetry";
33
import { RedactableError } from "../errors";
44

5-
export interface ShowAndLogOptions {
5+
interface ShowAndLogOptions {
66
/**
77
* An alternate message that is added to the log, but not displayed in the popup.
88
* This is useful for adding extra detail to the logs that would be too noisy for the popup.

extensions/ql-vscode/src/common/sarif-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as Sarif from "sarif";
22
import type { HighlightedRegion } from "../variant-analysis/shared/analysis-result";
33
import { ResolvableLocationValue } from "../common/bqrs-cli-types";
44

5-
export interface SarifLink {
5+
interface SarifLink {
66
dest: number;
77
text: string;
88
}
@@ -24,7 +24,7 @@ type ParsedSarifLocation =
2424
// that, and is appropriate for display in the UI.
2525
| NoLocation;
2626

27-
export type SarifMessageComponent = string | SarifLink;
27+
type SarifMessageComponent = string | SarifLink;
2828

2929
/**
3030
* Unescape "[", "]" and "\\" like in sarif plain text messages
@@ -203,7 +203,7 @@ export function shouldHighlightLine(
203203
* A line of code split into: plain text before the highlighted section, the highlighted
204204
* text itself, and plain text after the highlighted section.
205205
*/
206-
export interface PartiallyHighlightedLine {
206+
interface PartiallyHighlightedLine {
207207
plainSection1: string;
208208
highlightedSection: string;
209209
plainSection2: string;

extensions/ql-vscode/src/common/time.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* Contains an assortment of helper constants and functions for working with time, dates, and durations.
33
*/
44

5-
export const ONE_SECOND_IN_MS = 1000;
6-
export const ONE_MINUTE_IN_MS = ONE_SECOND_IN_MS * 60;
5+
const ONE_SECOND_IN_MS = 1000;
6+
const ONE_MINUTE_IN_MS = ONE_SECOND_IN_MS * 60;
77
export const ONE_HOUR_IN_MS = ONE_MINUTE_IN_MS * 60;
88
export const TWO_HOURS_IN_MS = ONE_HOUR_IN_MS * 2;
99
export const THREE_HOURS_IN_MS = ONE_HOUR_IN_MS * 3;
1010
export const ONE_DAY_IN_MS = ONE_HOUR_IN_MS * 24;
1111

1212
// These are approximations
13-
export const ONE_MONTH_IN_MS = ONE_DAY_IN_MS * 30;
14-
export const ONE_YEAR_IN_MS = ONE_DAY_IN_MS * 365;
13+
const ONE_MONTH_IN_MS = ONE_DAY_IN_MS * 30;
14+
const ONE_YEAR_IN_MS = ONE_DAY_IN_MS * 365;
1515

1616
const durationFormatter = new Intl.RelativeTimeFormat("en", {
1717
numeric: "auto",

0 commit comments

Comments
 (0)