mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
parent
866ecdd45a
commit
280e007073
|
@ -99,6 +99,9 @@ export class TypeScriptServerSpawner {
|
|||
}
|
||||
|
||||
switch (configuration.separateSyntaxServer) {
|
||||
case SeparateSyntaxServerConfiguration.ForAllRequests:
|
||||
return CompositeServerType.SyntaxOnly;
|
||||
|
||||
case SeparateSyntaxServerConfiguration.Disabled:
|
||||
return CompositeServerType.Single;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ import { TypeScriptVersionManager } from './tsServer/versionManager';
|
|||
import { ITypeScriptVersionProvider, TypeScriptVersion } from './tsServer/versionProvider';
|
||||
import { ClientCapabilities, ClientCapability, ExecConfig, ITypeScriptServiceClient, ServerResponse, TypeScriptRequests } from './typescriptService';
|
||||
import API from './utils/api';
|
||||
import { TsServerLogLevel, TypeScriptServiceConfiguration } from './utils/configuration';
|
||||
import { SeparateSyntaxServerConfiguration, TsServerLogLevel, TypeScriptServiceConfiguration } from './utils/configuration';
|
||||
import { Disposable } from './utils/dispose';
|
||||
import * as fileSchemes from './utils/fileSchemes';
|
||||
import { Logger } from './utils/logger';
|
||||
|
@ -224,6 +224,12 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
}
|
||||
|
||||
public get capabilities() {
|
||||
if (this._configuration.separateSyntaxServer === SeparateSyntaxServerConfiguration.ForAllRequests) {
|
||||
return new ClientCapabilities(
|
||||
ClientCapability.Syntax,
|
||||
ClientCapability.EnhancedSyntax);
|
||||
}
|
||||
|
||||
if (isWeb()) {
|
||||
return new ClientCapabilities(
|
||||
ClientCapability.Syntax,
|
||||
|
@ -676,6 +682,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
}
|
||||
|
||||
public hasCapabilityForResource(resource: vscode.Uri, capability: ClientCapability): boolean {
|
||||
if (!this.capabilities.has(capability)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (capability) {
|
||||
case ClientCapability.Semantic:
|
||||
{
|
||||
|
|
|
@ -48,6 +48,8 @@ export namespace TsServerLogLevel {
|
|||
export const enum SeparateSyntaxServerConfiguration {
|
||||
Disabled,
|
||||
Enabled,
|
||||
/** Use a single syntax server for every request, even on desktop */
|
||||
ForAllRequests,
|
||||
}
|
||||
|
||||
export class ImplicitProjectConfiguration {
|
||||
|
@ -180,7 +182,10 @@ export class TypeScriptServiceConfiguration {
|
|||
}
|
||||
|
||||
private static readUseSeparateSyntaxServer(configuration: vscode.WorkspaceConfiguration): SeparateSyntaxServerConfiguration {
|
||||
const value = configuration.get('typescript.tsserver.useSeparateSyntaxServer', true);
|
||||
const value = configuration.get<boolean | string>('typescript.tsserver.useSeparateSyntaxServer', true);
|
||||
if (value === 'forAllRequests') {
|
||||
return SeparateSyntaxServerConfiguration.ForAllRequests;
|
||||
}
|
||||
if (value === true) {
|
||||
return SeparateSyntaxServerConfiguration.Enabled;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue