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