Skip to content

Commit

Permalink
fixed review comments: added array comparison for tsServerPluginPaths…
Browse files Browse the repository at this point in the history
…, setting made executable
  • Loading branch information
killerDJO committed Mar 22, 2018
1 parent ad09748 commit 27f0ac1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
3 changes: 2 additions & 1 deletion extensions/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@
},
"default": [],
"description": "%typescript.tsserver.pluginPaths%",
"scope": "window"
"scope": "window",
"isExecutable": true
},
"typescript.tsserver.trace": {
"type": "string",
Expand Down
17 changes: 17 additions & 0 deletions extensions/typescript/src/utils/arrays.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
export function equals<T>(one: T[], other: T[], itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean {
if (one.length !== other.length) {
return false;
}

for (let i = 0, len = one.length; i < len; i++) {
if (!itemEquals(one[i], other[i])) {
return false;
}
}

return true;
}
5 changes: 3 additions & 2 deletions extensions/typescript/src/utils/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { WorkspaceConfiguration, workspace } from 'vscode';
import * as arrays from './arrays';

export enum TsServerLogLevel {
Off,
Expand Down Expand Up @@ -76,10 +77,10 @@ export class TypeScriptServiceConfiguration {
&& this.localTsdk === other.localTsdk
&& this.npmLocation === other.npmLocation
&& this.tsServerLogLevel === other.tsServerLogLevel
&& this.tsServerPluginPaths === other.tsServerPluginPaths
&& this.checkJs === other.checkJs
&& this.experimentalDecorators === other.experimentalDecorators
&& this.disableAutomaticTypeAcquisition === other.disableAutomaticTypeAcquisition;
&& this.disableAutomaticTypeAcquisition === other.disableAutomaticTypeAcquisition
&& arrays.equals(this.tsServerPluginPaths, other.tsServerPluginPaths);
}

private static extractGlobalTsdk(configuration: WorkspaceConfiguration): string | null {
Expand Down

0 comments on commit 27f0ac1

Please sign in to comment.