Skip to content

Commit 6b3a235

Browse files
Convert extensions/ql-vscode/src/log-insights/summary-language-support.ts to call typed commands
1 parent d56a986 commit 6b3a235

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

extensions/ql-vscode/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ async function activateWithInstalledDistribution(
876876

877877
ctx.subscriptions.push(astViewer);
878878

879-
const summaryLanguageSupport = new SummaryLanguageSupport();
879+
const summaryLanguageSupport = new SummaryLanguageSupport(app);
880880
ctx.subscriptions.push(summaryLanguageSupport);
881881

882882
const mockServer = new VSCodeMockGitHubApiServer(ctx);

extensions/ql-vscode/src/log-insights/summary-language-support.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { readFile } from "fs-extra";
22
import { RawSourceMap, SourceMapConsumer } from "source-map";
33
import {
4-
commands,
54
Position,
65
Selection,
76
TextDocument,
@@ -16,6 +15,7 @@ import { DisposableObject } from "../pure/disposable-object";
1615
import { extLogger } from "../common";
1716
import { getErrorMessage } from "../pure/helpers-pure";
1817
import { SummaryLanguageSupportCommands } from "../common/commands";
18+
import { App } from "../common/app";
1919

2020
/** A `Position` within a specified file on disk. */
2121
interface PositionInFile {
@@ -55,7 +55,7 @@ export class SummaryLanguageSupport extends DisposableObject {
5555
*/
5656
private sourceMap: SourceMapConsumer | undefined = undefined;
5757

58-
constructor() {
58+
constructor(private readonly app: App) {
5959
super();
6060

6161
this.push(
@@ -160,7 +160,7 @@ export class SummaryLanguageSupport extends DisposableObject {
160160
private async updateContext(): Promise<void> {
161161
const position = await this.getQLSourceLocation();
162162

163-
await commands.executeCommand(
163+
await this.app.commands.execute(
164164
"setContext",
165165
"codeql.hasQLSource",
166166
position !== undefined,

0 commit comments

Comments
 (0)