Convert extensions/ql-vscode/src/log-insights/summary-language-support.ts to call typed commands
This commit is contained in:
Родитель
d56a986cc5
Коммит
6b3a235a77
|
@ -876,7 +876,7 @@ async function activateWithInstalledDistribution(
|
|||
|
||||
ctx.subscriptions.push(astViewer);
|
||||
|
||||
const summaryLanguageSupport = new SummaryLanguageSupport();
|
||||
const summaryLanguageSupport = new SummaryLanguageSupport(app);
|
||||
ctx.subscriptions.push(summaryLanguageSupport);
|
||||
|
||||
const mockServer = new VSCodeMockGitHubApiServer(ctx);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { readFile } from "fs-extra";
|
||||
import { RawSourceMap, SourceMapConsumer } from "source-map";
|
||||
import {
|
||||
commands,
|
||||
Position,
|
||||
Selection,
|
||||
TextDocument,
|
||||
|
@ -16,6 +15,7 @@ import { DisposableObject } from "../pure/disposable-object";
|
|||
import { extLogger } from "../common";
|
||||
import { getErrorMessage } from "../pure/helpers-pure";
|
||||
import { SummaryLanguageSupportCommands } from "../common/commands";
|
||||
import { App } from "../common/app";
|
||||
|
||||
/** A `Position` within a specified file on disk. */
|
||||
interface PositionInFile {
|
||||
|
@ -55,7 +55,7 @@ export class SummaryLanguageSupport extends DisposableObject {
|
|||
*/
|
||||
private sourceMap: SourceMapConsumer | undefined = undefined;
|
||||
|
||||
constructor() {
|
||||
constructor(private readonly app: App) {
|
||||
super();
|
||||
|
||||
this.push(
|
||||
|
@ -160,7 +160,7 @@ export class SummaryLanguageSupport extends DisposableObject {
|
|||
private async updateContext(): Promise<void> {
|
||||
const position = await this.getQLSourceLocation();
|
||||
|
||||
await commands.executeCommand(
|
||||
await this.app.commands.execute(
|
||||
"setContext",
|
||||
"codeql.hasQLSource",
|
||||
position !== undefined,
|
||||
|
|
Загрузка…
Ссылка в новой задаче