Switch CommandCacheKey back to an enum

The code reads better/simpler as an `enum`.
This commit is contained in:
Mario Campos
2026-06-30 16:06:13 -05:00
parent 0d698171d3
commit da149812f1
5 changed files with 91 additions and 101 deletions

View File

@@ -14,9 +14,9 @@ import {
import * as api from "./api-client";
import {
cacheCommandOutput,
CommandCacheKey,
getCachedCommandOutput,
type CommandCacheKeyOutputMap,
type CommandCacheKey,
type ResolveLanguagesOutput,
type VersionInfo,
} from "./cli/output-cache";
@@ -515,7 +515,7 @@ async function getCodeQLForCmd(
return cmd;
},
async getVersion() {
return getCachedOrRun("version", cmd, () =>
return getCachedOrRun(CommandCacheKey.Version, cmd, () =>
runCliJson<VersionInfo>(cmd, ["version", "--format=json"], {
noStreamStdout: true,
}),
@@ -718,7 +718,7 @@ async function getCodeQLForCmd(
await runCli(cmd, args);
},
async resolveLanguages() {
return getCachedOrRun("resolve languages", cmd, async () => {
return getCachedOrRun(CommandCacheKey.ResolveLanguages, cmd, async () => {
const isFilterToLanguagesWithQueriesSupported =
await this.supportsFeature(
ToolsFeature.BuiltinExtractorsSpecifyDefaultQueries,