mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Clean up extension activation
This commit is contained in:
parent
0bf4493b75
commit
6649f4e296
|
@ -9,17 +9,17 @@ import { Lazy } from '../utils/lazy';
|
|||
import { PluginManager } from '../utils/plugins';
|
||||
import { ConfigurePluginCommand } from './configurePlugin';
|
||||
import { JavaScriptGoToProjectConfigCommand, TypeScriptGoToProjectConfigCommand } from './goToProjectConfiguration';
|
||||
import { LearnMoreAboutRefactoringsCommand } from './learnMoreAboutRefactorings';
|
||||
import { OpenTsServerLogCommand } from './openTsServerLog';
|
||||
import { ReloadJavaScriptProjectsCommand, ReloadTypeScriptProjectsCommand } from './reloadProject';
|
||||
import { RestartTsServerCommand } from './restartTsServer';
|
||||
import { SelectTypeScriptVersionCommand } from './selectTypeScriptVersion';
|
||||
import { LearnMoreAboutRefactoringsCommand } from './learnMoreAboutRefactorings';
|
||||
|
||||
export function registerCommands(
|
||||
export function registerBaseCommands(
|
||||
commandManager: CommandManager,
|
||||
lazyClientHost: Lazy<TypeScriptServiceClientHost>,
|
||||
pluginManager: PluginManager
|
||||
) {
|
||||
): void {
|
||||
commandManager.register(new ReloadTypeScriptProjectsCommand(lazyClientHost));
|
||||
commandManager.register(new ReloadJavaScriptProjectsCommand(lazyClientHost));
|
||||
commandManager.register(new SelectTypeScriptVersionCommand(lazyClientHost));
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import * as vscode from 'vscode';
|
||||
import { Api, getExtensionApi } from './api';
|
||||
import { registerCommands } from './commands/index';
|
||||
import { registerBaseCommands } from './commands/index';
|
||||
import { LanguageConfigurationManager } from './features/languageConfiguration';
|
||||
import { createLazyClientHost, lazilyActivateClient } from './lazyClientHost';
|
||||
import { noopRequestCancellerFactory } from './tsServer/cancellation';
|
||||
|
@ -44,6 +44,8 @@ export function activate(
|
|||
const commandManager = new CommandManager();
|
||||
context.subscriptions.push(commandManager);
|
||||
|
||||
context.subscriptions.push(new LanguageConfigurationManager());
|
||||
|
||||
const onCompletionAccepted = new vscode.EventEmitter<vscode.CompletionItem>();
|
||||
context.subscriptions.push(onCompletionAccepted);
|
||||
|
||||
|
@ -57,9 +59,9 @@ export function activate(
|
|||
onCompletionAccepted.fire(item);
|
||||
});
|
||||
|
||||
registerCommands(commandManager, lazyClientHost, pluginManager);
|
||||
registerBaseCommands(commandManager, lazyClientHost, pluginManager);
|
||||
|
||||
// context.subscriptions.push(task.register(lazyClientHost.map(x => x.serviceClient)));
|
||||
context.subscriptions.push(new LanguageConfigurationManager());
|
||||
|
||||
import('./features/tsconfig').then(module => {
|
||||
context.subscriptions.push(module.register());
|
||||
|
|
|
@ -6,9 +6,8 @@
|
|||
import * as rimraf from 'rimraf';
|
||||
import * as vscode from 'vscode';
|
||||
import { Api, getExtensionApi } from './api';
|
||||
import { registerCommands } from './commands/index';
|
||||
import { registerBaseCommands } from './commands/index';
|
||||
import { LanguageConfigurationManager } from './features/languageConfiguration';
|
||||
import * as task from './features/task';
|
||||
import { createLazyClientHost, lazilyActivateClient } from './lazyClientHost';
|
||||
import { nodeRequestCancellerFactory } from './tsServer/cancellation.electron';
|
||||
import { NodeLogDirectoryProvider } from './tsServer/logDirectoryProvider.electron';
|
||||
|
@ -32,16 +31,19 @@ export function activate(
|
|||
context.subscriptions.push(onCompletionAccepted);
|
||||
|
||||
const logDirectoryProvider = new NodeLogDirectoryProvider(context);
|
||||
|
||||
const versionProvider = new DiskTypeScriptVersionProvider();
|
||||
|
||||
context.subscriptions.push(new LanguageConfigurationManager());
|
||||
|
||||
const lazyClientHost = createLazyClientHost(context, onCaseInsenitiveFileSystem(), pluginManager, commandManager, logDirectoryProvider, nodeRequestCancellerFactory, versionProvider, ChildServerProcess, item => {
|
||||
onCompletionAccepted.fire(item);
|
||||
});
|
||||
|
||||
registerCommands(commandManager, lazyClientHost, pluginManager);
|
||||
context.subscriptions.push(task.register(lazyClientHost.map(x => x.serviceClient)));
|
||||
context.subscriptions.push(new LanguageConfigurationManager());
|
||||
registerBaseCommands(commandManager, lazyClientHost, pluginManager);
|
||||
|
||||
import('./features/task').then(module => {
|
||||
context.subscriptions.push(module.register(lazyClientHost.map(x => x.serviceClient)));
|
||||
});
|
||||
|
||||
import('./features/tsconfig').then(module => {
|
||||
context.subscriptions.push(module.register());
|
||||
|
|
Loading…
Reference in a new issue