Skip to content

Commit c40b8fe

Browse files
committed
Remove unused code path
`resolveRawDataset` can not be called.
1 parent 210bbcd commit c40b8fe

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

extensions/ql-vscode/src/databases.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async function findSourceArchive(
133133

134134
async function resolveDatabase(
135135
databasePath: string
136-
): Promise<DatabaseContents | undefined> {
136+
): Promise<DatabaseContents> {
137137

138138
const name = path.basename(databasePath);
139139

@@ -155,20 +155,6 @@ async function getDbSchemeFiles(dbDirectory: string): Promise<string[]> {
155155
return await glob('*.dbscheme', { cwd: dbDirectory });
156156
}
157157

158-
async function resolveRawDataset(datasetPath: string): Promise<DatabaseContents | undefined> {
159-
if ((await getDbSchemeFiles(datasetPath)).length > 0) {
160-
return {
161-
kind: DatabaseKind.RawDataset,
162-
name: path.basename(datasetPath),
163-
datasetUri: vscode.Uri.file(datasetPath),
164-
sourceArchiveUri: undefined
165-
};
166-
}
167-
else {
168-
return undefined;
169-
}
170-
}
171-
172158
async function resolveDatabaseContents(uri: vscode.Uri): Promise<DatabaseContents> {
173159
if (uri.scheme !== 'file') {
174160
throw new Error(`Database URI scheme '${uri.scheme}' not supported; only 'file' URIs are supported.`);
@@ -178,7 +164,7 @@ async function resolveDatabaseContents(uri: vscode.Uri): Promise<DatabaseContent
178164
throw new InvalidDatabaseError(`Database '${databasePath}' does not exist.`);
179165
}
180166

181-
const contents = await resolveDatabase(databasePath) || await resolveRawDataset(databasePath);
167+
const contents = await resolveDatabase(databasePath);
182168

183169
if (contents === undefined) {
184170
throw new InvalidDatabaseError(`'${databasePath}' is not a valid database.`);

0 commit comments

Comments
 (0)