mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-28 04:23:32 +01:00
Automatically restart ts server after disableAutomaticTypeAcquisition config changed (#32412)
* Automatically restart ts server after disableAutomaticTypeAcquisition config changed * Change to LF
This commit is contained in:
@@ -332,7 +332,7 @@ export default class TypeScriptServiceClient implements ITypescriptServiceClient
|
||||
const args: string[] = [];
|
||||
if (this.apiVersion.has206Features()) {
|
||||
args.push('--useSingleInferredProject');
|
||||
if (workspace.getConfiguration().get<boolean>('typescript.disableAutomaticTypeAcquisition', false)) {
|
||||
if (this.configuration.disableAutomaticTypeAcquisition) {
|
||||
args.push('--disableAutomaticTypingAcquisition');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@ export class TypeScriptServiceConfiguration {
|
||||
public readonly npmLocation: string | null;
|
||||
public readonly tsServerLogLevel: TsServerLogLevel = TsServerLogLevel.Off;
|
||||
public readonly checkJs: boolean;
|
||||
public readonly disableAutomaticTypeAcquisition: boolean;
|
||||
|
||||
public static loadFromWorkspace(): TypeScriptServiceConfiguration {
|
||||
return new TypeScriptServiceConfiguration();
|
||||
@@ -60,6 +61,7 @@ export class TypeScriptServiceConfiguration {
|
||||
this.npmLocation = TypeScriptServiceConfiguration.readNpmLocation(configuration);
|
||||
this.tsServerLogLevel = TypeScriptServiceConfiguration.readTsServerLogLevel(configuration);
|
||||
this.checkJs = TypeScriptServiceConfiguration.readCheckJs(configuration);
|
||||
this.disableAutomaticTypeAcquisition = TypeScriptServiceConfiguration.readDisableAutomaticTypeAcquisition(configuration);
|
||||
}
|
||||
|
||||
public isEqualTo(other: TypeScriptServiceConfiguration): boolean {
|
||||
@@ -67,7 +69,8 @@ export class TypeScriptServiceConfiguration {
|
||||
&& this.localTsdk === other.localTsdk
|
||||
&& this.npmLocation === other.npmLocation
|
||||
&& this.tsServerLogLevel === other.tsServerLogLevel
|
||||
&& this.checkJs === other.checkJs;
|
||||
&& this.checkJs === other.checkJs
|
||||
&& this.disableAutomaticTypeAcquisition === other.disableAutomaticTypeAcquisition;
|
||||
}
|
||||
|
||||
private static extractGlobalTsdk(configuration: WorkspaceConfiguration): string | null {
|
||||
@@ -98,4 +101,8 @@ export class TypeScriptServiceConfiguration {
|
||||
private static readNpmLocation(configuration: WorkspaceConfiguration): string | null {
|
||||
return configuration.get<string | null>('typescript.npm', null);
|
||||
}
|
||||
}
|
||||
|
||||
private static readDisableAutomaticTypeAcquisition(configuration: WorkspaceConfiguration): boolean {
|
||||
return configuration.get<boolean>('typescript.disableAutomaticTypeAcquisition', false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user