From 44ef3e9d1bd53c8992d883a5d9fd94e246402bae Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Sun, 27 May 2018 23:21:40 +0200 Subject: [PATCH 01/12] mode-debug@1.24.0 --- build/builtInExtensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 65a8a64d140..e61259d8103 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -1,7 +1,7 @@ [ { "name": "ms-vscode.node-debug", - "version": "1.23.3", + "version": "1.24.0", "repo": "https://github.com/Microsoft/vscode-node-debug" }, { From 847828147e85aa2557f0ff5c293e2f6e3159db81 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 28 May 2018 07:46:22 +0200 Subject: [PATCH 02/12] notifications - print error stack if possible to console --- .../browser/parts/notifications/notificationsAlerts.ts | 6 +++++- src/vs/workbench/common/notifications.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts b/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts index 39dc686ff6f..9d7e25af5ab 100644 --- a/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts +++ b/src/vs/workbench/browser/parts/notifications/notificationsAlerts.ts @@ -36,7 +36,11 @@ export class NotificationsAlerts { // Always log errors to console with full details if (e.item.severity === Severity.Error) { - console.error(toErrorMessage(e.item.message.value, true)); + if (e.item.message.original instanceof Error) { + console.error(e.item.message.original); + } else { + console.error(toErrorMessage(e.item.message.value, true)); + } } } } diff --git a/src/vs/workbench/common/notifications.ts b/src/vs/workbench/common/notifications.ts index d6640decdb5..d7af013262c 100644 --- a/src/vs/workbench/common/notifications.ts +++ b/src/vs/workbench/common/notifications.ts @@ -336,6 +336,7 @@ export interface IMessageLink { export interface INotificationMessage { raw: string; + original: NotificationMessage; value: string; links: IMessageLink[]; } @@ -417,7 +418,7 @@ export class NotificationViewItem implements INotificationViewItem { }); - return { raw, value: message, links }; + return { raw, value: message, links, original: input }; } private constructor(private _severity: Severity, private _message: INotificationMessage, private _source: string, actions?: INotificationActions) { From 86feb84737e13aab68d19305c8a0beecc92d45a0 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Mon, 28 May 2018 08:49:01 +0200 Subject: [PATCH 03/12] Make variable resolving for tasks async --- .../api/electron-browser/mainThreadTask.ts | 11 +- src/vs/workbench/api/node/extHost.api.impl.ts | 4 +- src/vs/workbench/api/node/extHost.protocol.ts | 1 + .../workbench/api/node/extHostApiCommands.ts | 18 +- src/vs/workbench/api/node/extHostTask.ts | 28 ++- .../parts/tasks/common/taskSystem.ts | 1 + .../electron-browser/terminalTaskSystem.ts | 181 ++++++++++++++---- .../api/extHostApiCommands.test.ts | 9 +- 8 files changed, 189 insertions(+), 64 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadTask.ts b/src/vs/workbench/api/electron-browser/mainThreadTask.ts index bd4901b72ad..466ced9706b 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTask.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTask.ts @@ -491,7 +491,16 @@ export class MainThreadTask implements MainThreadTaskShape { this._taskService.registerTaskSystem(key, { platform: platform, fileSystemScheme: key, - context: this._extHostContext + context: this._extHostContext, + resolveVariables: (workspaceFolder: IWorkspaceFolder, variables: Set): TPromise> => { + let vars: string[] = []; + variables.forEach(item => vars.push(item)); + return this._proxy.$resolveVariables(workspaceFolder.uri, vars).then(values => { + let result = new Map(); + Object.keys(values).forEach(key => result.set(key, values[key])); + return result; + }); + } }); } } diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 31ec131d4aa..efeeabfb8c3 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -121,7 +121,7 @@ export function createApiFactory( const extHostTerminalService = rpcProtocol.set(ExtHostContext.ExtHostTerminalService, new ExtHostTerminalService(rpcProtocol, extHostConfiguration, extHostLogService)); const extHostSCM = rpcProtocol.set(ExtHostContext.ExtHostSCM, new ExtHostSCM(rpcProtocol, extHostCommands, extHostLogService)); const extHostSearch = rpcProtocol.set(ExtHostContext.ExtHostSearch, new ExtHostSearch(rpcProtocol, schemeTransformer)); - const extHostTask = rpcProtocol.set(ExtHostContext.ExtHostTask, new ExtHostTask(rpcProtocol, extHostWorkspace)); + const extHostTask = rpcProtocol.set(ExtHostContext.ExtHostTask, new ExtHostTask(rpcProtocol, extHostWorkspace, extHostDocumentsAndEditors, extHostConfiguration)); const extHostWindow = rpcProtocol.set(ExtHostContext.ExtHostWindow, new ExtHostWindow(rpcProtocol)); rpcProtocol.set(ExtHostContext.ExtHostExtensionService, extensionService); const extHostProgress = rpcProtocol.set(ExtHostContext.ExtHostProgress, new ExtHostProgress(rpcProtocol.getProxy(MainContext.MainThreadProgress))); @@ -138,7 +138,7 @@ export function createApiFactory( const extHostLanguages = new ExtHostLanguages(rpcProtocol); // Register API-ish commands - ExtHostApiCommands.register(extHostCommands, extHostTask); + ExtHostApiCommands.register(extHostCommands); return function (extension: IExtensionDescription): typeof vscode { diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 0cd457bec02..80202809e70 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -784,6 +784,7 @@ export interface ExtHostTaskShape { $onDidStartTaskProcess(value: TaskProcessStartedDTO): void; $onDidEndTaskProcess(value: TaskProcessEndedDTO): void; $OnDidEndTask(execution: TaskExecutionDTO): void; + $resolveVariables(workspaceFolder: URI, variables: string[]): TPromise; } export interface IBreakpointDto { diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts index 5065659b7e2..0227c874623 100644 --- a/src/vs/workbench/api/node/extHostApiCommands.ts +++ b/src/vs/workbench/api/node/extHostApiCommands.ts @@ -18,22 +18,19 @@ import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; import { IWorkspaceSymbolProvider } from 'vs/workbench/parts/search/common/search'; import { CustomCodeAction } from 'vs/workbench/api/node/extHostLanguageFeatures'; -import { ExtHostTask } from './extHostTask'; import { ICommandsExecutor, PreviewHTMLAPICommand, OpenFolderAPICommand, DiffAPICommand, OpenAPICommand, RemoveFromRecentlyOpenedAPICommand } from './apiCommands'; export class ExtHostApiCommands { - static register(commands: ExtHostCommands, workspace: ExtHostTask) { - return new ExtHostApiCommands(commands, workspace).registerCommands(); + static register(commands: ExtHostCommands) { + return new ExtHostApiCommands(commands).registerCommands(); } private _commands: ExtHostCommands; - private _tasks: ExtHostTask; private _disposables: IDisposable[] = []; - private constructor(commands: ExtHostCommands, task: ExtHostTask) { + private constructor(commands: ExtHostCommands) { this._commands = commands; - this._tasks = task; } registerCommands() { @@ -176,11 +173,6 @@ export class ExtHostApiCommands { ], returns: 'A promise that resolves to an array of DocumentLink-instances.' }); - this._register('vscode.executeTaskProvider', this._executeTaskProvider, { - description: 'Execute task provider', - args: [], - returns: 'An array of task handles' - }); this._register('vscode.executeDocumentColorProvider', this._executeDocumentColorProvider, { description: 'Execute document color provider.', args: [ @@ -494,10 +486,6 @@ export class ExtHostApiCommands { return this._commands.executeCommand('_executeLinkProvider', resource) .then(tryMapWith(typeConverters.DocumentLink.to)); } - - private _executeTaskProvider(): Thenable { - return this._tasks.fetchTasks(); - } } function tryMapWith(f: (x: T) => R) { diff --git a/src/vs/workbench/api/node/extHostTask.ts b/src/vs/workbench/api/node/extHostTask.ts index 40a0d578998..03c10b1ee81 100644 --- a/src/vs/workbench/api/node/extHostTask.ts +++ b/src/vs/workbench/api/node/extHostTask.ts @@ -23,6 +23,10 @@ import { TaskDefinitionDTO, TaskExecutionDTO, TaskPresentationOptionsDTO, ProcessExecutionOptionsDTO, ProcessExecutionDTO, ShellExecutionOptionsDTO, ShellExecutionDTO, TaskDTO, TaskHandleDTO, TaskFilterDTO, TaskProcessStartedDTO, TaskProcessEndedDTO, TaskSystemInfoDTO } from '../shared/tasks'; +import { ExtHostVariableResolverService } from 'vs/workbench/api/node/extHostDebugService'; +import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; +import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration'; +import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; export { TaskExecutionDTO }; @@ -729,6 +733,8 @@ export class ExtHostTask implements ExtHostTaskShape { private _proxy: MainThreadTaskShape; private _workspaceService: ExtHostWorkspace; + private _editorService: ExtHostDocumentsAndEditors; + private _configurationService: ExtHostConfiguration; private _handleCounter: number; private _handlers: Map; private _taskExecutions: Map; @@ -739,9 +745,11 @@ export class ExtHostTask implements ExtHostTaskShape { private readonly _onDidTaskProcessStarted: Emitter = new Emitter(); private readonly _onDidTaskProcessEnded: Emitter = new Emitter(); - constructor(mainContext: IMainContext, workspaceService: ExtHostWorkspace) { + constructor(mainContext: IMainContext, workspaceService: ExtHostWorkspace, editorService: ExtHostDocumentsAndEditors, configurationService: ExtHostConfiguration) { this._proxy = mainContext.getProxy(MainContext.MainThreadTask); this._workspaceService = workspaceService; + this._editorService = editorService; + this._configurationService = configurationService; this._handleCounter = 0; this._handlers = new Map(); this._taskExecutions = new Map(); @@ -872,6 +880,24 @@ export class ExtHostTask implements ExtHostTaskShape { }); } + public $resolveVariables(uri: URI, variables: string[]): any { + let result = Object.create(null); + let workspaceFolder = this._workspaceService.resolveWorkspaceFolder(uri); + let resolver = new ExtHostVariableResolverService(this._workspaceService, this._editorService, this._configurationService); + let ws: IWorkspaceFolder = { + uri: workspaceFolder.uri, + name: workspaceFolder.name, + index: workspaceFolder.index, + toResource: () => { + throw new Error('Not implemented'); + } + }; + for (let variable of variables) { + result.push(variable, resolver.resolve(ws, variable)); + } + return result; + } + private nextHandle(): number { return this._handleCounter++; } diff --git a/src/vs/workbench/parts/tasks/common/taskSystem.ts b/src/vs/workbench/parts/tasks/common/taskSystem.ts index 764f5e052ac..7a055bf14a9 100644 --- a/src/vs/workbench/parts/tasks/common/taskSystem.ts +++ b/src/vs/workbench/parts/tasks/common/taskSystem.ts @@ -106,6 +106,7 @@ export interface TaskSystemInfo { fileSystemScheme: string; platform: Platform; context: any; + resolveVariables(workspaceFolder: IWorkspaceFolder, variables: Set): TPromise>; } export interface TaskSystemInfoResovler { diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index f0870fb193a..168538481af 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -21,7 +21,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import * as TPath from 'vs/base/common/paths'; import { IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; +import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IModelService } from 'vs/editor/common/services/modelService'; import { ProblemMatcher, ProblemMatcherRegistry /*, ProblemPattern, getResource */ } from 'vs/workbench/parts/tasks/common/problemMatcher'; @@ -33,7 +33,7 @@ import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind } from 'vs/workbench/parts/tasks/common/problemCollectors'; import { Task, CustomTask, ContributedTask, RevealKind, CommandOptions, ShellConfiguration, RuntimeType, PanelKind, - TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString + TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString, CommandConfiguration } from 'vs/workbench/parts/tasks/common/tasks'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, ITaskResolver, @@ -51,6 +51,24 @@ interface ActiveTerminalData { promise: TPromise; } +class VariableResolver { + + constructor(public workspaceFolder: IWorkspaceFolder, public taskSystemInfo: TaskSystemInfo | undefined, private _values: Map, private _service: IConfigurationResolverService | undefined) { + } + resolve(value: string): string { + return value.replace(/\$\{(.*?)\}/g, (match: string, variable: string) => { + let result = this._values.get(match); + if (result) { + return result; + } + if (this._service) { + return this._service.resolve(this.workspaceFolder, match); + } + return match; + }); + } +} + export class TerminalTaskSystem implements ITaskSystem { public static TelemetryEventName: string = 'taskService'; @@ -276,13 +294,36 @@ export class TerminalTaskSystem implements ITaskSystem { } private executeCommand(task: CustomTask | ContributedTask, trigger: string): TPromise { + let variables = new Set(); + this.collectTaskVariables(variables, task); + let workspaceFolder = Task.getWorkspaceFolder(task); + let taskSystemInfo: TaskSystemInfo; + if (workspaceFolder) { + taskSystemInfo = this.taskSystemInfoResolver(workspaceFolder); + } + let resolvedVariables: TPromise>; + if (taskSystemInfo) { + resolvedVariables = taskSystemInfo.resolveVariables(workspaceFolder, variables); + } else { + let result = new Map(); + variables.forEach(variable => { + result.set(variable, this.configurationResolverService.resolve(workspaceFolder, variable)); + }); + resolvedVariables = TPromise.as(result); + } + return resolvedVariables.then((variables) => { + return this.executeInTerminal(task, trigger, new VariableResolver(workspaceFolder, undefined, variables, this.configurationResolverService)); + }); + } + + private executeInTerminal(task: CustomTask | ContributedTask, trigger: string, resolver: VariableResolver): TPromise { let terminal: ITerminalInstance = undefined; let executedCommand: string = undefined; let error: TaskError = undefined; let promise: TPromise = undefined; if (task.isBackground) { promise = new TPromise((resolve, reject) => { - const problemMatchers = this.resolveMatchers(task, task.problemMatchers); + const problemMatchers = this.resolveMatchers(resolver, task.problemMatchers); let watchingProblemMatcher = new WatchingProblemCollector(problemMatchers, this.markerService, this.modelService); let toUnbind: IDisposable[] = []; let eventCounter: number = 0; @@ -304,7 +345,7 @@ export class TerminalTaskSystem implements ITaskSystem { })); watchingProblemMatcher.aboutToStart(); let delayer: Async.Delayer = undefined; - [terminal, executedCommand, error] = this.createTerminal(task); + [terminal, executedCommand, error] = this.createTerminal(task, resolver); if (error || !terminal) { return; } @@ -365,7 +406,7 @@ export class TerminalTaskSystem implements ITaskSystem { }); } else { promise = new TPromise((resolve, reject) => { - [terminal, executedCommand, error] = this.createTerminal(task); + [terminal, executedCommand, error] = this.createTerminal(task, resolver); if (error || !terminal) { return; } @@ -378,7 +419,7 @@ export class TerminalTaskSystem implements ITaskSystem { }); this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Start, task)); this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.Active, task)); - let problemMatchers = this.resolveMatchers(task, task.problemMatchers); + let problemMatchers = this.resolveMatchers(resolver, task.problemMatchers); let startStopProblemMatcher = new StartStopProblemCollector(problemMatchers, this.markerService, this.modelService); const registeredLinkMatchers = this.registerLinkMatchers(terminal, problemMatchers); const onData = terminal.onLineData((line) => { @@ -471,9 +512,9 @@ export class TerminalTaskSystem implements ITaskSystem { }); } - private createTerminal(task: CustomTask | ContributedTask): [ITerminalInstance, string, TaskError | undefined] { - let options = this.resolveOptions(task, task.command.options); - let { command, args } = this.resolveCommandAndArgs(task); + private createTerminal(task: CustomTask | ContributedTask, resolver: VariableResolver): [ITerminalInstance, string, TaskError | undefined] { + let options = this.resolveOptions(resolver, task.command.options); + let { command, args } = this.resolveCommandAndArgs(resolver, task.command); let commandExecutable = CommandString.value(command); let workspaceFolder = Task.getWorkspaceFolder(task); let needsFolderQualification = workspaceFolder && this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE; @@ -493,10 +534,10 @@ export class TerminalTaskSystem implements ITaskSystem { let shellSpecified: boolean = false; let shellOptions: ShellConfiguration = task.command.options && task.command.options.shell; if (shellOptions && shellOptions.executable) { - shellLaunchConfig.executable = this.resolveVariable(task, shellOptions.executable); + shellLaunchConfig.executable = this.resolveVariable(resolver, shellOptions.executable); shellSpecified = true; if (shellOptions.args) { - shellLaunchConfig.args = this.resolveVariables(task, shellOptions.args.slice()); + shellLaunchConfig.args = this.resolveVariables(resolver, shellOptions.args.slice()); } else { shellLaunchConfig.args = []; } @@ -750,11 +791,81 @@ export class TerminalTaskSystem implements ITaskSystem { return TerminalTaskSystem.shellQuotes[shellBasename] || TerminalTaskSystem.osShellQuotes[process.platform]; } - private resolveCommandAndArgs(task: CustomTask | ContributedTask): { command: CommandString, args: CommandString[] } { + private collectTaskVariables(variables: Set, task: CustomTask | ContributedTask): void { + if (task.command) { + this.collectCommandVariables(variables, task.command); + } + this.collectMatcherVariables(variables, task.problemMatchers); + } + + private collectCommandVariables(variables: Set, command: CommandConfiguration): void { + this.collectVariables(variables, command.name); + if (command.args) { + command.args.forEach(arg => this.collectVariables(variables, arg)); + } + variables.add('${workspaceFolder}'); + if (command.options) { + let options = command.options; + if (options.cwd) { + this.collectVariables(variables, options.cwd); + } + if (options.env) { + Object.keys(options.env).forEach((key) => { + let value: any = options.env[key]; + if (Types.isString(value)) { + this.collectVariables(variables, value); + } + }); + } + if (options.shell) { + if (options.shell.executable) { + this.collectVariables(variables, options.shell.executable); + } + if (options.shell.args) { + options.shell.args.forEach(arg => this.collectVariables(variables, arg)); + } + } + } + } + + private collectMatcherVariables(variables: Set, values: (string | ProblemMatcher)[]): void { + if (values === void 0 || values === null || values.length === 0) { + return; + } + values.forEach((value) => { + let matcher: ProblemMatcher; + if (Types.isString(value)) { + if (value[0] === '$') { + matcher = ProblemMatcherRegistry.get(value.substring(1)); + } else { + matcher = ProblemMatcherRegistry.get(value); + } + } else { + matcher = value; + } + if (matcher && matcher.filePrefix) { + this.collectVariables(variables, matcher.filePrefix); + } + }); + } + + private collectVariables(variables: Set, value: string | CommandString): void { + let string: string = Types.isString(value) ? value : value.value; + let r = /\$\{(.*?)\}/g; + let matches: RegExpExecArray; + do { + matches = r.exec(string); + if (matches) { + variables.add(matches[0]); + } + } while (matches); + } + + private resolveCommandAndArgs(resolver: VariableResolver, commandConfig: CommandConfiguration): { command: CommandString, args: CommandString[] } { // First we need to use the command args: - let args: CommandString[] = task.command.args ? task.command.args.slice() : []; - args = this.resolveVariables(task, args); - let command: CommandString = this.resolveVariable(task, task.command.name); + let args: CommandString[] = commandConfig.args ? commandConfig.args.slice() : []; + args = this.resolveVariables(resolver, args); + let command: CommandString = this.resolveVariable(resolver, commandConfig.name); return { command, args }; } @@ -814,13 +925,13 @@ export class TerminalTaskSystem implements ITaskSystem { return path.join(cwd, command); } - private resolveVariables(task: CustomTask | ContributedTask, value: string[]): string[]; - private resolveVariables(task: CustomTask | ContributedTask, value: CommandString[]): CommandString[]; - private resolveVariables(task: CustomTask | ContributedTask, value: CommandString[]): CommandString[] { - return value.map(s => this.resolveVariable(task, s)); + private resolveVariables(resolver: VariableResolver, value: string[]): string[]; + private resolveVariables(resolver: VariableResolver, value: CommandString[]): CommandString[]; + private resolveVariables(resolver: VariableResolver, value: CommandString[]): CommandString[] { + return value.map(s => this.resolveVariable(resolver, s)); } - private resolveMatchers(task: CustomTask | ContributedTask, values: (string | ProblemMatcher)[]): ProblemMatcher[] { + private resolveMatchers(resolver: VariableResolver, values: (string | ProblemMatcher)[]): ProblemMatcher[] { if (values === void 0 || values === null || values.length === 0) { return []; } @@ -840,13 +951,9 @@ export class TerminalTaskSystem implements ITaskSystem { this.outputChannel.append(nls.localize('unkownProblemMatcher', 'Problem matcher {0} can\'t be resolved. The matcher will be ignored')); return; } - let workspaceFolder = Task.getWorkspaceFolder(task); - let taskSystemInfo: TaskSystemInfo; - if (workspaceFolder) { - taskSystemInfo = this.taskSystemInfoResolver(workspaceFolder); - } + let taskSystemInfo: TaskSystemInfo = resolver.taskSystemInfo; let hasFilePrefix = matcher.filePrefix !== void 0; - let hasScheme = taskSystemInfo !== void 0 && taskSystemInfo.fileSystemScheme !== void 0 && taskSystemInfo.fileSystemScheme === 'file'; + let hasScheme = taskSystemInfo !== void 0 && taskSystemInfo.fileSystemScheme !== void 0 && taskSystemInfo.fileSystemScheme !== 'file'; if (!hasFilePrefix && !hasScheme) { result.push(matcher); } else { @@ -855,7 +962,7 @@ export class TerminalTaskSystem implements ITaskSystem { copy.fileSystemScheme = taskSystemInfo.fileSystemScheme; } if (hasFilePrefix) { - copy.filePrefix = this.resolveVariable(task, copy.filePrefix); + copy.filePrefix = this.resolveVariable(resolver, copy.filePrefix); } result.push(copy); } @@ -863,33 +970,33 @@ export class TerminalTaskSystem implements ITaskSystem { return result; } - private resolveVariable(task: CustomTask | ContributedTask, value: string): string; - private resolveVariable(task: CustomTask | ContributedTask, value: CommandString): CommandString; - private resolveVariable(task: CustomTask | ContributedTask, value: CommandString): CommandString { + private resolveVariable(resolver: VariableResolver, value: string): string; + private resolveVariable(resolver: VariableResolver, value: CommandString): CommandString; + private resolveVariable(resolver: VariableResolver, value: CommandString): CommandString { // TODO@Dirk Task.getWorkspaceFolder should return a WorkspaceFolder that is defined in workspace.ts if (Types.isString(value)) { - return this.configurationResolverService.resolve(Task.getWorkspaceFolder(task), value); + return resolver.resolve(value); } else { return { - value: this.configurationResolverService.resolve(Task.getWorkspaceFolder(task), value.value), + value: resolver.resolve(value.value), quoting: value.quoting }; } } - private resolveOptions(task: CustomTask | ContributedTask, options: CommandOptions): CommandOptions { + private resolveOptions(resolver: VariableResolver, options: CommandOptions): CommandOptions { if (options === void 0 || options === null) { - return { cwd: this.resolveVariable(task, '${workspaceFolder}') }; + return { cwd: this.resolveVariable(resolver, '${workspaceFolder}') }; } let result: CommandOptions = Types.isString(options.cwd) - ? { cwd: this.resolveVariable(task, options.cwd) } - : { cwd: this.resolveVariable(task, '${workspaceFolder}') }; + ? { cwd: this.resolveVariable(resolver, options.cwd) } + : { cwd: this.resolveVariable(resolver, '${workspaceFolder}') }; if (options.env) { result.env = Object.create(null); Object.keys(options.env).forEach((key) => { let value: any = options.env[key]; if (Types.isString(value)) { - result.env[key] = this.resolveVariable(task, value); + result.env[key] = this.resolveVariable(resolver, value); } else { result.env[key] = value.toString(); } diff --git a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts index dca3072a243..34528d0623d 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -33,9 +33,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import 'vs/workbench/parts/search/electron-browser/search.contribution'; import { NullLogService } from 'vs/platform/log/common/log'; import { ITextModel } from 'vs/editor/common/model'; -import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; -import { generateUuid } from 'vs/base/common/uuid'; -import { ExtHostTask } from 'vs/workbench/api/node/extHostTask'; const defaultSelector = { scheme: 'far' }; const model: ITextModel = EditorModel.createFromString( @@ -52,8 +49,6 @@ let rpcProtocol: TestRPCProtocol; let extHost: ExtHostLanguageFeatures; let mainThread: MainThreadLanguageFeatures; let commands: ExtHostCommands; -let task: ExtHostTask; -let workspace: ExtHostWorkspace; let disposables: vscode.Disposable[] = []; let originalErrorHandler: (e: any) => any; @@ -120,11 +115,9 @@ suite('ExtHostLanguageFeatureCommands', function () { const heapService = new ExtHostHeapService(); commands = new ExtHostCommands(rpcProtocol, heapService, new NullLogService()); - workspace = new ExtHostWorkspace(rpcProtocol, { id: generateUuid(), name: 'Test', folders: [] }, new NullLogService()); - task = new ExtHostTask(rpcProtocol, workspace); rpcProtocol.set(ExtHostContext.ExtHostCommands, commands); rpcProtocol.set(MainContext.MainThreadCommands, inst.createInstance(MainThreadCommands, rpcProtocol)); - ExtHostApiCommands.register(commands, task); + ExtHostApiCommands.register(commands); const diagnostics = new ExtHostDiagnostics(rpcProtocol); rpcProtocol.set(ExtHostContext.ExtHostDiagnostics, diagnostics); From a48089ce51c46b6146895366fc23006671aa755d Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 May 2018 09:15:33 +0200 Subject: [PATCH 04/12] Remove first cut of QuickInput API (#49340) --- src/vs/vscode.proposed.d.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index fe241ee9ade..8d8db91dc94 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -561,30 +561,6 @@ declare module 'vscode' { //#endregion - //#region Multi-step input - - export namespace window { - - /** - * Collect multiple inputs from the user. The provided handler will be called with a - * [`QuickInput`](#QuickInput) that should be used to control the UI. - * - * @param handler The callback that will collect the inputs. - */ - export function multiStepInput(handler: (input: QuickInput, token: CancellationToken) => Thenable, token?: CancellationToken): Thenable; - } - - /** - * Controls the UI within a multi-step input session. The handler passed to [`window.multiStepInput`](#window.multiStepInput) - * should use the instance of this interface passed to it to collect all inputs. - */ - export interface QuickInput { - showQuickPick: typeof window.showQuickPick; - showInputBox: typeof window.showInputBox; - } - - //#endregion - //#region mjbvz: Unused diagnostics /** * Additional metadata about the type of diagnostic. From 0662a71dfb2a89a691b512fc9ca18a2bed875cd7 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 May 2018 09:30:39 +0200 Subject: [PATCH 05/12] Remove first cut of QuickInput API (#49340) --- .../src/singlefolder-tests/window.test.ts | 78 ------------------- src/vs/workbench/api/node/extHost.api.impl.ts | 3 - src/vs/workbench/api/node/extHostQuickOpen.ts | 45 +---------- 3 files changed, 2 insertions(+), 124 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts index f6bbd075404..84307f80d99 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts @@ -405,84 +405,6 @@ suite('window namespace tests', () => { return Promise.all([a, b]); }); - test('multiStepInput, two steps', async function () { - const picks = window.multiStepInput(async (input, token) => { - const pick1 = input.showQuickPick(['eins', 'zwei', 'drei']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick1, 'eins'); - - const pick2 = input.showQuickPick(['vier', 'fünf', 'sechs']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick2, 'vier'); - - return [ await pick1, await pick2 ]; - }); - assert.deepEqual(await picks, ['eins', 'vier']); - }); - - test('multiStepInput, interrupted by showQuickPick', async function () { - const picks = window.multiStepInput(async (input, token) => { - const pick1 = input.showQuickPick(['eins', 'zwei', 'drei']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick1, 'eins'); - - assert.ok(!token.isCancellationRequested); - const otherPick = window.showQuickPick(['sieben', 'acht', 'neun']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await otherPick, 'sieben'); - assert.ok(token.isCancellationRequested); - - const pick2 = input.showQuickPick(['vier', 'fünf', 'sechs']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick2, undefined); - - return [ await pick1, await pick2 ]; - }); - assert.deepEqual(await picks, ['eins', undefined]); - }); - - test('multiStepInput, interrupted by multiStepInput', async function () { - const picks = window.multiStepInput(async (input, token) => { - const pick1 = input.showQuickPick(['eins', 'zwei', 'drei']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick1, 'eins'); - - assert.ok(!token.isCancellationRequested); - const otherPick = window.multiStepInput(async (input, token) => { - const otherPick = window.showQuickPick(['sieben', 'acht', 'neun']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await otherPick, 'sieben'); - - return otherPick; - }); - assert.equal(await otherPick, 'sieben'); - assert.ok(token.isCancellationRequested); - - const pick2 = input.showQuickPick(['vier', 'fünf', 'sechs']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick2, undefined); - - return [ await pick1, await pick2 ]; - }); - assert.deepEqual(await picks, ['eins', undefined]); - }); - - test('multiStepInput, interrupted by error', async function () { - try { - const picks = window.multiStepInput(async (input, token) => { - const pick1 = input.showQuickPick(['eins', 'zwei', 'drei']); - await commands.executeCommand('workbench.action.acceptSelectedQuickOpenItem'); - assert.equal(await pick1, 'eins'); - - throw new Error('because'); - }); - await picks; - assert.ok(false); - } catch (error) { - assert.equal(error.message, 'because'); - } - }); - test('showWorkspaceFolderPick', function () { const p = window.showWorkspaceFolderPick(undefined); diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index efeeabfb8c3..26ed470010b 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -394,9 +394,6 @@ export function createApiFactory( showInputBox(options?: vscode.InputBoxOptions, token?: vscode.CancellationToken) { return extHostQuickOpen.showInput(undefined, options, token); }, - multiStepInput(handler: (input: vscode.QuickInput, token: vscode.CancellationToken) => Thenable, token?: vscode.CancellationToken): Thenable { - return extHostQuickOpen.multiStepInput(handler, token); - }, showOpenDialog(options) { return extHostDialogs.showOpenDialog(options); }, diff --git a/src/vs/workbench/api/node/extHostQuickOpen.ts b/src/vs/workbench/api/node/extHostQuickOpen.ts index 6f4bb3137c0..bb1af794ce9 100644 --- a/src/vs/workbench/api/node/extHostQuickOpen.ts +++ b/src/vs/workbench/api/node/extHostQuickOpen.ts @@ -6,12 +6,11 @@ import { TPromise } from 'vs/base/common/winjs.base'; import { wireCancellationToken, asWinJsPromise } from 'vs/base/common/async'; -import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation'; -import { QuickPickOptions, QuickPickItem, InputBoxOptions, WorkspaceFolderPickOptions, WorkspaceFolder, QuickInput } from 'vscode'; +import { CancellationToken } from 'vs/base/common/cancellation'; +import { QuickPickOptions, QuickPickItem, InputBoxOptions, WorkspaceFolderPickOptions, WorkspaceFolder } from 'vscode'; import { MainContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, MyQuickPickItems, IMainContext } from './extHost.protocol'; import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; -import { isPromiseCanceledError } from 'vs/base/common/errors'; export type Item = string | QuickPickItem; @@ -24,8 +23,6 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { private _onDidSelectItem: (handle: number) => void; private _validateInput: (input: string) => string | Thenable; - private _nextMultiStepHandle = 1; - constructor(mainContext: IMainContext, workspace: ExtHostWorkspace, commands: ExtHostCommands) { this._proxy = mainContext.getProxy(MainContext.MainThreadQuickOpen); this._workspace = workspace; @@ -145,42 +142,4 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { return this._workspace.getWorkspaceFolders().filter(folder => folder.uri.toString() === selectedFolder.uri.toString())[0]; }); } - - // ---- Multi-step input - - multiStepInput(handler: (input: QuickInput, token: CancellationToken) => Thenable, clientToken: CancellationToken = CancellationToken.None): Thenable { - const handle = this._nextMultiStepHandle++; - const remotePromise = this._proxy.$multiStep(handle); - - const cancellationSource = new CancellationTokenSource(); - const handlerPromise = TPromise.wrap(handler({ - showQuickPick: this.showQuickPick.bind(this, handle), - showInputBox: this.showInput.bind(this, handle) - }, cancellationSource.token)); - - clientToken.onCancellationRequested(() => { - remotePromise.cancel(); - cancellationSource.cancel(); - }); - - return TPromise.join([ - remotePromise.then(() => { - throw new Error('Unexpectedly fulfilled promise.'); - }, err => { - if (!isPromiseCanceledError(err)) { - throw err; - } - cancellationSource.cancel(); - }), - handlerPromise.then(result => { - remotePromise.cancel(); - return result; - }, err => { - remotePromise.cancel(); - throw err; - }) - ]).then(([_, result]) => result, ([remoteErr, handlerErr]) => { - throw handlerErr || remoteErr; - }); - } } From 43303c3f3ba589c7ecdc2cfae2076bde41556ea3 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Mon, 28 May 2018 09:32:09 +0200 Subject: [PATCH 06/12] Fixes #49806: Finalize Task API --- src/vs/vscode.d.ts | 156 +++++++++++++++++++++++++++++++++++- src/vs/vscode.proposed.d.ts | 155 +---------------------------------- 2 files changed, 157 insertions(+), 154 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 9c4049d2b38..576cf4551cc 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -4803,7 +4803,7 @@ declare module 'vscode' { /** * A task provider allows to add tasks to the task service. - * A task provider is registered via #workspace.registerTaskProvider. + * A task provider is registered via #tasks.registerTaskProvider. */ export interface TaskProvider { /** @@ -4829,6 +4829,158 @@ declare module 'vscode' { resolveTask(task: Task, token?: CancellationToken): ProviderResult; } + /** + * An object representing an executed Task. It can be used + * to terminate a task. + * + * This interface is not intended to be implemented. + */ + export interface TaskExecution { + /** + * The task that got started. + */ + task: Task; + + /** + * Terminates the task execution. + */ + terminate(): void; + } + + /** + * An event signaling the start of a task execution. + * + * This interface is not intended to be implemented. + */ + interface TaskStartEvent { + /** + * The task item representing the task that got started. + */ + execution: TaskExecution; + } + + /** + * An event signaling the end of an executed task. + * + * This interface is not intended to be implemented. + */ + interface TaskEndEvent { + /** + * The task item representing the task that finished. + */ + execution: TaskExecution; + } + + /** + * An event signaling the start of a process execution + * triggered through a task + */ + export interface TaskProcessStartEvent { + + /** + * The task execution for which the process got started. + */ + execution: TaskExecution; + + /** + * The underlying process id. + */ + processId: number; + } + + /** + * An event signaling the end of a process execution + * triggered through a task + */ + export interface TaskProcessEndEvent { + + /** + * The task execution for which the process got started. + */ + execution: TaskExecution; + + /** + * The process's exit code. + */ + exitCode: number; + } + + export interface TaskFilter { + /** + * The task version as used in the tasks.json file. + * The string support the package.json semver notation. + */ + version?: string; + + /** + * The task type to return; + */ + type?: string; + } + + /** + * Namespace for tasks functionality. + */ + export namespace tasks { + + /** + * Register a task provider. + * + * @param type The task kind type this provider is registered for. + * @param provider A task provider. + * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + */ + export function registerTaskProvider(type: string, provider: TaskProvider): Disposable; + + /** + * Fetches all tasks available in the systems. This includes tasks + * from `tasks.json` files as well as tasks from task providers + * contributed through extensions. + * + * @param filter a filter to filter the return tasks. + */ + export function fetchTasks(filter?: TaskFilter): Thenable; + + /** + * Executes a task that is managed by VS Code. The returned + * task execution can be used to terminate the task. + * + * @param task the task to execute + */ + export function executeTask(task: Task): Thenable; + + /** + * The currently active task executions or an empty array. + * + * @readonly + */ + export let taskExecutions: ReadonlyArray; + + /** + * Fires when a task starts. + */ + export const onDidStartTask: Event; + + /** + * Fires when a task ends. + */ + export const onDidEndTask: Event; + + /** + * Fires when the underlying process has been started. + * This event will not fire for tasks that don't + * execute an underlying process. + */ + export const onDidStartTaskProcess: Event; + + /** + * Fires when the underlying process has ended. + * This event will not fire for tasks that don't + * execute an underlying process. + */ + export const onDidEndTaskProcess: Event; + } + /** * Enumeration of file types. The types `File` and `Directory` can also be * a symbolic links, in that use `FileType.File | FileType.SymbolicLink` and @@ -6592,6 +6744,8 @@ declare module 'vscode' { * @param type The task kind type this provider is registered for. * @param provider A task provider. * @return A [disposable](#Disposable) that unregisters this provider when being disposed. + * + * @deprecated Use the corresponding function on the `tasks` namespace instead */ export function registerTaskProvider(type: string, provider: TaskProvider): Disposable; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 8d8db91dc94..5f102c6451c 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -296,96 +296,7 @@ declare module 'vscode' { //#endregion - //#region Tasks - - /** - * An object representing an executed Task. It can be used - * to terminate a task. - * - * This interface is not intended to be implemented. - */ - export interface TaskExecution { - /** - * The task that got started. - */ - task: Task; - - /** - * Terminates the task execution. - */ - terminate(): void; - } - - /** - * An event signaling the start of a task execution. - * - * This interface is not intended to be implemented. - */ - interface TaskStartEvent { - /** - * The task item representing the task that got started. - */ - execution: TaskExecution; - } - - /** - * An event signaling the end of an executed task. - * - * This interface is not intended to be implemented. - */ - interface TaskEndEvent { - /** - * The task item representing the task that finished. - */ - execution: TaskExecution; - } - - /** - * An event signaling the start of a process execution - * triggered through a task - */ - export interface TaskProcessStartEvent { - - /** - * The task execution for which the process got started. - */ - execution: TaskExecution; - - /** - * The underlying process id. - */ - processId: number; - } - - /** - * An event signaling the end of a process execution - * triggered through a task - */ - export interface TaskProcessEndEvent { - - /** - * The task execution for which the process got started. - */ - execution: TaskExecution; - - /** - * The process's exit code. - */ - exitCode: number; - } - - export interface TaskFilter { - /** - * The task version as used in the tasks.json file. - * The string support the package.json semver notation. - */ - version?: string; - - /** - * The task type to return; - */ - type?: string; - } + //#region Task export namespace workspace { @@ -424,71 +335,9 @@ declare module 'vscode' { export const onDidEndTask: Event; } - /** - * Namespace for tasks functionality. - */ - export namespace tasks { - - /** - * Register a task provider. - * - * @param type The task kind type this provider is registered for. - * @param provider A task provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerTaskProvider(type: string, provider: TaskProvider): Disposable; - - /** - * Fetches all tasks available in the systems. This includes tasks - * from `tasks.json` files as well as tasks from task providers - * contributed through extensions. - * - * @param filter a filter to filter the return tasks. - */ - export function fetchTasks(filter?: TaskFilter): Thenable; - - /** - * Executes a task that is managed by VS Code. The returned - * task execution can be used to terminate the task. - * - * @param task the task to execute - */ - export function executeTask(task: Task): Thenable; - - /** - * The currently active task executions or an empty array. - * - * @readonly - */ - export let taskExecutions: ReadonlyArray; - - /** - * Fires when a task starts. - */ - export const onDidStartTask: Event; - - /** - * Fires when a task ends. - */ - export const onDidEndTask: Event; - - /** - * Fires when the underlying process has been started. - * This event will not fire for tasks that don't - * execute an underlying process. - */ - export const onDidStartTaskProcess: Event; - - /** - * Fires when the underlying process has ended. - * This event will not fire for tasks that don't - * execute an underlying process. - */ - export const onDidEndTaskProcess: Event; - } - //#endregion + //#region Terminal export interface Terminal { From ed33aa3bc759afe111336d6eda7f3520f3c6c894 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 May 2018 09:46:02 +0200 Subject: [PATCH 07/12] Update getmac (#48804) --- package.json | 2 +- yarn.lock | 38 +++++++++++++++++++++++++++----------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 23514cd7969..f6d9ecd1ee7 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "applicationinsights": "0.18.0", "fast-plist": "0.1.2", "gc-signals": "^0.0.1", - "getmac": "1.0.7", + "getmac": "1.4.1", "graceful-fs": "4.1.11", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.1", diff --git a/yarn.lock b/yarn.lock index a265683c55f..d3aeb437fa5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1271,12 +1271,23 @@ duplexify@^3.2.0: readable-stream "^2.0.0" stream-shift "^1.0.0" +eachr@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/eachr/-/eachr-3.2.0.tgz#2c35e43ea086516f7997cf80b7aa64d55a4a4484" + dependencies: + editions "^1.1.1" + typechecker "^4.3.0" + ecc-jsbn@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz#0fc73a9ed5f0d53c38193398523ef7e543777505" dependencies: jsbn "~0.1.0" +editions@^1.1.1, editions@^1.3.4: + version "1.3.4" + resolved "https://registry.yarnpkg.com/editions/-/editions-1.3.4.tgz#3662cb592347c3168eb8e498a0ff73271d67f50b" + editorconfig@^0.15.0: version "0.15.0" resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.0.tgz#b6dd4a0b6b9e76ce48e066bdc15381aebb8804fd" @@ -1664,11 +1675,13 @@ extglob@^0.3.1: dependencies: is-extglob "^1.0.0" -extract-opts@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-2.2.0.tgz#1fa28eba7352c6db480f885ceb71a46810be6d7d" +extract-opts@^3.2.0: + version "3.3.1" + resolved "https://registry.yarnpkg.com/extract-opts/-/extract-opts-3.3.1.tgz#5abbedc98c0d5202e3278727f9192d7e086c6be1" dependencies: - typechecker "~2.0.1" + eachr "^3.2.0" + editions "^1.1.1" + typechecker "^4.3.0" extract-zip@^1.6.5: version "1.6.6" @@ -1975,11 +1988,12 @@ get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" -getmac@1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/getmac/-/getmac-1.0.7.tgz#94460f9778698d2e159a03da6c165689f22cdd67" +getmac@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/getmac/-/getmac-1.4.1.tgz#cfefcb3ee7d7a73cba5292129cb100c19afbe17a" dependencies: - extract-opts "^2.2.0" + editions "^1.3.4" + extract-opts "^3.2.0" getpass@^0.1.1: version "0.1.7" @@ -5631,9 +5645,11 @@ type-is@~1.6.15: media-typer "0.3.0" mime-types "~2.1.15" -typechecker@~2.0.1: - version "2.0.8" - resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-2.0.8.tgz#e83da84bb64c584ccb345838576c40b0337db82e" +typechecker@^4.3.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/typechecker/-/typechecker-4.5.0.tgz#c382920097812364bbaf4595b0ab6588244117a6" + dependencies: + editions "^1.3.4" typed-rest-client@^0.9.0: version "0.9.0" From 3ac58daa76c32c2e55fe6397555d47bf91fa83dd Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 May 2018 09:53:43 +0200 Subject: [PATCH 08/12] Update keytar (#48804) --- package.json | 2 +- yarn.lock | 248 ++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 235 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index f6d9ecd1ee7..31cb3633bba 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "https-proxy-agent": "^2.2.1", "iconv-lite": "0.4.23", "jschardet": "1.6.0", - "keytar": "^4.0.5", + "keytar": "4.2.1", "minimist": "1.2.0", "native-is-elevated": "^0.2.1", "native-keymap": "1.2.5", diff --git a/yarn.lock b/yarn.lock index d3aeb437fa5..7f0b53d77e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -185,10 +185,21 @@ applicationinsights@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1" +aproba@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a" + archy@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" +are-we-there-yet@~1.1.2: + version "1.1.5" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz#4b35c2944f062a8bfcda66410760350fe9ddfc21" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -449,6 +460,13 @@ bindings@^1.2.1, bindings@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7" +bl@^1.0.0: + version "1.2.2" + resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.2.tgz#a160911717103c07410cef63ef51b397c025af9c" + dependencies: + readable-stream "^2.3.5" + safe-buffer "^5.1.1" + bl@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/bl/-/bl-1.1.2.tgz#fdca871a99713aa00d19e3bbba41c44787a65398" @@ -528,10 +546,25 @@ browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: caniuse-db "^1.0.30000639" electron-to-chromium "^1.2.7" +buffer-alloc-unsafe@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffer-alloc-unsafe/-/buffer-alloc-unsafe-0.1.1.tgz#ffe1f67551dd055737de253337bfe853dfab1a6a" + +buffer-alloc@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/buffer-alloc/-/buffer-alloc-1.1.0.tgz#05514d33bf1656d3540c684f65b1202e90eca303" + dependencies: + buffer-alloc-unsafe "^0.1.0" + buffer-fill "^0.1.0" + buffer-crc32@~0.2.3: version "0.2.13" resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" +buffer-fill@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/buffer-fill/-/buffer-fill-0.1.1.tgz#76d825c4d6e50e06b7a31eb520c04d08cc235071" + buffers@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" @@ -652,6 +685,10 @@ cheerio@^1.0.0-rc.1: lodash "^4.15.0" parse5 "^3.0.1" +chownr@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181" + chrome-remote-interface@^0.25.3: version "0.25.3" resolved "https://registry.yarnpkg.com/chrome-remote-interface/-/chrome-remote-interface-0.25.3.tgz#b692ae538cd5af3a6dd285636bfab3d29a7006c1" @@ -871,6 +908,10 @@ config-chain@~1.1.5: ini "^1.3.4" proto-list "~1.2.1" +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" @@ -1099,6 +1140,12 @@ decamelize@^1.0.0, decamelize@^1.1.1, decamelize@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" +decompress-response@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3" + dependencies: + mimic-response "^1.0.0" + decompress-zip@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/decompress-zip/-/decompress-zip-0.3.0.tgz#ae3bcb7e34c65879adfe77e19c30f86602b4bdb0" @@ -1111,6 +1158,10 @@ decompress-zip@0.3.0: readable-stream "^1.1.8" touch "0.0.3" +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + deep-extend@~0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" @@ -1157,6 +1208,10 @@ delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + denodeify@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/denodeify/-/denodeify-1.2.1.tgz#3a36287f5034e699e7577901052c2e6c94251631" @@ -1187,6 +1242,10 @@ detect-indent@^2.0.0: minimist "^1.1.0" repeating "^1.1.0" +detect-libc@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + detect-newline@2.X: version "2.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-2.1.0.tgz#f41f1c10be4b00e87b5f13da680759f2c5bfd3e2" @@ -1602,6 +1661,10 @@ expand-range@^1.8.1: dependencies: fill-range "^2.1.0" +expand-template@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.1.1.tgz#981f188c0c3a87d2e28f559bc541426ff94f21dd" + expand-tilde@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" @@ -1923,6 +1986,10 @@ from@~0: version "0.1.7" resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" +fs-constants@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" + fs-exists-sync@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" @@ -1952,6 +2019,19 @@ function-bind@^1.0.2: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + gaze@^0.5.1: version "0.5.2" resolved "https://registry.yarnpkg.com/gaze/-/gaze-0.5.2.tgz#40b709537d24d1d45767db5a908689dfe69ac44f" @@ -1988,7 +2068,7 @@ get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" -getmac@^1.4.1: +getmac@1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/getmac/-/getmac-1.4.1.tgz#cfefcb3ee7d7a73cba5292129cb100c19afbe17a" dependencies: @@ -2001,6 +2081,10 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +github-from-package@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" + github-releases@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/github-releases/-/github-releases-0.4.1.tgz#4a13bdf85c4161344271db3d81db08e7379102ff" @@ -2597,6 +2681,10 @@ has-gulplog@^0.1.0: dependencies: sparkles "^1.0.0" +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -3192,11 +3280,12 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" -keytar@^4.0.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.0.5.tgz#cc1255ef06eeea1a12440b773f7d4a375b048729" +keytar@^4.2.1: + version "4.2.1" + resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.2.1.tgz#8a06a6577fdf6373e0aa6b112277e63dec77fd12" dependencies: - nan "2.5.1" + nan "2.8.0" + prebuild-install "^2.4.1" kind-of@^1.1.0: version "1.1.0" @@ -3681,6 +3770,10 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" +mimic-response@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e" + minimatch@0.3: version "0.3.0" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.3.0.tgz#275d8edaac4f1bb3326472089e7949c8394699dd" @@ -3797,9 +3890,9 @@ mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" -nan@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2" +nan@2.8.0, nan@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" nan@^2.0.0: version "2.9.2" @@ -3817,10 +3910,6 @@ nan@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/nan/-/nan-2.6.2.tgz#e4ff34e6c95fdfb5aecc08de6596f43605a7db45" -nan@^2.8.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" - native-is-elevated@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/native-is-elevated/-/native-is-elevated-0.2.1.tgz#70a2123a8575b9f624a3ef465d98cb74ae017385" @@ -3845,6 +3934,12 @@ negotiator@0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9" +node-abi@^2.2.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.4.1.tgz#7628c4d4ec4e9cd3764ceb3652f36b2e7f8d4923" + dependencies: + semver "^5.4.1" + node-pty@0.7.4: version "0.7.4" resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.7.4.tgz#07146b2b40b76e432e57ce6750bda40f0da5c99f" @@ -3867,6 +3962,10 @@ nodegit-promise@~4.0.0: dependencies: asap "~2.0.3" +noop-logger@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" + nopt@3.x, nopt@^3.0.1, nopt@~3.0.1: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" @@ -3921,6 +4020,15 @@ npm-run-path@^2.0.0: dependencies: path-key "^2.0.0" +npmlog@^4.0.1: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + nth-check@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.1.tgz#9929acdf628fc2c41098deab82ac580cf149aae4" @@ -4503,6 +4611,26 @@ postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0 source-map "^0.5.6" supports-color "^3.2.3" +prebuild-install@^2.4.1: + version "2.5.3" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-2.5.3.tgz#9f65f242782d370296353710e9bc843490c19f69" + dependencies: + detect-libc "^1.0.3" + expand-template "^1.0.2" + github-from-package "0.0.0" + minimist "^1.2.0" + mkdirp "^0.5.1" + node-abi "^2.2.0" + noop-logger "^0.1.1" + npmlog "^4.0.1" + os-homedir "^1.0.1" + pump "^2.0.1" + rc "^1.1.6" + simple-get "^2.7.0" + tar-fs "^1.13.0" + tunnel-agent "^0.6.0" + which-pm-runs "^1.0.0" + prelude-ls@~1.1.0, prelude-ls@~1.1.1, prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -4541,6 +4669,10 @@ process-nextick-args@^1.0.6, process-nextick-args@~1.0.6: version "1.0.7" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-1.0.7.tgz#150e20b756590ad3f91093f25a4f2ad8bff30ba3" +process-nextick-args@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.0.tgz#a37d732f4271b4ab1ad070d35508e8290788ffaa" + progress-stream@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/progress-stream/-/progress-stream-1.2.0.tgz#2cd3cfea33ba3a89c9c121ec3347abe9ab125f77" @@ -4573,6 +4705,13 @@ pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" +pump@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + pump@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.2.tgz#3b3ee6512f94f0e575538c17995f9f16990a5d51" @@ -4580,6 +4719,13 @@ pump@^1.0.1: end-of-stream "^1.1.0" once "^1.3.1" +pump@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/pump/-/pump-2.0.1.tgz#12399add6e4cf7526d973cbc8b5ce2e2908b3909" + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" @@ -4656,6 +4802,15 @@ rc@^1.1.2: minimist "^1.2.0" strip-json-comments "~2.0.1" +rc@^1.1.6: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + rcedit@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/rcedit/-/rcedit-0.3.0.tgz#cb5eee185e546f9eda597c248c9906186fa96bce" @@ -4711,6 +4866,18 @@ readable-stream@^2.0.0, readable-stream@^2.0.1, readable-stream@^2.0.2, readable string_decoder "~1.0.3" util-deprecate "~1.0.1" +readable-stream@^2.0.6, readable-stream@^2.3.0, readable-stream@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.6.tgz#b11c27d88b8ff1fbe070643cf94b0c79ae1b0aaf" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + readable-stream@~2.0.0, readable-stream@~2.0.5: version "2.0.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" @@ -5095,7 +5262,7 @@ serve-static@1.13.1: parseurl "~1.3.2" send "0.16.1" -set-blocking@^2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" @@ -5137,6 +5304,18 @@ signal-exit@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +simple-concat@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.0.tgz#7344cbb8b6e26fb27d66b2fc86f9f6d5997521c6" + +simple-get@^2.7.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-2.8.1.tgz#0e22e91d4575d87620620bc91308d57a77f44b5d" + dependencies: + decompress-response "^3.3.0" + once "^1.3.1" + simple-concat "^1.0.0" + single-line-log@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/single-line-log/-/single-line-log-1.1.2.tgz#c2f83f273a3e1a16edb0995661da0ed5ef033364" @@ -5317,7 +5496,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -string-width@^2.0.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.0.0, string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" dependencies: @@ -5334,6 +5513,12 @@ string_decoder@~1.0.3: dependencies: safe-buffer "~5.1.0" +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + dependencies: + safe-buffer "~5.1.0" + stringstream@~0.0.4, stringstream@~0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -5451,6 +5636,27 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" +tar-fs@^1.13.0: + version "1.16.2" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.2.tgz#17e5239747e399f7e77344f5f53365f04af53577" + dependencies: + chownr "^1.0.1" + mkdirp "^0.5.1" + pump "^1.0.0" + tar-stream "^1.1.2" + +tar-stream@^1.1.2: + version "1.6.1" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.1.tgz#f84ef1696269d6223ca48f6e1eeede3f7e81f395" + dependencies: + bl "^1.0.0" + buffer-alloc "^1.1.0" + end-of-stream "^1.0.0" + fs-constants "^1.0.0" + readable-stream "^2.3.0" + to-buffer "^1.1.0" + xtend "^4.0.0" + temp@^0.8.1, temp@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/temp/-/temp-0.8.3.tgz#e0c6bc4d26b903124410e4fed81103014dfc1f59" @@ -5551,6 +5757,10 @@ to-absolute-glob@^0.1.1: dependencies: extend-shallow "^2.0.1" +to-buffer@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80" + to-iso-string@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/to-iso-string/-/to-iso-string-0.0.2.tgz#4dc19e664dfccbe25bd8db508b00c6da158255d1" @@ -6034,12 +6244,22 @@ which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" +which-pm-runs@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" + which@^1.1.1, which@^1.2.12, which@^1.2.9: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: isexe "^2.0.0" +wide-align@^1.1.0: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + dependencies: + string-width "^1.0.2 || 2" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" From f024f25654d48961d330c3bebca09a0e694b4096 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 28 May 2018 10:29:10 +0200 Subject: [PATCH 09/12] Pass unregsitered views to super update views --- src/vs/workbench/common/views.ts | 2 +- .../electron-browser/extensionsViewlet.ts | 22 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index 29d774d0c4e..52355a0e60c 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -125,9 +125,9 @@ export const ViewsRegistry: IViewsRegistry = new class implements IViewsRegistry this._views.delete(location); this._viewLocations.splice(this._viewLocations.indexOf(location), 1); } + this._onViewsDeregistered.fire(viewsToDeregister); } - this._onViewsDeregistered.fire(viewsToDeregister); } getViews(loc: ViewLocation): IViewDescriptor[] { diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts index 2b02d88b44c..aeb8a6d9c2d 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts @@ -93,7 +93,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('marketPlace', "Marketplace"), location: ViewLocation.Extensions, ctor: ExtensionsListView, - when: ContextKeyExpr.and(ContextKeyExpr.has('searchExtensions'), ContextKeyExpr.not('searchInstalledExtensions'), ContextKeyExpr.not('searchBuiltInExtensions'), ContextKeyExpr.not('recommendedExtensions')), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchExtensions'), ContextKeyExpr.not('searchInstalledExtensions'), ContextKeyExpr.not('searchBuiltInExtensions'), ContextKeyExpr.not('recommendedExtensions')), weight: 100 }; } @@ -104,7 +104,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('installedExtensions', "Installed"), location: ViewLocation.Extensions, ctor: InstalledExtensionsView, - when: ContextKeyExpr.and(ContextKeyExpr.not('searchExtensions')), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.not('searchExtensions')), + order: 1, weight: 30 }; } @@ -115,7 +116,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('searchInstalledExtensions', "Installed"), location: ViewLocation.Extensions, ctor: InstalledExtensionsView, - when: ContextKeyExpr.and(ContextKeyExpr.has('searchInstalledExtensions')), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchInstalledExtensions')), weight: 100 }; } @@ -126,8 +127,9 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('recommendedExtensions', "Recommended"), location: ViewLocation.Extensions, ctor: RecommendedExtensionsView, - when: ContextKeyExpr.and(ContextKeyExpr.not('searchExtensions'), ContextKeyExpr.has('defaultRecommendedExtensions')), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.not('searchExtensions'), ContextKeyExpr.has('defaultRecommendedExtensions')), weight: 70, + order: 2, canToggleVisibility: true }; } @@ -138,7 +140,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('otherRecommendedExtensions', "Other Recommendations"), location: ViewLocation.Extensions, ctor: RecommendedExtensionsView, - when: ContextKeyExpr.and(ContextKeyExpr.has('recommendedExtensions')), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('recommendedExtensions')), weight: 50, canToggleVisibility: true, order: 2 @@ -151,7 +153,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('workspaceRecommendedExtensions', "Workspace Recommendations"), location: ViewLocation.Extensions, ctor: WorkspaceRecommendedExtensionsView, - when: ContextKeyExpr.and(ContextKeyExpr.has('recommendedExtensions'), ContextKeyExpr.has('nonEmptyWorkspace')), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('recommendedExtensions'), ContextKeyExpr.has('nonEmptyWorkspace')), weight: 50, canToggleVisibility: true, order: 1 @@ -164,7 +166,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('builtInExtensions', "Features"), location: ViewLocation.Extensions, ctor: BuiltInExtensionsView, - when: ContextKeyExpr.has('searchBuiltInExtensions'), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchBuiltInExtensions')), weight: 100, canToggleVisibility: true }; @@ -176,7 +178,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('builtInThemesExtensions', "Themes"), location: ViewLocation.Extensions, ctor: BuiltInThemesExtensionsView, - when: ContextKeyExpr.has('searchBuiltInExtensions'), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchBuiltInExtensions')), weight: 100, canToggleVisibility: true }; @@ -188,7 +190,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio name: localize('builtInBasicsExtensions', "Programming Languages"), location: ViewLocation.Extensions, ctor: BuiltInBasicsExtensionsView, - when: ContextKeyExpr.has('searchBuiltInExtensions'), + when: ContextKeyExpr.and(ContextKeyExpr.not('donotshowExtensions'), ContextKeyExpr.has('searchBuiltInExtensions')), weight: 100, canToggleVisibility: true }; @@ -392,7 +394,7 @@ export class ExtensionsViewlet extends PersistentViewsViewlet implements IExtens } protected async updateViews(unregisteredViews: IViewDescriptor[] = [], showAll = false): TPromise { - const created = await super.updateViews(); + const created = await super.updateViews(unregisteredViews); const toShow = showAll ? this.views : created; if (toShow.length) { await this.progress(TPromise.join(toShow.map(view => (view).show(this.searchBox.value)))); From c6d1072a7ff7a87b0a3ce2b42396f9c9dca41131 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 May 2018 10:35:40 +0200 Subject: [PATCH 10/12] Improve getmac test (#48804) --- src/vs/base/test/node/id.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/test/node/id.test.ts b/src/vs/base/test/node/id.test.ts index 3c01f23d8c1..0cddcf54249 100644 --- a/src/vs/base/test/node/id.test.ts +++ b/src/vs/base/test/node/id.test.ts @@ -11,7 +11,7 @@ suite('ID', () => { test('getMachineId', function () { return getMachineId().then(id => { - assert.ok(id); + assert.ok(/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/.test(id), `Expected a MAC address: ${id}`); }); }); }); \ No newline at end of file From baf3b60651bbfac50d8297b07e71240232316de9 Mon Sep 17 00:00:00 2001 From: Erich Gamma Date: Mon, 28 May 2018 11:09:16 +0200 Subject: [PATCH 11/12] Merge NPM Scripts: Added configuration option to change default click action #49282 --- extensions/npm/README.md | 3 ++- extensions/npm/package.json | 25 ++++++++++++++++++------- extensions/npm/package.nls.json | 1 + extensions/npm/src/main.ts | 5 +++++ extensions/npm/src/npmView.ts | 23 ++++++++++++++++++----- 5 files changed, 44 insertions(+), 13 deletions(-) diff --git a/extensions/npm/README.md b/extensions/npm/README.md index 1946e16a958..625002ee7ee 100644 --- a/extensions/npm/README.md +++ b/extensions/npm/README.md @@ -1,6 +1,6 @@ # Node npm -**Notice** This is a an extension that is bundled with Visual Studio Code. +**Notice** This is a an extension that is bundled with Visual Studio Code. This extension supports running npm scripts defined in the `package.json` as [tasks](https://code.visualstudio.com/docs/editor/tasks). Scripts with the name 'build', 'compile', or 'watch' are treated as build tasks. @@ -15,3 +15,4 @@ For more information about auto detection of Tasks pls see the [documentation](h - `npm.packageManager` the package manager used to run the scripts: `npm` or `yarn`, the default is `npm`. - `npm.exclude` glob patterns for folders that should be excluded from automatic script detection. The pattern is matched against the **absolute path** of the package.json. For example, to exclude all test folders use '**/test/**'. - `npm.enableScriptExplorer` enable an explorer view for npm scripts. +- `npm.scriptExplorerAction` the default click action: `open` or `run`, the default is `open`. diff --git a/extensions/npm/package.json b/extensions/npm/package.json index 80d97e225af..a57db1747a0 100644 --- a/extensions/npm/package.json +++ b/extensions/npm/package.json @@ -98,19 +98,20 @@ }, { "command": "npm.runScript", - "when": "view == npm && viewItem == script", - "group": "inline" + "when": "view == npm && viewItem == script", + "group": "inline" }, { "command": "npm.runScript", - "when": "view == npm && viewItem == debugScript", - "group": "inline" + "when": "view == npm && viewItem == debugScript", + "group": "inline" }, { "command": "npm.debugScript", - "when": "view == npm && viewItem == debugScript", - "group": "inline" - }, { + "when": "view == npm && viewItem == debugScript", + "group": "inline" + }, + { "command": "npm.debugScript", "when": "view == npm && viewItem == script", "group": "navigation@3" @@ -164,6 +165,16 @@ "default": false, "scope": "resource", "description": "%config.npm.enableScriptExplorer%" + }, + "npm.scriptExplorerAction": { + "type": "string", + "enum": [ + "open", + "run" + ], + "description": "%config.npm.scriptExplorerAction%", + "scope": "window", + "default": "open" } } }, diff --git a/extensions/npm/package.nls.json b/extensions/npm/package.nls.json index 19acf55d865..dedd7af6161 100644 --- a/extensions/npm/package.nls.json +++ b/extensions/npm/package.nls.json @@ -6,6 +6,7 @@ "config.npm.packageManager": "The package manager used to run scripts.", "config.npm.exclude": "Configure glob patterns for folders that should be excluded from automatic script detection.", "config.npm.enableScriptExplorer": "Enable an explorer view for npm scripts.", + "config.npm.scriptExplorerAction": "The default click action used in the scripts explorer: 'open' or 'run', the default is 'open'.", "npm.parseError": "Npm task detection: failed to parse the file {0}", "taskdef.script": "The npm script to customize.", "taskdef.path": "The path to the folder of the package.json file that provides the script. Can be omitted.", diff --git a/extensions/npm/src/main.ts b/extensions/npm/src/main.ts index 18db3890ef5..023fddbffb6 100644 --- a/extensions/npm/src/main.ts +++ b/extensions/npm/src/main.ts @@ -25,6 +25,11 @@ export async function activate(context: vscode.ExtensionContext): Promise treeDataProvider.refresh(); } } + if (e.affectsConfiguration('npm.scriptExplorerAction')) { + if (treeDataProvider) { + treeDataProvider.refresh(); + } + } }); context.subscriptions.push(addJSONProviders(httpRequest.xhr)); } diff --git a/extensions/npm/src/npmView.ts b/extensions/npm/src/npmView.ts index acdf930f907..db2e086d50a 100644 --- a/extensions/npm/src/npmView.ts +++ b/extensions/npm/src/npmView.ts @@ -65,23 +65,36 @@ class PackageJSON extends TreeItem { } } +type ExplorerCommands = 'open' | 'run'; + class NpmScript extends TreeItem { task: Task; package: PackageJSON; constructor(context: ExtensionContext, packageJson: PackageJSON, task: Task) { super(task.name, TreeItemCollapsibleState.None); + const command: ExplorerCommands = workspace.getConfiguration('npm').get('scriptExplorerAction') || 'open'; + + const commandList = { + 'open': { + title: 'Edit Script', + command: 'npm.openScript', + arguments: [this] + }, + 'run': { + title: 'Run Script', + command: 'npm.runScript', + arguments: [this] + } + }; this.contextValue = 'script'; if (task.group && task.group === TaskGroup.Rebuild) { this.contextValue = 'debugScript'; } this.package = packageJson; this.task = task; - this.command = { - title: 'Run Script', - command: 'npm.openScript', - arguments: [this] - }; + this.command = commandList[command]; + if (task.group && task.group === TaskGroup.Clean) { this.iconPath = { light: context.asAbsolutePath(path.join('resources', 'light', 'prepostscript.svg')), From 8a1f33d2bdef2d768067fb819e798d22e68e89ec Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 28 May 2018 11:19:27 +0200 Subject: [PATCH 12/12] fix #50560 --- src/vs/workbench/browser/parts/editor/textDiffEditor.ts | 4 ++++ src/vs/workbench/browser/parts/editor/textEditor.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index 50a3dfd9e8d..4f8987cb622 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -73,6 +73,10 @@ export class TextDiffEditor extends BaseTextEditor { })); } + protected getEditorViewStateStorage(): object { + return Object.create(null); // do not persist in storage as diff editors are never persisted + } + public getTitle(): string { if (this.input) { return this.input.getName(); diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 266e11fb960..262c1510987 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -51,7 +51,7 @@ export abstract class BaseTextEditor extends BaseEditor { id: string, @ITelemetryService telemetryService: ITelemetryService, @IInstantiationService private readonly _instantiationService: IInstantiationService, - @IStorageService storageService: IStorageService, + @IStorageService private storageService: IStorageService, @ITextResourceConfigurationService private readonly _configurationService: ITextResourceConfigurationService, @IThemeService protected themeService: IThemeService, @ITextFileService private readonly _textFileService: ITextFileService, @@ -59,11 +59,15 @@ export abstract class BaseTextEditor extends BaseEditor { ) { super(id, telemetryService, themeService); - this.editorViewStateMemento = new EditorViewStateMemento(this.getMemento(storageService, Scope.WORKSPACE), TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY, 100); + this.editorViewStateMemento = new EditorViewStateMemento(this.getEditorViewStateStorage(), TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY, 100); this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getValue(this.getResource())))); } + protected getEditorViewStateStorage(): object { + return this.getMemento(this.storageService, Scope.WORKSPACE); + } + protected get instantiationService(): IInstantiationService { return this._instantiationService; }