Skip to content

Commit b0c18b3

Browse files
committed
Move unused languageToDbScheme
1 parent 706c6b8 commit b0c18b3

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

extensions/ql-vscode/src/helpers.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -357,24 +357,6 @@ export async function prepareCodeTour(
357357
* The following functions al heuristically determine metadata about databases.
358358
*/
359359

360-
/**
361-
* Note that this heuristic is only being used for backwards compatibility with
362-
* CLI versions before the langauge name was introduced to dbInfo. Features
363-
* that do not require backwards compatibility should call
364-
* `cli.CodeQLCliServer.resolveDatabase` and use the first entry in the
365-
* `languages` property.
366-
*
367-
* @see cli.CodeQLCliServer.resolveDatabase
368-
*/
369-
370-
export const languageToDbScheme = Object.entries(dbSchemeToLanguage).reduce(
371-
(acc, [k, v]) => {
372-
acc[v] = k;
373-
return acc;
374-
},
375-
{} as { [k: string]: string },
376-
);
377-
378360
/**
379361
* Returns the initial contents for an empty query, based on the language of the selected
380362
* databse.

extensions/ql-vscode/test/vscode-tests/cli-integration/run-cli.test.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ import {
77
QueryInfoByLanguage,
88
} from "../../../src/codeql-cli/cli";
99
import { itWithCodeQL } from "../cli";
10-
import {
11-
getOnDiskWorkspaceFolders,
12-
languageToDbScheme,
13-
} from "../../../src/helpers";
10+
import { getOnDiskWorkspaceFolders } from "../../../src/helpers";
1411
import { KeyType, resolveQueries } from "../../../src/language-support";
1512
import { faker } from "@faker-js/faker";
1613
import { getActivatedExtension } from "../global.helper";
1714
import { BaseLogger } from "../../../src/common";
1815
import { getQlPackForDbscheme } from "../../../src/databases/qlpack";
16+
import { dbSchemeToLanguage } from "../../../src/common/query-language";
1917

2018
/**
2119
* Perform proper integration tests by running the CLI
@@ -26,6 +24,14 @@ describe("Use cli", () => {
2624

2725
let logSpy: jest.SpiedFunction<BaseLogger["log"]>;
2826

27+
const languageToDbScheme = Object.entries(dbSchemeToLanguage).reduce(
28+
(acc, [k, v]) => {
29+
acc[v] = k;
30+
return acc;
31+
},
32+
{} as { [k: string]: string },
33+
);
34+
2935
beforeEach(async () => {
3036
const extension = await getActivatedExtension();
3137
cli = extension.cliServer;

0 commit comments

Comments
 (0)