Skip to content

Commit 50df8cd

Browse files
committed
Remove dead code
After removing all namespace imports, the dead code detection is now more accurate, so we can remove some more dead code.
1 parent 034bfc2 commit 50df8cd

File tree

3 files changed

+25
-37
lines changed

3 files changed

+25
-37
lines changed

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

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ const CSV_FORMAT = "csv";
5555
*/
5656
const LOGGING_FLAGS = ["-v", "--log-to-stderr"];
5757

58-
/**
59-
* The expected output of `codeql resolve library-path`.
60-
*/
61-
export interface QuerySetup {
62-
libraryPath: string[];
63-
dbscheme: string;
64-
relativeName?: string;
65-
compilationCache?: string;
66-
}
67-
6858
/**
6959
* The expected output of `codeql resolve queries --format bylanguage`.
7060
*/
@@ -92,7 +82,7 @@ export interface DbInfo {
9282
/**
9383
* The expected output of `codeql resolve upgrades`.
9484
*/
95-
export interface UpgradesInfo {
85+
interface UpgradesInfo {
9686
scripts: string[];
9787
finalDbscheme: string;
9888
matchesTarget?: boolean;
@@ -106,33 +96,33 @@ export type QlpacksInfo = { [name: string]: string[] };
10696
/**
10797
* The expected output of `codeql resolve languages`.
10898
*/
109-
export type LanguagesInfo = { [name: string]: string[] };
99+
type LanguagesInfo = { [name: string]: string[] };
110100

111101
/** Information about an ML model, as resolved by `codeql resolve ml-models`. */
112-
export type MlModelInfo = {
102+
type MlModelInfo = {
113103
checksum: string;
114104
path: string;
115105
};
116106

117107
/** The expected output of `codeql resolve ml-models`. */
118-
export type MlModelsInfo = { models: MlModelInfo[] };
108+
type MlModelsInfo = { models: MlModelInfo[] };
119109

120110
/** Information about a data extension predicate, as resolved by `codeql resolve extensions`. */
121-
export type DataExtensionResult = {
111+
type DataExtensionResult = {
122112
predicate: string;
123113
file: string;
124114
index: number;
125115
};
126116

127117
/** The expected output of `codeql resolve extensions`. */
128-
export type ResolveExtensionsResult = {
118+
type ResolveExtensionsResult = {
129119
models: MlModelInfo[];
130120
data: {
131121
[path: string]: DataExtensionResult[];
132122
};
133123
};
134124

135-
export type GenerateExtensiblePredicateMetadataResult = {
125+
type GenerateExtensiblePredicateMetadataResult = {
136126
// There are other properties in this object, but they are
137127
// not relevant for its use in the extension, so we omit them.
138128
extensible_predicates: Array<{
@@ -144,7 +134,7 @@ export type GenerateExtensiblePredicateMetadataResult = {
144134
/**
145135
* The expected output of `codeql resolve qlref`.
146136
*/
147-
export type QlrefInfo = { resolvedPath: string };
137+
type QlrefInfo = { resolvedPath: string };
148138

149139
// `codeql bqrs interpret` requires both of these to be present or
150140
// both absent.
@@ -156,17 +146,17 @@ export interface SourceInfo {
156146
/**
157147
* The expected output of `codeql resolve queries`.
158148
*/
159-
export type ResolvedQueries = string[];
149+
type ResolvedQueries = string[];
160150

161151
/**
162152
* The expected output of `codeql resolve tests`.
163153
*/
164-
export type ResolvedTests = string[];
154+
type ResolvedTests = string[];
165155

166156
/**
167157
* A compilation message for a test message (either an error or a warning)
168158
*/
169-
export interface CompilationMessage {
159+
interface CompilationMessage {
170160
/**
171161
* The text of the message
172162
*/
@@ -209,7 +199,7 @@ interface BqrsDecodeOptions {
209199
entities?: string[];
210200
}
211201

212-
export type OnLineCallback = (
202+
type OnLineCallback = (
213203
line: string,
214204
) => Promise<string | undefined> | string | undefined;
215205

@@ -1714,7 +1704,7 @@ export function shouldDebugQueryServer() {
17141704
return isEnvTrue("QUERY_SERVER_JAVA_DEBUG");
17151705
}
17161706

1717-
export function shouldDebugCliServer() {
1707+
function shouldDebugCliServer() {
17181708
return isEnvTrue("CLI_SERVER_JAVA_DEBUG");
17191709
}
17201710

extensions/ql-vscode/src/query-server/messages.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export interface TrimCacheParams {
4545
/**
4646
* The result of trimming or clearing the cache.
4747
*/
48-
export interface ClearCacheResult {
48+
interface ClearCacheResult {
4949
/**
5050
* A user friendly message saying what was or would be
5151
* deleted.
@@ -92,19 +92,19 @@ export namespace QueryResultType {
9292
export const DBSCHEME_NO_UPGRADE = 6;
9393
}
9494

95-
export interface RegisterDatabasesParams {
95+
interface RegisterDatabasesParams {
9696
databases: string[];
9797
}
9898

99-
export interface DeregisterDatabasesParams {
99+
interface DeregisterDatabasesParams {
100100
databases: string[];
101101
}
102102

103-
export type RegisterDatabasesResult = {
103+
type RegisterDatabasesResult = {
104104
registeredDatabases: string[];
105105
};
106106

107-
export type DeregisterDatabasesResult = {
107+
type DeregisterDatabasesResult = {
108108
registeredDatabases: string[];
109109
};
110110

@@ -130,22 +130,22 @@ export interface RunQueryParams {
130130
extensionPacks?: string[];
131131
}
132132

133-
export interface RunQueryResult {
133+
interface RunQueryResult {
134134
resultType: QueryResultType;
135135
message?: string;
136136
expectedDbschemeName?: string;
137137
evaluationTime: number;
138138
}
139139

140-
export interface UpgradeParams {
140+
interface UpgradeParams {
141141
db: string;
142142
additionalPacks: string[];
143143
}
144144

145-
export type UpgradeResult = Record<string, unknown>;
145+
type UpgradeResult = Record<string, unknown>;
146146

147-
export type ClearPackCacheParams = Record<string, unknown>;
148-
export type ClearPackCacheResult = Record<string, unknown>;
147+
type ClearPackCacheParams = Record<string, unknown>;
148+
type ClearPackCacheResult = Record<string, unknown>;
149149

150150
/**
151151
* A position within a QL file.
@@ -156,9 +156,7 @@ export type Position = shared.Position;
156156
* The way of compiling the query, as a normal query
157157
* or a subset of it. Note that precisely one of the two options should be set.
158158
*/
159-
export type CompilationTarget = shared.CompilationTarget;
160-
161-
export type QuickEvalOptions = shared.QuickEvalOptions;
159+
type CompilationTarget = shared.CompilationTarget;
162160

163161
export type WithProgressId<T> = shared.WithProgressId<T>;
164162
export type ProgressMessage = shared.ProgressMessage;

extensions/ql-vscode/src/view/results/result-keys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface Result extends ResultKeyBase {
2121
/**
2222
* Identifies one of the paths associated with a result.
2323
*/
24-
export interface Path extends ResultKeyBase {
24+
interface Path extends ResultKeyBase {
2525
pathIndex: number;
2626
pathNodeIndex?: undefined;
2727
}

0 commit comments

Comments
 (0)