Skip to content

Commit 6e6ea76

Browse files
committed
Rename settingState to initialSettingState
1 parent d30eb27 commit 6e6ea76

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

extensions/ql-vscode/src/vscode-tests/test-config.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ConfigurationTarget } from 'vscode';
22
import { CUSTOM_CODEQL_PATH_SETTING, InspectionResult, REMOTE_CONTROLLER_REPO, REMOTE_REPO_LISTS, Setting } from '../config';
33

44
class TestSetting<T> {
5-
private settingState: InspectionResult<T> | undefined;
5+
private initialSettingState: InspectionResult<T> | undefined;
66

77
constructor(
88
public readonly setting: Setting,
@@ -22,15 +22,15 @@ class TestSetting<T> {
2222
}
2323

2424
public async initialSetup() {
25-
this.settingState = this.setting.inspect();
25+
this.initialSettingState = this.setting.inspect();
2626

2727
// Unfortunately it's not well-documented how to check whether we can write to a workspace
2828
// configuration. This is the best I could come up with. It only fails for initial test values
2929
// which are not undefined.
30-
if (this.settingState?.workspaceValue !== undefined) {
30+
if (this.initialSettingState?.workspaceValue !== undefined) {
3131
await this.set(this.initialTestValue, ConfigurationTarget.Workspace);
3232
}
33-
if (this.settingState?.workspaceFolderValue !== undefined) {
33+
if (this.initialSettingState?.workspaceFolderValue !== undefined) {
3434
await this.set(this.initialTestValue, ConfigurationTarget.WorkspaceFolder);
3535
}
3636

@@ -47,14 +47,14 @@ class TestSetting<T> {
4747
// We need to check the state of the setting before we restore it. This is less important for the global
4848
// configuration target, but the workspace/workspace folder configuration might not even exist. If they
4949
// don't exist, VSCode will error when trying to write the new value (even if that value is undefined).
50-
if (state?.globalValue !== this.settingState?.globalValue) {
51-
await this.set(this.settingState?.globalValue, ConfigurationTarget.Global);
50+
if (state?.globalValue !== this.initialSettingState?.globalValue) {
51+
await this.set(this.initialSettingState?.globalValue, ConfigurationTarget.Global);
5252
}
53-
if (state?.workspaceValue !== this.settingState?.workspaceValue) {
54-
await this.set(this.settingState?.workspaceValue, ConfigurationTarget.Workspace);
53+
if (state?.workspaceValue !== this.initialSettingState?.workspaceValue) {
54+
await this.set(this.initialSettingState?.workspaceValue, ConfigurationTarget.Workspace);
5555
}
56-
if (state?.workspaceFolderValue !== this.settingState?.workspaceFolderValue) {
57-
await this.set(this.settingState?.workspaceFolderValue, ConfigurationTarget.WorkspaceFolder);
56+
if (state?.workspaceFolderValue !== this.initialSettingState?.workspaceFolderValue) {
57+
await this.set(this.initialSettingState?.workspaceFolderValue, ConfigurationTarget.WorkspaceFolder);
5858
}
5959
}
6060
}

0 commit comments

Comments
 (0)