mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Move project status into host
This commit is contained in:
parent
e91c4a1d0e
commit
ba6576d343
|
@ -4,15 +4,14 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import { CommandManager } from './commands/commandManager';
|
||||
import { OngoingRequestCancellerFactory } from './tsServer/cancellation';
|
||||
import { ILogDirectoryProvider } from './tsServer/logDirectoryProvider';
|
||||
import { TsServerProcessFactory } from './tsServer/server';
|
||||
import { ITypeScriptVersionProvider } from './tsServer/versionProvider';
|
||||
import TypeScriptServiceClientHost from './typeScriptServiceClientHost';
|
||||
import { flatten } from './utils/arrays';
|
||||
import { CommandManager } from './commands/commandManager';
|
||||
import { standardLanguageDescriptions } from './utils/languageDescription';
|
||||
import * as ProjectStatus from './utils/largeProjectStatus';
|
||||
import { lazy, Lazy } from './utils/lazy';
|
||||
import ManagedFileContextManager from './utils/managedFileContext';
|
||||
import { PluginManager } from './utils/plugins';
|
||||
|
@ -40,13 +39,6 @@ export function createLazyClientHost(
|
|||
|
||||
context.subscriptions.push(clientHost);
|
||||
|
||||
clientHost.serviceClient.onReady(() => {
|
||||
context.subscriptions.push(
|
||||
ProjectStatus.create(
|
||||
clientHost.serviceClient,
|
||||
clientHost.serviceClient.telemetryReporter));
|
||||
});
|
||||
|
||||
return clientHost;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ import { DiagnosticLanguage, LanguageDescription } from './utils/languageDescrip
|
|||
import { PluginManager } from './utils/plugins';
|
||||
import * as typeConverters from './utils/typeConverters';
|
||||
import TypingsStatus, { AtaProgressReporter } from './utils/typingsStatus';
|
||||
import * as ProjectStatus from './utils/largeProjectStatus';
|
||||
|
||||
namespace Experimental {
|
||||
export interface Diagnostic extends Proto.Diagnostic {
|
||||
|
@ -95,6 +96,8 @@ export default class TypeScriptServiceClientHost extends Disposable {
|
|||
this._register(new VersionStatus(this.client, services.commandManager));
|
||||
this._register(new AtaProgressReporter(this.client));
|
||||
this.typingsStatus = this._register(new TypingsStatus(this.client));
|
||||
this._register(ProjectStatus.create(this.client));
|
||||
|
||||
this.fileConfigurationManager = this._register(new FileConfigurationManager(this.client, onCaseInsenitiveFileSystem));
|
||||
|
||||
for (const description of descriptions) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import { TypeScriptVersion } from './tsServer/versionProvider';
|
|||
import API from './utils/api';
|
||||
import { TypeScriptServiceConfiguration } from './utils/configuration';
|
||||
import { PluginManager } from './utils/plugins';
|
||||
import { TelemetryReporter } from './utils/telemetry';
|
||||
|
||||
export namespace ServerResponse {
|
||||
|
||||
|
@ -159,9 +160,11 @@ export interface ITypeScriptServiceClient {
|
|||
showVersionPicker(): void;
|
||||
|
||||
readonly apiVersion: API;
|
||||
|
||||
readonly pluginManager: PluginManager;
|
||||
readonly configuration: TypeScriptServiceConfiguration;
|
||||
readonly bufferSyncSupport: BufferSyncSupport;
|
||||
readonly telemetryReporter: TelemetryReporter;
|
||||
|
||||
execute<K extends keyof StandardTsServerRequests>(
|
||||
command: K,
|
||||
|
|
|
@ -115,11 +115,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
|||
private readonly loadingIndicator = new ServerInitializingIndicator();
|
||||
|
||||
public readonly telemetryReporter: TelemetryReporter;
|
||||
|
||||
public readonly bufferSyncSupport: BufferSyncSupport;
|
||||
public readonly diagnosticsManager: DiagnosticsManager;
|
||||
|
||||
public readonly pluginManager: PluginManager;
|
||||
|
||||
private readonly logDirectoryProvider: ILogDirectoryProvider;
|
||||
private readonly cancellerFactory: OngoingRequestCancellerFactory;
|
||||
private readonly versionProvider: ITypeScriptVersionProvider;
|
||||
|
|
|
@ -111,16 +111,15 @@ function onConfigureExcludesSelected(
|
|||
|
||||
export function create(
|
||||
client: ITypeScriptServiceClient,
|
||||
telemetryReporter: TelemetryReporter
|
||||
) {
|
||||
): vscode.Disposable {
|
||||
const toDispose: vscode.Disposable[] = [];
|
||||
|
||||
const item = new ExcludeHintItem(telemetryReporter);
|
||||
const item = new ExcludeHintItem(client.telemetryReporter);
|
||||
toDispose.push(vscode.commands.registerCommand('js.projectStatus.command', () => {
|
||||
if (item.configFileName) {
|
||||
onConfigureExcludesSelected(client, item.configFileName);
|
||||
}
|
||||
let { message } = item.getCurrentHint();
|
||||
const { message } = item.getCurrentHint();
|
||||
return vscode.window.showInformationMessage(message);
|
||||
}));
|
||||
|
||||
|
@ -128,4 +127,3 @@ export function create(
|
|||
|
||||
return vscode.Disposable.from(...toDispose);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue