mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 12:19:20 +00:00
Use more consistent method names
This commit is contained in:
@@ -9,11 +9,11 @@ import { BaseServiceConfigurationProvider } from './configuration';
|
||||
export class BrowserServiceConfigurationProvider extends BaseServiceConfigurationProvider {
|
||||
|
||||
// On browsers, we only support using the built-in TS version
|
||||
protected extractGlobalTsdk(_configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
protected readGlobalTsdk(_configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected extractLocalTsdk(_configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
protected readLocalTsdk(_configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export class ElectronServiceConfigurationProvider extends BaseServiceConfigurati
|
||||
return inspectValue;
|
||||
}
|
||||
|
||||
protected extractGlobalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
protected readGlobalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
const inspect = configuration.inspect('typescript.tsdk');
|
||||
if (inspect && typeof inspect.globalValue === 'string') {
|
||||
return this.fixPathPrefixes(inspect.globalValue);
|
||||
@@ -28,7 +28,7 @@ export class ElectronServiceConfigurationProvider extends BaseServiceConfigurati
|
||||
return null;
|
||||
}
|
||||
|
||||
protected extractLocalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
protected readLocalTsdk(configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
const inspect = configuration.inspect('typescript.tsdk');
|
||||
if (inspect && typeof inspect.workspaceValue === 'string') {
|
||||
return this.fixPathPrefixes(inspect.workspaceValue);
|
||||
|
||||
@@ -130,9 +130,9 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
|
||||
public loadFromWorkspace(): TypeScriptServiceConfiguration {
|
||||
const configuration = vscode.workspace.getConfiguration();
|
||||
return {
|
||||
locale: this.extractLocale(configuration),
|
||||
globalTsdk: this.extractGlobalTsdk(configuration),
|
||||
localTsdk: this.extractLocalTsdk(configuration),
|
||||
locale: this.readLocale(configuration),
|
||||
globalTsdk: this.readGlobalTsdk(configuration),
|
||||
localTsdk: this.readLocalTsdk(configuration),
|
||||
npmLocation: this.readNpmLocation(configuration),
|
||||
tsServerLogLevel: this.readTsServerLogLevel(configuration),
|
||||
tsServerPluginPaths: this.readTsServerPluginPaths(configuration),
|
||||
@@ -148,8 +148,8 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
|
||||
};
|
||||
}
|
||||
|
||||
protected abstract extractGlobalTsdk(configuration: vscode.WorkspaceConfiguration): string | null;
|
||||
protected abstract extractLocalTsdk(configuration: vscode.WorkspaceConfiguration): string | null;
|
||||
protected abstract readGlobalTsdk(configuration: vscode.WorkspaceConfiguration): string | null;
|
||||
protected abstract readLocalTsdk(configuration: vscode.WorkspaceConfiguration): string | null;
|
||||
|
||||
protected readTsServerLogLevel(configuration: vscode.WorkspaceConfiguration): TsServerLogLevel {
|
||||
const setting = configuration.get<string>('typescript.tsserver.log', 'off');
|
||||
@@ -168,7 +168,7 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
|
||||
return configuration.get<boolean>('typescript.disableAutomaticTypeAcquisition', false);
|
||||
}
|
||||
|
||||
protected extractLocale(configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
protected readLocale(configuration: vscode.WorkspaceConfiguration): string | null {
|
||||
const value = configuration.get<string>('typescript.locale', 'auto');
|
||||
return !value || value === 'auto' ? null : value;
|
||||
}
|
||||
@@ -221,5 +221,4 @@ export abstract class BaseServiceConfigurationProvider implements ServiceConfigu
|
||||
protected readEnableTsServerTracing(configuration: vscode.WorkspaceConfiguration): boolean {
|
||||
return configuration.get<boolean>('typescript.tsserver.enableTracing', false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user