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