Skip to content

Commit ff7cc33

Browse files
committed
Use objects.equals for comparing configuration objects
1 parent 05fee0c commit ff7cc33

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

extensions/typescript-language-features/src/utils/configuration.ts

+2-19
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import * as os from 'os';
77
import * as path from 'path';
88
import * as vscode from 'vscode';
99
import * as objects from '../utils/objects';
10-
import * as arrays from './arrays';
1110

1211
export enum TsServerLogLevel {
1312
Off,
@@ -66,10 +65,7 @@ export class ImplicitProjectConfiguration {
6665
}
6766

6867
public isEqualTo(other: ImplicitProjectConfiguration): boolean {
69-
return this.checkJs === other.checkJs
70-
&& this.experimentalDecorators === other.experimentalDecorators
71-
&& this.strictNullChecks === other.strictNullChecks
72-
&& this.strictFunctionTypes === other.strictFunctionTypes;
68+
return objects.equals(this, other);
7369
}
7470

7571
private static readCheckJs(configuration: vscode.WorkspaceConfiguration): boolean {
@@ -129,20 +125,7 @@ export class TypeScriptServiceConfiguration {
129125
}
130126

131127
public isEqualTo(other: TypeScriptServiceConfiguration): boolean {
132-
return this.locale === other.locale
133-
&& this.globalTsdk === other.globalTsdk
134-
&& this.localTsdk === other.localTsdk
135-
&& this.npmLocation === other.npmLocation
136-
&& this.tsServerLogLevel === other.tsServerLogLevel
137-
&& this.implictProjectConfiguration.isEqualTo(other.implictProjectConfiguration)
138-
&& this.disableAutomaticTypeAcquisition === other.disableAutomaticTypeAcquisition
139-
&& arrays.equals(this.tsServerPluginPaths, other.tsServerPluginPaths)
140-
&& this.separateSyntaxServer === other.separateSyntaxServer
141-
&& this.enableProjectDiagnostics === other.enableProjectDiagnostics
142-
&& this.maxTsServerMemory === other.maxTsServerMemory
143-
&& objects.equals(this.watchOptions, other.watchOptions)
144-
&& this.enablePromptUseWorkspaceTsdk === other.enablePromptUseWorkspaceTsdk
145-
&& this.includePackageJsonAutoImports === other.includePackageJsonAutoImports;
128+
return objects.equals(this, other);
146129
}
147130

148131
private static fixPathPrefixes(inspectValue: string): string {

0 commit comments

Comments
 (0)