remove extensionsWorkbenchExtension!

This commit is contained in:
Joao Moreno
2016-09-15 18:41:16 +02:00
parent 9dea73691e
commit b3f39bf739
8 changed files with 17 additions and 123 deletions
-6
View File
@@ -84,9 +84,6 @@ export interface IPath {
// indicator to create the file path in the VSCode instance
createFilePath?: boolean;
// indicator to install the extension (path to .vsix) in the VSCode instance
installExtensionPath?: boolean;
}
export interface IWindowConfiguration extends ICommandLineArguments {
@@ -102,8 +99,6 @@ export interface IWindowConfiguration extends ICommandLineArguments {
filesToOpen?: IPath[];
filesToCreate?: IPath[];
filesToDiff?: IPath[];
extensionsToInstall: string[];
}
export interface IWindowSettings {
@@ -388,7 +383,6 @@ export class VSCodeWindow {
delete configuration.filesToOpen;
delete configuration.filesToCreate;
delete configuration.filesToDiff;
delete configuration.extensionsToInstall;
// Some configuration things get inherited if the window is being reloaded and we are
// in plugin development mode. These options are all development related.
+9 -22
View File
@@ -576,13 +576,12 @@ export class WindowsManager implements IWindowsService {
let filesToOpen: IPath[] = [];
let filesToDiff: IPath[] = [];
let foldersToOpen = iPathsToOpen.filter(iPath => iPath.workspacePath && !iPath.filePath && !iPath.installExtensionPath);
let emptyToOpen = iPathsToOpen.filter(iPath => !iPath.workspacePath && !iPath.filePath && !iPath.installExtensionPath);
let extensionsToInstall = iPathsToOpen.filter(iPath => iPath.installExtensionPath).map(ipath => ipath.filePath);
let filesToCreate = iPathsToOpen.filter(iPath => !!iPath.filePath && iPath.createFilePath && !iPath.installExtensionPath);
let foldersToOpen = iPathsToOpen.filter(iPath => iPath.workspacePath && !iPath.filePath);
let emptyToOpen = iPathsToOpen.filter(iPath => !iPath.workspacePath && !iPath.filePath);
let filesToCreate = iPathsToOpen.filter(iPath => !!iPath.filePath && iPath.createFilePath);
// Diff mode needs special care
const candidates = iPathsToOpen.filter(iPath => !!iPath.filePath && !iPath.createFilePath && !iPath.installExtensionPath);
const candidates = iPathsToOpen.filter(iPath => !!iPath.filePath && !iPath.createFilePath);
if (openConfig.diffMode) {
if (candidates.length === 2) {
filesToDiff = candidates;
@@ -599,7 +598,7 @@ export class WindowsManager implements IWindowsService {
let configuration: IWindowConfiguration;
// Handle files to open/diff or to create when we dont open a folder
if (!foldersToOpen.length && (filesToOpen.length > 0 || filesToCreate.length > 0 || filesToDiff.length > 0 || extensionsToInstall.length > 0)) {
if (!foldersToOpen.length && (filesToOpen.length > 0 || filesToCreate.length > 0 || filesToDiff.length > 0)) {
// const the user settings override how files are open in a new window or same window unless we are forced
let openFilesInNewWindow: boolean;
@@ -621,10 +620,6 @@ export class WindowsManager implements IWindowsService {
lastActiveWindow.focus();
lastActiveWindow.ready().then(readyWindow => {
readyWindow.send('vscode:openFiles', { filesToOpen, filesToCreate, filesToDiff });
if (extensionsToInstall.length) {
readyWindow.send('vscode:installExtensions', { extensionsToInstall });
}
});
usedWindows.push(lastActiveWindow);
@@ -632,7 +627,7 @@ export class WindowsManager implements IWindowsService {
// Otherwise open instance with files
else {
configuration = this.toConfiguration(this.getWindowUserEnv(openConfig), openConfig.cli, null, filesToOpen, filesToCreate, filesToDiff, extensionsToInstall);
configuration = this.toConfiguration(this.getWindowUserEnv(openConfig), openConfig.cli, null, filesToOpen, filesToCreate, filesToDiff);
const browserWindow = this.openInBrowserWindow(configuration, true /* new window */);
usedWindows.push(browserWindow);
@@ -651,10 +646,6 @@ export class WindowsManager implements IWindowsService {
browserWindow.focus(); // just focus one of them
browserWindow.ready().then(readyWindow => {
readyWindow.send('vscode:openFiles', { filesToOpen, filesToCreate, filesToDiff });
if (extensionsToInstall.length) {
readyWindow.send('vscode:installExtensions', { extensionsToInstall });
}
});
usedWindows.push(browserWindow);
@@ -663,7 +654,6 @@ export class WindowsManager implements IWindowsService {
filesToOpen = [];
filesToCreate = [];
filesToDiff = [];
extensionsToInstall = [];
openInNewWindow = true; // any other folders to open must open in new window then
}
@@ -674,7 +664,7 @@ export class WindowsManager implements IWindowsService {
return; // ignore folders that are already open
}
configuration = this.toConfiguration(this.getWindowUserEnv(openConfig), openConfig.cli, folderToOpen.workspacePath, filesToOpen, filesToCreate, filesToDiff, extensionsToInstall);
configuration = this.toConfiguration(this.getWindowUserEnv(openConfig), openConfig.cli, folderToOpen.workspacePath, filesToOpen, filesToCreate, filesToDiff);
const browserWindow = this.openInBrowserWindow(configuration, openInNewWindow, openInNewWindow ? void 0 : openConfig.windowToUse);
usedWindows.push(browserWindow);
@@ -682,7 +672,6 @@ export class WindowsManager implements IWindowsService {
filesToOpen = [];
filesToCreate = [];
filesToDiff = [];
extensionsToInstall = [];
openInNewWindow = true; // any other folders to open must open in new window then
});
@@ -826,7 +815,7 @@ export class WindowsManager implements IWindowsService {
this.open({ cli: openConfig.cli, forceNewWindow: true, forceEmpty: openConfig.cli.paths.length === 0 });
}
private toConfiguration(userEnv: IProcessEnvironment, cli: ICommandLineArguments, workspacePath?: string, filesToOpen?: IPath[], filesToCreate?: IPath[], filesToDiff?: IPath[], extensionsToInstall?: string[]): IWindowConfiguration {
private toConfiguration(userEnv: IProcessEnvironment, cli: ICommandLineArguments, workspacePath?: string, filesToOpen?: IPath[], filesToCreate?: IPath[], filesToDiff?: IPath[]): IWindowConfiguration {
const configuration: IWindowConfiguration = mixin({}, cli); // inherit all properties from CLI
configuration.appRoot = this.envService.appRoot;
configuration.execPath = process.execPath;
@@ -835,7 +824,6 @@ export class WindowsManager implements IWindowsService {
configuration.filesToOpen = filesToOpen;
configuration.filesToCreate = filesToCreate;
configuration.filesToDiff = filesToDiff;
configuration.extensionsToInstall = extensionsToInstall;
return configuration;
}
@@ -859,8 +847,7 @@ export class WindowsManager implements IWindowsService {
{
filePath: candidate,
lineNumber: gotoLineMode ? parsedPath.line : void 0,
columnNumber: gotoLineMode ? parsedPath.column : void 0,
installExtensionPath: /\.vsix$/i.test(candidate)
columnNumber: gotoLineMode ? parsedPath.column : void 0
} :
{ workspacePath: candidate };
}
+4 -2
View File
@@ -8,6 +8,7 @@ import * as platform from 'vs/base/common/platform';
import product from 'vs/platform/product';
import pkg from 'vs/platform/package';
import { serve, Server, connect } from 'vs/base/parts/ipc/node/ipc.net';
import { coalesce } from 'vs/base/common/arrays';
import { TPromise } from 'vs/base/common/winjs.base';
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
@@ -112,8 +113,9 @@ function main(server: Server, initData: ISharedProcessInitData): void {
(extensionManagementService as ExtensionManagementService).removeDeprecatedExtensions();
// install vsix
environmentService.args['install-vsix']
.forEach(vsix => extensionManagementService.install(vsix));
const vsixArg = environmentService.args['install-vsix'];
const vsix = typeof vsixArg === 'string' ? [vsixArg] : vsixArg;
coalesce(vsix || []).forEach(vsix => extensionManagementService.install(vsix));
});
});
}