Move unused languageToDbScheme
This commit is contained in:
@@ -357,24 +357,6 @@ export async function prepareCodeTour(
|
||||
* The following functions al heuristically determine metadata about databases.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Note that this heuristic is only being used for backwards compatibility with
|
||||
* CLI versions before the langauge name was introduced to dbInfo. Features
|
||||
* that do not require backwards compatibility should call
|
||||
* `cli.CodeQLCliServer.resolveDatabase` and use the first entry in the
|
||||
* `languages` property.
|
||||
*
|
||||
* @see cli.CodeQLCliServer.resolveDatabase
|
||||
*/
|
||||
|
||||
export const languageToDbScheme = Object.entries(dbSchemeToLanguage).reduce(
|
||||
(acc, [k, v]) => {
|
||||
acc[v] = k;
|
||||
return acc;
|
||||
},
|
||||
{} as { [k: string]: string },
|
||||
);
|
||||
|
||||
/**
|
||||
* Returns the initial contents for an empty query, based on the language of the selected
|
||||
* databse.
|
||||
|
||||
@@ -7,15 +7,13 @@ import {
|
||||
QueryInfoByLanguage,
|
||||
} from "../../../src/codeql-cli/cli";
|
||||
import { itWithCodeQL } from "../cli";
|
||||
import {
|
||||
getOnDiskWorkspaceFolders,
|
||||
languageToDbScheme,
|
||||
} from "../../../src/helpers";
|
||||
import { getOnDiskWorkspaceFolders } from "../../../src/helpers";
|
||||
import { KeyType, resolveQueries } from "../../../src/language-support";
|
||||
import { faker } from "@faker-js/faker";
|
||||
import { getActivatedExtension } from "../global.helper";
|
||||
import { BaseLogger } from "../../../src/common";
|
||||
import { getQlPackForDbscheme } from "../../../src/databases/qlpack";
|
||||
import { dbSchemeToLanguage } from "../../../src/common/query-language";
|
||||
|
||||
/**
|
||||
* Perform proper integration tests by running the CLI
|
||||
@@ -26,6 +24,14 @@ describe("Use cli", () => {
|
||||
|
||||
let logSpy: jest.SpiedFunction<BaseLogger["log"]>;
|
||||
|
||||
const languageToDbScheme = Object.entries(dbSchemeToLanguage).reduce(
|
||||
(acc, [k, v]) => {
|
||||
acc[v] = k;
|
||||
return acc;
|
||||
},
|
||||
{} as { [k: string]: string },
|
||||
);
|
||||
|
||||
beforeEach(async () => {
|
||||
const extension = await getActivatedExtension();
|
||||
cli = extension.cliServer;
|
||||
|
||||
Reference in New Issue
Block a user