Skip to content

Commit b722fb4

Browse files
Convert to using a getter for AppEnvironmentContext.language
1 parent 0e65c79 commit b722fb4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { env } from "vscode";
2+
import { EnvironmentContext } from "../app";
3+
4+
export class AppEnvironmentContext implements EnvironmentContext {
5+
public get language(): string {
6+
return env.language;
7+
}
8+
}

extensions/ql-vscode/src/common/vscode/vscode-app.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { Memento } from "../memento";
88
import { VSCodeAppEventEmitter } from "./events";
99
import { AppCommandManager, QueryServerCommandManager } from "../commands";
1010
import { createVSCodeCommandManager } from "./commands";
11+
import { AppEnvironmentContext } from "./environment-context";
1112

1213
export class ExtensionApp implements App {
1314
public readonly credentials: VSCodeCredentials;
@@ -71,8 +72,6 @@ export class ExtensionApp implements App {
7172
}
7273

7374
public get environment(): EnvironmentContext {
74-
return {
75-
language: vscode.env.language,
76-
};
75+
return new AppEnvironmentContext();
7776
}
7877
}

0 commit comments

Comments
 (0)