Move plugin config provider to plugins file
This commit is contained in:
parent
3c78e312c6
commit
49fd31af84
5 changed files with 23 additions and 22 deletions
|
@ -10,7 +10,7 @@ import { Command } from './utils/commandManager';
|
|||
import { Lazy } from './utils/lazy';
|
||||
import { isImplicitProjectConfigFile, openOrCreateConfigFile } from './utils/tsconfig';
|
||||
import { nulToken } from './utils/cancellation';
|
||||
import { PluginConfigProvider } from './typescriptServiceClient';
|
||||
import { PluginConfigProvider } from './utils/plugins';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
|
|
|
@ -15,10 +15,9 @@ import { standardLanguageDescriptions } from './utils/languageDescription';
|
|||
import { lazy, Lazy } from './utils/lazy';
|
||||
import LogDirectoryProvider from './utils/logDirectoryProvider';
|
||||
import ManagedFileContextManager from './utils/managedFileContext';
|
||||
import { getContributedTypeScriptServerPlugins, TypeScriptServerPlugin } from './utils/plugins';
|
||||
import { getContributedTypeScriptServerPlugins, TypeScriptServerPlugin, PluginConfigProvider } from './utils/plugins';
|
||||
import * as ProjectStatus from './utils/projectStatus';
|
||||
import { Surveyor } from './utils/surveyor';
|
||||
import { PluginConfigProvider } from './typescriptServiceClient';
|
||||
|
||||
|
||||
interface ApiV0 {
|
||||
|
|
|
@ -14,13 +14,13 @@ import FileConfigurationManager from './features/fileConfigurationManager';
|
|||
import LanguageProvider from './languageProvider';
|
||||
import * as Proto from './protocol';
|
||||
import * as PConst from './protocol.const';
|
||||
import TypeScriptServiceClient, { PluginConfigProvider } from './typescriptServiceClient';
|
||||
import TypeScriptServiceClient from './typescriptServiceClient';
|
||||
import API from './utils/api';
|
||||
import { CommandManager } from './utils/commandManager';
|
||||
import { Disposable } from './utils/dispose';
|
||||
import { LanguageDescription, DiagnosticLanguage } from './utils/languageDescription';
|
||||
import LogDirectoryProvider from './utils/logDirectoryProvider';
|
||||
import { TypeScriptServerPlugin } from './utils/plugins';
|
||||
import { TypeScriptServerPlugin, PluginConfigProvider } from './utils/plugins';
|
||||
import * as typeConverters from './utils/typeConverters';
|
||||
import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus';
|
||||
import VersionStatus from './utils/versionStatus';
|
||||
|
|
|
@ -20,7 +20,7 @@ import * as is from './utils/is';
|
|||
import LogDirectoryProvider from './utils/logDirectoryProvider';
|
||||
import Logger from './utils/logger';
|
||||
import { TypeScriptPluginPathsProvider } from './utils/pluginPathsProvider';
|
||||
import { TypeScriptServerPlugin } from './utils/plugins';
|
||||
import { PluginConfigProvider, TypeScriptServerPlugin } from './utils/plugins';
|
||||
import TelemetryReporter from './utils/telemetry';
|
||||
import Tracer from './utils/tracer';
|
||||
import { inferredProjectConfig } from './utils/tsconfig';
|
||||
|
@ -29,22 +29,6 @@ import { TypeScriptVersion, TypeScriptVersionProvider } from './utils/versionPro
|
|||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
export class PluginConfigProvider extends Disposable {
|
||||
private readonly _config = new Map<string, {}>();
|
||||
|
||||
private readonly _onDidUpdateConfig = this._register(new vscode.EventEmitter<{ pluginId: string, config: {} }>());
|
||||
public readonly onDidUpdateConfig = this._onDidUpdateConfig.event;
|
||||
|
||||
public set(pluginId: string, config: {}) {
|
||||
this._config.set(pluginId, config);
|
||||
this._onDidUpdateConfig.fire({ pluginId, config });
|
||||
}
|
||||
|
||||
public entries(): IterableIterator<[string, {}]> {
|
||||
return this._config.entries();
|
||||
}
|
||||
}
|
||||
|
||||
export interface TsDiagnostics {
|
||||
readonly kind: DiagnosticKind;
|
||||
readonly resource: vscode.Uri;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { Disposable } from './dispose';
|
||||
|
||||
export interface TypeScriptServerPlugin {
|
||||
readonly path: string;
|
||||
|
@ -27,3 +28,20 @@ export function getContributedTypeScriptServerPlugins(): TypeScriptServerPlugin[
|
|||
}
|
||||
return plugins;
|
||||
}
|
||||
|
||||
|
||||
export class PluginConfigProvider extends Disposable {
|
||||
private readonly _config = new Map<string, {}>();
|
||||
|
||||
private readonly _onDidUpdateConfig = this._register(new vscode.EventEmitter<{ pluginId: string, config: {} }>());
|
||||
public readonly onDidUpdateConfig = this._onDidUpdateConfig.event;
|
||||
|
||||
public set(pluginId: string, config: {}) {
|
||||
this._config.set(pluginId, config);
|
||||
this._onDidUpdateConfig.fire({ pluginId, config });
|
||||
}
|
||||
|
||||
public entries(): IterableIterator<[string, {}]> {
|
||||
return this._config.entries();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue