From 01292b41740349747ed2748cb7aefa7123f6e386 Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Tue, 11 Dec 2018 10:38:36 -0800 Subject: [PATCH 001/429] Add Git log, globalConfig, and tree diff API --- extensions/git/src/api/api1.ts | 40 +++++-- extensions/git/src/api/git.d.ts | 13 +++ extensions/git/src/git.ts | 161 +++++++++++++++++++++++++--- extensions/git/src/repository.ts | 33 ++++-- extensions/git/src/test/git.test.ts | 12 ++- 5 files changed, 226 insertions(+), 33 deletions(-) diff --git a/extensions/git/src/api/api1.ts b/extensions/git/src/api/api1.ts index 9469580d97b..9d8a5901786 100644 --- a/extensions/git/src/api/api1.ts +++ b/extensions/git/src/api/api1.ts @@ -5,7 +5,7 @@ import { Model } from '../model'; import { Repository as BaseRepository, Resource } from '../repository'; -import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, Ref, Submodule, Commit, Change, RepositoryUIState, Status } from './git'; +import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, Ref, Submodule, Commit, Change, RepositoryUIState, Status, GitLogOptions } from './git'; import { Event, SourceControlInputBox, Uri, SourceControl } from 'vscode'; import { mapEvent } from '../util'; @@ -76,6 +76,10 @@ export class ApiRepository implements Repository { return this._repository.setConfig(key, value); } + getGlobalConfig(key: string): Promise { + return this._repository.getGlobalConfig(key); + } + getObjectDetails(treeish: string, path: string): Promise<{ mode: string; object: string; size: number; }> { return this._repository.getObjectDetails(treeish, path); } @@ -104,28 +108,38 @@ export class ApiRepository implements Repository { return this._repository.diff(cached); } - diffWithHEAD(path: string): Promise { - return this._repository.diffWithHEAD(path); + diffWithHEAD(): Promise; + diffWithHEAD(path: string): Promise; + diffWithHEAD(path?: string): Promise { + return path ? this._repository.diffWithHEAD(path) : this._repository.diffWithHEAD(); } - diffWith(ref: string, path: string): Promise { - return this._repository.diffWith(ref, path); + diffWith(ref: string): Promise; + diffWith(ref: string, path: string): Promise; + diffWith(ref: string, path?: string): Promise { + return path ? this._repository.diffWith(ref, path) : this._repository.diffWith(ref); } - diffIndexWithHEAD(path: string): Promise { - return this._repository.diffIndexWithHEAD(path); + diffIndexWithHEAD(): Promise; + diffIndexWithHEAD(path: string): Promise; + diffIndexWithHEAD(path?: string): Promise { + return path ? this._repository.diffIndexWithHEAD(path) : this._repository.diffIndexWithHEAD(); } - diffIndexWith(ref: string, path: string): Promise { - return this._repository.diffIndexWith(ref, path); + diffIndexWith(ref: string): Promise; + diffIndexWith(ref: string, path: string): Promise; + diffIndexWith(ref: string, path?: string): Promise { + return path ? this._repository.diffIndexWith(ref, path) : this._repository.diffIndexWith(ref); } diffBlobs(object1: string, object2: string): Promise { return this._repository.diffBlobs(object1, object2); } - diffBetween(ref1: string, ref2: string, path: string): Promise { - return this._repository.diffBetween(ref1, ref2, path); + diffBetween(ref1: string, ref2: string): Promise; + diffBetween(ref1: string, ref2: string, path: string): Promise; + diffBetween(ref1: string, ref2: string, path?: string): Promise { + return path ? this._repository.diffBetween(ref1, ref2, path) : this._repository.diffBetween(ref1, ref2); } hashObject(data: string): Promise { @@ -179,6 +193,10 @@ export class ApiRepository implements Repository { push(remoteName?: string, branchName?: string, setUpstream: boolean = false): Promise { return this._repository.pushTo(remoteName, branchName, setUpstream); } + + getLog(options?: GitLogOptions): Promise { + return this._repository.getLog(options); + } } export class ApiGit implements Git { diff --git a/extensions/git/src/api/git.d.ts b/extensions/git/src/api/git.d.ts index 1b3ed4d2dec..ff6ce04ab99 100644 --- a/extensions/git/src/api/git.d.ts +++ b/extensions/git/src/api/git.d.ts @@ -41,6 +41,7 @@ export interface Commit { readonly hash: string; readonly message: string; readonly parents: string[]; + readonly authorEmail?: string | undefined; } export interface Submodule { @@ -109,6 +110,10 @@ export interface RepositoryUIState { readonly onDidChange: Event; } +export interface GitLogOptions { + readonly maxEntries?: number; +} + export interface Repository { readonly rootUri: Uri; @@ -119,6 +124,7 @@ export interface Repository { getConfigs(): Promise<{ key: string; value: string; }[]>; getConfig(key: string): Promise; setConfig(key: string, value: string): Promise; + getGlobalConfig(key: string): Promise; getObjectDetails(treeish: string, path: string): Promise<{ mode: string, object: string, size: number }>; detectObjectType(object: string): Promise<{ mimetype: string, encoding?: string }>; @@ -130,11 +136,16 @@ export interface Repository { apply(patch: string, reverse?: boolean): Promise; diff(cached?: boolean): Promise; + diffWithHEAD(): Promise; diffWithHEAD(path: string): Promise; + diffWith(ref: string): Promise; diffWith(ref: string, path: string): Promise; + diffIndexWithHEAD(): Promise; diffIndexWithHEAD(path: string): Promise; + diffIndexWith(ref: string): Promise; diffIndexWith(ref: string, path: string): Promise; diffBlobs(object1: string, object2: string): Promise; + diffBetween(ref1: string, ref2: string): Promise; diffBetween(ref1: string, ref2: string, path: string): Promise; hashObject(data: string): Promise; @@ -155,6 +166,8 @@ export interface Repository { fetch(remote?: string, ref?: string): Promise; pull(): Promise; push(remoteName?: string, branchName?: string, setUpstream?: boolean): Promise; + + getLog(options?: GitLogOptions): Promise; } export interface API { diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index 380ee42f411..d104d3cbdf4 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -12,9 +12,9 @@ import { EventEmitter } from 'events'; import iconv = require('iconv-lite'); import * as filetype from 'file-type'; import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent } from './util'; -import { CancellationToken } from 'vscode'; +import { CancellationToken, Uri } from 'vscode'; import { detectEncoding } from './encoding'; -import { Ref, RefType, Branch, Remote, GitErrorCodes } from './api/git'; +import { Ref, RefType, Branch, Remote, GitErrorCodes, GitLogOptions, Change, Status } from './api/git'; const readfile = denodeify(fs.readFile); @@ -311,6 +311,8 @@ function getGitErrorCode(stderr: string): string | undefined { return void 0; } +const COMMIT_FORMAT = '%H\n%ae\n%P\n%B'; + export class Git { readonly path: string; @@ -450,6 +452,7 @@ export interface Commit { hash: string; message: string; parents: string[]; + authorEmail?: string | undefined; } export class GitStatusParser { @@ -581,13 +584,13 @@ export function parseGitmodules(raw: string): Submodule[] { } export function parseGitCommit(raw: string): Commit | null { - const match = /^([0-9a-f]{40})\n(.*)\n([^]*)$/m.exec(raw.trim()); + const match = /^([0-9a-f]{40})\n(.*)\n(.*)\n([^]*)$/m.exec(raw.trim()); if (!match) { return null; } - const parents = match[2] ? match[2].split(' ') : []; - return { hash: match[1], message: match[3], parents }; + const parents = match[3] ? match[3].split(' ') : []; + return { hash: match[1], message: match[4], parents, authorEmail: match[2] }; } interface LsTreeElement { @@ -697,6 +700,38 @@ export class Repository { }); } + async getLog(options?: GitLogOptions): Promise { + const args = ['log']; + if (options) { + if (typeof options.maxEntries === 'number' && options.maxEntries > 0) { + args.push('-' + options.maxEntries); + } + } + + args.push(`--pretty=format:${COMMIT_FORMAT}%x00%x00`); + const gitResult = await this.run(args); + if (gitResult.exitCode) { + // An empty repo. + return []; + } + + const entries = gitResult.stdout.split('\x00\x00'); + const result: Commit[] = []; + for (let entry of entries) { + if (entry.startsWith('\n')) { + entry = entry.substring(1); + } + const commit = parseGitCommit(entry); + if (!commit) { + break; + } + + result.push(commit); + } + + return result; + } + async bufferString(object: string, encoding: string = 'utf8', autoGuessEncoding = false): Promise { const stdout = await this.buffer(object); @@ -851,25 +886,41 @@ export class Repository { return result.stdout; } - async diffWithHEAD(path: string): Promise { + async diffWithHEAD(path?: string): Promise { + if (!path) { + return await this.diffFiles(false); + } + const args = ['diff', '--', path]; const result = await this.run(args); return result.stdout; } - async diffWith(ref: string, path: string): Promise { + async diffWith(ref: string, path?: string): Promise { + if (!path) { + return await this.diffFiles(false, ref); + } + const args = ['diff', ref, '--', path]; const result = await this.run(args); return result.stdout; } - async diffIndexWithHEAD(path: string): Promise { + async diffIndexWithHEAD(path?: string): Promise { + if (!path) { + return await this.diffFiles(true); + } + const args = ['diff', '--cached', '--', path]; const result = await this.run(args); return result.stdout; } - async diffIndexWith(ref: string, path: string): Promise { + async diffIndexWith(ref: string, path?: string): Promise { + if (!path) { + return await this.diffFiles(true, ref); + } + const args = ['diff', '--cached', ref, '--', path]; const result = await this.run(args); return result.stdout; @@ -881,13 +932,99 @@ export class Repository { return result.stdout; } - async diffBetween(ref1: string, ref2: string, path: string): Promise { - const args = ['diff', `${ref1}...${ref2}`, '--', path]; + async diffBetween(ref1: string, ref2: string, path?: string): Promise { + const range = `${ref1}...${ref2}`; + if (!path) { + return await this.diffFiles(false, range); + } + + const args = ['diff', range, '--', path]; const result = await this.run(args); return result.stdout.trim(); } + private async diffFiles(cached: boolean, ref?: string): Promise { + const args = ['diff', '--name-status', '-z', '--diff-filter=ADMR']; + if (cached) { + args.push('--cached'); + } + + if (ref) { + args.push(ref); + } + + const gitResult = await this.run(args); + if (gitResult.exitCode) { + return []; + } + + const entries = gitResult.stdout.split('\x00'); + let index = 0; + const result: Change[] = []; + + entriesLoop: + while (index < entries.length - 1) { + const change = entries[index++]; + const resourcePath = entries[index++]; + if (!change || !resourcePath) { + break; + } + + const originalUri = Uri.file(path.isAbsolute(resourcePath) ? resourcePath : path.join(this.repositoryRoot, resourcePath)); + let status: Status = Status.UNTRACKED; + + // Copy or Rename status comes with a number, e.g. 'R100'. We don't need the number, so we use only first character of the status. + switch (change[0]) { + case 'M': + status = Status.MODIFIED; + break; + + case 'A': + status = Status.INDEX_ADDED; + break; + + case 'D': + status = Status.DELETED; + break; + + // Rename contains two paths, the second one is what the file is renamed/copied to. + case 'R': + if (index >= entries.length) { + break; + } + + const newPath = entries[index++]; + if (!newPath) { + break; + } + + const uri = Uri.file(path.isAbsolute(newPath) ? newPath : path.join(this.repositoryRoot, newPath)); + result.push({ + uri, + renameUri: uri, + originalUri, + status: Status.INDEX_RENAMED + }); + + continue; + + default: + // Unknown status + break entriesLoop; + } + + result.push({ + status, + originalUri, + uri: originalUri, + renameUri: originalUri, + }); + } + + return result; + } + async getMergeBase(ref1: string, ref2: string): Promise { const args = ['merge-base', ref1, ref2]; const result = await this.run(args); @@ -1529,7 +1666,7 @@ export class Repository { } async getCommit(ref: string): Promise { - const result = await this.run(['show', '-s', '--format=%H\n%P\n%B', ref]); + const result = await this.run(['show', '-s', `--format=${COMMIT_FORMAT}`, ref]); return parseGitCommit(result.stdout) || Promise.reject('bad commit format'); } diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index d188eea026e..e9650b905a7 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -13,7 +13,7 @@ import * as path from 'path'; import * as nls from 'vscode-nls'; import * as fs from 'fs'; import { StatusBarCommands } from './statusbar'; -import { Branch, Ref, Remote, RefType, GitErrorCodes, Status } from './api/git'; +import { Branch, Ref, Remote, RefType, GitErrorCodes, Status, GitLogOptions, Change } from './api/git'; const timeout = (millis: number) => new Promise(c => setTimeout(c, millis)); @@ -295,7 +295,8 @@ export const enum Operation { GetObjectDetails = 'GetObjectDetails', SubmoduleUpdate = 'SubmoduleUpdate', RebaseContinue = 'RebaseContinue', - Apply = 'Apply' + Apply = 'Apply', + Log = 'Log', } function isReadOnly(operation: Operation): boolean { @@ -697,10 +698,18 @@ export class Repository implements Disposable { return this.run(Operation.Config, () => this.repository.config('local', key)); } + getGlobalConfig(key: string): Promise { + return this.run(Operation.Config, () => this.repository.config('global', key)); + } + setConfig(key: string, value: string): Promise { return this.run(Operation.Config, () => this.repository.config('local', key, value)); } + getLog(options?: GitLogOptions): Promise { + return this.run(Operation.Log, () => this.repository.getLog(options)); + } + @throttle async status(): Promise { await this.run(Operation.Status); @@ -710,19 +719,27 @@ export class Repository implements Disposable { return this.run(Operation.Diff, () => this.repository.diff(cached)); } - diffWithHEAD(path: string): Promise { + diffWithHEAD(): Promise; + diffWithHEAD(path: string): Promise; + diffWithHEAD(path?: string | undefined): Promise { return this.run(Operation.Diff, () => this.repository.diffWithHEAD(path)); } - diffWith(ref: string, path: string): Promise { + diffWith(ref: string): Promise; + diffWith(ref: string, path: string): Promise; + diffWith(ref: string, path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffWith(ref, path)); } - diffIndexWithHEAD(path: string): Promise { + diffIndexWithHEAD(): Promise; + diffIndexWithHEAD(path: string): Promise; + diffIndexWithHEAD(path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffIndexWithHEAD(path)); } - diffIndexWith(ref: string, path: string): Promise { + diffIndexWith(ref: string): Promise; + diffIndexWith(ref: string, path: string): Promise; + diffIndexWith(ref: string, path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffIndexWith(ref, path)); } @@ -730,7 +747,9 @@ export class Repository implements Disposable { return this.run(Operation.Diff, () => this.repository.diffBlobs(object1, object2)); } - diffBetween(ref1: string, ref2: string, path: string): Promise { + diffBetween(ref1: string, ref2: string): Promise; + diffBetween(ref1: string, ref2: string, path: string): Promise; + diffBetween(ref1: string, ref2: string, path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffBetween(ref1, ref2, path)); } diff --git a/extensions/git/src/test/git.test.ts b/extensions/git/src/test/git.test.ts index 6b7af8c8684..e28cf10d192 100644 --- a/extensions/git/src/test/git.test.ts +++ b/extensions/git/src/test/git.test.ts @@ -177,37 +177,43 @@ suite('git', () => { suite('parseGitCommit', () => { test('single parent commit', function () { const GIT_OUTPUT_SINGLE_PARENT = `52c293a05038d865604c2284aa8698bd087915a1 +john.doe@mail.com 8e5a374372b8393906c7e380dbb09349c5385554 This is a commit message.`; assert.deepEqual(parseGitCommit(GIT_OUTPUT_SINGLE_PARENT), { hash: '52c293a05038d865604c2284aa8698bd087915a1', message: 'This is a commit message.', - parents: ['8e5a374372b8393906c7e380dbb09349c5385554'] + parents: ['8e5a374372b8393906c7e380dbb09349c5385554'], + authorEmail: 'john.doe@mail.com', }); }); test('multiple parent commits', function () { const GIT_OUTPUT_MULTIPLE_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1 +john.doe@mail.com 8e5a374372b8393906c7e380dbb09349c5385554 df27d8c75b129ab9b178b386077da2822101b217 This is a commit message.`; assert.deepEqual(parseGitCommit(GIT_OUTPUT_MULTIPLE_PARENTS), { hash: '52c293a05038d865604c2284aa8698bd087915a1', message: 'This is a commit message.', - parents: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217'] + parents: ['8e5a374372b8393906c7e380dbb09349c5385554', 'df27d8c75b129ab9b178b386077da2822101b217'], + authorEmail: 'john.doe@mail.com', }); }); test('no parent commits', function () { const GIT_OUTPUT_NO_PARENTS = `52c293a05038d865604c2284aa8698bd087915a1 +john.doe@mail.com This is a commit message.`; assert.deepEqual(parseGitCommit(GIT_OUTPUT_NO_PARENTS), { hash: '52c293a05038d865604c2284aa8698bd087915a1', message: 'This is a commit message.', - parents: [] + parents: [], + authorEmail: 'john.doe@mail.com', }); }); }); From 4c02c554ce5880822c4f5bcdc999466201d50850 Mon Sep 17 00:00:00 2001 From: Krish De Souza Date: Sat, 22 Dec 2018 09:39:52 +0530 Subject: [PATCH 002/429] Removed snapUpdate.sh and replaced with inline command +Simplifies the build process. +Avoids creating a new shell that simply spawns another shell environment. +Simplifies the update mechanism by removing the need to track the existence of snapUpdate.sh. +Keeps the logic for snapUpdate.sh close to updateService.snap.ts --- build/gulpfile.vscode.linux.js | 5 +---- resources/linux/snap/snapUpdate.sh | 3 --- .../update/electron-main/updateService.linux.ts | 6 ++++-- .../update/electron-main/updateService.snap.ts | 17 +++-------------- 4 files changed, 8 insertions(+), 23 deletions(-) delete mode 100755 resources/linux/snap/snapUpdate.sh diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 33972ba398b..2f823cdf705 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -203,13 +203,10 @@ function prepareSnapPackage(arch) { .pipe(replace('@@VERSION@@', commit.substr(0, 8))) .pipe(rename('snap/snapcraft.yaml')); - const snapUpdate = gulp.src('resources/linux/snap/snapUpdate.sh', { base: '.' }) - .pipe(rename(`usr/share/${product.applicationName}/snapUpdate.sh`)); - const electronLaunch = gulp.src('resources/linux/snap/electron-launch', { base: '.' }) .pipe(rename('electron-launch')); - const all = es.merge(desktop, icon, code, snapcraft, electronLaunch, snapUpdate); + const all = es.merge(desktop, icon, code, snapcraft, electronLaunch); return all.pipe(vfs.dest(destination)); }; diff --git a/resources/linux/snap/snapUpdate.sh b/resources/linux/snap/snapUpdate.sh deleted file mode 100755 index 77569bfc16a..00000000000 --- a/resources/linux/snap/snapUpdate.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -sleep 2 -$SNAP_NAME \ No newline at end of file diff --git a/src/vs/platform/update/electron-main/updateService.linux.ts b/src/vs/platform/update/electron-main/updateService.linux.ts index 7f4261df7ea..0d73ce81733 100644 --- a/src/vs/platform/update/electron-main/updateService.linux.ts +++ b/src/vs/platform/update/electron-main/updateService.linux.ts @@ -125,9 +125,11 @@ export class LinuxUpdateService extends AbstractUpdateService { } // Allow 3 seconds for VS Code to close - spawn('bash', ['-c', path.join(snap, `usr/share/${product.applicationName}/snapUpdate.sh`)], { + spawn('sleep 3 && $SNAP_NAME', { + shell: true, detached: true, - stdio: ['ignore', 'ignore', 'ignore'] + stdio: 'ignore', }); + } } diff --git a/src/vs/platform/update/electron-main/updateService.snap.ts b/src/vs/platform/update/electron-main/updateService.snap.ts index c11676fed4b..fa574427195 100644 --- a/src/vs/platform/update/electron-main/updateService.snap.ts +++ b/src/vs/platform/update/electron-main/updateService.snap.ts @@ -6,7 +6,6 @@ import { Event, Emitter } from 'vs/base/common/event'; import { timeout } from 'vs/base/common/async'; import { ILifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain'; -import product from 'vs/platform/node/product'; import { IUpdateService, State, StateType, AvailableForDownload, UpdateType } from 'vs/platform/update/common/update'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ILogService } from 'vs/platform/log/common/log'; @@ -14,7 +13,6 @@ import * as path from 'path'; import { realpath, watch } from 'fs'; import { spawn } from 'child_process'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { stat } from 'vs/base/node/pfs'; abstract class AbstractUpdateService2 implements IUpdateService { @@ -137,8 +135,6 @@ export class SnapUpdateService extends AbstractUpdateService2 { _serviceBrand: any; - private snapUpdatePath: string; - constructor( private snap: string, private snapRevision: string, @@ -149,8 +145,6 @@ export class SnapUpdateService extends AbstractUpdateService2 { ) { super(lifecycleService, environmentService, logService); - this.snapUpdatePath = path.join(this.snap, `usr/share/${product.applicationName}/snapUpdate.sh`); - const watcher = watch(path.dirname(this.snap)); const onChange = Event.fromNodeEventEmitter(watcher, 'change', (_, fileName: string) => fileName); const onCurrentChange = Event.filter(onChange, n => n === 'current'); @@ -196,19 +190,14 @@ export class SnapUpdateService extends AbstractUpdateService2 { this.logService.trace('update#quitAndInstall(): running raw#quitAndInstall()'); // Allow 3 seconds for VS Code to close - spawn('bash', ['-c', this.snapUpdatePath], { + spawn('sleep 3 && $SNAP_NAME', { + shell: true, detached: true, - stdio: ['ignore', 'ignore', 'ignore'] + stdio: 'ignore', }); } private async isUpdateAvailable(): Promise { - try { - await stat(this.snapUpdatePath); - } catch (err) { - return false; - } - const resolvedCurrentSnapPath = await new Promise((c, e) => realpath(`${path.dirname(this.snap)}/current`, (err, r) => err ? e(err) : c(r))); const currentRevision = path.basename(resolvedCurrentSnapPath); return this.snapRevision !== currentRevision; From d59b2965c175d63bf30f280688da6fc17d616d98 Mon Sep 17 00:00:00 2001 From: Pranshu Gupta Date: Thu, 27 Dec 2018 18:11:12 +0530 Subject: [PATCH 003/429] added strict null checks for findModel.test.ts --- src/vs/editor/contrib/find/test/findModel.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/editor/contrib/find/test/findModel.test.ts b/src/vs/editor/contrib/find/test/findModel.test.ts index bd93b102c43..c158d351627 100644 --- a/src/vs/editor/contrib/find/test/findModel.test.ts +++ b/src/vs/editor/contrib/find/test/findModel.test.ts @@ -1505,7 +1505,7 @@ suite('FindModel', () => { ] ); - editor.getModel().setValue('hello\nhi'); + editor!.getModel()!.setValue('hello\nhi'); assertFindState( editor, [1, 1, 1, 1], @@ -1536,7 +1536,7 @@ suite('FindModel', () => { findModel.selectAllMatches(); - assert.deepEqual(editor.getSelections().map(s => s.toString()), [ + assert.deepEqual(editor!.getSelections()!.map(s => s.toString()), [ new Selection(6, 14, 6, 19), new Selection(6, 27, 6, 32), new Selection(7, 14, 7, 19), @@ -1580,14 +1580,14 @@ suite('FindModel', () => { findModel.selectAllMatches(); - assert.deepEqual(editor.getSelections().map(s => s.toString()), [ + assert.deepEqual(editor!.getSelections()!.map(s => s.toString()), [ new Selection(7, 14, 7, 19), new Selection(6, 14, 6, 19), new Selection(6, 27, 6, 32), new Selection(8, 14, 8, 19) ].map(s => s.toString())); - assert.deepEqual(editor.getSelection().toString(), new Selection(7, 14, 7, 19).toString()); + assert.deepEqual(editor!.getSelection()!.toString(), new Selection(7, 14, 7, 19).toString()); assertFindState( editor, @@ -1982,7 +1982,7 @@ suite('FindModel', () => { for (let i = 0; i < 1100; i++) { initialText += 'line' + i + '\n'; } - editor.getModel().setValue(initialText); + editor!.getModel()!.setValue(initialText); let findState = new FindReplaceState(); findState.change({ searchString: '^', replaceString: 'a ', isRegex: true }, false); let findModel = new FindModelBoundToEditorModel(editor, findState); @@ -1994,7 +1994,7 @@ suite('FindModel', () => { expectedText += 'a line' + i + '\n'; } expectedText += 'a '; - assert.equal(editor.getModel().getValue(), expectedText); + assert.equal(editor!.getModel()!.getValue(), expectedText); findModel.dispose(); findState.dispose(); From 04c3dde6e49613d716dd16ef253c6351d8b5077d Mon Sep 17 00:00:00 2001 From: Ilya Biryukov Date: Mon, 7 Jan 2019 11:31:28 -0800 Subject: [PATCH 004/429] Address PR feedback on Git provide APIs --- extensions/git/src/api/api1.ts | 16 ++++++------ extensions/git/src/api/git.d.ts | 8 ++++-- extensions/git/src/git.ts | 44 ++++++++++++++++++++++---------- extensions/git/src/repository.ts | 11 +++++--- 4 files changed, 53 insertions(+), 26 deletions(-) diff --git a/extensions/git/src/api/api1.ts b/extensions/git/src/api/api1.ts index 9d8a5901786..769a646baeb 100644 --- a/extensions/git/src/api/api1.ts +++ b/extensions/git/src/api/api1.ts @@ -5,7 +5,7 @@ import { Model } from '../model'; import { Repository as BaseRepository, Resource } from '../repository'; -import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, Ref, Submodule, Commit, Change, RepositoryUIState, Status, GitLogOptions } from './git'; +import { InputBox, Git, API, Repository, Remote, RepositoryState, Branch, Ref, Submodule, Commit, Change, RepositoryUIState, Status, LogOptions } from './git'; import { Event, SourceControlInputBox, Uri, SourceControl } from 'vscode'; import { mapEvent } from '../util'; @@ -111,25 +111,25 @@ export class ApiRepository implements Repository { diffWithHEAD(): Promise; diffWithHEAD(path: string): Promise; diffWithHEAD(path?: string): Promise { - return path ? this._repository.diffWithHEAD(path) : this._repository.diffWithHEAD(); + return this._repository.diffWithHEAD(path); } diffWith(ref: string): Promise; diffWith(ref: string, path: string): Promise; diffWith(ref: string, path?: string): Promise { - return path ? this._repository.diffWith(ref, path) : this._repository.diffWith(ref); + return this._repository.diffWith(ref, path); } diffIndexWithHEAD(): Promise; diffIndexWithHEAD(path: string): Promise; diffIndexWithHEAD(path?: string): Promise { - return path ? this._repository.diffIndexWithHEAD(path) : this._repository.diffIndexWithHEAD(); + return this._repository.diffIndexWithHEAD(path); } diffIndexWith(ref: string): Promise; diffIndexWith(ref: string, path: string): Promise; diffIndexWith(ref: string, path?: string): Promise { - return path ? this._repository.diffIndexWith(ref, path) : this._repository.diffIndexWith(ref); + return this._repository.diffIndexWith(ref, path); } diffBlobs(object1: string, object2: string): Promise { @@ -139,7 +139,7 @@ export class ApiRepository implements Repository { diffBetween(ref1: string, ref2: string): Promise; diffBetween(ref1: string, ref2: string, path: string): Promise; diffBetween(ref1: string, ref2: string, path?: string): Promise { - return path ? this._repository.diffBetween(ref1, ref2, path) : this._repository.diffBetween(ref1, ref2); + return this._repository.diffBetween(ref1, ref2, path); } hashObject(data: string): Promise { @@ -194,8 +194,8 @@ export class ApiRepository implements Repository { return this._repository.pushTo(remoteName, branchName, setUpstream); } - getLog(options?: GitLogOptions): Promise { - return this._repository.getLog(options); + log(options?: LogOptions): Promise { + return this._repository.log(options); } } diff --git a/extensions/git/src/api/git.d.ts b/extensions/git/src/api/git.d.ts index ff6ce04ab99..c5e2b3bc9d2 100644 --- a/extensions/git/src/api/git.d.ts +++ b/extensions/git/src/api/git.d.ts @@ -110,7 +110,11 @@ export interface RepositoryUIState { readonly onDidChange: Event; } -export interface GitLogOptions { +/** + * Log options. + */ +export interface LogOptions { + /** Max number of log entries to retrieve. If not specified, the default is 32. */ readonly maxEntries?: number; } @@ -167,7 +171,7 @@ export interface Repository { pull(): Promise; push(remoteName?: string, branchName?: string, setUpstream?: boolean): Promise; - getLog(options?: GitLogOptions): Promise; + log(options?: LogOptions): Promise; } export interface API { diff --git a/extensions/git/src/git.ts b/extensions/git/src/git.ts index d104d3cbdf4..a06598f5974 100644 --- a/extensions/git/src/git.ts +++ b/extensions/git/src/git.ts @@ -14,7 +14,7 @@ import * as filetype from 'file-type'; import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent } from './util'; import { CancellationToken, Uri } from 'vscode'; import { detectEncoding } from './encoding'; -import { Ref, RefType, Branch, Remote, GitErrorCodes, GitLogOptions, Change, Status } from './api/git'; +import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git'; const readfile = denodeify(fs.readFile); @@ -700,33 +700,36 @@ export class Repository { }); } - async getLog(options?: GitLogOptions): Promise { - const args = ['log']; - if (options) { - if (typeof options.maxEntries === 'number' && options.maxEntries > 0) { - args.push('-' + options.maxEntries); - } - } - - args.push(`--pretty=format:${COMMIT_FORMAT}%x00%x00`); + async log(options?: LogOptions): Promise { + const maxEntries = options && typeof options.maxEntries === 'number' && options.maxEntries > 0 ? options.maxEntries : 32; + const args = ['log', '-' + maxEntries, `--pretty=format:${COMMIT_FORMAT}%x00%x00`]; const gitResult = await this.run(args); if (gitResult.exitCode) { // An empty repo. return []; } - const entries = gitResult.stdout.split('\x00\x00'); + const s = gitResult.stdout; const result: Commit[] = []; - for (let entry of entries) { + let index = 0; + while (index < s.length) { + let nextIndex = s.indexOf('\x00\x00', index); + if (nextIndex === -1) { + nextIndex = s.length; + } + + let entry = s.substr(index, nextIndex - index); if (entry.startsWith('\n')) { entry = entry.substring(1); } + const commit = parseGitCommit(entry); if (!commit) { break; } result.push(commit); + index = nextIndex + 2; } return result; @@ -886,7 +889,10 @@ export class Repository { return result.stdout; } - async diffWithHEAD(path?: string): Promise { + diffWithHEAD(): Promise; + diffWithHEAD(path: string): Promise; + diffWithHEAD(path?: string | undefined): Promise; + async diffWithHEAD(path?: string | undefined): Promise { if (!path) { return await this.diffFiles(false); } @@ -896,6 +902,9 @@ export class Repository { return result.stdout; } + diffWith(ref: string): Promise; + diffWith(ref: string, path: string): Promise; + diffWith(ref: string, path?: string | undefined): Promise; async diffWith(ref: string, path?: string): Promise { if (!path) { return await this.diffFiles(false, ref); @@ -906,6 +915,9 @@ export class Repository { return result.stdout; } + diffIndexWithHEAD(): Promise; + diffIndexWithHEAD(path: string): Promise; + diffIndexWithHEAD(path?: string | undefined): Promise; async diffIndexWithHEAD(path?: string): Promise { if (!path) { return await this.diffFiles(true); @@ -916,6 +928,9 @@ export class Repository { return result.stdout; } + diffIndexWith(ref: string): Promise; + diffIndexWith(ref: string, path: string): Promise; + diffIndexWith(ref: string, path?: string | undefined): Promise; async diffIndexWith(ref: string, path?: string): Promise { if (!path) { return await this.diffFiles(true, ref); @@ -932,6 +947,9 @@ export class Repository { return result.stdout; } + diffBetween(ref1: string, ref2: string): Promise; + diffBetween(ref1: string, ref2: string, path: string): Promise; + diffBetween(ref1: string, ref2: string, path?: string | undefined): Promise; async diffBetween(ref1: string, ref2: string, path?: string): Promise { const range = `${ref1}...${ref2}`; if (!path) { diff --git a/extensions/git/src/repository.ts b/extensions/git/src/repository.ts index e9650b905a7..dc3399e3ec9 100644 --- a/extensions/git/src/repository.ts +++ b/extensions/git/src/repository.ts @@ -13,7 +13,7 @@ import * as path from 'path'; import * as nls from 'vscode-nls'; import * as fs from 'fs'; import { StatusBarCommands } from './statusbar'; -import { Branch, Ref, Remote, RefType, GitErrorCodes, Status, GitLogOptions, Change } from './api/git'; +import { Branch, Ref, Remote, RefType, GitErrorCodes, Status, LogOptions, Change } from './api/git'; const timeout = (millis: number) => new Promise(c => setTimeout(c, millis)); @@ -706,8 +706,8 @@ export class Repository implements Disposable { return this.run(Operation.Config, () => this.repository.config('local', key, value)); } - getLog(options?: GitLogOptions): Promise { - return this.run(Operation.Log, () => this.repository.getLog(options)); + log(options?: LogOptions): Promise { + return this.run(Operation.Log, () => this.repository.log(options)); } @throttle @@ -721,24 +721,28 @@ export class Repository implements Disposable { diffWithHEAD(): Promise; diffWithHEAD(path: string): Promise; + diffWithHEAD(path?: string | undefined): Promise; diffWithHEAD(path?: string | undefined): Promise { return this.run(Operation.Diff, () => this.repository.diffWithHEAD(path)); } diffWith(ref: string): Promise; diffWith(ref: string, path: string): Promise; + diffWith(ref: string, path?: string | undefined): Promise; diffWith(ref: string, path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffWith(ref, path)); } diffIndexWithHEAD(): Promise; diffIndexWithHEAD(path: string): Promise; + diffIndexWithHEAD(path?: string | undefined): Promise; diffIndexWithHEAD(path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffIndexWithHEAD(path)); } diffIndexWith(ref: string): Promise; diffIndexWith(ref: string, path: string): Promise; + diffIndexWith(ref: string, path?: string | undefined): Promise; diffIndexWith(ref: string, path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffIndexWith(ref, path)); } @@ -749,6 +753,7 @@ export class Repository implements Disposable { diffBetween(ref1: string, ref2: string): Promise; diffBetween(ref1: string, ref2: string, path: string): Promise; + diffBetween(ref1: string, ref2: string, path?: string | undefined): Promise; diffBetween(ref1: string, ref2: string, path?: string): Promise { return this.run(Operation.Diff, () => this.repository.diffBetween(ref1, ref2, path)); } From b0e04e04c59a8d065d14c698d2531a31779ee01c Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Tue, 8 Jan 2019 16:20:38 -0800 Subject: [PATCH 005/429] Remove outdated ionic/angular support in HTML --- extensions/html-language-features/package.json | 14 -------------- extensions/html-language-features/package.nls.json | 2 -- 2 files changed, 16 deletions(-) diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index 78236179394..19f3cd2c904 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -131,20 +131,6 @@ ], "description": "%html.format.wrapAttributes.desc%" }, - "html.suggest.angular1": { - "deprecationMessage": "Angular 1 is obsolete and Angular completion will be removed.", - "type": "boolean", - "scope": "resource", - "default": false, - "description": "%html.suggest.angular1.desc%" - }, - "html.suggest.ionic": { - "deprecationMessage": "Ionic 1 is obsolete and Ionic completion will be removed.", - "type": "boolean", - "scope": "resource", - "default": false, - "description": "%html.suggest.ionic.desc%" - }, "html.suggest.html5": { "type": "boolean", "scope": "resource", diff --git a/extensions/html-language-features/package.nls.json b/extensions/html-language-features/package.nls.json index c6923ce881e..1f05175ed93 100644 --- a/extensions/html-language-features/package.nls.json +++ b/extensions/html-language-features/package.nls.json @@ -17,8 +17,6 @@ "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", - "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", - "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", "html.trace.server.desc": "Traces the communication between VS Code and the HTML language server.", "html.validate.scripts": "Controls whether the built-in HTML language support validates embedded scripts.", From ea59a710ca419d66063592b9efd97b0e361676b5 Mon Sep 17 00:00:00 2001 From: Romain Marcadier-Muller Date: Mon, 21 Jan 2019 16:22:36 -0800 Subject: [PATCH 006/429] Fix the "tsc watch" task when references are used Moves the `--watch` option at the end of the `tsc` invocation, as `--build` is required to be the first option on the call. Fixes #66875 --- extensions/typescript-language-features/src/features/task.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/typescript-language-features/src/features/task.ts b/extensions/typescript-language-features/src/features/task.ts index c71f3c4435d..a084fc9e495 100644 --- a/extensions/typescript-language-features/src/features/task.ts +++ b/extensions/typescript-language-features/src/features/task.ts @@ -197,7 +197,7 @@ class TscTaskProvider implements vscode.TaskProvider { project.workspaceFolder || vscode.TaskScope.Workspace, localize('buildAndWatchTscLabel', 'watch - {0}', label), 'tsc', - new vscode.ShellExecution(command, ['--watch', ...args]), + new vscode.ShellExecution(command, [...args, '--watch']), '$tsc-watch'); watchTask.group = vscode.TaskGroup.Build; watchTask.isBackground = true; @@ -272,4 +272,4 @@ export default class TypeScriptTaskProviderManager { this.taskProviderSub = vscode.workspace.registerTaskProvider('typescript', new TscTaskProvider(this.client)); } } -} \ No newline at end of file +} From 29d575b76ce092b5e913bcc496ba9ad082a09420 Mon Sep 17 00:00:00 2001 From: gangachris Date: Thu, 24 Jan 2019 13:44:51 +0100 Subject: [PATCH 007/429] correct message for global and snippet templates --- .../electron-browser/configureSnippets.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts b/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts index a545024ae54..57964993e2d 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts @@ -120,7 +120,7 @@ async function computePicks(snippetService: ISnippetsService, envService: IEnvir return { existing, future }; } -async function createGlobalSnippetFile(defaultPath: URI, windowService: IWindowService, notificationService: INotificationService, fileService: IFileService, opener: IOpenerService) { +async function createSnippetFile(scope: string, defaultPath: URI, windowService: IWindowService, notificationService: INotificationService, fileService: IFileService, opener: IOpenerService) { await fileService.createFolder(defaultPath); await timeout(100); // ensure quick pick closes... @@ -140,7 +140,7 @@ async function createGlobalSnippetFile(defaultPath: URI, windowService: IWindowS await fileService.updateContent(resource, [ '{', - '\t// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and ', + '\t// Place your ' + scope + ' snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and ', '\t// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope ', '\t// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is ', '\t// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: ', @@ -207,8 +207,12 @@ CommandsRegistry.registerCommand(id, async (accessor): Promise => { label: nls.localize('new.global', "New Global Snippets file..."), uri: URI.file(join(envService.appSettingsHome, 'snippets')) }]; + + type WorkspaceSnippetPick = IQuickPickItem & { uri: URI } & { name: string }; + const workspaceSnippetPicks: WorkspaceSnippetPick[] = []; for (const folder of workspaceService.getWorkspace().folders) { - globalSnippetPicks.push({ + workspaceSnippetPicks.push({ + name: folder.name, label: nls.localize('new.folder', "New Snippets file for '{0}'...", folder.name), uri: folder.toResource('.vscode') }); @@ -221,13 +225,15 @@ CommandsRegistry.registerCommand(id, async (accessor): Promise => { existing.push({ type: 'separator', label: nls.localize('new.global.sep', "New Snippets") }); } - const pick = await quickInputService.pick(([] as QuickPickInput[]).concat(existing, globalSnippetPicks, picks.future), { + const pick = await quickInputService.pick(([] as QuickPickInput[]).concat(existing, globalSnippetPicks, workspaceSnippetPicks, picks.future), { placeHolder: nls.localize('openSnippet.pickLanguage', "Select Snippets File or Create Snippets"), matchOnDescription: true }); if (globalSnippetPicks.indexOf(pick as GlobalSnippetPick) >= 0) { - return createGlobalSnippetFile((pick as GlobalSnippetPick).uri, windowService, notificationService, fileService, opener); + return createSnippetFile('global', (pick as GlobalSnippetPick).uri, windowService, notificationService, fileService, opener); + } else if (workspaceSnippetPicks.indexOf(pick as WorkspaceSnippetPick) >= 0) { + return createSnippetFile((pick as WorkspaceSnippetPick).name + ' workspace', (pick as WorkspaceSnippetPick).uri, windowService, notificationService, fileService, opener); } else if (ISnippetPick.is(pick)) { if (pick.hint) { await createLanguageSnippetFile(pick, fileService); From 6c7d1cc2bd8425085d602cd0071824abeb20a445 Mon Sep 17 00:00:00 2001 From: Dipen Ved Date: Fri, 25 Jan 2019 01:01:19 +0530 Subject: [PATCH 008/429] Making longDescription as absolute --- src/vs/workbench/parts/files/common/editors/fileEditorInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts b/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts index 660e206385d..78c08b20065 100644 --- a/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts @@ -140,7 +140,7 @@ export class FileEditorInput extends EditorInput implements IFileEditorInput { @memoize private get longDescription(): string { - return this.labelService.getUriLabel(resources.dirname(this.resource), { relative: true }); + return this.labelService.getUriLabel(resources.dirname(this.resource)); } getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string { From 4d20887762be6a060ffaa2363b448a35e3ea92d4 Mon Sep 17 00:00:00 2001 From: Scott Craig Date: Fri, 25 Jan 2019 13:48:56 -0500 Subject: [PATCH 009/429] Fix settings centering issue --- .../parts/preferences/electron-browser/media/settingsEditor2.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css b/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css index 5acd2d73baf..a29751e89bd 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css +++ b/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css @@ -113,7 +113,6 @@ text-decoration: underline; } -.settings-editor.no-toc-search > .settings-body .settings-tree-container .monaco-list-rows, .settings-editor.narrow-width > .settings-body .settings-tree-container .monaco-list-rows { margin-left: 0px; } From a6369781746ae12dd76bcbf77e9796a924246d9a Mon Sep 17 00:00:00 2001 From: al Date: Sun, 27 Jan 2019 02:09:44 +0300 Subject: [PATCH 010/429] Move cursor inside braces --- src/vs/workbench/api/common/configurationExtensionPoint.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/workbench/api/common/configurationExtensionPoint.ts b/src/vs/workbench/api/common/configurationExtensionPoint.ts index 151bc66d10a..596500d9c4c 100644 --- a/src/vs/workbench/api/common/configurationExtensionPoint.ts +++ b/src/vs/workbench/api/common/configurationExtensionPoint.ts @@ -84,7 +84,6 @@ const defaultConfigurationExtPoint = ExtensionsRegistry.registerExtensionPoint Date: Sun, 27 Jan 2019 22:25:09 +0530 Subject: [PATCH 011/429] Resolve vars in text for sendSequence to Terminal --- .../terminal/electron-browser/terminalActions.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index c77fbe34407..477670b053c 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -30,6 +30,9 @@ import { Command } from 'vs/editor/browser/editorExtensions'; import { timeout } from 'vs/base/common/async'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; +import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; +import { IHistoryService } from 'vs/workbench/services/history/common/history'; +import { Schemas } from 'vs/base/common/network'; export const TERMINAL_PICKER_PREFIX = 'term '; @@ -285,7 +288,16 @@ export class SendSequenceTerminalCommand extends Command { if (!terminalInstance) { return; } - terminalInstance.sendText(args.text, false); + + const configurationResolverService = accessor.get(IConfigurationResolverService); + + const workspaceContextService = accessor.get(IWorkspaceContextService); + const historyService = accessor.get(IHistoryService); + const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.file); + const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; + + const resolvedText = configurationResolverService.resolve(lastActiveWorkspaceRoot, args.text); + terminalInstance.sendText(resolvedText, false); } } From 0562d28586c7c8e835ec8431a65f69f30559f0c9 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 11:32:15 +0100 Subject: [PATCH 012/429] fixes #67188 --- src/vs/editor/contrib/referenceSearch/referencesTree.ts | 9 ++++++++- .../editor/contrib/referenceSearch/referencesWidget.ts | 7 ++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/referenceSearch/referencesTree.ts b/src/vs/editor/contrib/referenceSearch/referencesTree.ts index e9282d70092..296d55db965 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesTree.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesTree.ts @@ -20,7 +20,7 @@ import { escape } from 'vs/base/common/strings'; import { Disposable } from 'vs/base/common/lifecycle'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { IListVirtualDelegate, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; +import { IListVirtualDelegate, IKeyboardNavigationLabelProvider, IIdentityProvider } from 'vs/base/browser/ui/list/list'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { basename } from 'vs/base/common/paths'; @@ -93,6 +93,13 @@ export class StringRepresentationProvider implements IKeyboardNavigationLabelPro } } +export class IdentityProvider implements IIdentityProvider { + + getId(element: TreeElement): { toString(): string; } { + return element.id; + } +} + //#region render: File class FileReferencesTemplate extends Disposable { diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index 1b4bfd87b19..1978ad1e501 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -21,7 +21,7 @@ import { IModelDeltaDecoration, TrackedRangeStickiness } from 'vs/editor/common/ import { ModelDecorationOptions, TextModel } from 'vs/editor/common/model/textModel'; import { Location } from 'vs/editor/common/modes'; import { ITextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService'; -import { AriaProvider, DataSource, Delegate, FileReferencesRenderer, OneReferenceRenderer, TreeElement, StringRepresentationProvider } from 'vs/editor/contrib/referenceSearch/referencesTree'; +import { AriaProvider, DataSource, Delegate, FileReferencesRenderer, OneReferenceRenderer, TreeElement, StringRepresentationProvider, IdentityProvider } from 'vs/editor/contrib/referenceSearch/referencesTree'; import * as nls from 'vs/nls'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -358,11 +358,12 @@ export class ReferenceWidget extends PeekViewWidget { this._instantiationService.createInstance(OneReferenceRenderer), ]; - const treeOptions = { + const treeOptions: IAsyncDataTreeOptions = { ariaLabel: nls.localize('treeAriaLabel', "References"), keyboardSupport: this._defaultTreeKeyboardSupport, accessibilityProvider: new AriaProvider(), - keyboardNavigationLabelProvider: this._instantiationService.createInstance(StringRepresentationProvider) + keyboardNavigationLabelProvider: this._instantiationService.createInstance(StringRepresentationProvider), + identityProvider: new IdentityProvider() }; const treeDataSource = this._instantiationService.createInstance(DataSource); From 366bfe96bf2fe4cff37de895c3fa2ccb776eb621 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 28 Jan 2019 11:49:44 +0100 Subject: [PATCH 013/429] Add dependsOn to task JSON schema for customized tasks Fixes #63874 --- src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts index f2a5ff58613..17b87290553 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts @@ -341,6 +341,7 @@ let taskConfiguration: IJSONSchema = { description: nls.localize('JsonSchema.tasks.matchers', 'The problem matcher(s) to use. Can either be a string or a problem matcher definition or an array of strings and problem matchers.') }, runOptions: Objects.deepClone(runOptions), + dependsOn: Objects.deepClone(dependsOn), } }; From 392d0bee87fda7e5e16662e15fde1a6492c1ffca Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 Jan 2019 12:03:18 +0100 Subject: [PATCH 014/429] Fix converting of URL to request options (fixes #66892) --- .../services/extensions/node/proxyResolver.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/extensions/node/proxyResolver.ts b/src/vs/workbench/services/extensions/node/proxyResolver.ts index c330eb973a2..c954a089f1d 100644 --- a/src/vs/workbench/services/extensions/node/proxyResolver.ts +++ b/src/vs/workbench/services/extensions/node/proxyResolver.ts @@ -233,14 +233,17 @@ function patches(originals: typeof http | typeof https, agent: http.Agent, setti if (!options.socketPath && (config === 'override' || config === 'on' && !options.agent) && options.agent !== agent) { if (url) { - const parsed = typeof url === 'string' ? nodeurl.parse(url) : url; - options = { + const parsed = typeof url === 'string' ? new nodeurl.URL(url) : url; + const urlOptions = { protocol: parsed.protocol, - hostname: parsed.hostname, + hostname: parsed.hostname.lastIndexOf('[', 0) === 0 ? parsed.hostname.slice(1, -1) : parsed.hostname, port: parsed.port, - path: parsed.pathname, - ...options + path: `${parsed.pathname}${parsed.search}` }; + if (parsed.username || parsed.password) { + options.auth = `${parsed.username}:${parsed.password}`; + } + options = { ...urlOptions, ...options }; } else { options = { ...options }; } From 5974c2ecaab418fe22e2340eacbbdc8eb2ccfec4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 28 Jan 2019 12:05:22 +0100 Subject: [PATCH 015/429] move ui extensions to product json --- .../node/extensionManagementService.ts | 3 +- .../node/multiExtensionManagement.ts | 3 +- .../platform/extensions/common/extensions.ts | 37 +---------------- .../extensions/node/extensionsUtil.ts | 40 +++++++++++++++++++ src/vs/platform/node/product.ts | 1 + .../node/extensionsWorkbenchService.ts | 3 +- 6 files changed, 48 insertions(+), 39 deletions(-) create mode 100644 src/vs/platform/extensions/node/extensionsUtil.ts diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index b3656aee654..ab6982abed3 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -44,8 +44,9 @@ import { Schemas } from 'vs/base/common/network'; import { CancellationToken } from 'vs/base/common/cancellation'; import { getPathFromAmdModule } from 'vs/base/common/amd'; import { getManifest } from 'vs/platform/extensionManagement/node/extensionManagementUtil'; -import { IExtensionManifest, ExtensionType, ExtensionIdentifierWithVersion, isUIExtension } from 'vs/platform/extensions/common/extensions'; +import { IExtensionManifest, ExtensionType, ExtensionIdentifierWithVersion } from 'vs/platform/extensions/common/extensions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { isUIExtension } from 'vs/platform/extensions/node/extensionsUtil'; const ERROR_SCANNING_SYS_EXTENSIONS = 'scanningSystem'; const ERROR_SCANNING_USER_EXTENSIONS = 'scanningUser'; diff --git a/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts b/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts index 2e1ea397eb5..f5764c324d9 100644 --- a/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts +++ b/src/vs/platform/extensionManagement/node/multiExtensionManagement.ts @@ -9,7 +9,7 @@ import { IExtensionManagementServerService, IExtensionManagementServer, IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { flatten } from 'vs/base/common/arrays'; -import { isUIExtension, ExtensionType, IExtensionManifest } from 'vs/platform/extensions/common/extensions'; +import { ExtensionType, IExtensionManifest } from 'vs/platform/extensions/common/extensions'; import { URI } from 'vs/base/common/uri'; import { Disposable } from 'vs/base/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -19,6 +19,7 @@ import { getManifest } from 'vs/platform/extensionManagement/node/extensionManag import { ILogService } from 'vs/platform/log/common/log'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { localize } from 'vs/nls'; +import { isUIExtension } from 'vs/platform/extensions/node/extensionsUtil'; export class MultiExtensionManagementService extends Disposable implements IExtensionManagementService { diff --git a/src/vs/platform/extensions/common/extensions.ts b/src/vs/platform/extensions/common/extensions.ts index e00d3ed9d5f..1fc3e1913be 100644 --- a/src/vs/platform/extensions/common/extensions.ts +++ b/src/vs/platform/extensions/common/extensions.ts @@ -3,10 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { getGalleryExtensionId, areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import * as strings from 'vs/base/common/strings'; -import { isNonEmptyArray } from 'vs/base/common/arrays'; import { ILocalization } from 'vs/platform/localizations/common/localizations'; import { URI } from 'vs/base/common/uri'; @@ -174,39 +172,6 @@ export interface IExtension { readonly location: URI; } -const uiExtensions = new Set(); -uiExtensions.add('msjsdiag.debugger-for-chrome'); - -export function isUIExtension(manifest: IExtensionManifest, configurationService: IConfigurationService): boolean { - const extensionId = getGalleryExtensionId(manifest.publisher, manifest.name); - const configuredUIExtensions = configurationService.getValue('_workbench.uiExtensions') || []; - if (configuredUIExtensions.length) { - if (configuredUIExtensions.indexOf(extensionId) !== -1) { - return true; - } - if (configuredUIExtensions.indexOf(`-${extensionId}`) !== -1) { - return false; - } - } - switch (manifest.extensionKind) { - case 'ui': return true; - case 'workspace': return false; - default: { - if (uiExtensions.has(extensionId)) { - return true; - } - if (manifest.main) { - return false; - } - if (manifest.contributes && isNonEmptyArray(manifest.contributes.debuggers)) { - return false; - } - // Default is UI Extension - return true; - } - } -} - /** * **!Do not construct directly!** * diff --git a/src/vs/platform/extensions/node/extensionsUtil.ts b/src/vs/platform/extensions/node/extensionsUtil.ts new file mode 100644 index 00000000000..5041bf9577e --- /dev/null +++ b/src/vs/platform/extensions/node/extensionsUtil.ts @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IExtensionManifest } from 'vs/platform/extensions/common/extensions'; +import { getGalleryExtensionId, areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; +import { isNonEmptyArray } from 'vs/base/common/arrays'; +import product from 'vs/platform/node/product'; + +export function isUIExtension(manifest: IExtensionManifest, configurationService: IConfigurationService): boolean { + const extensionId = getGalleryExtensionId(manifest.publisher, manifest.name); + const configuredUIExtensions = configurationService.getValue('_workbench.uiExtensions') || []; + if (configuredUIExtensions.length) { + if (configuredUIExtensions.indexOf(extensionId) !== -1) { + return true; + } + if (configuredUIExtensions.indexOf(`-${extensionId}`) !== -1) { + return false; + } + } + switch (manifest.extensionKind) { + case 'ui': return true; + case 'workspace': return false; + default: { + if (isNonEmptyArray(product.uiExtensions) && product.uiExtensions.some(id => areSameExtensions({ id }, { id: extensionId }))) { + return true; + } + if (manifest.main) { + return false; + } + if (manifest.contributes && isNonEmptyArray(manifest.contributes.debuggers)) { + return false; + } + // Default is UI Extension + return true; + } + } +} diff --git a/src/vs/platform/node/product.ts b/src/vs/platform/node/product.ts index dbb84fd473f..08b8b607e2b 100644 --- a/src/vs/platform/node/product.ts +++ b/src/vs/platform/node/product.ts @@ -80,6 +80,7 @@ export interface IProductConfiguration { }; logUploaderUrl: string; portable?: string; + uiExtensions?: string[]; } export interface ISurveyData { diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 58ed50763e3..167b592c380 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -34,7 +34,8 @@ import * as resources from 'vs/base/common/resources'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IFileService } from 'vs/platform/files/common/files'; -import { IExtensionManifest, ExtensionType, ExtensionIdentifierWithVersion, IExtension as IPlatformExtension, isUIExtension } from 'vs/platform/extensions/common/extensions'; +import { IExtensionManifest, ExtensionType, ExtensionIdentifierWithVersion, IExtension as IPlatformExtension } from 'vs/platform/extensions/common/extensions'; +import { isUIExtension } from 'vs/platform/extensions/node/extensionsUtil'; interface IExtensionStateProvider { (extension: Extension): T; From 8b7f1ed1e7268f2974e333f599f55e3604286f5b Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 28 Jan 2019 12:05:22 +0100 Subject: [PATCH 016/429] update extension, #64376 --- build/builtInExtensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 368480b1118..1ce94db95eb 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -31,7 +31,7 @@ }, { "name": "ms-vscode.references-view", - "version": "0.0.23", + "version": "0.0.24", "repo": "https://github.com/Microsoft/vscode-reference-view", "metadata": { "id": "dc489f46-520d-4556-ae85-1f9eab3c412d", From d0ba2734fa9636c288a099e13e9a9802ed12da18 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 28 Jan 2019 12:06:00 +0100 Subject: [PATCH 017/429] make sure to invoke command with correct argument types, #64376 --- src/vs/workbench/api/node/extHostCommands.ts | 31 +++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostCommands.ts b/src/vs/workbench/api/node/extHostCommands.ts index 8a6b94a362d..4e91ca97d00 100644 --- a/src/vs/workbench/api/node/extHostCommands.ts +++ b/src/vs/workbench/api/node/extHostCommands.ts @@ -15,6 +15,9 @@ import * as modes from 'vs/editor/common/modes'; import * as vscode from 'vscode'; import { ILogService } from 'vs/platform/log/common/log'; import { revive } from 'vs/base/common/marshalling'; +import { Range } from 'vs/editor/common/core/range'; +import { Position } from 'vs/editor/common/core/position'; +import { URI } from 'vs/base/common/uri'; interface CommandHandler { callback: Function; @@ -42,7 +45,33 @@ export class ExtHostCommands implements ExtHostCommandsShape { this._proxy = mainContext.getProxy(MainContext.MainThreadCommands); this._logService = logService; this._converter = new CommandsConverter(this, heapService); - this._argumentProcessors = [{ processArgument(a) { return revive(a, 0); } }]; + this._argumentProcessors = [ + { + processArgument(a) { + // URI, Regex + return revive(a, 0); + } + }, + { + processArgument(arg) { + return cloneAndChange(arg, function (obj) { + // Reverse of https://github.com/Microsoft/vscode/blob/1f28c5fc681f4c01226460b6d1c7e91b8acb4a5b/src/vs/workbench/api/node/extHostCommands.ts#L112-L127 + if (Range.isIRange(obj)) { + return extHostTypeConverter.Range.to(obj); + } + if (Position.isIPosition(obj)) { + return extHostTypeConverter.Position.to(obj); + } + if (Range.isIRange((obj as modes.Location).range) && URI.isUri((obj as modes.Location).uri)) { + return extHostTypeConverter.location.to(obj); + } + if (!Array.isArray(obj)) { + return obj; + } + }); + } + } + ]; } get converter(): CommandsConverter { From 80a1a06e715b402ca8cd1641108611e150a49984 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 28 Jan 2019 12:11:54 +0100 Subject: [PATCH 018/429] Add a task lifecycle event for when a depends on task is started (#67221) Fixes #66561 --- .../parts/debug/electron-browser/debugService.ts | 2 +- src/vs/workbench/parts/tasks/common/tasks.ts | 3 ++- .../parts/tasks/electron-browser/terminalTaskSystem.ts | 9 +++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 8e930b91103..1ec06113de4 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -716,7 +716,7 @@ export class DebugService implements IDebugService { // task is already running - nothing to do. return Promise.resolve(null); } - once(e => e.kind === TaskEventKind.Active && e.taskId === task._id, this.taskService.onDidStateChange)(() => { + once(e => ((e.kind === TaskEventKind.Active) || (e.kind === TaskEventKind.DependsOnStarted)) && e.taskId === task._id, this.taskService.onDidStateChange)(() => { // Task is active, so everything seems to be fine, no need to prompt after 10 seconds // Use case being a slow running task should not be prompted even though it takes more than 10 seconds taskStarted = true; diff --git a/src/vs/workbench/parts/tasks/common/tasks.ts b/src/vs/workbench/parts/tasks/common/tasks.ts index 98128bbbfea..3b9248543fc 100644 --- a/src/vs/workbench/parts/tasks/common/tasks.ts +++ b/src/vs/workbench/parts/tasks/common/tasks.ts @@ -836,6 +836,7 @@ export class TaskSorter { } export const enum TaskEventKind { + DependsOnStarted = 'dependsOnStarted', Start = 'start', ProcessStarted = 'processStarted', Active = 'active', @@ -871,7 +872,7 @@ export const enum TaskRunSource { export namespace TaskEvent { export function create(kind: TaskEventKind.ProcessStarted | TaskEventKind.ProcessEnded, task: Task, processIdOrExitCode: number): TaskEvent; - export function create(kind: TaskEventKind.Start | TaskEventKind.Active | TaskEventKind.Inactive | TaskEventKind.Terminated | TaskEventKind.End, task: Task): TaskEvent; + export function create(kind: TaskEventKind.DependsOnStarted | TaskEventKind.Start | TaskEventKind.Active | TaskEventKind.Inactive | TaskEventKind.Terminated | TaskEventKind.End, task: Task): TaskEvent; export function create(kind: TaskEventKind.Changed): TaskEvent; export function create(kind: TaskEventKind, task?: Task, processIdOrExitCode?: number): TaskEvent { if (task) { diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 7dac1287f27..305d2c05c46 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -314,12 +314,13 @@ export class TerminalTaskSystem implements ITaskSystem { let promises: Promise[] = []; if (task.configurationProperties.dependsOn) { task.configurationProperties.dependsOn.forEach((dependency) => { - let task = resolver.resolve(dependency.workspaceFolder, dependency.task!); - if (task) { - let key = task.getMapKey(); + let dependencyTask = resolver.resolve(dependency.workspaceFolder, dependency.task!); + if (dependencyTask) { + let key = dependencyTask.getMapKey(); let promise = this.activeTasks[key] ? this.activeTasks[key].promise : undefined; if (!promise) { - promise = this.executeTask(task, resolver, trigger); + this._onDidStateChange.fire(TaskEvent.create(TaskEventKind.DependsOnStarted, task)); + promise = this.executeTask(dependencyTask, resolver, trigger); } promises.push(promise); } else { From a584b902638e4573a909646d59662817d432c165 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 28 Jan 2019 12:21:00 +0100 Subject: [PATCH 019/429] Improve description of task presentation silent. Fixes #65701 --- src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts index 17b87290553..ad8290e168e 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts @@ -105,7 +105,7 @@ const presentation: IJSONSchema = { enum: ['always', 'silent', 'never'], enumDescriptions: [ nls.localize('JsonSchema.tasks.presentation.reveal.always', 'Always reveals the terminal when this task is executed.'), - nls.localize('JsonSchema.tasks.presentation.reveal.silent', 'Only reveals the terminal if no problem matcher is associated with the task and an errors occurs executing it.'), + nls.localize('JsonSchema.tasks.presentation.reveal.silent', 'Only reveals the terminal if the task exits with an error.'), nls.localize('JsonSchema.tasks.presentation.reveal.never', 'Never reveals the terminal when this task is executed.'), ], default: 'always', From 0443e4c95d1a1d473ee5c8cf512de5408af7e034 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 Jan 2019 12:28:38 +0100 Subject: [PATCH 020/429] Refactor fix for #65118 --- .../services/extensions/node/proxyResolver.ts | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/services/extensions/node/proxyResolver.ts b/src/vs/workbench/services/extensions/node/proxyResolver.ts index c954a089f1d..6e3ebb2bc65 100644 --- a/src/vs/workbench/services/extensions/node/proxyResolver.ts +++ b/src/vs/workbench/services/extensions/node/proxyResolver.ts @@ -24,14 +24,14 @@ export function connectProxyResolver( extHostLogService: ExtHostLogService, mainThreadTelemetry: MainThreadTelemetryShape ) { - const agent = createProxyAgent(extHostWorkspace, configProvider, extHostLogService, mainThreadTelemetry); - const lookup = createPatchedModules(configProvider, agent); + const agents = createProxyAgents(extHostWorkspace, configProvider, extHostLogService, mainThreadTelemetry); + const lookup = createPatchedModules(configProvider, agents); return configureModuleLoading(extensionService, lookup); } const maxCacheEntries = 5000; // Cache can grow twice that much due to 'oldCache'. -function createProxyAgent( +function createProxyAgents( extHostWorkspace: ExtHostWorkspace, configProvider: ExtHostConfigProvider, extHostLogService: ExtHostLogService, @@ -156,7 +156,11 @@ function createProxyAgent( }); } - return new ProxyAgent({ resolveProxy }); + const httpAgent: http.Agent = new ProxyAgent({ resolveProxy }); + (httpAgent).defaultPort = 80; + const httpsAgent: http.Agent = new ProxyAgent({ resolveProxy }); + (httpsAgent).defaultPort = 443; + return { http: httpAgent, https: httpsAgent }; } function proxyFromConfigURL(configURL: string) { @@ -177,7 +181,7 @@ function proxyFromConfigURL(configURL: string) { return undefined; } -function createPatchedModules(configProvider: ExtHostConfigProvider, agent: http.Agent) { +function createPatchedModules(configProvider: ExtHostConfigProvider, agents: { http: http.Agent; https: http.Agent; }) { const setting = { config: configProvider.getConfiguration('http') .get('proxySupport') || 'off' @@ -189,25 +193,23 @@ function createPatchedModules(configProvider: ExtHostConfigProvider, agent: http return { http: { - off: assign({}, http, patches(http, agent, { config: 'off' }, true)), - on: assign({}, http, patches(http, agent, { config: 'on' }, true)), - override: assign({}, http, patches(http, agent, { config: 'override' }, true)), - onRequest: assign({}, http, patches(http, agent, setting, true)), - default: assign(http, patches(http, agent, setting, false)) // run last + off: assign({}, http, patches(http, agents.http, { config: 'off' }, true)), + on: assign({}, http, patches(http, agents.http, { config: 'on' }, true)), + override: assign({}, http, patches(http, agents.http, { config: 'override' }, true)), + onRequest: assign({}, http, patches(http, agents.http, setting, true)), + default: assign(http, patches(http, agents.http, setting, false)) // run last }, https: { - off: assign({}, https, patches(https, agent, { config: 'off' }, true)), - on: assign({}, https, patches(https, agent, { config: 'on' }, true)), - override: assign({}, https, patches(https, agent, { config: 'override' }, true)), - onRequest: assign({}, https, patches(https, agent, setting, true)), - default: assign(https, patches(https, agent, setting, false)) // run last + off: assign({}, https, patches(https, agents.https, { config: 'off' }, true)), + on: assign({}, https, patches(https, agents.https, { config: 'on' }, true)), + override: assign({}, https, patches(https, agents.https, { config: 'override' }, true)), + onRequest: assign({}, https, patches(https, agents.https, setting, true)), + default: assign(https, patches(https, agents.https, setting, false)) // run last } }; } function patches(originals: typeof http | typeof https, agent: http.Agent, setting: { config: string; }, onRequest: boolean) { - const defaultPort = originals === https ? 443 : 80; - return { get: patch(originals.get), request: patch(originals.request) @@ -248,7 +250,6 @@ function patches(originals: typeof http | typeof https, agent: http.Agent, setti options = { ...options }; } options.agent = agent; - options.defaultPort = defaultPort; // Lets Node's http module omit the port, if it is the default port, in the Host header. (https://github.com/Microsoft/vscode/issues/65118) return original(options, callback); } From 7d90c4836e4594e98bd6da1d33cfb47ae2d7a71e Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 Jan 2019 12:50:47 +0100 Subject: [PATCH 021/429] Refactor fix for #65118 --- .../services/extensions/node/proxyResolver.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vs/workbench/services/extensions/node/proxyResolver.ts b/src/vs/workbench/services/extensions/node/proxyResolver.ts index 6e3ebb2bc65..4a8df829c28 100644 --- a/src/vs/workbench/services/extensions/node/proxyResolver.ts +++ b/src/vs/workbench/services/extensions/node/proxyResolver.ts @@ -193,23 +193,23 @@ function createPatchedModules(configProvider: ExtHostConfigProvider, agents: { h return { http: { - off: assign({}, http, patches(http, agents.http, { config: 'off' }, true)), - on: assign({}, http, patches(http, agents.http, { config: 'on' }, true)), - override: assign({}, http, patches(http, agents.http, { config: 'override' }, true)), - onRequest: assign({}, http, patches(http, agents.http, setting, true)), - default: assign(http, patches(http, agents.http, setting, false)) // run last + off: assign({}, http, patches(http, agents.http, agents.https, { config: 'off' }, true)), + on: assign({}, http, patches(http, agents.http, agents.https, { config: 'on' }, true)), + override: assign({}, http, patches(http, agents.http, agents.https, { config: 'override' }, true)), + onRequest: assign({}, http, patches(http, agents.http, agents.https, setting, true)), + default: assign(http, patches(http, agents.http, agents.https, setting, false)) // run last }, https: { - off: assign({}, https, patches(https, agents.https, { config: 'off' }, true)), - on: assign({}, https, patches(https, agents.https, { config: 'on' }, true)), - override: assign({}, https, patches(https, agents.https, { config: 'override' }, true)), - onRequest: assign({}, https, patches(https, agents.https, setting, true)), - default: assign(https, patches(https, agents.https, setting, false)) // run last + off: assign({}, https, patches(https, agents.https, agents.http, { config: 'off' }, true)), + on: assign({}, https, patches(https, agents.https, agents.http, { config: 'on' }, true)), + override: assign({}, https, patches(https, agents.https, agents.http, { config: 'override' }, true)), + onRequest: assign({}, https, patches(https, agents.https, agents.http, setting, true)), + default: assign(https, patches(https, agents.https, agents.http, setting, false)) // run last } }; } -function patches(originals: typeof http | typeof https, agent: http.Agent, setting: { config: string; }, onRequest: boolean) { +function patches(originals: typeof http | typeof https, agent: http.Agent, otherAgent: http.Agent, setting: { config: string; }, onRequest: boolean) { return { get: patch(originals.get), request: patch(originals.request) @@ -233,7 +233,7 @@ function patches(originals: typeof http | typeof https, agent: http.Agent, setti return original.apply(null, arguments as unknown as any[]); } - if (!options.socketPath && (config === 'override' || config === 'on' && !options.agent) && options.agent !== agent) { + if (!options.socketPath && (config === 'override' || config === 'on' && !options.agent) && options.agent !== agent && options.agent !== otherAgent) { if (url) { const parsed = typeof url === 'string' ? new nodeurl.URL(url) : url; const urlOptions = { From f82458104246c6abde789979c973eed659df268f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 28 Jan 2019 14:03:01 +0100 Subject: [PATCH 022/429] fix #67120 --- src/vs/platform/files/common/files.ts | 6 +++++- src/vs/vscode.proposed.d.ts | 2 +- .../api/electron-browser/mainThreadFileSystem.ts | 6 +++--- src/vs/workbench/api/node/extHost.protocol.ts | 4 ++-- src/vs/workbench/api/node/extHostFileSystem.ts | 4 ++-- .../services/files/electron-browser/streams.ts | 10 +++++++--- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index b007b6f1840..fce0e320b86 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -168,6 +168,10 @@ export interface FileWriteOptions { create: boolean; } +export interface FileOpenOptions { + create: boolean; +} + export interface FileDeleteOptions { recursive: boolean; } @@ -219,7 +223,7 @@ export interface IFileSystemProvider { readFile?(resource: URI): Promise; writeFile?(resource: URI, content: Uint8Array, opts: FileWriteOptions): Promise; - open?(resource: URI): Promise; + open?(resource: URI, opts: FileOpenOptions): Promise; close?(fd: number): Promise; read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise; write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): Promise; diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index b95a09fadff..c1b069e85a8 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -67,7 +67,7 @@ declare module 'vscode' { //#region Joh - read/write in chunks export interface FileSystemProvider { - open?(resource: Uri): number | Thenable; + open?(resource: Uri, options: { create: boolean }): number | Thenable; close?(fd: number): void | Thenable; read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable; write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable; diff --git a/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts b/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts index 0a948e1cfbb..caea6c69d7f 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts @@ -6,7 +6,7 @@ import { Emitter, Event } from 'vs/base/common/event'; import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; -import { FileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IFileSystemProvider, IStat, IWatchOptions, FileType, FileOverwriteOptions, FileDeleteOptions } from 'vs/platform/files/common/files'; +import { FileWriteOptions, FileSystemProviderCapabilities, IFileChange, IFileService, IFileSystemProvider, IStat, IWatchOptions, FileType, FileOverwriteOptions, FileDeleteOptions, FileOpenOptions } from 'vs/platform/files/common/files'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; import { ExtHostContext, ExtHostFileSystemShape, IExtHostContext, IFileChangeDto, MainContext, MainThreadFileSystemShape } from '../node/extHost.protocol'; import { ResourceLabelFormatter, ILabelService } from 'vs/platform/label/common/label'; @@ -130,8 +130,8 @@ class RemoteFileSystemProvider implements IFileSystemProvider { return this._proxy.$copy(this._handle, resource, target, opts); } - open(resource: URI): Promise { - return this._proxy.$open(this._handle, resource); + open(resource: URI, opts: FileOpenOptions): Promise { + return this._proxy.$open(this._handle, resource, opts); } close(fd: number): Promise { diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 72e15943a45..c9bb77f1063 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -20,7 +20,7 @@ import { CharacterPair, CommentRule, EnterAction } from 'vs/editor/common/modes/ import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { ConfigurationTarget, IConfigurationData, IConfigurationModel } from 'vs/platform/configuration/common/configuration'; import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { FileChangeType, FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities, FileType, FileWriteOptions, IStat, IWatchOptions } from 'vs/platform/files/common/files'; +import { FileChangeType, FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities, FileType, FileWriteOptions, IStat, IWatchOptions, FileOpenOptions } from 'vs/platform/files/common/files'; import { ResourceLabelFormatter } from 'vs/platform/label/common/label'; import { LogLevel } from 'vs/platform/log/common/log'; import { IMarkerData } from 'vs/platform/markers/common/markers'; @@ -731,7 +731,7 @@ export interface ExtHostFileSystemShape { $delete(handle: number, resource: UriComponents, opts: FileDeleteOptions): Promise; $watch(handle: number, session: number, resource: UriComponents, opts: IWatchOptions): void; $unwatch(handle: number, session: number): void; - $open(handle: number, resource: UriComponents): Promise; + $open(handle: number, resource: UriComponents, opts: FileOpenOptions): Promise; $close(handle: number, fd: number): Promise; $read(handle: number, fd: number, pos: number, length: number): Promise; $write(handle: number, fd: number, pos: number, data: Buffer): Promise; diff --git a/src/vs/workbench/api/node/extHostFileSystem.ts b/src/vs/workbench/api/node/extHostFileSystem.ts index f1fe101d1c1..a1e8edc9204 100644 --- a/src/vs/workbench/api/node/extHostFileSystem.ts +++ b/src/vs/workbench/api/node/extHostFileSystem.ts @@ -280,9 +280,9 @@ export class ExtHostFileSystem implements ExtHostFileSystemShape { } } - $open(handle: number, resource: UriComponents): Promise { + $open(handle: number, resource: UriComponents, opts: files.FileOpenOptions): Promise { this._checkProviderExists(handle); - return Promise.resolve(this._fsProvider.get(handle).open(URI.revive(resource))); + return Promise.resolve(this._fsProvider.get(handle).open(URI.revive(resource), opts)); } $close(handle: number, fd: number): Promise { diff --git a/src/vs/workbench/services/files/electron-browser/streams.ts b/src/vs/workbench/services/files/electron-browser/streams.ts index 60117fe986d..d4af4580a88 100644 --- a/src/vs/workbench/services/files/electron-browser/streams.ts +++ b/src/vs/workbench/services/files/electron-browser/streams.ts @@ -50,7 +50,7 @@ function createWritable(provider: IFileSystemProvider, resource: URI, opts: File async _write(chunk: Buffer, encoding, callback: Function) { try { if (typeof this._fd !== 'number') { - this._fd = await provider.open(resource); + this._fd = await provider.open(resource, { create: true }); } let bytesWritten = await provider.write(this._fd, this._pos, chunk, 0, chunk.length); this._pos += bytesWritten; @@ -60,7 +60,11 @@ function createWritable(provider: IFileSystemProvider, resource: URI, opts: File } } _final(callback: (err?: any) => any) { - provider.close(this._fd).then(callback, callback); + if (typeof this._fd !== 'number') { + provider.open(resource, { create: true }).then(fd => provider.close(fd)).finally(callback); + } else { + provider.close(this._fd).finally(callback); + } } }; } @@ -88,7 +92,7 @@ function createReadable(provider: IFileSystemProvider, resource: URI, position: this._reading = true; try { if (typeof this._fd !== 'number') { - this._fd = await provider.open(resource); + this._fd = await provider.open(resource, { create: false }); } while (this._reading) { let buffer = Buffer.allocUnsafe(size); From 8846757657096a3d58817c313a2dcaebbe0b6ae6 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 28 Jan 2019 05:38:25 -0800 Subject: [PATCH 023/429] Move cwd ownership into terminal process --- .../mainThreadTerminalService.ts | 16 +++++++++ src/vs/workbench/api/node/extHost.protocol.ts | 4 +++ .../api/node/extHostTerminalService.ts | 28 +++++++++++++--- .../parts/terminal/common/terminal.ts | 14 ++++---- .../electron-browser/terminalActions.ts | 18 +++++----- .../electron-browser/terminalInstance.ts | 30 ++++++----------- .../terminalProcessManager.ts | 9 +++++ .../workbench/parts/terminal/node/terminal.ts | 5 ++- .../parts/terminal/node/terminalProcess.ts | 23 +++++++++++++ .../node/terminalProcessExtHostProxy.ts | 33 +++++++++++++++++++ 10 files changed, 138 insertions(+), 42 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index 84ed8b00b64..3edd37683f0 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -214,6 +214,14 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape request.proxy.onInput(data => this._proxy.$acceptProcessInput(request.proxy.terminalId, data)); request.proxy.onResize(dimensions => this._proxy.$acceptProcessResize(request.proxy.terminalId, dimensions.cols, dimensions.rows)); request.proxy.onShutdown(immediate => this._proxy.$acceptProcessShutdown(request.proxy.terminalId, immediate)); + request.proxy.onRequestCwd(() => { + console.log('onRequestCwd', request.proxy.terminalId); + this._proxy.$acceptProcessRequestCwd(request.proxy.terminalId); + }); + request.proxy.onRequestInitialCwd(() => { + console.log('onRequestInitialCwd', request.proxy.terminalId); + this._proxy.$acceptProcessRequestInitialCwd(request.proxy.terminalId); + }); } public $sendProcessTitle(terminalId: number, title: string): void { @@ -232,4 +240,12 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape this._terminalProcesses[terminalId].emitExit(exitCode); delete this._terminalProcesses[terminalId]; } + + public $sendProcessInitialCwd(terminalId: number, initialCwd: string): void { + this._terminalProcesses[terminalId].emitInitialCwd(initialCwd); + } + + public $sendProcessCwd(terminalId: number, cwd: string): void { + this._terminalProcesses[terminalId].emitCwd(cwd); + } } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index c9bb77f1063..85e68f5080d 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -363,6 +363,8 @@ export interface MainThreadTerminalServiceShape extends IDisposable { $sendProcessData(terminalId: number, data: string): void; $sendProcessPid(terminalId: number, pid: number): void; $sendProcessExit(terminalId: number, exitCode: number): void; + $sendProcessInitialCwd(terminalId: number, cwd: string): void; + $sendProcessCwd(terminalId: number, initialCwd: string): void; // Renderer $terminalRendererSetName(terminalId: number, name: string): void; @@ -938,6 +940,8 @@ export interface ExtHostTerminalServiceShape { $acceptProcessInput(id: number, data: string): void; $acceptProcessResize(id: number, cols: number, rows: number): void; $acceptProcessShutdown(id: number, immediate: boolean): void; + $acceptProcessRequestInitialCwd(id: number): void; + $acceptProcessRequestCwd(id: number): void; } export interface ExtHostSCMShape { diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 99ba5c8878d..c99a43a3561 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -430,11 +430,12 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { // Fork the process and listen for messages this._logService.debug(`Terminal process launching on ext host`, shellLaunchConfig, initialCwd, cols, rows, env); - this._terminalProcesses[id] = new TerminalProcess(shellLaunchConfig, initialCwd, cols, rows, env, terminalConfig.get('windowsEnableConpty')); - this._terminalProcesses[id].onProcessIdReady(pid => this._proxy.$sendProcessPid(id, pid)); - this._terminalProcesses[id].onProcessTitleChanged(title => this._proxy.$sendProcessTitle(id, title)); - this._terminalProcesses[id].onProcessData(data => this._proxy.$sendProcessData(id, data)); - this._terminalProcesses[id].onProcessExit((exitCode) => this._onProcessExit(id, exitCode)); + const p = new TerminalProcess(shellLaunchConfig, initialCwd, cols, rows, env, terminalConfig.get('windowsEnableConpty')); + p.onProcessIdReady(pid => this._proxy.$sendProcessPid(id, pid)); + p.onProcessTitleChanged(title => this._proxy.$sendProcessTitle(id, title)); + p.onProcessData(data => this._proxy.$sendProcessData(id, data)); + p.onProcessExit((exitCode) => this._onProcessExit(id, exitCode)); + this._terminalProcesses[id] = p; } @@ -457,6 +458,23 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { this._terminalProcesses[id].shutdown(immediate); } + // TODO: Also support initial cwd as it's evaluated on the ext host + public $acceptProcessRequestInitialCwd(id: number): void { + console.log('$acceptProcessRequestInitialCwd', id); + this._terminalProcesses[id].getInitialCwd().then(initialCwd => { + console.log('initialCwd', initialCwd); + this._proxy.$sendProcessInitialCwd(id, initialCwd); + }); + } + + public $acceptProcessRequestCwd(id: number): void { + console.log('$acceptProcessRequestCwd', id); + this._terminalProcesses[id].getCwd().then(cwd => { + console.log('cwd', cwd); + this._proxy.$sendProcessCwd(id, cwd); + }); + } + private _onProcessExit(id: number, exitCode: number): void { // Remove listeners this._terminalProcesses[id].dispose(); diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index 155b7c68578..8f61e7761ce 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -417,11 +417,6 @@ export interface ITerminalInstance { */ readonly commandTracker: ITerminalCommandTracker; - /** - * The cwd that the terminal instance was initialized with. - */ - readonly initialCwd: string; - /** * Dispose the terminal instance, removing it from the panel/service and freeing up resources. * @@ -614,6 +609,7 @@ export interface ITerminalInstance { toggleEscapeSequenceLogging(): void; + getInitialCwd(): Promise; getCwd(): Promise; } @@ -630,7 +626,6 @@ export interface ITerminalProcessManager extends IDisposable { readonly processState: ProcessState; readonly ptyProcessReady: Promise; readonly shellProcessId: number; - readonly initialCwd: string; readonly onProcessReady: Event; readonly onProcessData: Event; @@ -642,6 +637,9 @@ export interface ITerminalProcessManager extends IDisposable { createProcess(shellLaunchConfig: IShellLaunchConfig, cols: number, rows: number); write(data: string): void; setDimensions(cols: number, rows: number): void; + + getInitialCwd(): Promise; + getCwd(): Promise; } export const enum ProcessState { @@ -671,10 +669,14 @@ export interface ITerminalProcessExtHostProxy extends IDisposable { emitTitle(title: string): void; emitPid(pid: number): void; emitExit(exitCode: number): void; + emitInitialCwd(initialCwd: string): void; + emitCwd(cwd: string): void; onInput: Event; onResize: Event<{ cols: number, rows: number }>; onShutdown: Event; + onRequestInitialCwd: Event; + onRequestCwd: Event; } export interface ITerminalProcessExtHostRequest { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index c77fbe34407..31564bafef7 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -35,7 +35,7 @@ export const TERMINAL_PICKER_PREFIX = 'term '; function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminalInstance, folders?: IWorkspaceFolder[], commandService?: ICommandService): Promise { switch (configHelper.config.splitCwd) { - case 'workspaceRoot': { + case 'workspaceRoot': // allow original behavior let pathPromise: Promise = Promise.resolve(''); if (folders.length > 1) { @@ -53,15 +53,12 @@ function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminal } return pathPromise; - } - case 'initial': { - return new Promise(resolve => { - resolve(instance.initialCwd); - }); - } - case 'inherited': { + case 'initial': + console.log('getCwdForSplit initial'); + return instance.getInitialCwd(); + case 'inherited': + console.log('getCwdForSplit inherited'); return instance.getCwd(); - } } } @@ -385,8 +382,9 @@ export class SplitTerminalAction extends Action { if (!instance) { return Promise.resolve(undefined); } - + console.log('SplitTerminalAction'); return getCwdForSplit(this._terminalService.configHelper, instance, this.workspaceContextService.getWorkspace().folders, this.commandService).then(cwd => { + console.log('SplitTerminalAction cwd', cwd); if (cwd || (cwd === '')) { this._terminalService.splitInstance(instance, { cwd }); return this._terminalService.showPanel(true); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index 4adb53f2ac0..c0c72063d10 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -36,7 +36,7 @@ import { INotificationService, Severity, IPromptChoice } from 'vs/platform/notif import { ILogService } from 'vs/platform/log/common/log'; import { TerminalCommandTracker } from 'vs/workbench/parts/terminal/node/terminalCommandTracker'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { execFile, exec } from 'child_process'; +import { execFile } from 'child_process'; import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; import { TerminalProcessManager } from 'vs/workbench/parts/terminal/electron-browser/terminalProcessManager'; @@ -434,8 +434,8 @@ export class TerminalInstance implements ITerminalInstance { this._xterm.on('data', data => this._processManager!.write(data)); // TODO: How does the cwd work on detached processes? this._linkHandler = this._instantiationService.createInstance(TerminalLinkHandler, this._xterm, platform.platform); - this.processReady.then(() => { - this._linkHandler.processCwd = this._processManager!.initialCwd; + this.processReady.then(async () => { + this._linkHandler.processCwd = await this._processManager!.getInitialCwd(); }); } this._xterm.on('focus', () => this._onFocus.fire(this)); @@ -1314,28 +1314,18 @@ export class TerminalInstance implements ITerminalInstance { this._xterm.setOption('debug', this._xterm._core.debug); } - public get initialCwd(): string { - if (this._processManager) { - return this._processManager.initialCwd; + public getInitialCwd(): Promise { + if (!this._processManager) { + return Promise.resolve(''); } - return ''; + return this._processManager.getInitialCwd(); } public getCwd(): Promise { - if (!platform.isWindows) { - let pid = this.processId; - return new Promise(resolve => { - exec('lsof -p ' + pid + ' | grep cwd', (error, stdout, stderr) => { - if (stdout !== '') { - resolve(stdout.substring(stdout.indexOf('/'), stdout.length - 1)); - } - }); - }); - } else { - return new Promise(resolve => { - resolve(this.initialCwd); - }); + if (!this._processManager) { + return Promise.resolve(''); } + return this._processManager.getCwd(); } } diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index f838343e3ff..ed59e4a655a 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -35,6 +35,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { public processState: ProcessState = ProcessState.UNINITIALIZED; public ptyProcessReady: Promise; public shellProcessId: number; + // TODO: This should be removed in favor of async getInitialCwd public initialCwd: string; private _process: ITerminalChildProcess | null = null; @@ -200,6 +201,14 @@ export class TerminalProcessManager implements ITerminalProcessManager { } } + public getInitialCwd(): Promise { + return this._process.getInitialCwd(); + } + + public getCwd(): Promise { + return this._process.getCwd(); + } + private _onExit(exitCode: number): void { this._process = null; diff --git a/src/vs/workbench/parts/terminal/node/terminal.ts b/src/vs/workbench/parts/terminal/node/terminal.ts index 83768c9025f..73b41c24e5d 100644 --- a/src/vs/workbench/parts/terminal/node/terminal.ts +++ b/src/vs/workbench/parts/terminal/node/terminal.ts @@ -10,7 +10,7 @@ import { readFile, fileExists } from 'vs/base/node/pfs'; import { Event } from 'vs/base/common/event'; /** - * An interface representing a raw terminal child process, this is a subset of the + * An interface representing a raw terminal child process, this contains a subset of the * child_process.ChildProcess node.js interface. */ export interface ITerminalChildProcess { @@ -28,6 +28,9 @@ export interface ITerminalChildProcess { shutdown(immediate: boolean): void; input(data: string): void; resize(cols: number, rows: number): void; + + getInitialCwd(): Promise; + getCwd(): Promise; } export function getDefaultShell(p: platform.Platform): string { diff --git a/src/vs/workbench/parts/terminal/node/terminalProcess.ts b/src/vs/workbench/parts/terminal/node/terminalProcess.ts index ac913edc443..16dfd0580b4 100644 --- a/src/vs/workbench/parts/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/parts/terminal/node/terminalProcess.ts @@ -11,6 +11,7 @@ import { Event, Emitter } from 'vs/base/common/event'; import { ITerminalChildProcess } from 'vs/workbench/parts/terminal/node/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; import { IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; +import { exec } from 'child_process'; export class TerminalProcess implements ITerminalChildProcess, IDisposable { private _exitCode: number; @@ -20,6 +21,7 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { private _processStartupComplete: Promise; private _isDisposed: boolean = false; private _titleInterval: NodeJS.Timer | null = null; + private _initialCwd: string; private readonly _onProcessData = new Emitter(); public get onProcessData(): Event { return this._onProcessData.event; } @@ -47,6 +49,7 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { shellName = 'xterm-256color'; } + this._initialCwd = cwd; const useConpty = windowsEnableConpty && process.platform === 'win32' && this._getWindowsBuildNumber() >= 18309; const options: pty.IPtyForkOptions = { name: shellName, @@ -187,4 +190,24 @@ export class TerminalProcess implements ITerminalChildProcess, IDisposable { // exception in winpty. this._ptyProcess.resize(Math.max(cols, 1), Math.max(rows, 1)); } + + public getInitialCwd(): Promise { + return Promise.resolve(this._initialCwd); + } + + public getCwd(): Promise { + if (platform.isWindows) { + return new Promise(resolve => { + resolve(this._initialCwd); + }); + } + + return new Promise(resolve => { + exec('lsof -p ' + this._ptyProcess.pid + ' | grep cwd', (error, stdout, stderr) => { + if (stdout !== '') { + resolve(stdout.substring(stdout.indexOf('/'), stdout.length - 1)); + } + }); + }); + } } diff --git a/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts b/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts index ea06eac26f5..653e09b65dd 100644 --- a/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts +++ b/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts @@ -28,6 +28,13 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm public get onResize(): Event<{ cols: number, rows: number }> { return this._onResize.event; } private readonly _onShutdown = new Emitter(); public get onShutdown(): Event { return this._onShutdown.event; } + private readonly _onRequestInitialCwd = new Emitter(); + public get onRequestInitialCwd(): Event { return this._onRequestInitialCwd.event; } + private readonly _onRequestCwd = new Emitter(); + public get onRequestCwd(): Event { return this._onRequestCwd.event; } + + private _pendingInitialCwdRequests: ((value?: string | Thenable) => void)[] = []; + private _pendingCwdRequests: ((value?: string | Thenable) => void)[] = []; constructor( public terminalId: number, @@ -68,6 +75,18 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm this.dispose(); } + public emitInitialCwd(initialCwd: string): void { + while (this._pendingInitialCwdRequests.length > 0) { + this._pendingInitialCwdRequests.pop()(initialCwd); + } + } + + public emitCwd(cwd: string): void { + while (this._pendingCwdRequests.length > 0) { + this._pendingCwdRequests.pop()(cwd); + } + } + public shutdown(immediate: boolean): void { this._onShutdown.fire(immediate); } @@ -79,4 +98,18 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm public resize(cols: number, rows: number): void { this._onResize.fire({ cols, rows }); } + + public getInitialCwd(): Promise { + return new Promise(resolve => { + this._onRequestInitialCwd.fire(); + this._pendingInitialCwdRequests.push(resolve); + }); + } + + public getCwd(): Promise { + return new Promise(resolve => { + this._onRequestCwd.fire(); + this._pendingCwdRequests.push(resolve); + }); + } } \ No newline at end of file From e384ca7461d40f3bead9474b7cd077b8466447f5 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 28 Jan 2019 06:01:56 -0800 Subject: [PATCH 024/429] Clean up terminal cwd handling --- .../mainThreadTerminalService.ts | 10 ++-------- .../api/node/extHostTerminalService.ts | 13 ++----------- .../electron-browser/terminalActions.ts | 19 +++++++++---------- .../terminalProcessManager.ts | 17 ++++++++--------- 4 files changed, 21 insertions(+), 38 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index 3edd37683f0..bb267c2dbb4 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -214,14 +214,8 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape request.proxy.onInput(data => this._proxy.$acceptProcessInput(request.proxy.terminalId, data)); request.proxy.onResize(dimensions => this._proxy.$acceptProcessResize(request.proxy.terminalId, dimensions.cols, dimensions.rows)); request.proxy.onShutdown(immediate => this._proxy.$acceptProcessShutdown(request.proxy.terminalId, immediate)); - request.proxy.onRequestCwd(() => { - console.log('onRequestCwd', request.proxy.terminalId); - this._proxy.$acceptProcessRequestCwd(request.proxy.terminalId); - }); - request.proxy.onRequestInitialCwd(() => { - console.log('onRequestInitialCwd', request.proxy.terminalId); - this._proxy.$acceptProcessRequestInitialCwd(request.proxy.terminalId); - }); + request.proxy.onRequestCwd(() => this._proxy.$acceptProcessRequestCwd(request.proxy.terminalId)); + request.proxy.onRequestInitialCwd(() => this._proxy.$acceptProcessRequestInitialCwd(request.proxy.terminalId)); } public $sendProcessTitle(terminalId: number, title: string): void { diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index c99a43a3561..fd343a8de75 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -458,21 +458,12 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { this._terminalProcesses[id].shutdown(immediate); } - // TODO: Also support initial cwd as it's evaluated on the ext host public $acceptProcessRequestInitialCwd(id: number): void { - console.log('$acceptProcessRequestInitialCwd', id); - this._terminalProcesses[id].getInitialCwd().then(initialCwd => { - console.log('initialCwd', initialCwd); - this._proxy.$sendProcessInitialCwd(id, initialCwd); - }); + this._terminalProcesses[id].getInitialCwd().then(initialCwd => this._proxy.$sendProcessInitialCwd(id, initialCwd)); } public $acceptProcessRequestCwd(id: number): void { - console.log('$acceptProcessRequestCwd', id); - this._terminalProcesses[id].getCwd().then(cwd => { - console.log('cwd', cwd); - this._proxy.$sendProcessCwd(id, cwd); - }); + this._terminalProcesses[id].getCwd().then(cwd => this._proxy.$sendProcessCwd(id, cwd)); } private _onProcessExit(id: number, exitCode: number): void { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index 31564bafef7..ac30cb45070 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -30,15 +30,19 @@ import { Command } from 'vs/editor/browser/editorExtensions'; import { timeout } from 'vs/base/common/async'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; +import { URI } from 'vs/base/common/uri'; export const TERMINAL_PICKER_PREFIX = 'term '; -function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminalInstance, folders?: IWorkspaceFolder[], commandService?: ICommandService): Promise { +function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminalInstance, folders?: IWorkspaceFolder[], commandService?: ICommandService): Promise { switch (configHelper.config.splitCwd) { case 'workspaceRoot': - // allow original behavior - let pathPromise: Promise = Promise.resolve(''); - if (folders.length > 1) { + let pathPromise: Promise; + if (folders.length === 0) { + pathPromise = Promise.resolve(''); + } else if (folders.length === 1) { + pathPromise = Promise.resolve(folders[0].uri); + } else if (folders.length > 1) { // Only choose a path when there's more than 1 folder const options: IPickOptions = { placeHolder: nls.localize('workbench.action.terminal.newWorkspacePlaceholder', "Select current working directory for new terminal") @@ -48,16 +52,13 @@ function getCwdForSplit(configHelper: ITerminalConfigHelper, instance: ITerminal // Don't split the instance if the workspace picker was canceled return undefined; } - return Promise.resolve(workspace.uri.fsPath); + return Promise.resolve(workspace.uri); }); } - return pathPromise; case 'initial': - console.log('getCwdForSplit initial'); return instance.getInitialCwd(); case 'inherited': - console.log('getCwdForSplit inherited'); return instance.getCwd(); } } @@ -382,9 +383,7 @@ export class SplitTerminalAction extends Action { if (!instance) { return Promise.resolve(undefined); } - console.log('SplitTerminalAction'); return getCwdForSplit(this._terminalService.configHelper, instance, this.workspaceContextService.getWorkspace().folders, this.commandService).then(cwd => { - console.log('SplitTerminalAction cwd', cwd); if (cwd || (cwd === '')) { this._terminalService.splitInstance(instance, { cwd }); return this._terminalService.showPanel(true); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index ed59e4a655a..93f6d2ac0f1 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -35,8 +35,6 @@ export class TerminalProcessManager implements ITerminalProcessManager { public processState: ProcessState = ProcessState.UNINITIALIZED; public ptyProcessReady: Promise; public shellProcessId: number; - // TODO: This should be removed in favor of async getInitialCwd - public initialCwd: string; private _process: ITerminalChildProcess | null = null; private _preLaunchInputQueue: string[] = []; @@ -92,24 +90,25 @@ export class TerminalProcessManager implements ITerminalProcessManager { rows: number ): void { let launchRemotely = false; + const forceExtHostProcess = (this._configHelper.config as any).extHostProcess; if (shellLaunchConfig.cwd && typeof shellLaunchConfig.cwd === 'object') { launchRemotely = !!getRemoteAuthority(shellLaunchConfig.cwd); shellLaunchConfig.cwd = shellLaunchConfig.cwd.fsPath; } else { - launchRemotely = !!this._windowService.getConfiguration().remoteAuthority || (this._configHelper.config as any).extHostProcess; + launchRemotely = !!this._windowService.getConfiguration().remoteAuthority; } - if (launchRemotely) { - const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(REMOTE_HOST_SCHEME); + if (launchRemotely || forceExtHostProcess) { + const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(forceExtHostProcess ? undefined : REMOTE_HOST_SCHEME); this._process = this._instantiationService.createInstance(TerminalProcessExtHostProxy, this._terminalId, shellLaunchConfig, activeWorkspaceRootUri, cols, rows); } else { if (!shellLaunchConfig.executable) { this._configHelper.mergeDefaultShellPathAndArgs(shellLaunchConfig); } - // TODO: @daniel + const activeWorkspaceRootUri = this._historyService.getLastActiveWorkspaceRoot(Schemas.file); - this.initialCwd = terminalEnvironment.getCwd(shellLaunchConfig, activeWorkspaceRootUri, this._configHelper.config.cwd); + const initialCwd = terminalEnvironment.getCwd(shellLaunchConfig, activeWorkspaceRootUri, this._configHelper.config.cwd); // Compel type system as process.env should not have any undefined entries let env: platform.IProcessEnvironment = {}; @@ -140,8 +139,8 @@ export class TerminalProcessManager implements ITerminalProcessManager { terminalEnvironment.addTerminalEnvironmentKeys(env, platform.locale, this._configHelper.config.setLocaleVariables); } - this._logService.debug(`Terminal process launching`, shellLaunchConfig, this.initialCwd, cols, rows, env); - this._process = new TerminalProcess(shellLaunchConfig, this.initialCwd, cols, rows, env, this._configHelper.config.windowsEnableConpty); + this._logService.debug(`Terminal process launching`, shellLaunchConfig, initialCwd, cols, rows, env); + this._process = new TerminalProcess(shellLaunchConfig, initialCwd, cols, rows, env, this._configHelper.config.windowsEnableConpty); } this.processState = ProcessState.LAUNCHING; From bc848b75430ff3bed6f744a461ca30121659c7ca Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 28 Jan 2019 15:06:15 +0100 Subject: [PATCH 025/429] explorer: forgetchildren when item gets outdated fixes #67112 --- .../parts/files/common/explorerModel.ts | 25 +++++++++++++------ .../files/electron-browser/explorerService.ts | 4 +-- .../electron-browser/explorerModel.test.ts | 2 +- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/parts/files/common/explorerModel.ts b/src/vs/workbench/parts/files/common/explorerModel.ts index db6a66248c8..0bbd5075ca8 100644 --- a/src/vs/workbench/parts/files/common/explorerModel.ts +++ b/src/vs/workbench/parts/files/common/explorerModel.ts @@ -73,7 +73,7 @@ export class ExplorerModel implements IDisposable { } export class ExplorerItem { - public isDirectoryResolved: boolean; + private _isDirectoryResolved: boolean; public isError: boolean; constructor( @@ -86,7 +86,11 @@ export class ExplorerItem { private _mtime?: number, private _etag?: string, ) { - this.isDirectoryResolved = false; + this._isDirectoryResolved = false; + } + + get isDirectoryResolved(): boolean { + return this._isDirectoryResolved; } get isSymbolicLink(): boolean { @@ -157,7 +161,7 @@ export class ExplorerItem { // isDirectoryResolved is a very important indicator in the stat model that tells if the folder was fully resolved // the folder is fully resolved if either it has a list of children or the client requested this by using the resolveTo // array of resource path to resolve. - stat.isDirectoryResolved = !!raw.children || (!!resolveTo && resolveTo.some((r) => { + stat._isDirectoryResolved = !!raw.children || (!!resolveTo && resolveTo.some((r) => { return resources.isEqualOrParent(r, stat.resource); })); @@ -185,7 +189,7 @@ export class ExplorerItem { // Stop merging when a folder is not resolved to avoid loosing local data const mergingDirectories = disk.isDirectory || local.isDirectory; - if (mergingDirectories && local.isDirectoryResolved && !disk.isDirectoryResolved) { + if (mergingDirectories && local._isDirectoryResolved && !disk._isDirectoryResolved) { return; } @@ -194,13 +198,13 @@ export class ExplorerItem { local.updateName(disk.name); local._isDirectory = disk.isDirectory; local._mtime = disk.mtime; - local.isDirectoryResolved = disk.isDirectoryResolved; + local._isDirectoryResolved = disk._isDirectoryResolved; local._isSymbolicLink = disk.isSymbolicLink; local._isReadonly = disk.isReadonly; local.isError = disk.isError; // Merge Children if resolved - if (mergingDirectories && disk.isDirectoryResolved) { + if (mergingDirectories && disk._isDirectoryResolved) { // Map resource => stat const oldLocalChildren = new ResourceMap(); @@ -244,11 +248,11 @@ export class ExplorerItem { fetchChildren(fileService: IFileService): Promise { let promise: Promise = Promise.resolve(undefined); - if (!this.isDirectoryResolved) { + if (!this._isDirectoryResolved) { promise = fileService.resolveFile(this.resource, { resolveSingleChildDescendants: true }).then(stat => { const resolved = ExplorerItem.create(stat, this); ExplorerItem.mergeLocalWithDisk(resolved, this); - this.isDirectoryResolved = true; + this._isDirectoryResolved = true; }); } @@ -269,6 +273,11 @@ export class ExplorerItem { this.children.delete(this.getPlatformAwareName(child.name)); } + forgetChildren(): void { + this.children.clear(); + this._isDirectoryResolved = false; + } + private getPlatformAwareName(name: string): string { return (isLinux || !name) ? name : name.toLowerCase(); } diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/parts/files/electron-browser/explorerService.ts index a439f87af54..8ac994aede6 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerService.ts @@ -156,7 +156,7 @@ export class ExplorerService implements IExplorerService { } refresh(): void { - this.model.roots.forEach(r => r.isDirectoryResolved = false); + this.model.roots.forEach(r => r.forgetChildren()); this._onDidChangeItem.fire(undefined); } @@ -249,7 +249,7 @@ export class ExplorerService implements IExplorerService { // Filter to the ones we care e = this.filterToViewRelevantEvents(e); const explorerItemChanged = (item: ExplorerItem) => { - item.isDirectoryResolved = false; + item.forgetChildren(); this._onDidChangeItem.fire(item); }; diff --git a/src/vs/workbench/parts/files/test/electron-browser/explorerModel.test.ts b/src/vs/workbench/parts/files/test/electron-browser/explorerModel.test.ts index a5f20068a38..c7dc1ab2380 100644 --- a/src/vs/workbench/parts/files/test/electron-browser/explorerModel.test.ts +++ b/src/vs/workbench/parts/files/test/electron-browser/explorerModel.test.ts @@ -268,7 +268,7 @@ suite('Files - View Model', () => { const child = new ExplorerItem(URI.file(join('C:\\', '/path/to/foo.html')), undefined, true, false, false, 'foo.html', Date.now(), d); merge2.removeChild(child); merge2.addChild(child); - merge2.isDirectoryResolved = true; + (merge2)._isDirectoryResolved = true; ExplorerItem.mergeLocalWithDisk(merge2, merge1); assert.strictEqual(merge1.getChild('foo.html').name, 'foo.html'); assert.deepEqual(merge1.getChild('foo.html').parent, merge1, 'Check parent'); From c5e6633fd189b80ecedf2e99bd61c0a83e1ee611 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 15:10:58 +0100 Subject: [PATCH 026/429] avoid doing unnecessary filters fixes #65213 fixes #67222 --- src/vs/base/browser/ui/tree/abstractTree.ts | 4 ++++ src/vs/base/browser/ui/tree/asyncDataTree.ts | 25 ++++++++++---------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index e8916590c1d..3cace23df45 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -547,6 +547,10 @@ class TypeFilterController implements IDisposable { } private onDidSpliceModel(): void { + if (!this.enabled || this.pattern.length === 0) { + return; + } + this.tree.refilter(); this.render(); } diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index e6b0b855f9d..80b14c23900 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -28,8 +28,8 @@ enum AsyncDataTreeNodeState { interface IAsyncDataTreeNode { element: TInput | T; readonly parent: IAsyncDataTreeNode | null; + readonly children: IAsyncDataTreeNode[]; readonly id?: string | null; - readonly children?: IAsyncDataTreeNode[]; state: AsyncDataTreeNodeState; } @@ -224,7 +224,7 @@ function asObjectTreeOptions(options?: IAsyncDataTreeOpt function asTreeElement(node: IAsyncDataTreeNode): ITreeElement> { return { element: node, - children: Iterator.map(Iterator.fromArray(node.children!), asTreeElement) + children: Iterator.map(Iterator.fromArray(node.children), asTreeElement) }; } @@ -296,14 +296,14 @@ export class AsyncDataTree implements IDisposable this.root = { element: undefined!, parent: null, + children: [], state: AsyncDataTreeNodeState.Uninitialized, }; if (this.identityProvider) { this.root = { ...this.root, - id: null, - children: [], + id: null }; } @@ -539,7 +539,7 @@ export class AsyncDataTree implements IDisposable private async refreshNode(node: IAsyncDataTreeNode, recursive: boolean, reason: ChildrenResolutionReason, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { await this.queueRefresh(node, recursive, reason, viewStateContext); - if (recursive && node.children) { + if (recursive) { await Promise.all(node.children.map(child => this.refreshNode(child, recursive, reason, viewStateContext))); } } @@ -652,7 +652,7 @@ export class AsyncDataTree implements IDisposable if (this.identityProvider) { nodeChildren = new Map(); - for (const child of node.children!) { + for (const child of node.children) { nodeChildren.set(child.id!, child); } } @@ -663,6 +663,7 @@ export class AsyncDataTree implements IDisposable element: { element, parent: node, + children: [], state: AsyncDataTreeNodeState.Uninitialized }, collapsible: !!this.dataSource.hasChildren(element), @@ -708,7 +709,7 @@ export class AsyncDataTree implements IDisposable asyncDataTreeNode.state = AsyncDataTreeNodeState.Uninitialized; if (this.tree.isCollapsed(asyncDataTreeNode === this.root ? null : asyncDataTreeNode)) { - asyncDataTreeNode.children!.length = 0; + asyncDataTreeNode.children.length = 0; return { element: asyncDataTreeNode, @@ -721,7 +722,7 @@ export class AsyncDataTree implements IDisposable let children: Iterator>> | undefined = undefined; if (collapsible) { - children = Iterator.map(Iterator.fromArray(asyncDataTreeNode.children!), asTreeElement); + children = Iterator.map(Iterator.fromArray(asyncDataTreeNode.children), asTreeElement); } return { @@ -750,10 +751,10 @@ export class AsyncDataTree implements IDisposable } }; - this.tree.setChildren(node === this.root ? null : node, children, onDidCreateNode, onDidDeleteNode); - - if (this.identityProvider) { - node.children!.splice(0, node.children!.length, ...children.map(c => c.element)); + // perf: if the node was and still is a leaf, avoid all these expensive no-ops + if (node.children.length > 0 || children.length > 0) { + this.tree.setChildren(node === this.root ? null : node, children, onDidCreateNode, onDidDeleteNode); + node.children.splice(0, node.children.length, ...children.map(c => c.element)); } } From 5d5d386403ac434a8a81dac554eb947fc6ca08dd Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 28 Jan 2019 06:23:46 -0800 Subject: [PATCH 027/429] Fix strict null checks --- .../terminal/electron-browser/terminalProcessManager.ts | 6 ++++++ .../parts/terminal/node/terminalProcessExtHostProxy.ts | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index 93f6d2ac0f1..6eb9ec9906c 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -201,10 +201,16 @@ export class TerminalProcessManager implements ITerminalProcessManager { } public getInitialCwd(): Promise { + if (!this._process) { + return Promise.resolve(''); + } return this._process.getInitialCwd(); } public getCwd(): Promise { + if (!this._process) { + return Promise.resolve(''); + } return this._process.getCwd(); } diff --git a/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts b/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts index 653e09b65dd..dbf10b10214 100644 --- a/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts +++ b/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts @@ -77,13 +77,13 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm public emitInitialCwd(initialCwd: string): void { while (this._pendingInitialCwdRequests.length > 0) { - this._pendingInitialCwdRequests.pop()(initialCwd); + this._pendingInitialCwdRequests.pop()!(initialCwd); } } public emitCwd(cwd: string): void { while (this._pendingCwdRequests.length > 0) { - this._pendingCwdRequests.pop()(cwd); + this._pendingCwdRequests.pop()!(cwd); } } @@ -100,7 +100,7 @@ export class TerminalProcessExtHostProxy implements ITerminalChildProcess, ITerm } public getInitialCwd(): Promise { - return new Promise(resolve => { + return new Promise(resolve => { this._onRequestInitialCwd.fire(); this._pendingInitialCwdRequests.push(resolve); }); From ea84e77a9e12be13d76f2e11746f55eaf0b0b05b Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 28 Jan 2019 15:44:34 +0100 Subject: [PATCH 028/429] fix #64429 --- .../browser/parts/editor/media/notabstitlecontrol.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css index 6b309377039..4c96ebbc1f1 100644 --- a/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css +++ b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css @@ -60,7 +60,9 @@ .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item.root_folder::before, .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item.root_folder + .monaco-breadcrumb-item::before, -.monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control.relative-path .monaco-breadcrumb-item:nth-child(2)::before { +.monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control.relative-path .monaco-breadcrumb-item:nth-child(2)::before, +.windows > .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item:nth-child(2)::before, +{ /* workspace folder, item following workspace folder, or relative path -> hide first seperator */ display: none; } @@ -68,7 +70,7 @@ .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item.root_folder::after { /* use dot separator for workspace folder */ content: '\00a0•\00a0'; - padding: 0px; + padding: 0; } .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item:last-child { From 363e829071b1b7d123024172836f0f05776acc70 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 28 Jan 2019 06:59:31 -0800 Subject: [PATCH 029/429] Fix clicking on dock in Ubuntu opening additional windows Fixes #65460 --- resources/linux/code.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/linux/code.desktop b/resources/linux/code.desktop index f93060d565b..dbc7818cecf 100644 --- a/resources/linux/code.desktop +++ b/resources/linux/code.desktop @@ -5,7 +5,7 @@ GenericName=Text Editor Exec=/usr/share/@@NAME@@/@@NAME@@ --unity-launch %F Icon=@@ICON@@ Type=Application -StartupNotify=true +StartupNotify=false StartupWMClass=@@NAME_SHORT@@ Categories=Utility;TextEditor;Development;IDE; MimeType=text/plain;inode/directory; From 7d94471759fa47fc4283a8845e4b5a9bded2cbf3 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 15:41:56 +0100 Subject: [PATCH 030/429] fixes #65397 --- .../workbench/browser/actions/listCommands.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 196930c81b7..1ee1e0e8491 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -27,7 +27,7 @@ function ensureDOMFocus(widget: ListWidget): void { } } -function focusDown(accessor: ServicesAccessor, arg2?: number): void { +function focusDown(accessor: ServicesAccessor, arg2?: number, loop: boolean = true): void { const focused = accessor.get(IListService).lastFocusedList; const count = typeof arg2 === 'number' ? arg2 : 1; @@ -50,7 +50,7 @@ function focusDown(accessor: ServicesAccessor, arg2?: number): void { const tree = focused; const fakeKeyboardEvent = new KeyboardEvent('keydown'); - tree.focusNext(count, true, fakeKeyboardEvent); + tree.focusNext(count, loop, fakeKeyboardEvent); const listFocus = tree.getFocus(); if (listFocus.length) { @@ -99,6 +99,11 @@ function expandMultiSelection(focused: List | PagedList | ITree | Obje const list = focused; const focus = list.getFocus() ? list.getFocus()[0] : undefined; + + if (previousFocus === focus) { + return; + } + const selection = list.getSelection(); const fakeKeyboardEvent = new KeyboardEvent('keydown', { shiftKey: true }); @@ -137,7 +142,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ // Focus down first const previousFocus = list.getFocus() ? list.getFocus()[0] : undefined; - focusDown(accessor, arg2); + focusDown(accessor, arg2, false); // Then adjust selection expandMultiSelection(focused, previousFocus); @@ -157,7 +162,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); -function focusUp(accessor: ServicesAccessor, arg2?: number): void { +function focusUp(accessor: ServicesAccessor, arg2?: number, loop: boolean = true): void { const focused = accessor.get(IListService).lastFocusedList; const count = typeof arg2 === 'number' ? arg2 : 1; @@ -180,7 +185,7 @@ function focusUp(accessor: ServicesAccessor, arg2?: number): void { const tree = focused; const fakeKeyboardEvent = new KeyboardEvent('keydown'); - tree.focusPrevious(count, true, fakeKeyboardEvent); + tree.focusPrevious(count, loop, fakeKeyboardEvent); const listFocus = tree.getFocus(); if (listFocus.length) { @@ -223,7 +228,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ // Focus up first const previousFocus = list.getFocus() ? list.getFocus()[0] : undefined; - focusUp(accessor, arg2); + focusUp(accessor, arg2, false); // Then adjust selection expandMultiSelection(focused, previousFocus); From 6f2daa3fe2be9bd4343d3bb856549ae9530937fd Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 16:03:39 +0100 Subject: [PATCH 031/429] tree.updateWidth(element) --- src/vs/base/browser/ui/list/listView.ts | 56 ++++++++++++------- src/vs/base/browser/ui/list/listWidget.ts | 4 ++ src/vs/base/browser/ui/tree/abstractTree.ts | 10 ++++ src/vs/base/browser/ui/tree/asyncDataTree.ts | 5 ++ .../electron-browser/views/explorerView.ts | 3 +- .../electron-browser/views/explorerViewer.ts | 4 +- 6 files changed, 60 insertions(+), 22 deletions(-) diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index 18f70e285a8..b599fe92406 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -165,6 +165,7 @@ export class ListView implements ISpliceable, IDisposable { private setRowLineHeight: boolean; private supportDynamicHeights: boolean; private horizontalScrolling: boolean; + private scrollWidth: number | undefined; private canUseTranslate3d: boolean | undefined = undefined; private dnd: IListViewDragAndDrop; @@ -387,9 +388,24 @@ export class ListView implements ISpliceable, IDisposable { } } + this.scrollWidth = scrollWidth; this.scrollableElement.setScrollDimensions({ scrollWidth: scrollWidth + 10 }); } + updateWidth(index: number): void { + if (!this.horizontalScrolling || typeof this.scrollWidth === 'undefined') { + return; + } + + const item = this.items[index]; + this.measureItemWidth(item); + + if (typeof item.width !== 'undefined' && item.width > this.scrollWidth) { + this.scrollWidth = item.width; + this.scrollableElement.setScrollDimensions({ scrollWidth: this.scrollWidth + 10 }); + } + } + get length(): number { return this.items.length; } @@ -530,29 +546,10 @@ export class ListView implements ISpliceable, IDisposable { throw new Error(`No renderer found for template id ${item.templateId}`); } - if (this.horizontalScrolling) { - item.row.domNode!.style.width = 'fit-content'; - } - if (renderer) { renderer.renderElement(item.element, index, item.row.templateData); } - if (this.horizontalScrolling) { - item.width = DOM.getContentWidth(item.row.domNode!); - const style = window.getComputedStyle(item.row.domNode!); - - if (style.paddingLeft) { - item.width += parseFloat(style.paddingLeft); - } - - if (style.paddingRight) { - item.width += parseFloat(style.paddingRight); - } - - item.row.domNode!.style.width = ''; - } - const uri = this.dnd.getDragURI(item.element); item.dragStartDisposable.dispose(); @@ -563,10 +560,31 @@ export class ListView implements ISpliceable, IDisposable { } if (this.horizontalScrolling) { + this.measureItemWidth(item); this.eventuallyUpdateScrollWidth(); } } + private measureItemWidth(item: IItem): void { + if (!item.row || !item.row.domNode) { + return; + } + + item.row.domNode.style.width = 'fit-content'; + item.width = DOM.getContentWidth(item.row.domNode); + const style = window.getComputedStyle(item.row.domNode); + + if (style.paddingLeft) { + item.width += parseFloat(style.paddingLeft); + } + + if (style.paddingRight) { + item.width += parseFloat(style.paddingRight); + } + + item.row.domNode.style.width = ''; + } + private updateItemInDOM(item: IItem, index: number): void { item.row!.domNode!.style.top = `${this.elementTop(index)}px`; item.row!.domNode!.style.height = `${item.size}px`; diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 81dedadaa7e..87da7ffcb11 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -1243,6 +1243,10 @@ export class List implements ISpliceable, IDisposable { this.eventBufferer.bufferEvents(() => this.spliceable.splice(start, deleteCount, elements)); } + updateWidth(index: number): void { + this.view.updateWidth(index); + } + element(index: number): T { return this.view.element(index); } diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 3cace23df45..145e9366547 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -734,6 +734,16 @@ export abstract class AbstractTree implements IDisposable return this._options; } + updateWidth(element: TRef): void { + const index = this.model.getListIndex(element); + + if (index === -1) { + return; + } + + this.view.updateWidth(index); + } + // Widget getHTMLElement(): HTMLElement { diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 80b14c23900..c4ea62fed4a 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -395,6 +395,11 @@ export class AsyncDataTree implements IDisposable this.tree.refresh(node); } + updateWidth(element: T): void { + const node = this.getDataNode(element); + this.tree.updateWidth(node); + } + // Tree getNode(element: TInput | T = this.root.element): ITreeNode { diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 7bf3b826f07..67b3aa76db8 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -249,7 +249,8 @@ export class ExplorerView extends ViewletPanel { const explorerLabels = this.instantiationService.createInstance(ResourceLabels, { onDidChangeVisibility: this.onDidChangeBodyVisibility } as IResourceLabelsContainer); this.disposables.push(explorerLabels); - const filesRenderer = this.instantiationService.createInstance(FilesRenderer, explorerLabels); + const updateWidth = (stat: ExplorerItem) => this.tree.updateWidth(stat); + const filesRenderer = this.instantiationService.createInstance(FilesRenderer, explorerLabels, updateWidth); this.disposables.push(filesRenderer); this.disposables.push(createFileIconThemableTreeContainerScope(container, this.themeService)); diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index d2b763b4890..e9f412f022b 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -107,6 +107,7 @@ export class FilesRenderer implements ITreeRenderer void, @IContextViewService private readonly contextViewService: IContextViewService, @IThemeService private readonly themeService: IThemeService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -152,8 +153,7 @@ export class FilesRenderer implements ITreeRenderer { - // todo@isidor horizontal scrolling - // this.tree.updateWidth(stat); + this.updateWidth(stat); }); } From 5f4406ce838fb7520f4d7b5c99e16315bbd6c282 Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 28 Jan 2019 16:00:59 +0100 Subject: [PATCH 032/429] fixes #67187 --- src/vs/workbench/parts/files/browser/files.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/files/browser/files.ts b/src/vs/workbench/parts/files/browser/files.ts index e6953ee8700..006ae8c00db 100644 --- a/src/vs/workbench/parts/files/browser/files.ts +++ b/src/vs/workbench/parts/files/browser/files.ts @@ -27,8 +27,11 @@ export function getResourceForCommand(resource: URI | object, listService: IList if (focused.length) { focus = focused[0]; } - } else { - focus = list.getFocus(); + } else if (list instanceof WorkbenchAsyncDataTree) { + const focused = list.getFocus(); + if (focused.length) { + focus = focused[0]; + } } if (focus instanceof ExplorerItem) { @@ -47,7 +50,8 @@ export function getMultiSelectedResources(resource: URI | object, listService: I // Explorer if (list instanceof WorkbenchAsyncDataTree) { const selection = list.getSelection().map((fs: ExplorerItem) => fs.resource); - const focus = list.getFocus(); + const focusedElements = list.getFocus(); + const focus = focusedElements.length ? focusedElements[0] : undefined; const mainUriStr = URI.isUri(resource) ? resource.toString() : focus instanceof ExplorerItem ? focus.resource.toString() : undefined; // If the resource is passed it has to be a part of the returned context. // We only respect the selection if it contains the focused element. From 21585312c29ff26afac6fbc55eab8d3820254b4d Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 28 Jan 2019 16:05:18 +0100 Subject: [PATCH 033/429] [json] enable semantic selection --- .../client/src/cssMain.ts | 6 +- .../client/src/typings/ref.d.ts | 2 +- .../client/src/vscode.proposed.d.ts | 1142 ----------------- extensions/css-language-features/package.json | 2 +- .../client/src/typings/ref.d.ts | 1 + .../client/src/vscode.proposed.d.ts | 1142 ----------------- .../client/src/jsonMain.ts | 22 +- .../client/src/typings/ref.d.ts | 1 + .../json-language-features/package.json | 3 +- .../server/package.json | 2 +- .../server/src/jsonServerMain.ts | 11 + .../json-language-features/server/yarn.lock | 8 +- 12 files changed, 46 insertions(+), 2296 deletions(-) delete mode 100644 extensions/css-language-features/client/src/vscode.proposed.d.ts delete mode 100644 extensions/html-language-features/client/src/vscode.proposed.d.ts diff --git a/extensions/css-language-features/client/src/cssMain.ts b/extensions/css-language-features/client/src/cssMain.ts index 3108b13e5bd..18f82a02d77 100644 --- a/extensions/css-language-features/client/src/cssMain.ts +++ b/extensions/css-language-features/client/src/cssMain.ts @@ -94,9 +94,9 @@ export function activate(context: ExtensionContext) { }); } }; - languages.registerSelectionRangeProvider('css', selectionRangeProvider); - languages.registerSelectionRangeProvider('less', selectionRangeProvider); - languages.registerSelectionRangeProvider('scss', selectionRangeProvider); + documentSelector.forEach(selector => { + languages.registerSelectionRangeProvider(selector, selectionRangeProvider); + }); function initCompletionProvider(): Disposable { const regionCompletionRegExpr = /^(\s*)(\/(\*\s*(#\w*)?)?)?$/; diff --git a/extensions/css-language-features/client/src/typings/ref.d.ts b/extensions/css-language-features/client/src/typings/ref.d.ts index 9c1a5df18ed..de602d3f8d6 100644 --- a/extensions/css-language-features/client/src/typings/ref.d.ts +++ b/extensions/css-language-features/client/src/typings/ref.d.ts @@ -2,5 +2,5 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ - /// +/// diff --git a/extensions/css-language-features/client/src/vscode.proposed.d.ts b/extensions/css-language-features/client/src/vscode.proposed.d.ts deleted file mode 100644 index 44ad9a1d01b..00000000000 --- a/extensions/css-language-features/client/src/vscode.proposed.d.ts +++ /dev/null @@ -1,1142 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * This is the place for API experiments and proposals. - * These API are NOT stable and subject to change. They are only available in the Insiders - * distribution and CANNOT be used in published extensions. - * - * To test these API in local environment: - * - Use Insiders release of VS Code. - * - Add `"enableProposedApi": true` to your package.json. - * - Copy this file to your project. - */ - -declare module 'vscode' { - - //#region Joh - vscode.open - - export namespace env { - - /** - * Opens an *external* item, e.g. a http(s) or mailto-link, using the - * default application. - * - * *Note* that [`showTextDocument`](#window.showTextDocument) is the right - * way to open a text document inside the editor, not this function. - * - * @param target The uri that should be opened. - * @returns A promise indicating if open was successful. - */ - export function open(target: Uri): Thenable; - } - - //#endregion - - //#region Joh - selection range provider - - export class SelectionRangeKind { - - /** - * Empty Kind. - */ - static readonly Empty: SelectionRangeKind; - - /** - * The statment kind, its value is `statement`, possible extensions can be - * `statement.if` etc - */ - static readonly Statement: SelectionRangeKind; - - /** - * The declaration kind, its value is `declaration`, possible extensions can be - * `declaration.function`, `declaration.class` etc. - */ - static readonly Declaration: SelectionRangeKind; - - readonly value: string; - - private constructor(value: string); - - append(value: string): SelectionRangeKind; - } - - export class SelectionRange { - kind: SelectionRangeKind; - range: Range; - constructor(range: Range, kind: SelectionRangeKind); - } - - export interface SelectionRangeProvider { - /** - * Provide selection ranges starting at a given position. The first range must [contain](#Range.contains) - * position and subsequent ranges must contain the previous range. - */ - provideSelectionRanges(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; - } - - export namespace languages { - export function registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable; - } - - //#endregion - - //#region Joh - read/write in chunks - - export interface FileSystemProvider { - open?(resource: Uri): number | Thenable; - close?(fd: number): void | Thenable; - read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable; - write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable; - } - - //#endregion - - //#region Rob: search provider - - /** - * The parameters of a query for text search. - */ - export interface TextSearchQuery { - /** - * The text pattern to search for. - */ - pattern: string; - - /** - * Whether or not `pattern` should match multiple lines of text. - */ - isMultiline?: boolean; - - /** - * Whether or not `pattern` should be interpreted as a regular expression. - */ - isRegExp?: boolean; - - /** - * Whether or not the search should be case-sensitive. - */ - isCaseSensitive?: boolean; - - /** - * Whether or not to search for whole word matches only. - */ - isWordMatch?: boolean; - } - - /** - * A file glob pattern to match file paths against. - * TODO@roblou - merge this with the GlobPattern docs/definition in vscode.d.ts. - * @see [GlobPattern](#GlobPattern) - */ - export type GlobString = string; - - /** - * Options common to file and text search - */ - export interface SearchOptions { - /** - * The root folder to search within. - */ - folder: Uri; - - /** - * Files that match an `includes` glob pattern should be included in the search. - */ - includes: GlobString[]; - - /** - * Files that match an `excludes` glob pattern should be excluded from the search. - */ - excludes: GlobString[]; - - /** - * Whether external files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useIgnoreFiles"`. - */ - useIgnoreFiles: boolean; - - /** - * Whether symlinks should be followed while searching. - * See the vscode setting `"search.followSymlinks"`. - */ - followSymlinks: boolean; - - /** - * Whether global files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useGlobalIgnoreFiles"`. - */ - useGlobalIgnoreFiles: boolean; - - } - - /** - * Options to specify the size of the result text preview. - * These options don't affect the size of the match itself, just the amount of preview text. - */ - export interface TextSearchPreviewOptions { - /** - * The maximum number of lines in the preview. - * Only search providers that support multiline search will ever return more than one line in the match. - */ - matchLines: number; - - /** - * The maximum number of characters included per line. - */ - charsPerLine: number; - } - - /** - * Options that apply to text search. - */ - export interface TextSearchOptions extends SearchOptions { - /** - * The maximum number of results to be returned. - */ - maxResults: number; - - /** - * Options to specify the size of the result text preview. - */ - previewOptions?: TextSearchPreviewOptions; - - /** - * Exclude files larger than `maxFileSize` in bytes. - */ - maxFileSize?: number; - - /** - * Interpret files using this encoding. - * See the vscode setting `"files.encoding"` - */ - encoding?: string; - - /** - * Number of lines of context to include before each match. - */ - beforeContext?: number; - - /** - * Number of lines of context to include after each match. - */ - afterContext?: number; - } - - /** - * Information collected when text search is complete. - */ - export interface TextSearchComplete { - /** - * Whether the search hit the limit on the maximum number of search results. - * `maxResults` on [`TextSearchOptions`](#TextSearchOptions) specifies the max number of results. - * - If exactly that number of matches exist, this should be false. - * - If `maxResults` matches are returned and more exist, this should be true. - * - If search hits an internal limit which is less than `maxResults`, this should be true. - */ - limitHit?: boolean; - } - - /** - * The parameters of a query for file search. - */ - export interface FileSearchQuery { - /** - * The search pattern to match against file paths. - */ - pattern: string; - } - - /** - * Options that apply to file search. - */ - export interface FileSearchOptions extends SearchOptions { - /** - * The maximum number of results to be returned. - */ - maxResults?: number; - - /** - * A CancellationToken that represents the session for this search query. If the provider chooses to, this object can be used as the key for a cache, - * and searches with the same session object can search the same cache. When the token is cancelled, the session is complete and the cache can be cleared. - */ - session?: CancellationToken; - } - - /** - * Options that apply to requesting the file index. - */ - export interface FileIndexOptions extends SearchOptions { } - - /** - * A preview of the text result. - */ - export interface TextSearchMatchPreview { - /** - * The matching lines of text, or a portion of the matching line that contains the match. - */ - text: string; - - /** - * The Range within `text` corresponding to the text of the match. - * The number of matches must match the TextSearchMatch's range property. - */ - matches: Range | Range[]; - } - - /** - * A match from a text search - */ - export interface TextSearchMatch { - /** - * The uri for the matching document. - */ - uri: Uri; - - /** - * The range of the match within the document, or multiple ranges for multiple matches. - */ - ranges: Range | Range[]; - - /** - * A preview of the text match. - */ - preview: TextSearchMatchPreview; - } - - /** - * A line of context surrounding a TextSearchMatch. - */ - export interface TextSearchContext { - /** - * The uri for the matching document. - */ - uri: Uri; - - /** - * One line of text. - * previewOptions.charsPerLine applies to this - */ - text: string; - - /** - * The line number of this line of context. - */ - lineNumber: number; - } - - export type TextSearchResult = TextSearchMatch | TextSearchContext; - - /** - * A FileIndexProvider provides a list of files in the given folder. VS Code will filter that list for searching with quickopen or from other extensions. - * - * A FileIndexProvider is the simpler of two ways to implement file search in VS Code. Use a FileIndexProvider if you are able to provide a listing of all files - * in a folder, and want VS Code to filter them according to the user's search query. - * - * The FileIndexProvider will be invoked once when quickopen is opened, and VS Code will filter the returned list. It will also be invoked when - * `workspace.findFiles` is called. - * - * If a [`FileSearchProvider`](#FileSearchProvider) is registered for the scheme, that provider will be used instead. - */ - export interface FileIndexProvider { - /** - * Provide the set of files in the folder. - * @param options A set of options to consider while searching. - * @param token A cancellation token. - */ - provideFileIndex(options: FileIndexOptions, token: CancellationToken): ProviderResult; - } - - /** - * A FileSearchProvider provides search results for files in the given folder that match a query string. It can be invoked by quickopen or other extensions. - * - * A FileSearchProvider is the more powerful of two ways to implement file search in VS Code. Use a FileSearchProvider if you wish to search within a folder for - * all files that match the user's query. - * - * The FileSearchProvider will be invoked on every keypress in quickopen. When `workspace.findFiles` is called, it will be invoked with an empty query string, - * and in that case, every file in the folder should be returned. - * - * @see [FileIndexProvider](#FileIndexProvider) - */ - export interface FileSearchProvider { - /** - * Provide the set of files that match a certain file path pattern. - * @param query The parameters for this query. - * @param options A set of options to consider while searching files. - * @param progress A progress callback that must be invoked for all results. - * @param token A cancellation token. - */ - provideFileSearchResults(query: FileSearchQuery, options: FileSearchOptions, token: CancellationToken): ProviderResult; - } - - /** - * A TextSearchProvider provides search results for text results inside files in the workspace. - */ - export interface TextSearchProvider { - /** - * Provide results that match the given text pattern. - * @param query The parameters for this query. - * @param options A set of options to consider while searching. - * @param progress A progress callback that must be invoked for all results. - * @param token A cancellation token. - */ - provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress, token: CancellationToken): ProviderResult; - } - - /** - * Options that can be set on a findTextInFiles search. - */ - export interface FindTextInFilesOptions { - /** - * A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern - * will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern) - * to restrict the search results to a [workspace folder](#WorkspaceFolder). - */ - include?: GlobPattern; - - /** - * A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern - * will be matched against the file paths of resulting matches relative to their workspace. When `undefined` only default excludes will - * apply, when `null` no excludes will apply. - */ - exclude?: GlobPattern | null; - - /** - * The maximum number of results to search for - */ - maxResults?: number; - - /** - * Whether external files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useIgnoreFiles"`. - */ - useIgnoreFiles?: boolean; - - /** - * Whether global files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useGlobalIgnoreFiles"`. - */ - useGlobalIgnoreFiles?: boolean; - - /** - * Whether symlinks should be followed while searching. - * See the vscode setting `"search.followSymlinks"`. - */ - followSymlinks?: boolean; - - /** - * Interpret files using this encoding. - * See the vscode setting `"files.encoding"` - */ - encoding?: string; - - /** - * Options to specify the size of the result text preview. - */ - previewOptions?: TextSearchPreviewOptions; - - /** - * Number of lines of context to include before each match. - */ - beforeContext?: number; - - /** - * Number of lines of context to include after each match. - */ - afterContext?: number; - } - - export namespace workspace { - /** - * DEPRECATED - */ - export function registerSearchProvider(): Disposable; - - /** - * Register a file index provider. - * - * Only one provider can be registered per scheme. - * - * @param scheme The provider will be invoked for workspace folders that have this file scheme. - * @param provider The provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerFileIndexProvider(scheme: string, provider: FileIndexProvider): Disposable; - - /** - * Register a search provider. - * - * Only one provider can be registered per scheme. - * - * @param scheme The provider will be invoked for workspace folders that have this file scheme. - * @param provider The provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerFileSearchProvider(scheme: string, provider: FileSearchProvider): Disposable; - - /** - * Register a text search provider. - * - * Only one provider can be registered per scheme. - * - * @param scheme The provider will be invoked for workspace folders that have this file scheme. - * @param provider The provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerTextSearchProvider(scheme: string, provider: TextSearchProvider): Disposable; - - /** - * Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace. - * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words. - * @param callback A callback, called for each result - * @param token A token that can be used to signal cancellation to the underlying search engine. - * @return A thenable that resolves when the search is complete. - */ - export function findTextInFiles(query: TextSearchQuery, callback: (result: TextSearchResult) => void, token?: CancellationToken): Thenable; - - /** - * Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace. - * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words. - * @param options An optional set of query options. Include and exclude patterns, maxResults, etc. - * @param callback A callback, called for each result - * @param token A token that can be used to signal cancellation to the underlying search engine. - * @return A thenable that resolves when the search is complete. - */ - export function findTextInFiles(query: TextSearchQuery, options: FindTextInFilesOptions, callback: (result: TextSearchResult) => void, token?: CancellationToken): Thenable; - } - - //#endregion - - //#region Joao: diff command - - /** - * The contiguous set of modified lines in a diff. - */ - export interface LineChange { - readonly originalStartLineNumber: number; - readonly originalEndLineNumber: number; - readonly modifiedStartLineNumber: number; - readonly modifiedEndLineNumber: number; - } - - export namespace commands { - - /** - * Registers a diff information command that can be invoked via a keyboard shortcut, - * a menu item, an action, or directly. - * - * Diff information commands are different from ordinary [commands](#commands.registerCommand) as - * they only execute when there is an active diff editor when the command is called, and the diff - * information has been computed. Also, the command handler of an editor command has access to - * the diff information. - * - * @param command A unique identifier for the command. - * @param callback A command handler function with access to the [diff information](#LineChange). - * @param thisArg The `this` context used when invoking the handler function. - * @return Disposable which unregisters this command on disposal. - */ - export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable; - } - - //#endregion - - //#region Joh: decorations - - //todo@joh -> make class - export interface DecorationData { - letter?: string; - title?: string; - color?: ThemeColor; - priority?: number; - bubble?: boolean; - source?: string; // hacky... we should remove it and use equality under the hood - } - - export interface SourceControlResourceDecorations { - source?: string; - letter?: string; - color?: ThemeColor; - } - - export interface DecorationProvider { - onDidChangeDecorations: Event; - provideDecoration(uri: Uri, token: CancellationToken): ProviderResult; - } - - export namespace window { - export function registerDecorationProvider(provider: DecorationProvider): Disposable; - } - - //#endregion - - //#region André: debug - - // deprecated - - export interface DebugConfigurationProvider { - /** - * Deprecated, use DebugAdapterDescriptorFactory.provideDebugAdapter instead. - * @deprecated Use DebugAdapterDescriptorFactory.createDebugAdapterDescriptor instead - */ - debugAdapterExecutable?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult; - } - - //#endregion - - //#region Rob, Matt: logging - - /** - * The severity level of a log message - */ - export enum LogLevel { - Trace = 1, - Debug = 2, - Info = 3, - Warning = 4, - Error = 5, - Critical = 6, - Off = 7 - } - - export namespace env { - /** - * Current logging level. - */ - export const logLevel: LogLevel; - - /** - * An [event](#Event) that fires when the log level has changed. - */ - export const onDidChangeLogLevel: Event; - } - - //#endregion - - //#region Joao: SCM validation - - /** - * Represents the validation type of the Source Control input. - */ - export enum SourceControlInputBoxValidationType { - - /** - * Something not allowed by the rules of a language or other means. - */ - Error = 0, - - /** - * Something suspicious but allowed. - */ - Warning = 1, - - /** - * Something to inform about but not a problem. - */ - Information = 2 - } - - export interface SourceControlInputBoxValidation { - - /** - * The validation message to display. - */ - readonly message: string; - - /** - * The validation type. - */ - readonly type: SourceControlInputBoxValidationType; - } - - /** - * Represents the input box in the Source Control viewlet. - */ - export interface SourceControlInputBox { - - /** - * A validation function for the input box. It's possible to change - * the validation provider simply by setting this property to a different function. - */ - validateInput?(value: string, cursorPosition: number): ProviderResult; - } - - //#endregion - - //#region Joao: SCM selected provider - - export interface SourceControl { - - /** - * Whether the source control is selected. - */ - readonly selected: boolean; - - /** - * An event signaling when the selection state changes. - */ - readonly onDidChangeSelection: Event; - } - - //#endregion - - //#region Joao: SCM Input Box - - /** - * Represents the input box in the Source Control viewlet. - */ - export interface SourceControlInputBox { - - /** - * Controls whether the input box is visible (default is `true`). - */ - visible: boolean; - } - - //#endregion - - //#region Comments - /** - * Comments provider related APIs are still in early stages, they may be changed significantly during our API experiments. - */ - - interface CommentInfo { - /** - * All of the comment threads associated with the document. - */ - threads: CommentThread[]; - - /** - * The ranges of the document which support commenting. - */ - commentingRanges?: Range[]; - - /** - * If it's in draft mode or not - */ - inDraftMode?: boolean; - } - - export enum CommentThreadCollapsibleState { - /** - * Determines an item is collapsed - */ - Collapsed = 0, - /** - * Determines an item is expanded - */ - Expanded = 1 - } - - /** - * A collection of comments representing a conversation at a particular range in a document. - */ - interface CommentThread { - /** - * A unique identifier of the comment thread. - */ - threadId: string; - - /** - * The uri of the document the thread has been created on. - */ - resource: Uri; - - /** - * The range the comment thread is located within the document. The thread icon will be shown - * at the first line of the range. - */ - range: Range; - - /** - * The ordered comments of the thread. - */ - comments: Comment[]; - - /** - * Whether the thread should be collapsed or expanded when opening the document. Defaults to Collapsed. - */ - collapsibleState?: CommentThreadCollapsibleState; - } - - /** - * A comment is displayed within the editor or the Comments Panel, depending on how it is provided. - */ - interface Comment { - /** - * The id of the comment - */ - commentId: string; - - /** - * The text of the comment - */ - body: MarkdownString; - - /** - * The display name of the user who created the comment - */ - userName: string; - - /** - * The icon path for the user who created the comment - */ - userIconPath?: Uri; - - - /** - * @deprecated Use userIconPath instead. The avatar src of the user who created the comment - */ - gravatar?: string; - - /** - * Whether the current user has permission to edit the comment. - * - * This will be treated as false if the comment is provided by a `WorkspaceCommentProvider`, or - * if it is provided by a `DocumentCommentProvider` and no `editComment` method is given. - */ - canEdit?: boolean; - - /** - * Whether the current user has permission to delete the comment. - * - * This will be treated as false if the comment is provided by a `WorkspaceCommentProvider`, or - * if it is provided by a `DocumentCommentProvider` and no `deleteComment` method is given. - */ - canDelete?: boolean; - - /** - * The command to be executed if the comment is selected in the Comments Panel - */ - command?: Command; - - isDraft?: boolean; - } - - export interface CommentThreadChangedEvent { - /** - * Added comment threads. - */ - readonly added: CommentThread[]; - - /** - * Removed comment threads. - */ - readonly removed: CommentThread[]; - - /** - * Changed comment threads. - */ - readonly changed: CommentThread[]; - - /** - * Changed draft mode - */ - readonly inDraftMode: boolean; - } - - interface DocumentCommentProvider { - /** - * Provide the commenting ranges and comment threads for the given document. The comments are displayed within the editor. - */ - provideDocumentComments(document: TextDocument, token: CancellationToken): Promise; - - /** - * Called when a user adds a new comment thread in the document at the specified range, with body text. - */ - createNewCommentThread(document: TextDocument, range: Range, text: string, token: CancellationToken): Promise; - - /** - * Called when a user replies to a new comment thread in the document at the specified range, with body text. - */ - replyToCommentThread(document: TextDocument, range: Range, commentThread: CommentThread, text: string, token: CancellationToken): Promise; - - /** - * Called when a user edits the comment body to the be new text. - */ - editComment?(document: TextDocument, comment: Comment, text: string, token: CancellationToken): Promise; - - /** - * Called when a user deletes the comment. - */ - deleteComment?(document: TextDocument, comment: Comment, token: CancellationToken): Promise; - - startDraft?(document: TextDocument, token: CancellationToken): Promise; - deleteDraft?(document: TextDocument, token: CancellationToken): Promise; - finishDraft?(document: TextDocument, token: CancellationToken): Promise; - - startDraftLabel?: string; - deleteDraftLabel?: string; - finishDraftLabel?: string; - - /** - * Notify of updates to comment threads. - */ - onDidChangeCommentThreads: Event; - } - - interface WorkspaceCommentProvider { - /** - * Provide all comments for the workspace. Comments are shown within the comments panel. Selecting a comment - * from the panel runs the comment's command. - */ - provideWorkspaceComments(token: CancellationToken): Promise; - - /** - * Notify of updates to comment threads. - */ - onDidChangeCommentThreads: Event; - } - - namespace workspace { - export function registerDocumentCommentProvider(provider: DocumentCommentProvider): Disposable; - export function registerWorkspaceCommentProvider(provider: WorkspaceCommentProvider): Disposable; - } - //#endregion - - //#region Terminal - - export interface Terminal { - /** - * Fires when the terminal's pty slave pseudo-device is written to. In other words, this - * provides access to the raw data stream from the process running within the terminal, - * including VT sequences. - */ - onDidWriteData: Event; - } - - /** - * Represents the dimensions of a terminal. - */ - export interface TerminalDimensions { - /** - * The number of columns in the terminal. - */ - readonly columns: number; - - /** - * The number of rows in the terminal. - */ - readonly rows: number; - } - - /** - * Represents a terminal without a process where all interaction and output in the terminal is - * controlled by an extension. This is similar to an output window but has the same VT sequence - * compatility as the regular terminal. - * - * Note that an instance of [Terminal](#Terminal) will be created when a TerminalRenderer is - * created with all its APIs available for use by extensions. When using the Terminal object - * of a TerminalRenderer it acts just like normal only the extension that created the - * TerminalRenderer essentially acts as a process. For example when an - * [Terminal.onDidWriteData](#Terminal.onDidWriteData) listener is registered, that will fire - * when [TerminalRenderer.write](#TerminalRenderer.write) is called. Similarly when - * [Terminal.sendText](#Terminal.sendText) is triggered that will fire the - * [TerminalRenderer.onDidAcceptInput](#TerminalRenderer.onDidAcceptInput) event. - * - * **Example:** Create a terminal renderer, show it and write hello world in red - * ```typescript - * const renderer = window.createTerminalRenderer('foo'); - * renderer.terminal.then(t => t.show()); - * renderer.write('\x1b[31mHello world\x1b[0m'); - * ``` - */ - export interface TerminalRenderer { - /** - * The name of the terminal, this will appear in the terminal selector. - */ - name: string; - - /** - * The dimensions of the terminal, the rows and columns of the terminal can only be set to - * a value smaller than the maximum value, if this is undefined the terminal will auto fit - * to the maximum value [maximumDimensions](TerminalRenderer.maximumDimensions). - * - * **Example:** Override the dimensions of a TerminalRenderer to 20 columns and 10 rows - * ```typescript - * terminalRenderer.dimensions = { - * cols: 20, - * rows: 10 - * }; - * ``` - */ - dimensions: TerminalDimensions | undefined; - - /** - * The maximum dimensions of the terminal, this will be undefined immediately after a - * terminal renderer is created and also until the terminal becomes visible in the UI. - * Listen to [onDidChangeMaximumDimensions](TerminalRenderer.onDidChangeMaximumDimensions) - * to get notified when this value changes. - */ - readonly maximumDimensions: TerminalDimensions | undefined; - - /** - * The corressponding [Terminal](#Terminal) for this TerminalRenderer. - */ - readonly terminal: Terminal; - - /** - * Write text to the terminal. Unlike [Terminal.sendText](#Terminal.sendText) which sends - * text to the underlying _process_, this will write the text to the terminal itself. - * - * **Example:** Write red text to the terminal - * ```typescript - * terminalRenderer.write('\x1b[31mHello world\x1b[0m'); - * ``` - * - * **Example:** Move the cursor to the 10th row and 20th column and write an asterisk - * ```typescript - * terminalRenderer.write('\x1b[10;20H*'); - * ``` - * - * @param text The text to write. - */ - write(text: string): void; - - /** - * An event which fires on keystrokes in the terminal or when an extension calls - * [Terminal.sendText](#Terminal.sendText). Keystrokes are converted into their - * corresponding VT sequence representation. - * - * **Example:** Simulate interaction with the terminal from an outside extension or a - * workbench command such as `workbench.action.terminal.runSelectedText` - * ```typescript - * const terminalRenderer = window.createTerminalRenderer('test'); - * terminalRenderer.onDidAcceptInput(data => { - * cosole.log(data); // 'Hello world' - * }); - * terminalRenderer.terminal.then(t => t.sendText('Hello world')); - * ``` - */ - readonly onDidAcceptInput: Event; - - /** - * An event which fires when the [maximum dimensions](#TerminalRenderer.maimumDimensions) of - * the terminal renderer change. - */ - readonly onDidChangeMaximumDimensions: Event; - } - - export namespace window { - /** - * Create a [TerminalRenderer](#TerminalRenderer). - * - * @param name The name of the terminal renderer, this shows up in the terminal selector. - */ - export function createTerminalRenderer(name: string): TerminalRenderer; - } - - //#endregion - - //#region Joh -> exclusive document filters - - export interface DocumentFilter { - exclusive?: boolean; - } - - //#endregion - - //#region mjbvz,joh: https://github.com/Microsoft/vscode/issues/43768 - export interface FileRenameEvent { - readonly oldUri: Uri; - readonly newUri: Uri; - } - - export interface FileWillRenameEvent { - readonly oldUri: Uri; - readonly newUri: Uri; - waitUntil(thenable: Thenable): void; - } - - export namespace workspace { - export const onWillRenameFile: Event; - export const onDidRenameFile: Event; - } - //#endregion - - //#region Alex - OnEnter enhancement - export interface OnEnterRule { - /** - * This rule will only execute if the text above the this line matches this regular expression. - */ - oneLineAboveText?: RegExp; - } - //#endregion - - //#region Tree View - - export interface TreeView { - - /** - * An optional human-readable message that will be rendered in the view. - */ - message?: string | MarkdownString; - - } - - /** - * Label describing the [Tree item](#TreeItem) - */ - export interface TreeItemLabel { - - /** - * A human-readable string describing the [Tree item](#TreeItem). - */ - label: string; - - /** - * Ranges in the label to highlight. A range is defined as a tuple of two number where the - * first is the inclusive start index and the second the exclusive end index - */ - highlights?: [number, number][]; - - } - - export class TreeItem2 extends TreeItem { - /** - * Label describing this item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri). - */ - label?: string | TreeItemLabel | /* for compilation */ any; - - /** - * @param label Label describing this item - * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None) - */ - constructor(label: TreeItemLabel, collapsibleState?: TreeItemCollapsibleState); - } - //#endregion - - //#region SignatureHelpContext active paramters - mjbvz - export interface SignatureHelpContext { - /** - * The currently active [`SignatureHelp`](#SignatureHelp). - * - * Will have the [`SignatureHelp.activeSignature`] field updated based on user arrowing through sig help - */ - readonly activeSignatureHelp?: SignatureHelp; - } - //#endregion - - //#region CodeAction.isPreferred - mjbvz - export interface CodeAction { - /** - * If the action is a preferred action or fix to take. - * - * A quick fix should be marked preferred if it properly addresses the underlying error. - * A refactoring should be marked preferred if it is the most reasonable choice of actions to take. - */ - isPreferred?: boolean; - } - //#endregion - - - //#region Autofix - mjbvz - export namespace CodeActionKind { - /** - * Base kind for an auto fix source action: `source.autoFix`. - */ - export const SourceAutoFix: CodeActionKind; - } - //#endregion -} \ No newline at end of file diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index 7ef56c5f423..514196d3608 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -1,5 +1,4 @@ { - "enableProposedApi": true, "name": "css-language-features", "displayName": "%displayName%", "description": "%description%", @@ -16,6 +15,7 @@ "onCommand:_css.applyCodeAction" ], "main": "./client/out/cssMain", + "enableProposedApi": true, "scripts": { "compile": "gulp compile-extension:css-language-features-client compile-extension:css-language-features-server", "watch": "gulp watch-extension:css-language-features-client watch-extension:css-language-features-server", diff --git a/extensions/html-language-features/client/src/typings/ref.d.ts b/extensions/html-language-features/client/src/typings/ref.d.ts index 9c1a5df18ed..be1d1b0b776 100644 --- a/extensions/html-language-features/client/src/typings/ref.d.ts +++ b/extensions/html-language-features/client/src/typings/ref.d.ts @@ -4,3 +4,4 @@ *--------------------------------------------------------------------------------------------*/ /// +/// diff --git a/extensions/html-language-features/client/src/vscode.proposed.d.ts b/extensions/html-language-features/client/src/vscode.proposed.d.ts deleted file mode 100644 index 44ad9a1d01b..00000000000 --- a/extensions/html-language-features/client/src/vscode.proposed.d.ts +++ /dev/null @@ -1,1142 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * This is the place for API experiments and proposals. - * These API are NOT stable and subject to change. They are only available in the Insiders - * distribution and CANNOT be used in published extensions. - * - * To test these API in local environment: - * - Use Insiders release of VS Code. - * - Add `"enableProposedApi": true` to your package.json. - * - Copy this file to your project. - */ - -declare module 'vscode' { - - //#region Joh - vscode.open - - export namespace env { - - /** - * Opens an *external* item, e.g. a http(s) or mailto-link, using the - * default application. - * - * *Note* that [`showTextDocument`](#window.showTextDocument) is the right - * way to open a text document inside the editor, not this function. - * - * @param target The uri that should be opened. - * @returns A promise indicating if open was successful. - */ - export function open(target: Uri): Thenable; - } - - //#endregion - - //#region Joh - selection range provider - - export class SelectionRangeKind { - - /** - * Empty Kind. - */ - static readonly Empty: SelectionRangeKind; - - /** - * The statment kind, its value is `statement`, possible extensions can be - * `statement.if` etc - */ - static readonly Statement: SelectionRangeKind; - - /** - * The declaration kind, its value is `declaration`, possible extensions can be - * `declaration.function`, `declaration.class` etc. - */ - static readonly Declaration: SelectionRangeKind; - - readonly value: string; - - private constructor(value: string); - - append(value: string): SelectionRangeKind; - } - - export class SelectionRange { - kind: SelectionRangeKind; - range: Range; - constructor(range: Range, kind: SelectionRangeKind); - } - - export interface SelectionRangeProvider { - /** - * Provide selection ranges starting at a given position. The first range must [contain](#Range.contains) - * position and subsequent ranges must contain the previous range. - */ - provideSelectionRanges(document: TextDocument, position: Position, token: CancellationToken): ProviderResult; - } - - export namespace languages { - export function registerSelectionRangeProvider(selector: DocumentSelector, provider: SelectionRangeProvider): Disposable; - } - - //#endregion - - //#region Joh - read/write in chunks - - export interface FileSystemProvider { - open?(resource: Uri): number | Thenable; - close?(fd: number): void | Thenable; - read?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable; - write?(fd: number, pos: number, data: Uint8Array, offset: number, length: number): number | Thenable; - } - - //#endregion - - //#region Rob: search provider - - /** - * The parameters of a query for text search. - */ - export interface TextSearchQuery { - /** - * The text pattern to search for. - */ - pattern: string; - - /** - * Whether or not `pattern` should match multiple lines of text. - */ - isMultiline?: boolean; - - /** - * Whether or not `pattern` should be interpreted as a regular expression. - */ - isRegExp?: boolean; - - /** - * Whether or not the search should be case-sensitive. - */ - isCaseSensitive?: boolean; - - /** - * Whether or not to search for whole word matches only. - */ - isWordMatch?: boolean; - } - - /** - * A file glob pattern to match file paths against. - * TODO@roblou - merge this with the GlobPattern docs/definition in vscode.d.ts. - * @see [GlobPattern](#GlobPattern) - */ - export type GlobString = string; - - /** - * Options common to file and text search - */ - export interface SearchOptions { - /** - * The root folder to search within. - */ - folder: Uri; - - /** - * Files that match an `includes` glob pattern should be included in the search. - */ - includes: GlobString[]; - - /** - * Files that match an `excludes` glob pattern should be excluded from the search. - */ - excludes: GlobString[]; - - /** - * Whether external files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useIgnoreFiles"`. - */ - useIgnoreFiles: boolean; - - /** - * Whether symlinks should be followed while searching. - * See the vscode setting `"search.followSymlinks"`. - */ - followSymlinks: boolean; - - /** - * Whether global files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useGlobalIgnoreFiles"`. - */ - useGlobalIgnoreFiles: boolean; - - } - - /** - * Options to specify the size of the result text preview. - * These options don't affect the size of the match itself, just the amount of preview text. - */ - export interface TextSearchPreviewOptions { - /** - * The maximum number of lines in the preview. - * Only search providers that support multiline search will ever return more than one line in the match. - */ - matchLines: number; - - /** - * The maximum number of characters included per line. - */ - charsPerLine: number; - } - - /** - * Options that apply to text search. - */ - export interface TextSearchOptions extends SearchOptions { - /** - * The maximum number of results to be returned. - */ - maxResults: number; - - /** - * Options to specify the size of the result text preview. - */ - previewOptions?: TextSearchPreviewOptions; - - /** - * Exclude files larger than `maxFileSize` in bytes. - */ - maxFileSize?: number; - - /** - * Interpret files using this encoding. - * See the vscode setting `"files.encoding"` - */ - encoding?: string; - - /** - * Number of lines of context to include before each match. - */ - beforeContext?: number; - - /** - * Number of lines of context to include after each match. - */ - afterContext?: number; - } - - /** - * Information collected when text search is complete. - */ - export interface TextSearchComplete { - /** - * Whether the search hit the limit on the maximum number of search results. - * `maxResults` on [`TextSearchOptions`](#TextSearchOptions) specifies the max number of results. - * - If exactly that number of matches exist, this should be false. - * - If `maxResults` matches are returned and more exist, this should be true. - * - If search hits an internal limit which is less than `maxResults`, this should be true. - */ - limitHit?: boolean; - } - - /** - * The parameters of a query for file search. - */ - export interface FileSearchQuery { - /** - * The search pattern to match against file paths. - */ - pattern: string; - } - - /** - * Options that apply to file search. - */ - export interface FileSearchOptions extends SearchOptions { - /** - * The maximum number of results to be returned. - */ - maxResults?: number; - - /** - * A CancellationToken that represents the session for this search query. If the provider chooses to, this object can be used as the key for a cache, - * and searches with the same session object can search the same cache. When the token is cancelled, the session is complete and the cache can be cleared. - */ - session?: CancellationToken; - } - - /** - * Options that apply to requesting the file index. - */ - export interface FileIndexOptions extends SearchOptions { } - - /** - * A preview of the text result. - */ - export interface TextSearchMatchPreview { - /** - * The matching lines of text, or a portion of the matching line that contains the match. - */ - text: string; - - /** - * The Range within `text` corresponding to the text of the match. - * The number of matches must match the TextSearchMatch's range property. - */ - matches: Range | Range[]; - } - - /** - * A match from a text search - */ - export interface TextSearchMatch { - /** - * The uri for the matching document. - */ - uri: Uri; - - /** - * The range of the match within the document, or multiple ranges for multiple matches. - */ - ranges: Range | Range[]; - - /** - * A preview of the text match. - */ - preview: TextSearchMatchPreview; - } - - /** - * A line of context surrounding a TextSearchMatch. - */ - export interface TextSearchContext { - /** - * The uri for the matching document. - */ - uri: Uri; - - /** - * One line of text. - * previewOptions.charsPerLine applies to this - */ - text: string; - - /** - * The line number of this line of context. - */ - lineNumber: number; - } - - export type TextSearchResult = TextSearchMatch | TextSearchContext; - - /** - * A FileIndexProvider provides a list of files in the given folder. VS Code will filter that list for searching with quickopen or from other extensions. - * - * A FileIndexProvider is the simpler of two ways to implement file search in VS Code. Use a FileIndexProvider if you are able to provide a listing of all files - * in a folder, and want VS Code to filter them according to the user's search query. - * - * The FileIndexProvider will be invoked once when quickopen is opened, and VS Code will filter the returned list. It will also be invoked when - * `workspace.findFiles` is called. - * - * If a [`FileSearchProvider`](#FileSearchProvider) is registered for the scheme, that provider will be used instead. - */ - export interface FileIndexProvider { - /** - * Provide the set of files in the folder. - * @param options A set of options to consider while searching. - * @param token A cancellation token. - */ - provideFileIndex(options: FileIndexOptions, token: CancellationToken): ProviderResult; - } - - /** - * A FileSearchProvider provides search results for files in the given folder that match a query string. It can be invoked by quickopen or other extensions. - * - * A FileSearchProvider is the more powerful of two ways to implement file search in VS Code. Use a FileSearchProvider if you wish to search within a folder for - * all files that match the user's query. - * - * The FileSearchProvider will be invoked on every keypress in quickopen. When `workspace.findFiles` is called, it will be invoked with an empty query string, - * and in that case, every file in the folder should be returned. - * - * @see [FileIndexProvider](#FileIndexProvider) - */ - export interface FileSearchProvider { - /** - * Provide the set of files that match a certain file path pattern. - * @param query The parameters for this query. - * @param options A set of options to consider while searching files. - * @param progress A progress callback that must be invoked for all results. - * @param token A cancellation token. - */ - provideFileSearchResults(query: FileSearchQuery, options: FileSearchOptions, token: CancellationToken): ProviderResult; - } - - /** - * A TextSearchProvider provides search results for text results inside files in the workspace. - */ - export interface TextSearchProvider { - /** - * Provide results that match the given text pattern. - * @param query The parameters for this query. - * @param options A set of options to consider while searching. - * @param progress A progress callback that must be invoked for all results. - * @param token A cancellation token. - */ - provideTextSearchResults(query: TextSearchQuery, options: TextSearchOptions, progress: Progress, token: CancellationToken): ProviderResult; - } - - /** - * Options that can be set on a findTextInFiles search. - */ - export interface FindTextInFilesOptions { - /** - * A [glob pattern](#GlobPattern) that defines the files to search for. The glob pattern - * will be matched against the file paths of files relative to their workspace. Use a [relative pattern](#RelativePattern) - * to restrict the search results to a [workspace folder](#WorkspaceFolder). - */ - include?: GlobPattern; - - /** - * A [glob pattern](#GlobPattern) that defines files and folders to exclude. The glob pattern - * will be matched against the file paths of resulting matches relative to their workspace. When `undefined` only default excludes will - * apply, when `null` no excludes will apply. - */ - exclude?: GlobPattern | null; - - /** - * The maximum number of results to search for - */ - maxResults?: number; - - /** - * Whether external files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useIgnoreFiles"`. - */ - useIgnoreFiles?: boolean; - - /** - * Whether global files that exclude files, like .gitignore, should be respected. - * See the vscode setting `"search.useGlobalIgnoreFiles"`. - */ - useGlobalIgnoreFiles?: boolean; - - /** - * Whether symlinks should be followed while searching. - * See the vscode setting `"search.followSymlinks"`. - */ - followSymlinks?: boolean; - - /** - * Interpret files using this encoding. - * See the vscode setting `"files.encoding"` - */ - encoding?: string; - - /** - * Options to specify the size of the result text preview. - */ - previewOptions?: TextSearchPreviewOptions; - - /** - * Number of lines of context to include before each match. - */ - beforeContext?: number; - - /** - * Number of lines of context to include after each match. - */ - afterContext?: number; - } - - export namespace workspace { - /** - * DEPRECATED - */ - export function registerSearchProvider(): Disposable; - - /** - * Register a file index provider. - * - * Only one provider can be registered per scheme. - * - * @param scheme The provider will be invoked for workspace folders that have this file scheme. - * @param provider The provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerFileIndexProvider(scheme: string, provider: FileIndexProvider): Disposable; - - /** - * Register a search provider. - * - * Only one provider can be registered per scheme. - * - * @param scheme The provider will be invoked for workspace folders that have this file scheme. - * @param provider The provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerFileSearchProvider(scheme: string, provider: FileSearchProvider): Disposable; - - /** - * Register a text search provider. - * - * Only one provider can be registered per scheme. - * - * @param scheme The provider will be invoked for workspace folders that have this file scheme. - * @param provider The provider. - * @return A [disposable](#Disposable) that unregisters this provider when being disposed. - */ - export function registerTextSearchProvider(scheme: string, provider: TextSearchProvider): Disposable; - - /** - * Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace. - * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words. - * @param callback A callback, called for each result - * @param token A token that can be used to signal cancellation to the underlying search engine. - * @return A thenable that resolves when the search is complete. - */ - export function findTextInFiles(query: TextSearchQuery, callback: (result: TextSearchResult) => void, token?: CancellationToken): Thenable; - - /** - * Search text in files across all [workspace folders](#workspace.workspaceFolders) in the workspace. - * @param query The query parameters for the search - the search string, whether it's case-sensitive, or a regex, or matches whole words. - * @param options An optional set of query options. Include and exclude patterns, maxResults, etc. - * @param callback A callback, called for each result - * @param token A token that can be used to signal cancellation to the underlying search engine. - * @return A thenable that resolves when the search is complete. - */ - export function findTextInFiles(query: TextSearchQuery, options: FindTextInFilesOptions, callback: (result: TextSearchResult) => void, token?: CancellationToken): Thenable; - } - - //#endregion - - //#region Joao: diff command - - /** - * The contiguous set of modified lines in a diff. - */ - export interface LineChange { - readonly originalStartLineNumber: number; - readonly originalEndLineNumber: number; - readonly modifiedStartLineNumber: number; - readonly modifiedEndLineNumber: number; - } - - export namespace commands { - - /** - * Registers a diff information command that can be invoked via a keyboard shortcut, - * a menu item, an action, or directly. - * - * Diff information commands are different from ordinary [commands](#commands.registerCommand) as - * they only execute when there is an active diff editor when the command is called, and the diff - * information has been computed. Also, the command handler of an editor command has access to - * the diff information. - * - * @param command A unique identifier for the command. - * @param callback A command handler function with access to the [diff information](#LineChange). - * @param thisArg The `this` context used when invoking the handler function. - * @return Disposable which unregisters this command on disposal. - */ - export function registerDiffInformationCommand(command: string, callback: (diff: LineChange[], ...args: any[]) => any, thisArg?: any): Disposable; - } - - //#endregion - - //#region Joh: decorations - - //todo@joh -> make class - export interface DecorationData { - letter?: string; - title?: string; - color?: ThemeColor; - priority?: number; - bubble?: boolean; - source?: string; // hacky... we should remove it and use equality under the hood - } - - export interface SourceControlResourceDecorations { - source?: string; - letter?: string; - color?: ThemeColor; - } - - export interface DecorationProvider { - onDidChangeDecorations: Event; - provideDecoration(uri: Uri, token: CancellationToken): ProviderResult; - } - - export namespace window { - export function registerDecorationProvider(provider: DecorationProvider): Disposable; - } - - //#endregion - - //#region André: debug - - // deprecated - - export interface DebugConfigurationProvider { - /** - * Deprecated, use DebugAdapterDescriptorFactory.provideDebugAdapter instead. - * @deprecated Use DebugAdapterDescriptorFactory.createDebugAdapterDescriptor instead - */ - debugAdapterExecutable?(folder: WorkspaceFolder | undefined, token?: CancellationToken): ProviderResult; - } - - //#endregion - - //#region Rob, Matt: logging - - /** - * The severity level of a log message - */ - export enum LogLevel { - Trace = 1, - Debug = 2, - Info = 3, - Warning = 4, - Error = 5, - Critical = 6, - Off = 7 - } - - export namespace env { - /** - * Current logging level. - */ - export const logLevel: LogLevel; - - /** - * An [event](#Event) that fires when the log level has changed. - */ - export const onDidChangeLogLevel: Event; - } - - //#endregion - - //#region Joao: SCM validation - - /** - * Represents the validation type of the Source Control input. - */ - export enum SourceControlInputBoxValidationType { - - /** - * Something not allowed by the rules of a language or other means. - */ - Error = 0, - - /** - * Something suspicious but allowed. - */ - Warning = 1, - - /** - * Something to inform about but not a problem. - */ - Information = 2 - } - - export interface SourceControlInputBoxValidation { - - /** - * The validation message to display. - */ - readonly message: string; - - /** - * The validation type. - */ - readonly type: SourceControlInputBoxValidationType; - } - - /** - * Represents the input box in the Source Control viewlet. - */ - export interface SourceControlInputBox { - - /** - * A validation function for the input box. It's possible to change - * the validation provider simply by setting this property to a different function. - */ - validateInput?(value: string, cursorPosition: number): ProviderResult; - } - - //#endregion - - //#region Joao: SCM selected provider - - export interface SourceControl { - - /** - * Whether the source control is selected. - */ - readonly selected: boolean; - - /** - * An event signaling when the selection state changes. - */ - readonly onDidChangeSelection: Event; - } - - //#endregion - - //#region Joao: SCM Input Box - - /** - * Represents the input box in the Source Control viewlet. - */ - export interface SourceControlInputBox { - - /** - * Controls whether the input box is visible (default is `true`). - */ - visible: boolean; - } - - //#endregion - - //#region Comments - /** - * Comments provider related APIs are still in early stages, they may be changed significantly during our API experiments. - */ - - interface CommentInfo { - /** - * All of the comment threads associated with the document. - */ - threads: CommentThread[]; - - /** - * The ranges of the document which support commenting. - */ - commentingRanges?: Range[]; - - /** - * If it's in draft mode or not - */ - inDraftMode?: boolean; - } - - export enum CommentThreadCollapsibleState { - /** - * Determines an item is collapsed - */ - Collapsed = 0, - /** - * Determines an item is expanded - */ - Expanded = 1 - } - - /** - * A collection of comments representing a conversation at a particular range in a document. - */ - interface CommentThread { - /** - * A unique identifier of the comment thread. - */ - threadId: string; - - /** - * The uri of the document the thread has been created on. - */ - resource: Uri; - - /** - * The range the comment thread is located within the document. The thread icon will be shown - * at the first line of the range. - */ - range: Range; - - /** - * The ordered comments of the thread. - */ - comments: Comment[]; - - /** - * Whether the thread should be collapsed or expanded when opening the document. Defaults to Collapsed. - */ - collapsibleState?: CommentThreadCollapsibleState; - } - - /** - * A comment is displayed within the editor or the Comments Panel, depending on how it is provided. - */ - interface Comment { - /** - * The id of the comment - */ - commentId: string; - - /** - * The text of the comment - */ - body: MarkdownString; - - /** - * The display name of the user who created the comment - */ - userName: string; - - /** - * The icon path for the user who created the comment - */ - userIconPath?: Uri; - - - /** - * @deprecated Use userIconPath instead. The avatar src of the user who created the comment - */ - gravatar?: string; - - /** - * Whether the current user has permission to edit the comment. - * - * This will be treated as false if the comment is provided by a `WorkspaceCommentProvider`, or - * if it is provided by a `DocumentCommentProvider` and no `editComment` method is given. - */ - canEdit?: boolean; - - /** - * Whether the current user has permission to delete the comment. - * - * This will be treated as false if the comment is provided by a `WorkspaceCommentProvider`, or - * if it is provided by a `DocumentCommentProvider` and no `deleteComment` method is given. - */ - canDelete?: boolean; - - /** - * The command to be executed if the comment is selected in the Comments Panel - */ - command?: Command; - - isDraft?: boolean; - } - - export interface CommentThreadChangedEvent { - /** - * Added comment threads. - */ - readonly added: CommentThread[]; - - /** - * Removed comment threads. - */ - readonly removed: CommentThread[]; - - /** - * Changed comment threads. - */ - readonly changed: CommentThread[]; - - /** - * Changed draft mode - */ - readonly inDraftMode: boolean; - } - - interface DocumentCommentProvider { - /** - * Provide the commenting ranges and comment threads for the given document. The comments are displayed within the editor. - */ - provideDocumentComments(document: TextDocument, token: CancellationToken): Promise; - - /** - * Called when a user adds a new comment thread in the document at the specified range, with body text. - */ - createNewCommentThread(document: TextDocument, range: Range, text: string, token: CancellationToken): Promise; - - /** - * Called when a user replies to a new comment thread in the document at the specified range, with body text. - */ - replyToCommentThread(document: TextDocument, range: Range, commentThread: CommentThread, text: string, token: CancellationToken): Promise; - - /** - * Called when a user edits the comment body to the be new text. - */ - editComment?(document: TextDocument, comment: Comment, text: string, token: CancellationToken): Promise; - - /** - * Called when a user deletes the comment. - */ - deleteComment?(document: TextDocument, comment: Comment, token: CancellationToken): Promise; - - startDraft?(document: TextDocument, token: CancellationToken): Promise; - deleteDraft?(document: TextDocument, token: CancellationToken): Promise; - finishDraft?(document: TextDocument, token: CancellationToken): Promise; - - startDraftLabel?: string; - deleteDraftLabel?: string; - finishDraftLabel?: string; - - /** - * Notify of updates to comment threads. - */ - onDidChangeCommentThreads: Event; - } - - interface WorkspaceCommentProvider { - /** - * Provide all comments for the workspace. Comments are shown within the comments panel. Selecting a comment - * from the panel runs the comment's command. - */ - provideWorkspaceComments(token: CancellationToken): Promise; - - /** - * Notify of updates to comment threads. - */ - onDidChangeCommentThreads: Event; - } - - namespace workspace { - export function registerDocumentCommentProvider(provider: DocumentCommentProvider): Disposable; - export function registerWorkspaceCommentProvider(provider: WorkspaceCommentProvider): Disposable; - } - //#endregion - - //#region Terminal - - export interface Terminal { - /** - * Fires when the terminal's pty slave pseudo-device is written to. In other words, this - * provides access to the raw data stream from the process running within the terminal, - * including VT sequences. - */ - onDidWriteData: Event; - } - - /** - * Represents the dimensions of a terminal. - */ - export interface TerminalDimensions { - /** - * The number of columns in the terminal. - */ - readonly columns: number; - - /** - * The number of rows in the terminal. - */ - readonly rows: number; - } - - /** - * Represents a terminal without a process where all interaction and output in the terminal is - * controlled by an extension. This is similar to an output window but has the same VT sequence - * compatility as the regular terminal. - * - * Note that an instance of [Terminal](#Terminal) will be created when a TerminalRenderer is - * created with all its APIs available for use by extensions. When using the Terminal object - * of a TerminalRenderer it acts just like normal only the extension that created the - * TerminalRenderer essentially acts as a process. For example when an - * [Terminal.onDidWriteData](#Terminal.onDidWriteData) listener is registered, that will fire - * when [TerminalRenderer.write](#TerminalRenderer.write) is called. Similarly when - * [Terminal.sendText](#Terminal.sendText) is triggered that will fire the - * [TerminalRenderer.onDidAcceptInput](#TerminalRenderer.onDidAcceptInput) event. - * - * **Example:** Create a terminal renderer, show it and write hello world in red - * ```typescript - * const renderer = window.createTerminalRenderer('foo'); - * renderer.terminal.then(t => t.show()); - * renderer.write('\x1b[31mHello world\x1b[0m'); - * ``` - */ - export interface TerminalRenderer { - /** - * The name of the terminal, this will appear in the terminal selector. - */ - name: string; - - /** - * The dimensions of the terminal, the rows and columns of the terminal can only be set to - * a value smaller than the maximum value, if this is undefined the terminal will auto fit - * to the maximum value [maximumDimensions](TerminalRenderer.maximumDimensions). - * - * **Example:** Override the dimensions of a TerminalRenderer to 20 columns and 10 rows - * ```typescript - * terminalRenderer.dimensions = { - * cols: 20, - * rows: 10 - * }; - * ``` - */ - dimensions: TerminalDimensions | undefined; - - /** - * The maximum dimensions of the terminal, this will be undefined immediately after a - * terminal renderer is created and also until the terminal becomes visible in the UI. - * Listen to [onDidChangeMaximumDimensions](TerminalRenderer.onDidChangeMaximumDimensions) - * to get notified when this value changes. - */ - readonly maximumDimensions: TerminalDimensions | undefined; - - /** - * The corressponding [Terminal](#Terminal) for this TerminalRenderer. - */ - readonly terminal: Terminal; - - /** - * Write text to the terminal. Unlike [Terminal.sendText](#Terminal.sendText) which sends - * text to the underlying _process_, this will write the text to the terminal itself. - * - * **Example:** Write red text to the terminal - * ```typescript - * terminalRenderer.write('\x1b[31mHello world\x1b[0m'); - * ``` - * - * **Example:** Move the cursor to the 10th row and 20th column and write an asterisk - * ```typescript - * terminalRenderer.write('\x1b[10;20H*'); - * ``` - * - * @param text The text to write. - */ - write(text: string): void; - - /** - * An event which fires on keystrokes in the terminal or when an extension calls - * [Terminal.sendText](#Terminal.sendText). Keystrokes are converted into their - * corresponding VT sequence representation. - * - * **Example:** Simulate interaction with the terminal from an outside extension or a - * workbench command such as `workbench.action.terminal.runSelectedText` - * ```typescript - * const terminalRenderer = window.createTerminalRenderer('test'); - * terminalRenderer.onDidAcceptInput(data => { - * cosole.log(data); // 'Hello world' - * }); - * terminalRenderer.terminal.then(t => t.sendText('Hello world')); - * ``` - */ - readonly onDidAcceptInput: Event; - - /** - * An event which fires when the [maximum dimensions](#TerminalRenderer.maimumDimensions) of - * the terminal renderer change. - */ - readonly onDidChangeMaximumDimensions: Event; - } - - export namespace window { - /** - * Create a [TerminalRenderer](#TerminalRenderer). - * - * @param name The name of the terminal renderer, this shows up in the terminal selector. - */ - export function createTerminalRenderer(name: string): TerminalRenderer; - } - - //#endregion - - //#region Joh -> exclusive document filters - - export interface DocumentFilter { - exclusive?: boolean; - } - - //#endregion - - //#region mjbvz,joh: https://github.com/Microsoft/vscode/issues/43768 - export interface FileRenameEvent { - readonly oldUri: Uri; - readonly newUri: Uri; - } - - export interface FileWillRenameEvent { - readonly oldUri: Uri; - readonly newUri: Uri; - waitUntil(thenable: Thenable): void; - } - - export namespace workspace { - export const onWillRenameFile: Event; - export const onDidRenameFile: Event; - } - //#endregion - - //#region Alex - OnEnter enhancement - export interface OnEnterRule { - /** - * This rule will only execute if the text above the this line matches this regular expression. - */ - oneLineAboveText?: RegExp; - } - //#endregion - - //#region Tree View - - export interface TreeView { - - /** - * An optional human-readable message that will be rendered in the view. - */ - message?: string | MarkdownString; - - } - - /** - * Label describing the [Tree item](#TreeItem) - */ - export interface TreeItemLabel { - - /** - * A human-readable string describing the [Tree item](#TreeItem). - */ - label: string; - - /** - * Ranges in the label to highlight. A range is defined as a tuple of two number where the - * first is the inclusive start index and the second the exclusive end index - */ - highlights?: [number, number][]; - - } - - export class TreeItem2 extends TreeItem { - /** - * Label describing this item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri). - */ - label?: string | TreeItemLabel | /* for compilation */ any; - - /** - * @param label Label describing this item - * @param collapsibleState [TreeItemCollapsibleState](#TreeItemCollapsibleState) of the tree item. Default is [TreeItemCollapsibleState.None](#TreeItemCollapsibleState.None) - */ - constructor(label: TreeItemLabel, collapsibleState?: TreeItemCollapsibleState); - } - //#endregion - - //#region SignatureHelpContext active paramters - mjbvz - export interface SignatureHelpContext { - /** - * The currently active [`SignatureHelp`](#SignatureHelp). - * - * Will have the [`SignatureHelp.activeSignature`] field updated based on user arrowing through sig help - */ - readonly activeSignatureHelp?: SignatureHelp; - } - //#endregion - - //#region CodeAction.isPreferred - mjbvz - export interface CodeAction { - /** - * If the action is a preferred action or fix to take. - * - * A quick fix should be marked preferred if it properly addresses the underlying error. - * A refactoring should be marked preferred if it is the most reasonable choice of actions to take. - */ - isPreferred?: boolean; - } - //#endregion - - - //#region Autofix - mjbvz - export namespace CodeActionKind { - /** - * Base kind for an auto fix source action: `source.autoFix`. - */ - export const SourceAutoFix: CodeActionKind; - } - //#endregion -} \ No newline at end of file diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index 79d30295ff1..b1bc1f4097c 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -8,7 +8,7 @@ import * as fs from 'fs'; import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); -import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor } from 'vscode'; +import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange, Range, SelectionRangeKind } from 'vscode'; import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature } from 'vscode-languageclient'; import TelemetryReporter from 'vscode-extension-telemetry'; @@ -193,6 +193,26 @@ export function activate(context: ExtensionContext) { toDispose.push(commands.registerCommand('_json.retryResolveSchema', handleRetryResolveSchemaCommand)); client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); + + }); + + const selectionRangeProvider = { + async provideSelectionRanges(document: TextDocument, position: Position): Promise { + const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); + const rawRanges = await client.sendRequest('$/textDocument/selectionRange', { textDocument, position }); + if (Array.isArray(rawRanges)) { + return rawRanges.map(r => { + return { + range: client.protocol2CodeConverter.asRange(r), + kind: SelectionRangeKind.Declaration + }; + }); + } + return []; + } + }; + documentSelector.forEach(selector => { + languages.registerSelectionRangeProvider(selector, selectionRangeProvider); }); let languageConfiguration: LanguageConfiguration = { diff --git a/extensions/json-language-features/client/src/typings/ref.d.ts b/extensions/json-language-features/client/src/typings/ref.d.ts index 9c1a5df18ed..be1d1b0b776 100644 --- a/extensions/json-language-features/client/src/typings/ref.d.ts +++ b/extensions/json-language-features/client/src/typings/ref.d.ts @@ -4,3 +4,4 @@ *--------------------------------------------------------------------------------------------*/ /// +/// diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index 1eb1e6e2f88..6e982dac417 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -14,6 +14,7 @@ "onLanguage:jsonc" ], "main": "./client/out/jsonMain", + "enableProposedApi": true, "scripts": { "compile": "gulp compile-extension:json-language-features-client compile-extension:json-language-features-server", "watch": "gulp watch-extension:json-language-features-client watch-extension:json-language-features-server", @@ -107,4 +108,4 @@ "devDependencies": { "@types/node": "^8.10.25" } -} +} \ No newline at end of file diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index db0182fa088..0868d9aa049 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -14,7 +14,7 @@ "dependencies": { "jsonc-parser": "^2.0.2", "request-light": "^0.2.4", - "vscode-json-languageservice": "^3.2.1", + "vscode-json-languageservice": "^3.3.0-next.0", "vscode-languageserver": "^5.1.0", "vscode-nls": "^4.0.0", "vscode-uri": "^1.0.6" diff --git a/extensions/json-language-features/server/src/jsonServerMain.ts b/extensions/json-language-features/server/src/jsonServerMain.ts index e3b2dcb5f8f..5c3539454e4 100644 --- a/extensions/json-language-features/server/src/jsonServerMain.ts +++ b/extensions/json-language-features/server/src/jsonServerMain.ts @@ -427,5 +427,16 @@ connection.onFoldingRanges((params, token) => { }, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token); }); +connection.onRequest('$/textDocument/selectionRange', async (params, token) => { + return runSafe(() => { + const document = documents.get(params.textDocument.uri); + if (document) { + const jsonDocument = getJSONDocument(document); + return languageService.getSelectionRanges(document, params.position, jsonDocument); + } + return []; + }, [], `Error while computing selection ranges for ${params.textDocument.uri}`, token); +}); + // Listen on the connection connection.listen(); diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 012e346360a..1c933ebfb3c 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -73,10 +73,10 @@ request-light@^0.2.4: https-proxy-agent "^2.2.1" vscode-nls "^4.0.0" -vscode-json-languageservice@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.2.1.tgz#991d51128ebd81c5525d0578cabfa5b03e3cba2a" - integrity sha512-ee9MJ70/xR55ywvm0bZsDLhA800HCRE27AYgMNTU14RSg20Y+ngHdQnUt6OmiTXrQDI/7sne6QUOtHIN0hPQYA== +vscode-json-languageservice@^3.3.0-next.0: + version "3.3.0-next.0" + resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.0-next.0.tgz#c17db95d0eacc24f80d3b3f120ab5e03943769a0" + integrity sha512-YZXL3yHzbr0/Ar5dGdeM/f5Y0l41z/Y4QSQTdL3Hl3ScuY76IPcDEnf7iuk9yx+QoPfEHFCBDv5Rg6XVcMl8Tg== dependencies: jsonc-parser "^2.0.2" vscode-languageserver-types "^3.13.0" From 645d35508bd7fd6972d0b0defed74f2464055c6f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 16:16:19 +0100 Subject: [PATCH 034/429] fix tree model getListIndex --- src/vs/base/browser/ui/tree/indexTreeModel.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/vs/base/browser/ui/tree/indexTreeModel.ts b/src/vs/base/browser/ui/tree/indexTreeModel.ts index c00e38b55ee..3df971f5b55 100644 --- a/src/vs/base/browser/ui/tree/indexTreeModel.ts +++ b/src/vs/base/browser/ui/tree/indexTreeModel.ts @@ -144,7 +144,8 @@ export class IndexTreeModel, TFilterData = voi } getListIndex(location: number[]): number { - return this.getTreeNodeWithListIndex(location).listIndex; + const { listIndex, visible } = this.getTreeNodeWithListIndex(location); + return visible ? listIndex : -1; } getListRenderCount(location: number[]): number { @@ -423,12 +424,12 @@ export class IndexTreeModel, TFilterData = voi } // expensive - private getTreeNodeWithListIndex(location: number[]): { node: IMutableTreeNode, listIndex: number, revealed: boolean } { + private getTreeNodeWithListIndex(location: number[]): { node: IMutableTreeNode, listIndex: number, revealed: boolean, visible: boolean } { if (location.length === 0) { - return { node: this.root, listIndex: -1, revealed: true }; + return { node: this.root, listIndex: -1, revealed: true, visible: false }; } - const { parentNode, listIndex, revealed } = this.getParentNodeWithListIndex(location); + const { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location); const index = location[location.length - 1]; if (index < 0 || index > parentNode.children.length) { @@ -437,10 +438,10 @@ export class IndexTreeModel, TFilterData = voi const node = parentNode.children[index]; - return { node, listIndex, revealed }; + return { node, listIndex, revealed, visible: visible && node.visible }; } - private getParentNodeWithListIndex(location: number[], node: IMutableTreeNode = this.root, listIndex: number = 0, revealed = true): { parentNode: IMutableTreeNode; listIndex: number; revealed: boolean; } { + private getParentNodeWithListIndex(location: number[], node: IMutableTreeNode = this.root, listIndex: number = 0, revealed = true, visible = true): { parentNode: IMutableTreeNode; listIndex: number; revealed: boolean; visible: boolean; } { const [index, ...rest] = location; if (index < 0 || index > node.children.length) { @@ -453,12 +454,13 @@ export class IndexTreeModel, TFilterData = voi } revealed = revealed && !node.collapsed; + visible = visible && node.visible; if (rest.length === 0) { - return { parentNode: node, listIndex, revealed }; + return { parentNode: node, listIndex, revealed, visible }; } - return this.getParentNodeWithListIndex(rest, node.children[index], listIndex + 1, revealed); + return this.getParentNodeWithListIndex(rest, node.children[index], listIndex + 1, revealed, visible); } getNode(location: number[] = []): ITreeNode { From 71931e19487874201a6d70c0dd8fe22d39a6e9aa Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 16:18:43 +0100 Subject: [PATCH 035/429] fixes #67087 --- src/vs/base/browser/ui/tree/abstractTree.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 145e9366547..921d5101b44 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -21,6 +21,7 @@ import { fuzzyScore, FuzzyScore } from 'vs/base/common/filters'; import { getVisibleState, isFilterResult } from 'vs/base/browser/ui/tree/indexTreeModel'; import { localize } from 'vs/nls'; import { disposableTimeout } from 'vs/base/common/async'; +import { isMacintosh } from 'vs/base/common/platform'; function asTreeDragAndDropData(data: IDragAndDropData): IDragAndDropData { if (data instanceof ElementsDragAndDropData) { @@ -432,14 +433,14 @@ class TypeFilterController implements IDisposable { const onKeyDown = Event.chain(domEvent(this.view.getHTMLElement(), 'keydown')) .filter(e => !isInputElement(e.target as HTMLElement) || e.target === this.filterOnTypeDomNode) .map(e => new StandardKeyboardEvent(e)) - .filter(e => isPrintableCharEvent(e) || (this._pattern.length > 0 && (e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey)) + .filter(e => isPrintableCharEvent(e) || (this._pattern.length > 0 && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey)))) .forEach(e => { e.stopPropagation(); e.preventDefault(); }) .event; const onClear = domEvent(this.clearDomNode, 'click'); const onInput = Event.chain(Event.any(onKeyDown, onClear)) .reduce((previous: string, e) => { - if (e instanceof MouseEvent || e.keyCode === KeyCode.Escape) { + if (e instanceof MouseEvent || e.keyCode === KeyCode.Escape || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey))) { return ''; } From be1ca3cc4291292a9be05be6e0f94320d9682401 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 28 Jan 2019 07:43:38 -0800 Subject: [PATCH 036/429] Move env sanitizing to base/node/processes Part of #64897 --- src/vs/base/node/processes.ts | 20 +++++++++++++++ .../test/node/processes/processes.test.ts | 25 +++++++++++++++++++ .../api/node/extHostTerminalService.ts | 3 ++- .../terminalProcessManager.ts | 3 ++- .../terminal/node/terminalEnvironment.ts | 18 ------------- .../test/node/terminalEnvironment.test.ts | 24 ------------------ 6 files changed, 49 insertions(+), 44 deletions(-) diff --git a/src/vs/base/node/processes.ts b/src/vs/base/node/processes.ts index 36b95e0f378..15de8c293f6 100644 --- a/src/vs/base/node/processes.ts +++ b/src/vs/base/node/processes.ts @@ -72,6 +72,26 @@ export function getWindowsShell(): string { return process.env['comspec'] || 'cmd.exe'; } +/** + * Sanitizes a VS Code process environment by removing all Electron/VS Code-related values. + */ +export function sanitizeProcessEnvironment(env: Platform.IProcessEnvironment): void { + const keysToRemove = [ + /^ELECTRON_.+$/, + /^GOOGLE_API_KEY$/, + /^VSCODE_.+$/ + ]; + const envKeys = Object.keys(env); + envKeys.forEach(envKey => { + for (let i = 0; i < keysToRemove.length; i++) { + if (envKey.search(keysToRemove[i]) !== -1) { + delete env[envKey]; + break; + } + } + }); +} + export abstract class AbstractProcess { private cmd: string; private args: string[]; diff --git a/src/vs/base/test/node/processes/processes.test.ts b/src/vs/base/test/node/processes/processes.test.ts index 76719506d6e..10199cf5bf3 100644 --- a/src/vs/base/test/node/processes/processes.test.ts +++ b/src/vs/base/test/node/processes/processes.test.ts @@ -84,4 +84,29 @@ suite('Processes', () => { } }); }); + + + test('sanitizeProcessEnvironment', () => { + let env = { + FOO: 'bar', + ELECTRON_ENABLE_STACK_DUMPING: 'x', + ELECTRON_ENABLE_LOGGING: 'x', + ELECTRON_NO_ASAR: 'x', + ELECTRON_NO_ATTACH_CONSOLE: 'x', + ELECTRON_RUN_AS_NODE: 'x', + GOOGLE_API_KEY: 'x', + VSCODE_CLI: 'x', + VSCODE_DEV: 'x', + VSCODE_IPC_HOOK: 'x', + VSCODE_LOGS: 'x', + VSCODE_NLS_CONFIG: 'x', + VSCODE_PORTABLE: 'x', + VSCODE_PID: 'x', + VSCODE_NODE_CACHED_DATA_DIR: 'x', + VSCODE_NEW_VAR: 'x' + }; + processes.sanitizeProcessEnvironment(env); + assert.equal(env['FOO'], 'bar'); + assert.equal(Object.keys(env).length, 1); + }); }); diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index fd343a8de75..884bd047a33 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -18,6 +18,7 @@ import { generateRandomPipeName } from 'vs/base/parts/ipc/node/ipc.net'; import * as http from 'http'; import * as fs from 'fs'; import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; +import { sanitizeProcessEnvironment } from 'vs/base/node/processes'; const RENDERER_NO_PROCESS_ID = -1; @@ -417,7 +418,7 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { // Sanitize the environment, removing any undesirable VS Code and Electron environment // variables - terminalEnvironment.sanitizeEnvironment(env); + sanitizeProcessEnvironment(env); // Continue env initialization, merging in the env from the launch // config and adding keys that are needed to create the process diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index 6eb9ec9906c..a49259ddcd4 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -19,6 +19,7 @@ import { IConfigurationResolverService } from 'vs/workbench/services/configurati import { IWindowService } from 'vs/platform/windows/common/windows'; import { Schemas } from 'vs/base/common/network'; import { REMOTE_HOST_SCHEME, getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts'; +import { sanitizeProcessEnvironment } from 'vs/base/node/processes'; /** The amount of time to consider terminal errors to be related to the launch */ const LAUNCHING_DURATION = 500; @@ -133,7 +134,7 @@ export class TerminalProcessManager implements ITerminalProcessManager { // Sanitize the environment, removing any undesirable VS Code and Electron environment // variables - terminalEnvironment.sanitizeEnvironment(env); + sanitizeProcessEnvironment(env); // Adding other env keys necessary to create the process terminalEnvironment.addTerminalEnvironmentKeys(env, platform.locale, this._configHelper.config.setLocaleVariables); diff --git a/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts b/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts index 2175f1beb12..7942c4c8700 100644 --- a/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts +++ b/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts @@ -51,24 +51,6 @@ function _mergeEnvironmentValue(env: ITerminalEnvironment, key: string, value: s } } -export function sanitizeEnvironment(env: ITerminalEnvironment): void { - // Remove keys based on strings - const keysToRemove = [ - /^ELECTRON_.+$/, - /^GOOGLE_API_KEY$/, - /^VSCODE_.+$/ - ]; - const envKeys = Object.keys(env); - envKeys.forEach(envKey => { - for (let i = 0; i < keysToRemove.length; i++) { - if (envKey.search(keysToRemove[i]) !== -1) { - delete env[envKey]; - break; - } - } - }); -} - export function addTerminalEnvironmentKeys(env: ITerminalEnvironment, locale: string | undefined, setLocaleVariables: boolean): void { env['TERM_PROGRAM'] = 'vscode'; env['TERM_PROGRAM_VERSION'] = pkg.version; diff --git a/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts b/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts index 44806ac20ba..db8533967d8 100644 --- a/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts +++ b/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts @@ -32,30 +32,6 @@ suite('Workbench - TerminalEnvironment', () => { assert.equal(env4['LANG'], 'en_US.UTF-8', 'LANG is equal to the parent environment\'s LANG'); }); - test('sanitizeEnvironment', () => { - let env = { - FOO: 'bar', - ELECTRON_ENABLE_STACK_DUMPING: 'x', - ELECTRON_ENABLE_LOGGING: 'x', - ELECTRON_NO_ASAR: 'x', - ELECTRON_NO_ATTACH_CONSOLE: 'x', - ELECTRON_RUN_AS_NODE: 'x', - GOOGLE_API_KEY: 'x', - VSCODE_CLI: 'x', - VSCODE_DEV: 'x', - VSCODE_IPC_HOOK: 'x', - VSCODE_LOGS: 'x', - VSCODE_NLS_CONFIG: 'x', - VSCODE_PORTABLE: 'x', - VSCODE_PID: 'x', - VSCODE_NODE_CACHED_DATA_DIR: 'x', - VSCODE_NEW_VAR: 'x' - }; - terminalEnvironment.sanitizeEnvironment(env); - assert.equal(env['FOO'], 'bar'); - assert.equal(Object.keys(env).length, 1); - }); - suite('mergeEnvironments', () => { test('should add keys', () => { const parent = { From 04accde33c4797388b432bffd4e7beef5f450fda Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 28 Jan 2019 16:44:48 +0100 Subject: [PATCH 037/429] Add proposed API: change event for extensions.all --- src/vs/vscode.proposed.d.ts | 9 +++++++++ src/vs/workbench/api/node/extHost.api.impl.ts | 3 +++ .../extensions/node/extensionDescriptionRegistry.ts | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index c1b069e85a8..a32810ebda4 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1055,6 +1055,15 @@ declare module 'vscode' { } //#endregion + //#region Alex - extensions.all change event + export namespace extensions { + /** + * An event which fires when `extensions.all` changes. + */ + export const onDidChange: Event; + } + //#endregion + //#region Tree View export interface TreeView { diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 249c88fa891..ebdf93c02d4 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -272,6 +272,9 @@ export function createApiFactory( }, get all(): Extension[] { return extensionRegistry.getAllExtensionDescriptions().map((desc) => new Extension(extensionService, desc)); + }, + get onDidChange() { + return extensionRegistry.onDidChange; } }; diff --git a/src/vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts b/src/vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts index ad385a196c9..3eddf8c90ed 100644 --- a/src/vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts +++ b/src/vs/workbench/services/extensions/node/extensionDescriptionRegistry.ts @@ -5,8 +5,12 @@ import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { Emitter } from 'vs/base/common/event'; export class ExtensionDescriptionRegistry { + private readonly _onDidChange = new Emitter(); + public readonly onDidChange = this._onDidChange.event; + private _extensionDescriptions: IExtensionDescription[]; private _extensionsMap: Map; private _extensionsArr: IExtensionDescription[]; @@ -53,6 +57,7 @@ export class ExtensionDescriptionRegistry { extensionIds.forEach(extensionId => toKeep.add(ExtensionIdentifier.toKey(extensionId))); this._extensionDescriptions = this._extensionDescriptions.filter(extension => toKeep.has(ExtensionIdentifier.toKey(extension.identifier))); this._initialize(); + this._onDidChange.fire(undefined); } public deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]) { @@ -61,6 +66,7 @@ export class ExtensionDescriptionRegistry { toRemove.forEach(extensionId => toRemoveSet.add(ExtensionIdentifier.toKey(extensionId))); this._extensionDescriptions = this._extensionDescriptions.filter(extension => !toRemoveSet.has(ExtensionIdentifier.toKey(extension.identifier))); this._initialize(); + this._onDidChange.fire(undefined); } public containsActivationEvent(activationEvent: string): boolean { From ac2d914e213040b03cff5c28db6cf890a2eb7327 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 28 Jan 2019 16:50:24 +0100 Subject: [PATCH 038/429] fix #67245 (again) --- src/vs/platform/menubar/electron-main/menubar.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index b249609a84f..7bda195c819 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -709,14 +709,15 @@ export class Menubar { if (activeWindow) { if (invocation.type === 'commandId') { - if (!activeWindow.isReady && isMacintosh && invocation.commandId === 'workbench.action.toggleDevTools' && !this.environmentService.isBuilt) { + this.windowsMainService.sendToFocused('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest); + } else { + if (isMacintosh && invocation.userSettingsLabel === 'alt+cmd+i' && !this.environmentService.isBuilt && !activeWindow.isReady) { // prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719) // we already register a keybinding in bootstrap-window.js for opening developer tools in case something // goes wrong and that keybinding is only removed when the application has loaded (= window ready). return; } - this.windowsMainService.sendToFocused('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest); - } else { + this.windowsMainService.sendToFocused('vscode:runKeybinding', { userSettingsLabel: invocation.userSettingsLabel } as IRunKeybindingInWindowRequest); } } From 379e39ff0ed32a31def1068feeda01c9fc41aba8 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 16:56:57 +0100 Subject: [PATCH 039/429] fixes #67250 --- .../workbench/browser/actions/listCommands.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 1ee1e0e8491..e5ee5abd4e3 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -309,7 +309,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ // Tree only if (focused && !(focused instanceof List || focused instanceof PagedList)) { - if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) { + if (focused instanceof ObjectTree || focused instanceof DataTree) { const tree = focused; const focusedElements = tree.getFocus(); @@ -328,6 +328,26 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ tree.reveal(child); } } + } else if (focused instanceof AsyncDataTree) { + const tree = focused; + const focusedElements = tree.getFocus(); + + if (focusedElements.length === 0) { + return; + } + + const focus = focusedElements[0]; + tree.expand(focus).then(didExpand => { + if (focus && !didExpand) { + const child = tree.getFirstElementChild(focus); + + if (child) { + const fakeKeyboardEvent = new KeyboardEvent('keydown'); + tree.setFocus([child], fakeKeyboardEvent); + tree.reveal(child); + } + } + }); } else { const tree = focused; const focus = tree.getFocus(); From 3df1107cb006e11e22e17c290918ca42a1f73ec5 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 28 Jan 2019 17:40:55 +0100 Subject: [PATCH 040/429] Update problem matchers in json schema when providing extension is enabled/disabled --- src/vs/workbench/parts/tasks/common/problemMatcher.ts | 8 ++++++++ .../parts/tasks/electron-browser/jsonSchema_v2.ts | 6 +++++- .../parts/tasks/electron-browser/task.contribution.ts | 7 ++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/tasks/common/problemMatcher.ts b/src/vs/workbench/parts/tasks/common/problemMatcher.ts index bab1c2e486d..a9889946c2e 100644 --- a/src/vs/workbench/parts/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/parts/tasks/common/problemMatcher.ts @@ -20,6 +20,7 @@ import { IStringDictionary } from 'vs/base/common/collections'; import { IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry'; +import { Event, Emitter } from 'vs/base/common/event'; export enum FileLocationKind { Auto, @@ -1681,12 +1682,16 @@ export interface IProblemMatcherRegistry { onReady(): Promise; get(name: string): NamedProblemMatcher; keys(): string[]; + readonly onMatcherChanged; } class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { private matchers: IStringDictionary; private readyPromise: Promise; + private _onMatchersChanged: Emitter = new Emitter(); + public get onMatcherChanged(): Event { return this._onMatchersChanged.event; } + constructor() { this.matchers = Object.create(null); @@ -1712,6 +1717,9 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { } } }); + if ((delta.removed.length > 0) || (delta.added.length > 0)) { + this._onMatchersChanged.fire(); + } } catch (error) { } let matcher = this.get('tsc-watch'); diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts index ad8290e168e..1f39e52033a 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts @@ -513,7 +513,7 @@ Object.getOwnPropertyNames(definitions).forEach(key => { }); fixReferences(schema); -ProblemMatcherRegistry.onReady().then(() => { +export function updateProblemMatchers() { try { let matcherIds = ProblemMatcherRegistry.keys().map(key => '$' + key); definitions.problemMatcherType2.oneOf![0].enum = matcherIds; @@ -521,6 +521,10 @@ ProblemMatcherRegistry.onReady().then(() => { } catch (err) { console.log('Installing problem matcher ids failed'); } +} + +ProblemMatcherRegistry.onReady().then(() => { + updateProblemMatchers(); }); export default schema; diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 3d57be482f0..07a32bc0a65 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -2658,7 +2658,7 @@ let schema: IJSONSchema = { }; import schemaVersion1 from './jsonSchema_v1'; -import schemaVersion2 from './jsonSchema_v2'; +import schemaVersion2, { updateProblemMatchers } from './jsonSchema_v2'; schema.definitions = { ...schemaVersion1.definitions, ...schemaVersion2.definitions, @@ -2667,3 +2667,8 @@ schema.oneOf = [...schemaVersion2.oneOf, ...schemaVersion1.oneOf]; let jsonRegistry = Registry.as(jsonContributionRegistry.Extensions.JSONContribution); jsonRegistry.registerSchema(schemaId, schema); + +ProblemMatcherRegistry.onMatcherChanged(() => { + updateProblemMatchers(); + jsonRegistry.notifySchemaChanged(schemaId); +}); From d28a8e1ff771eff85d55b22f3aeb340bffe95f21 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 28 Jan 2019 04:29:48 +0000 Subject: [PATCH 041/429] Add cgmanifest for ripgrep --- cgmanifest.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cgmanifest.json b/cgmanifest.json index 1cf8ac1f1fe..37d52feb36c 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -505,6 +505,19 @@ " defined by the Mozilla Public License, v. 2.0." ], "license": "MPL" + }, + { + "component": { + "type": "git", + "git": { + "name": "ripgrep", + "repositoryUrl": "https://github.com/BurntSushi/ripgrep", + "commitHash": "8a7db1a918e969b85cd933d8ed9fa5285b281ba4" + } + }, + "isOnlyProductionDependency": true, + "license": "MIT", + "version": "0.10.0" } ], "version": 1 From 5f9257140a1a238259500e5cd9c3e62bb9488a0b Mon Sep 17 00:00:00 2001 From: isidor Date: Mon, 28 Jan 2019 17:42:50 +0100 Subject: [PATCH 042/429] fixes #67228 --- .../workbench/parts/debug/electron-browser/callStackView.ts | 4 ++++ .../workbench/parts/debug/electron-browser/variablesView.ts | 4 ++++ .../parts/debug/electron-browser/watchExpressionsView.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts index 38c16c1817c..aef0de79a27 100644 --- a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts @@ -227,6 +227,10 @@ export class CallStackView extends ViewletPanel { this.tree.layout(height, width); } + focus(): void { + this.tree.domFocus(); + } + private updateTreeSelection(): void { if (!this.tree || this.tree.visibleNodeCount === 0) { // Tree not initialized yet diff --git a/src/vs/workbench/parts/debug/electron-browser/variablesView.ts b/src/vs/workbench/parts/debug/electron-browser/variablesView.ts index 21c171270ca..9540ae417cd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/variablesView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/variablesView.ts @@ -121,6 +121,10 @@ export class VariablesView extends ViewletPanel { this.tree.layout(width, height); } + focus(): void { + this.tree.domFocus(); + } + private onMouseDblClick(e: ITreeMouseEvent): void { const session = this.debugService.getViewModel().focusedSession; if (e.element instanceof Variable && session.capabilities.supportsSetVariable) { diff --git a/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts b/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts index 7b344d0abbf..7e461ac86a3 100644 --- a/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts @@ -117,6 +117,10 @@ export class WatchExpressionsView extends ViewletPanel { this.tree.layout(height, width); } + focus(): void { + this.tree.domFocus(); + } + private onMouseDblClick(e: ITreeMouseEvent): void { if ((e.browserEvent.target as HTMLElement).className.indexOf('twistie') >= 0) { // Ignore double click events on twistie From 0fc0db3a7fe903f825bccf97391b366da7dd8af7 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 28 Jan 2019 08:48:14 -0800 Subject: [PATCH 043/429] update padding --- .../workbench/parts/comments/electron-browser/media/review.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/media/review.css b/src/vs/workbench/parts/comments/electron-browser/media/review.css index 57347578cb3..b8cf5584e59 100644 --- a/src/vs/workbench/parts/comments/electron-browser/media/review.css +++ b/src/vs/workbench/parts/comments/electron-browser/media/review.css @@ -137,7 +137,7 @@ } .monaco-editor .review-widget .body .review-comment .review-comment-contents .comment-reactions .action-item .action-label { - padding: 2px 5px 0px 5px; + padding: 2px 5px 2px 5px; white-space: pre; text-align: center; font-size: 14px; From 43c36fbdbd4096de0ffacb1cea7691d90f395799 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 28 Jan 2019 18:01:18 +0100 Subject: [PATCH 044/429] Collect telemetry on connection outcomes (#60773) --- package.json | 2 +- .../services/extensions/node/proxyResolver.ts | 43 +++++++++++++++++-- yarn.lock | 8 ++-- 3 files changed, 45 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 6d516a6819a..4f78caf443e 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "vscode-chokidar": "1.6.5", "vscode-debugprotocol": "1.33.0", "vscode-nsfw": "1.1.1", - "vscode-proxy-agent": "0.2.0", + "vscode-proxy-agent": "0.3.0", "vscode-ripgrep": "^1.2.5", "vscode-sqlite3": "4.0.7", "vscode-textmate": "^4.0.1", diff --git a/src/vs/workbench/services/extensions/node/proxyResolver.ts b/src/vs/workbench/services/extensions/node/proxyResolver.ts index 4a8df829c28..9205a62dd1b 100644 --- a/src/vs/workbench/services/extensions/node/proxyResolver.ts +++ b/src/vs/workbench/services/extensions/node/proxyResolver.ts @@ -17,6 +17,13 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; import { URI } from 'vs/base/common/uri'; +interface ConnectionResult { + proxy: string; + connection: string; + code: string; + count: number; +} + export function connectProxyResolver( extHostWorkspace: ExtHostWorkspace, configProvider: ExtHostConfigProvider, @@ -83,6 +90,7 @@ function createProxyAgents( let envCount = 0; let settingsCount = 0; let localhostCount = 0; + let results: ConnectionResult[] = []; function logEvent() { timeout = undefined; /* __GDPR__ @@ -95,14 +103,16 @@ function createProxyAgents( "cacheRolls": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "envCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "settingsCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, - "localhostCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true } + "localhostCount": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, + "results": { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" } } */ - mainThreadTelemetry.$publicLog('resolveProxy', { count, duration, errorCount, cacheCount, cacheSize: cache.size, cacheRolls, envCount, settingsCount, localhostCount }); + mainThreadTelemetry.$publicLog('resolveProxy', { count, duration, errorCount, cacheCount, cacheSize: cache.size, cacheRolls, envCount, settingsCount, localhostCount, results }); count = duration = errorCount = cacheCount = envCount = settingsCount = localhostCount = 0; + results = []; } - function resolveProxy(url: string, callback: (proxy?: string) => void) { + function resolveProxy(req: http.ClientRequest, opts: http.RequestOptions, url: string, callback: (proxy?: string) => void) { if (!timeout) { timeout = setTimeout(logEvent, 10 * 60 * 1000); } @@ -135,6 +145,7 @@ function createProxyAgents( const proxy = getCachedProxy(key); if (proxy) { cacheCount++; + collectResult(results, proxy, parsedUrl.protocol === 'https:' ? 'HTTPS' : 'HTTP', req); callback(proxy); extHostLogService.trace('ProxyResolver#resolveProxy cached', url, proxy); return; @@ -144,6 +155,7 @@ function createProxyAgents( extHostWorkspace.resolveProxy(url) // Use full URL to ensure it is an actually used one. .then(proxy => { cacheProxy(key, proxy); + collectResult(results, proxy, parsedUrl.protocol === 'https:' ? 'HTTPS' : 'HTTP', req); callback(proxy); extHostLogService.debug('ProxyResolver#resolveProxy', url, proxy); }).then(() => { @@ -163,6 +175,31 @@ function createProxyAgents( return { http: httpAgent, https: httpsAgent }; } +function collectResult(results: ConnectionResult[], resolveProxy: string, connection: string, req: http.ClientRequest) { + const proxy = resolveProxy ? String(resolveProxy).trim().split(/\s+/, 1)[0] : 'EMPTY'; + req.on('response', res => { + const code = `HTTP_${res.statusCode}`; + const result = findOrCreateResult(results, proxy, connection, code); + result.count++; + }); + req.on('error', err => { + const code = err && typeof (err).code === 'string' && (err).code || 'UNKNOWN_ERROR'; + const result = findOrCreateResult(results, proxy, connection, code); + result.count++; + }); +} + +function findOrCreateResult(results: ConnectionResult[], proxy: string, connection: string, code: string): ConnectionResult | undefined { + for (const result of results) { + if (result.proxy === proxy && result.connection === connection && result.code === code) { + return result; + } + } + const result = { proxy, connection, code, count: 0 }; + results.push(result); + return result; +} + function proxyFromConfigURL(configURL: string) { const url = (configURL || '').trim(); const i = url.indexOf('://'); diff --git a/yarn.lock b/yarn.lock index da55da48abd..82332aa7d79 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9399,10 +9399,10 @@ vscode-nsfw@1.1.1: lodash.isundefined "^3.0.1" nan "^2.10.0" -vscode-proxy-agent@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/vscode-proxy-agent/-/vscode-proxy-agent-0.2.0.tgz#5ae6e1f8e1b8715a4058fafb6d10cd2409d72620" - integrity sha512-x6RUOUkV18iM78+6S70VjiwiHuY7qmk3CU9+u+0y4c1Y/X8/IcTJfPsngoAXrrojoKcplyLdp3YCZbj1rFNo/Q== +vscode-proxy-agent@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/vscode-proxy-agent/-/vscode-proxy-agent-0.3.0.tgz#b5c8bea5046761966e1fa71f89d9cef11c457894" + integrity sha512-R6qz8Sc0ocNfeFPOp3k6QLP/Y8HzK1yqXwfgB1f0GakVzUGMDmniRe8RLxIiCAqlxGaWMn2yqpTSNUYZ1obPsQ== dependencies: debug "3.1.0" http-proxy-agent "2.1.0" From 1972f79077609b63b42563d71fe2d60f56bc8951 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 28 Jan 2019 18:24:12 +0100 Subject: [PATCH 045/429] client: semantic selection registration --- .../client/src/cssMain.ts | 18 ++++++++++ .../client/src/htmlMain.ts | 33 +++++++++-------- .../client/src/jsonMain.ts | 36 +++++++++---------- 3 files changed, 54 insertions(+), 33 deletions(-) diff --git a/extensions/css-language-features/client/src/cssMain.ts b/extensions/css-language-features/client/src/cssMain.ts index 18f82a02d77..59bd8db7d26 100644 --- a/extensions/css-language-features/client/src/cssMain.ts +++ b/extensions/css-language-features/client/src/cssMain.ts @@ -78,6 +78,24 @@ export function activate(context: ExtensionContext) { client.onReady().then(() => { context.subscriptions.push(initCompletionProvider()); + + documentSelector.forEach(selector => { + context.subscriptions.push(languages.registerSelectionRangeProvider(selector, { + async provideSelectionRanges(document: TextDocument, position: Position): Promise { + const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); + const rawRanges = await client.sendRequest('$/textDocument/selectionRange', { textDocument, position }); + if (Array.isArray(rawRanges)) { + return rawRanges.map(r => { + return { + range: client.protocol2CodeConverter.asRange(r), + kind: SelectionRangeKind.Declaration + }; + }); + } + return []; + } + })); + }); }); const selectionRangeProvider = { diff --git a/extensions/html-language-features/client/src/htmlMain.ts b/extensions/html-language-features/client/src/htmlMain.ts index 571c1d3ff47..218e05b3e32 100644 --- a/extensions/html-language-features/client/src/htmlMain.ts +++ b/extensions/html-language-features/client/src/htmlMain.ts @@ -9,7 +9,7 @@ import * as nls from 'vscode-nls'; const localize = nls.loadMessageBundle(); import { languages, ExtensionContext, IndentAction, Position, TextDocument, Range, CompletionItem, CompletionItemKind, SnippetString, workspace, SelectionRange, SelectionRangeKind } from 'vscode'; -import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, TextDocumentPositionParams, TextDocumentIdentifier } from 'vscode-languageclient'; +import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, TextDocumentPositionParams } from 'vscode-languageclient'; import { EMPTY_ELEMENTS } from './htmlEmptyTagsShared'; import { activateTagClosing } from './tagClosing'; import TelemetryReporter from 'vscode-extension-telemetry'; @@ -87,21 +87,24 @@ export function activate(context: ExtensionContext) { } }); toDispose.push(disposable); - }); - languages.registerSelectionRangeProvider('html', { - async provideSelectionRanges(document: TextDocument, position: Position): Promise { - const textDocument = TextDocumentIdentifier.create(document.uri.toString()); - const rawRanges: Range[] = await client.sendRequest('$/textDocument/selectionRange', { textDocument, position }); - - return rawRanges.map(r => { - const actualRange = new Range(new Position(r.start.line, r.start.character), new Position(r.end.line, r.end.character)); - return { - range: actualRange, - kind: SelectionRangeKind.Declaration - }; - }); - } + documentSelector.forEach(selector => { + context.subscriptions.push(languages.registerSelectionRangeProvider(selector, { + async provideSelectionRanges(document: TextDocument, position: Position): Promise { + const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); + const rawRanges = await client.sendRequest('$/textDocument/selectionRange', { textDocument, position }); + if (Array.isArray(rawRanges)) { + return rawRanges.map(r => { + return { + range: client.protocol2CodeConverter.asRange(r), + kind: SelectionRangeKind.Declaration + }; + }); + } + return []; + } + })); + }); }); languages.setLanguageConfiguration('html', { diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index b1bc1f4097c..585a908afe7 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -194,26 +194,26 @@ export function activate(context: ExtensionContext) { client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); + documentSelector.forEach(selector => { + toDispose.push(languages.registerSelectionRangeProvider(selector, { + async provideSelectionRanges(document: TextDocument, position: Position): Promise { + const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); + const rawRanges = await client.sendRequest('$/textDocument/selectionRange', { textDocument, position }); + if (Array.isArray(rawRanges)) { + return rawRanges.map(r => { + return { + range: client.protocol2CodeConverter.asRange(r), + kind: SelectionRangeKind.Declaration + }; + }); + } + return []; + } + })); + }); }); - const selectionRangeProvider = { - async provideSelectionRanges(document: TextDocument, position: Position): Promise { - const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document); - const rawRanges = await client.sendRequest('$/textDocument/selectionRange', { textDocument, position }); - if (Array.isArray(rawRanges)) { - return rawRanges.map(r => { - return { - range: client.protocol2CodeConverter.asRange(r), - kind: SelectionRangeKind.Declaration - }; - }); - } - return []; - } - }; - documentSelector.forEach(selector => { - languages.registerSelectionRangeProvider(selector, selectionRangeProvider); - }); + let languageConfiguration: LanguageConfiguration = { wordPattern: /("(?:[^\\\"]*(?:\\.)?)*"?)|[^\s{}\[\],:]+/, From b257ca20788c639d99790649f931f3b0fcccb331 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 28 Jan 2019 20:53:34 +0100 Subject: [PATCH 046/429] grid: views should know which orientation they are laid out --- src/vs/base/browser/ui/centered/centeredViewLayout.ts | 4 ++-- src/vs/base/browser/ui/grid/gridview.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/base/browser/ui/centered/centeredViewLayout.ts b/src/vs/base/browser/ui/centered/centeredViewLayout.ts index 1b1710bed0c..a776ba92a6d 100644 --- a/src/vs/base/browser/ui/centered/centeredViewLayout.ts +++ b/src/vs/base/browser/ui/centered/centeredViewLayout.ts @@ -40,7 +40,7 @@ function toSplitViewView(view: IView, getHeight: () => number): ISplitViewView { get maximumSize() { return view.maximumWidth; }, get minimumSize() { return view.minimumWidth; }, onDidChange: Event.map(view.onDidChange, e => e && e.width), - layout: size => view.layout(size, getHeight()) + layout: size => view.layout(size, getHeight(), Orientation.HORIZONTAL) }; } @@ -78,7 +78,7 @@ export class CenteredViewLayout { this.resizeMargins(); } } else { - this.view.layout(width, height); + this.view.layout(width, height, Orientation.HORIZONTAL); } this.didLayout = true; } diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index edde60f0eb3..a3f483632d0 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -24,7 +24,7 @@ export interface IView { readonly onDidChange: Event<{ width: number; height: number; } | undefined>; readonly priority?: LayoutPriority; readonly snapSize?: number; - layout(width: number, height: number): void; + layout(width: number, height: number, orientation: Orientation): void; } export function orthogonal(orientation: Orientation): Orientation { @@ -480,12 +480,12 @@ class LeafNode implements ISplitView, IDisposable { layout(size: number): void { this._size = size; - return this.view.layout(this.width, this.height); + return this.view.layout(this.width, this.height, orthogonal(this.orientation)); } orthogonalLayout(size: number): void { this._orthogonalSize = size; - return this.view.layout(this.width, this.height); + return this.view.layout(this.width, this.height, orthogonal(this.orientation)); } dispose(): void { } From a920f227b1a73597717b19d9e73de3ff6b4f822c Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 28 Jan 2019 22:21:41 +0100 Subject: [PATCH 047/429] Fix #66685 --- .../markers/electron-browser/constants.ts | 1 + .../electron-browser/markers.contribution.ts | 18 ++- .../markers/electron-browser/markersPanel.ts | 32 +++-- .../electron-browser/markersPanelActions.ts | 17 ++- .../electron-browser/markersTreeViewer.ts | 123 +++++++++++------- 5 files changed, 125 insertions(+), 66 deletions(-) diff --git a/src/vs/workbench/parts/markers/electron-browser/constants.ts b/src/vs/workbench/parts/markers/electron-browser/constants.ts index a9e0b9e8f6d..8d4348b87a7 100644 --- a/src/vs/workbench/parts/markers/electron-browser/constants.ts +++ b/src/vs/workbench/parts/markers/electron-browser/constants.ts @@ -16,6 +16,7 @@ export default { MARKERS_PANEL_SHOW_SINGLELINE_MESSAGE: 'problems.action.showSinglelineMessage', MARKER_OPEN_SIDE_ACTION_ID: 'problems.action.openToSide', MARKER_SHOW_PANEL_ID: 'workbench.action.showErrorsWarnings', + MARKER_SHOW_QUICK_FIX: 'problems.action.showQuickFixes', MarkerPanelFocusContextKey: new RawContextKey('problemsViewFocus', false), MarkerFocusContextKey: new RawContextKey('problemFocus', false), diff --git a/src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts b/src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts index 4afdc0bf6c3..765a7908f83 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts @@ -53,6 +53,20 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } }); +KeybindingsRegistry.registerCommandAndKeybindingRule({ + id: Constants.MARKER_SHOW_QUICK_FIX, + weight: KeybindingWeight.WorkbenchContrib, + when: Constants.MarkerFocusContextKey, + primary: KeyMod.CtrlCmd | KeyCode.US_DOT, + handler: (accessor, args: any) => { + const markersPanel = (accessor.get(IPanelService).getActivePanel()); + const focusedElement = markersPanel.getFocusElement(); + if (focusedElement instanceof Marker) { + markersPanel.showQuickFixes(focusedElement); + } + } +}); + // configuration Registry.as(Extensions.Configuration).registerConfiguration({ 'id': 'problems', @@ -161,7 +175,7 @@ registerAction({ const panelService = accessor.get(IPanelService); const panel = panelService.getActivePanel(); if (panel instanceof MarkersPanel) { - panel.markersViewState.multiline = true; + panel.markersViewModel.multiline = true; } }, title: localize('show multiline', "Show message in multiple lines"), @@ -177,7 +191,7 @@ registerAction({ const panelService = accessor.get(IPanelService); const panel = panelService.getActivePanel(); if (panel instanceof MarkersPanel) { - panel.markersViewState.multiline = false; + panel.markersViewModel.multiline = false; } }, title: localize('show singleline', "Show message in single line"), diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts index a87ac486e8c..128c751cd08 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts @@ -14,7 +14,7 @@ import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/ import Constants from 'vs/workbench/parts/markers/electron-browser/constants'; import { Marker, ResourceMarkers, RelatedInformation, MarkersModel } from 'vs/workbench/parts/markers/electron-browser/markersModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { MarkersFilterActionItem, MarkersFilterAction, QuickFixAction, QuickFixActionItem, IMarkersFilterActionChangeEvent, IMarkerFilterController } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; +import { MarkersFilterActionItem, MarkersFilterAction, IMarkersFilterActionChangeEvent, IMarkerFilterController } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; import { RangeHighlightDecorations } from 'vs/workbench/browser/parts/editor/rangeDecorations'; @@ -33,7 +33,7 @@ import { IExpression, getEmptyExpression } from 'vs/base/common/glob'; import { mixin, deepClone } from 'vs/base/common/objects'; import { IWorkspaceFolder, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { isAbsolute, join } from 'vs/base/common/paths'; -import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, TreeElement, MarkersTreeAccessibilityProvider, MarkersViewState } from 'vs/workbench/parts/markers/electron-browser/markersTreeViewer'; +import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, TreeElement, MarkersTreeAccessibilityProvider, MarkersViewModel } from 'vs/workbench/parts/markers/electron-browser/markersTreeViewer'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { Separator, ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; @@ -89,7 +89,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { private cachedFilterStats: { total: number; filtered: number; } | undefined = undefined; private currentResourceGotAddedToMarkersData: boolean = false; - readonly markersViewState: MarkersViewState; + readonly markersViewModel: MarkersViewModel; private disposables: IDisposable[] = []; constructor( @@ -109,8 +109,8 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { super(Constants.MARKERS_PANEL_ID, telemetryService, themeService, storageService); this.panelFoucusContextKey = Constants.MarkerPanelFocusContextKey.bindTo(contextKeyService); this.panelState = this.getMemento(StorageScope.WORKSPACE); - this.markersViewState = new MarkersViewState(this.panelState['multiline']); - this.markersViewState.onDidChangeViewState(this.onDidChangeViewState, this, this.disposables); + this.markersViewModel = instantiationService.createInstance(MarkersViewModel, this.panelState['multiline']); + this.markersViewModel.onDidChange(this.onDidChangeViewState, this, this.disposables); this.setCurrentActiveEditor(); } @@ -178,6 +178,13 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { return this.actions; } + public showQuickFixes(marker: Marker): void { + const viewModel = this.markersViewModel.getViewModel(marker); + if (viewModel) { + viewModel.quickFixAction.run(); + } + } + public openFileAtElement(element: any, preserveFocus: boolean, sideByside: boolean, pinned: boolean): boolean { const { resource, selection, event, data } = element instanceof Marker ? { resource: element.resource, selection: element.range, event: 'problems.selectDiagnostic', data: this.getTelemetryData(element.marker) } : element instanceof RelatedInformation ? { resource: element.raw.resource, selection: element.raw, event: 'problems.selectRelatedInformation', data: this.getTelemetryData(element.marker) } : { resource: null, selection: null, event: null, data: null }; @@ -306,10 +313,10 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { this.treeLabels = this._register(this.instantiationService.createInstance(ResourceLabels, this)); - const virtualDelegate = new VirtualDelegate(this.markersViewState); + const virtualDelegate = new VirtualDelegate(this.markersViewModel); const renderers = [ this.instantiationService.createInstance(ResourceMarkersRenderer, this.treeLabels, onDidChangeRenderNodeCount.event), - this.instantiationService.createInstance(MarkerRenderer, this.markersViewState, a => this.getActionItem(a)), + this.instantiationService.createInstance(MarkerRenderer, this.markersViewModel), this.instantiationService.createInstance(RelatedInformationRenderer) ]; this.filter = new Filter(); @@ -408,11 +415,11 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { private onDidChangeModel(resources: URI[]) { for (const resource of resources) { - this.markersViewState.remove(resource); + this.markersViewModel.remove(resource); const resourceMarkers = this.markersWorkbenchService.markersModel.getResourceMarkers(resource); if (resourceMarkers) { for (const marker of resourceMarkers.markers) { - this.markersViewState.add(marker); + this.markersViewModel.add(marker); } } } @@ -657,9 +664,6 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { this.filterInputActionItem = this.instantiationService.createInstance(MarkersFilterActionItem, this.filterAction, this); return this.filterInputActionItem; } - if (action.id === QuickFixAction.ID) { - return this.instantiationService.createInstance(QuickFixActionItem, action); - } return super.getActionItem(action); } @@ -701,7 +705,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { this.panelState['filter'] = this.filterAction.filterText; this.panelState['filterHistory'] = this.filterAction.filterHistory; this.panelState['useFilesExclude'] = this.filterAction.useFilesExclude; - this.panelState['multiline'] = this.markersViewState.multiline; + this.panelState['multiline'] = this.markersViewModel.multiline; super.saveState(); } @@ -709,7 +713,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { public dispose(): void { super.dispose(); this.tree.dispose(); - this.markersViewState.dispose(); + this.markersViewModel.dispose(); this.disposables = dispose(this.disposables); } } \ No newline at end of file diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts index b81abdf184c..278570fc877 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts @@ -29,7 +29,7 @@ import { Marker } from 'vs/workbench/parts/markers/electron-browser/markersModel import { IModelService } from 'vs/editor/common/services/modelService'; import { isEqual } from 'vs/base/common/resources'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; -import { Event } from 'vs/base/common/event'; +import { Event, Emitter } from 'vs/base/common/event'; import { FilterOptions } from 'vs/workbench/parts/markers/electron-browser/markersFilterOptions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -297,12 +297,16 @@ export class QuickFixAction extends Action { private updated: boolean = false; private disposables: IDisposable[] = []; + private _onShowQuickFixes: Emitter = new Emitter(); + readonly onShowQuickFixes: Event = this._onShowQuickFixes.event; + constructor( readonly marker: Marker, @IModelService modelService: IModelService, @IMarkersWorkbenchService private readonly markerWorkbenchService: IMarkersWorkbenchService, ) { super(QuickFixAction.ID, Messages.MARKERS_PANEL_ACTION_TOOLTIP_QUICKFIX, 'markers-panel-action-quickfix', false); + this.disposables.push(this._onShowQuickFixes); if (modelService.getModel(this.marker.resource)) { this.update(); } else { @@ -314,6 +318,11 @@ export class QuickFixAction extends Action { } } + run(): Promise { + this._onShowQuickFixes.fire(); + return Promise.resolve(); + } + private update(): void { if (!this.updated) { this.markerWorkbenchService.hasQuickFixes(this.marker).then(hasFixes => this.enabled = hasFixes); @@ -338,13 +347,17 @@ export class QuickFixActionItem extends ActionItem { public onClick(event: DOM.EventLike): void { DOM.EventHelper.stop(event, true); + this.showQuickFixes(); + } + + public showQuickFixes(): void { if (!this.element) { return; } const elementPosition = DOM.getDomNodePagePosition(this.element); this.markerWorkbenchService.getQuickFixActions((this.getAction()).marker).then(actions => { this.contextMenuService.showContextMenu({ - getAnchor: () => ({ x: elementPosition.left + 10, y: elementPosition.top + elementPosition.height }), + getAnchor: () => ({ x: elementPosition.left + 10, y: elementPosition.top + elementPosition.height + 4 }), getActions: () => actions }); }); diff --git a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts index c18c2778053..a284d526c5e 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts @@ -16,8 +16,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { ActionBar, IActionItemProvider } from 'vs/base/browser/ui/actionbar/actionbar'; -import { QuickFixAction } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; +import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; +import { QuickFixAction, QuickFixActionItem } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; import { ILabelService } from 'vs/platform/label/common/label'; import { dirname } from 'vs/base/common/resources'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; @@ -76,12 +76,12 @@ const enum TemplateId { export class VirtualDelegate implements IListVirtualDelegate { - constructor(private readonly markersViewState: MarkersViewState) { } + constructor(private readonly markersViewState: MarkersViewModel) { } getHeight(element: TreeElement): number { if (element instanceof Marker) { - const viewState = this.markersViewState.getViewState(element); - const noOfLines = !viewState || viewState.multiline ? element.lines.length : 1; + const viewModel = this.markersViewState.getViewModel(element); + const noOfLines = !viewModel || viewModel.multiline ? element.lines.length : 1; return noOfLines * 22; } return 22; @@ -201,8 +201,7 @@ export class FileResourceMarkersRenderer extends ResourceMarkersRenderer { export class MarkerRenderer implements ITreeRenderer { constructor( - private readonly markersViewState: MarkersViewState, - private actionItemProvider: IActionItemProvider, + private readonly markersViewState: MarkersViewModel, @IInstantiationService protected instantiationService: IInstantiationService ) { } @@ -210,7 +209,7 @@ export class MarkerRenderer implements ITreeRenderer action.id === QuickFixAction.ID ? instantiationService.createInstance(QuickFixActionItem, action) : null + })); this.icon = dom.append(parent, dom.$('.icon')); - this.multilineActionbar = this._register(new ActionBar(dom.append(parent, dom.$('.multiline-actions')), { actionItemProvider })); + this.multilineActionbar = this._register(new ActionBar(dom.append(parent, dom.$('.multiline-actions')))); this.messageAndDetailsContainer = dom.append(parent, dom.$('.marker-message-details')); this._register(toDisposable(() => this.disposables = dispose(this.disposables))); } @@ -254,38 +254,47 @@ class MarkerWidget extends Disposable { } dom.clearNode(this.messageAndDetailsContainer); - this.renderQuickfixActionbar(element); this.icon.className = 'marker-icon ' + MarkerWidget.iconClassNameFor(element.marker); + this.renderQuickfixActionbar(element); this.renderMultilineActionbar(element); this.renderMessageAndDetails(element, filterData); } private renderQuickfixActionbar(marker: Marker): void { - const quickFixAction = this.instantiationService.createInstance(QuickFixAction, marker); - this.actionBar.push([quickFixAction], { icon: true, label: false }); - dom.toggleClass(this.icon, 'quickFix', quickFixAction.enabled); - quickFixAction.onDidChange(({ enabled }) => { - if (!isUndefinedOrNull(enabled)) { - dom.toggleClass(this.icon, 'quickFix', enabled); - } - }, this, this.disposables); + const viewModel = this.markersViewModel.getViewModel(marker); + if (viewModel) { + const quickFixAction = viewModel.quickFixAction; + this.actionBar.push([quickFixAction], { icon: true, label: false }); + dom.toggleClass(this.icon, 'quickFix', quickFixAction.enabled); + quickFixAction.onDidChange(({ enabled }) => { + if (!isUndefinedOrNull(enabled)) { + dom.toggleClass(this.icon, 'quickFix', enabled); + } + }, this, this.disposables); + quickFixAction.onShowQuickFixes(() => { + const quickFixActionItem = this.actionBar.items[0]; + if (quickFixActionItem) { + quickFixActionItem.showQuickFixes(); + } + }, this, this.disposables); + } } private renderMultilineActionbar(marker: Marker): void { - const viewState = this.markersViewState.getViewState(marker); - const multiline = viewState && viewState.multiline; + const viewModel = this.markersViewModel.getViewModel(marker); + const multiline = viewModel && viewModel.multiline; const action = new Action('problems.action.toggleMultiline'); - action.enabled = viewState && marker.lines.length > 1; + action.enabled = viewModel && marker.lines.length > 1; action.tooltip = multiline ? localize('single line', "Show message in single line") : localize('multi line', "Show message in multiple lines"); action.class = multiline ? 'octicon octicon-chevron-up' : 'octicon octicon-chevron-down'; - action.run = () => { if (viewState) { viewState.multiline = !viewState.multiline; } return Promise.resolve(); }; + action.run = () => { if (viewModel) { viewModel.multiline = !viewModel.multiline; } return Promise.resolve(); }; this.multilineActionbar.push([action], { icon: true, label: false }); } private renderMessageAndDetails(element: Marker, filterData: MarkerFilterData) { const { marker, lines } = element; - const viewState = this.markersViewState.getViewState(element); + const viewState = this.markersViewModel.getViewModel(element); const multiline = !viewState || viewState.multiline; const lineMatches = filterData && filterData.lineMatches || []; const messageContainer = dom.append(this.messageAndDetailsContainer, dom.$('.marker-message')); @@ -461,10 +470,17 @@ export class Filter implements ITreeFilter { } } -export class MarkerViewState extends Disposable { +export class MarkerViewModel extends Disposable { - private readonly _onDidChangeViewState: Emitter = this._register(new Emitter()); - readonly onDidChangeViewState: Event = this._onDidChangeViewState.event; + private readonly _onDidChange: Emitter = this._register(new Emitter()); + readonly onDidChange: Event = this._onDidChange.event; + + constructor( + private readonly marker: Marker, + @IInstantiationService private instantiationService: IInstantiationService + ) { + super(); + } private _multiline: boolean = true; get multiline(): boolean { @@ -474,37 +490,48 @@ export class MarkerViewState extends Disposable { set multiline(value: boolean) { if (this._multiline !== value) { this._multiline = value; - this._onDidChangeViewState.fire(); + this._onDidChange.fire(); } } + + private _quickFixAction: QuickFixAction; + get quickFixAction(): QuickFixAction { + if (!this._quickFixAction) { + this._quickFixAction = this._register(this.instantiationService.createInstance(QuickFixAction, this.marker)); + } + return this._quickFixAction; + } } -export class MarkersViewState extends Disposable { +export class MarkersViewModel extends Disposable { - private readonly _onDidChangeViewState: Emitter = this._register(new Emitter()); - readonly onDidChangeViewState: Event = this._onDidChangeViewState.event; + private readonly _onDidChange: Emitter = this._register(new Emitter()); + readonly onDidChange: Event = this._onDidChange.event; - private readonly markersViewStates: Map = new Map(); + private readonly markersViewStates: Map = new Map(); private readonly markersPerResource: Map = new Map(); private bulkUpdate: boolean = false; - constructor(multiline: boolean = true) { + constructor( + multiline: boolean = true, + @IInstantiationService private instantiationService: IInstantiationService + ) { super(); this._multiline = multiline; } add(marker: Marker): void { if (!this.markersViewStates.has(marker.hash)) { - const disposables: IDisposable[] = []; - const viewState = new MarkerViewState(); - viewState.multiline = this.multiline; - viewState.onDidChangeViewState(() => { + const viewModel = this.instantiationService.createInstance(MarkerViewModel, marker); + const disposables: IDisposable[] = [viewModel]; + viewModel.multiline = this.multiline; + viewModel.onDidChange(() => { if (!this.bulkUpdate) { - this._onDidChangeViewState.fire(marker); + this._onDidChange.fire(marker); } }, this, disposables); - this.markersViewStates.set(marker.hash, { viewState, disposables }); + this.markersViewStates.set(marker.hash, { viewModel, disposables }); const markers = this.markersPerResource.get(marker.resource.toString()) || []; markers.push(marker); @@ -524,9 +551,9 @@ export class MarkersViewState extends Disposable { this.markersPerResource.delete(resource.toString()); } - getViewState(marker: Marker): MarkerViewState | null { + getViewModel(marker: Marker): MarkerViewModel | null { const value = this.markersViewStates.get(marker.hash); - return value ? value.viewState : null; + return value ? value.viewModel : null; } private _multiline: boolean = true; @@ -541,15 +568,15 @@ export class MarkersViewState extends Disposable { changed = true; } this.bulkUpdate = true; - this.markersViewStates.forEach(({ viewState }) => { - if (viewState.multiline !== value) { - viewState.multiline = value; + this.markersViewStates.forEach(({ viewModel }) => { + if (viewModel.multiline !== value) { + viewModel.multiline = value; changed = true; } }); this.bulkUpdate = false; if (changed) { - this._onDidChangeViewState.fire(undefined); + this._onDidChange.fire(undefined); } } From 81e2ef1be1d6e0cd60ede4fd82c2a8a22ae40111 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Mon, 28 Jan 2019 13:29:36 -0800 Subject: [PATCH 048/429] Update services --- .../css-language-features/server/package.json | 2 +- .../css-language-features/server/yarn.lock | 8 ++++---- .../html-language-features/server/package.json | 4 ++-- .../html-language-features/server/yarn.lock | 16 ++++++++-------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index 5fe60307113..aebf551a2e5 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -9,7 +9,7 @@ }, "main": "./out/cssServerMain", "dependencies": { - "vscode-css-languageservice": "^3.0.13-next.9", + "vscode-css-languageservice": "^3.0.13-next.10", "vscode-languageserver": "^5.1.0" }, "devDependencies": { diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index 0c35b246af8..665dd086b76 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -229,10 +229,10 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" -vscode-css-languageservice@^3.0.13-next.9: - version "3.0.13-next.9" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.13-next.9.tgz#1f3ba55fb7444d8eab2c20df60ea5a95ae450cce" - integrity sha512-ooq2KOge+fF7K3mk43C+3/a7roVBDgHUSWfPiDrhOcT7iHAFSmyG/I7yZpH29mXincIHo22hGCoWzEerJF1otw== +vscode-css-languageservice@^3.0.13-next.10: + version "3.0.13-next.10" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.13-next.10.tgz#f5822e832b06e1e91ec96c528bab83bb07251c35" + integrity sha512-zKwzo3GVhrAllYDM4afL8q1XCHixsI8tP3SyLrWGzp0Nc9P+bbjKQeC26VcaOb0dtkgfpB/vfBPf+4yOs4s/pw== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index eb1eae43671..170deb801b2 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -9,8 +9,8 @@ }, "main": "./out/htmlServerMain", "dependencies": { - "vscode-css-languageservice": "^3.0.13-next.9", - "vscode-html-languageservice": "^2.1.11-next.6", + "vscode-css-languageservice": "^3.0.13-next.10", + "vscode-html-languageservice": "^2.1.11-next.7", "vscode-languageserver": "^5.1.0", "vscode-languageserver-types": "^3.13.0", "vscode-nls": "^4.0.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index 3455b53ad43..bb1b921c1c6 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -229,18 +229,18 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" -vscode-css-languageservice@^3.0.13-next.9: - version "3.0.13-next.9" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.13-next.9.tgz#1f3ba55fb7444d8eab2c20df60ea5a95ae450cce" - integrity sha512-ooq2KOge+fF7K3mk43C+3/a7roVBDgHUSWfPiDrhOcT7iHAFSmyG/I7yZpH29mXincIHo22hGCoWzEerJF1otw== +vscode-css-languageservice@^3.0.13-next.10: + version "3.0.13-next.10" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.13-next.10.tgz#f5822e832b06e1e91ec96c528bab83bb07251c35" + integrity sha512-zKwzo3GVhrAllYDM4afL8q1XCHixsI8tP3SyLrWGzp0Nc9P+bbjKQeC26VcaOb0dtkgfpB/vfBPf+4yOs4s/pw== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" -vscode-html-languageservice@^2.1.11-next.6: - version "2.1.11-next.6" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.6.tgz#66eb7a10d84ac91d5985b45cfa704ce05fe3e638" - integrity sha512-BCShNFqflm1XpjMJrxAz4tWSAdA1cqJi2XrI3/eHzqcHzw4kO/l3ApaZPdci77CAcOdWKyDmmzSau0UwR+CkYQ== +vscode-html-languageservice@^2.1.11-next.7: + version "2.1.11-next.7" + resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.7.tgz#4de88828ffa8b133b94a00de31512856f1cd1998" + integrity sha512-k6xFtjw7mk7MIokNxPV+BTLLUTK9OwLxeIgJPibDi2v5b078FNgpD7Yb/h1sZ3ZHVTbd2ARfe4EY6QOTSQ1eaw== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" From 36100deb715cc3ebac7310326c10dc5a408ef0fc Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 28 Jan 2019 08:50:38 -0800 Subject: [PATCH 049/429] render reactions only when it's more than one. --- src/vs/workbench/parts/comments/electron-browser/commentNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts index d81030836ec..894c8a31fb2 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts @@ -92,7 +92,7 @@ export class CommentNode extends Disposable { this._md = this.markdownRenderer.render(comment.body).element; this._body.appendChild(this._md); - if (this.comment.commentReactions) { + if (this.comment.commentReactions && this.comment.commentReactions.length) { this.createReactions(commentDetailsContainer); } From 527513513ae1c49e63dce9828a4786fba58e8183 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Mon, 28 Jan 2019 13:35:11 -0800 Subject: [PATCH 050/429] rerender comment reactions when thread update --- .../comments/electron-browser/commentNode.ts | 36 +++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts index 894c8a31fb2..5d1c0b3b434 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts @@ -44,6 +44,9 @@ export class CommentNode extends Disposable { private _editAction: Action; private _commentEditContainer: HTMLElement; + private _commentDetailsContainer: HTMLElement; + private _reactionsActionBar?: ActionBar; + private _actionsContainer?: HTMLElement; private _commentEditor: SimpleCommentEditor; private _commentEditorModel: ITextModel; private _updateCommentButton: Button; @@ -84,16 +87,16 @@ export class CommentNode extends Disposable { img.src = comment.userIconPath.toString(); img.onerror = _ => img.remove(); } - const commentDetailsContainer = dom.append(this._domNode, dom.$('.review-comment-contents')); + this._commentDetailsContainer = dom.append(this._domNode, dom.$('.review-comment-contents')); - this.createHeader(commentDetailsContainer); + this.createHeader(this._commentDetailsContainer); - this._body = dom.append(commentDetailsContainer, dom.$('div.comment-body')); + this._body = dom.append(this._commentDetailsContainer, dom.$('div.comment-body')); this._md = this.markdownRenderer.render(comment.body).element; this._body.appendChild(this._md); if (this.comment.commentReactions && this.comment.commentReactions.length) { - this.createReactions(commentDetailsContainer); + this.createReactions(this._commentDetailsContainer); } this._domNode.setAttribute('aria-label', `${comment.userName}, ${comment.body.value}`); @@ -139,7 +142,7 @@ export class CommentNode extends Disposable { let reactionActions = []; let reactionGroup = this.commentService.getReactionGroup(this.owner); - if (reactionGroup) { + if (reactionGroup && reactionGroup.length) { reactionActions = reactionGroup.map((reaction) => { return new Action(`reaction.command.${reaction.label}`, `${reaction.label}`, '', true, async () => { try { @@ -172,9 +175,9 @@ export class CommentNode extends Disposable { } private createReactions(commentDetailsContainer: HTMLElement): void { - const actionsContainer = dom.append(commentDetailsContainer, dom.$('div.comment-reactions')); - const actionBar = new ActionBar(actionsContainer, {}); - this._toDispose.push(actionBar); + this._actionsContainer = dom.append(commentDetailsContainer, dom.$('div.comment-reactions')); + this._reactionsActionBar = new ActionBar(this._actionsContainer, {}); + this._toDispose.push(this._reactionsActionBar); let reactionActions = this.comment.commentReactions.map(reaction => { return new Action(`reaction.${reaction.label}`, `${reaction.label}`, reaction.hasReacted ? 'active' : '', true, async () => { @@ -201,7 +204,7 @@ export class CommentNode extends Disposable { }); }); - reactionActions.forEach(action => actionBar.push(action, { label: true, icon: true })); + reactionActions.forEach(action => this._reactionsActionBar.push(action, { label: true, icon: true })); } private createCommentEditor(): void { @@ -354,6 +357,8 @@ export class CommentNode extends Disposable { } update(newComment: modes.Comment) { + this.comment = newComment; + if (newComment.body !== this.comment.body) { this._body.removeChild(this._md); this._md = this.markdownRenderer.render(newComment.body).element; @@ -366,7 +371,18 @@ export class CommentNode extends Disposable { this._isPendingLabel.innerText = ''; } - this.comment = newComment; + // update comment reactions + if (this._actionsContainer) { + this._actionsContainer.remove(); + } + + if (this._reactionsActionBar) { + this._reactionsActionBar.clear(); + } + + if (this.comment.commentReactions && this.comment.commentReactions.length) { + this.createReactions(this._commentDetailsContainer); + } } focus() { From cd4a6cebe707abe467dfb7a52fba549732241b6a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 28 Jan 2019 22:39:39 +0100 Subject: [PATCH 051/429] Fix #67105 --- .../parts/extensions/electron-browser/media/extensionEditor.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css index f9b18fc7a83..a5446fb5d46 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css @@ -131,7 +131,7 @@ .extension-editor > .header > .details > .actions > .monaco-action-bar > .actions-container > .action-item > .action-label { font-weight: 600; - margin: 4px; + margin: 4px 8px 4px 0px; padding: 1px 6px; } From ccb5a625c2412b36baeb14d8cac84f7053f298eb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 25 Jan 2019 16:17:38 -0800 Subject: [PATCH 052/429] Mark extract constant as a preferred refactoring https://github.com/Microsoft/TypeScript/issues/29587 --- .../src/features/refactor.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/extensions/typescript-language-features/src/features/refactor.ts b/extensions/typescript-language-features/src/features/refactor.ts index 5f28e8e398b..bad25c983c4 100644 --- a/extensions/typescript-language-features/src/features/refactor.ts +++ b/extensions/typescript-language-features/src/features/refactor.ts @@ -188,6 +188,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { command: ApplyRefactoringCommand.ID, arguments: [document, file, info.name, action.name, rangeOrSelection], }; + codeAction.isPreferred = TypeScriptRefactorProvider.isPreferred(action); return codeAction; } @@ -209,6 +210,15 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider { } return vscode.CodeActionKind.Refactor; } + + private static isPreferred( + action: Proto.RefactorActionInfo + ): boolean { + if (action.name.startsWith('constant_')) { + return action.name.endsWith('scope_0'); + } + return false; + } } export function register( From ef25b181eac10cd69e522542b1321c435e438bc9 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 25 Jan 2019 17:06:14 -0800 Subject: [PATCH 053/429] Move ServerResponse into namespace --- .../src/commands/goToProjectConfiguration.ts | 2 +- .../src/features/rename.ts | 2 +- .../src/test/cachedResponse.test.ts | 20 +++++++------- .../src/tsServer/cachedResponse.ts | 8 +++--- .../src/tsServer/callbackMap.ts | 12 ++++----- .../src/tsServer/server.ts | 14 +++++----- .../src/typescriptService.ts | 27 ++++++++++--------- .../src/typescriptServiceClient.ts | 12 ++++----- 8 files changed, 50 insertions(+), 47 deletions(-) diff --git a/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts b/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts index ee819648000..9273683ba4c 100644 --- a/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts +++ b/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts @@ -69,7 +69,7 @@ async function goToProjectConfig( return; } - let res: ServerResponse | undefined; + let res: ServerResponse.Response | undefined; try { res = await client.execute('projectInfo', { file, needFileNameList: false }, nulToken); } catch { diff --git a/extensions/typescript-language-features/src/features/rename.ts b/extensions/typescript-language-features/src/features/rename.ts index 55e6c819a08..aff2c508c53 100644 --- a/extensions/typescript-language-features/src/features/rename.ts +++ b/extensions/typescript-language-features/src/features/rename.ts @@ -79,7 +79,7 @@ class TypeScriptRenameProvider implements vscode.RenameProvider { document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken - ): Promise | undefined> { + ): Promise | undefined> { const file = this.client.toOpenedFilePath(document); if (!file) { return undefined; diff --git a/extensions/typescript-language-features/src/test/cachedResponse.test.ts b/extensions/typescript-language-features/src/test/cachedResponse.test.ts index de1003f284f..919d5d4d03c 100644 --- a/extensions/typescript-language-features/src/test/cachedResponse.test.ts +++ b/extensions/typescript-language-features/src/test/cachedResponse.test.ts @@ -8,7 +8,7 @@ import 'mocha'; import * as vscode from 'vscode'; import * as Proto from '../protocol'; import { CachedResponse } from '../tsServer/cachedResponse'; -import { ServerResponse, CancelledResponse } from '../typescriptService'; +import { ServerResponse } from '../typescriptService'; suite('CachedResponse', () => { test('should cache simple response for same document', async () => { @@ -36,12 +36,12 @@ suite('CachedResponse', () => { const doc = await createTextDocument(); const response = new CachedResponse(); - const cancelledResponder = createEventualResponder(); + const cancelledResponder = createEventualResponder(); const result1 = response.execute(doc, () => cancelledResponder.promise); const result2 = response.execute(doc, respondWith('test-0')); const result3 = response.execute(doc, respondWith('test-1')); - cancelledResponder.resolve(new CancelledResponse('cancelled')); + cancelledResponder.resolve(new ServerResponse.Cancelled('cancelled')); assert.strictEqual((await result1).type, 'cancelled'); assertResult(await result2, 'test-0'); @@ -52,12 +52,12 @@ suite('CachedResponse', () => { const doc = await createTextDocument(); const response = new CachedResponse(); - const cancelledResponder = createEventualResponder(); + const cancelledResponder = createEventualResponder(); const result1 = response.execute(doc, respondWith('test-0')); const result2 = response.execute(doc, () => cancelledResponder.promise); const result3 = response.execute(doc, respondWith('test-1')); - cancelledResponder.resolve(new CancelledResponse('cancelled')); + cancelledResponder.resolve(new ServerResponse.Cancelled('cancelled')); assertResult(await result1, 'test-0'); assertResult(await result2, 'test-0'); @@ -69,8 +69,8 @@ suite('CachedResponse', () => { const doc2 = await createTextDocument(); const response = new CachedResponse(); - const cancelledResponder = createEventualResponder(); - const cancelledResponder2 = createEventualResponder(); + const cancelledResponder = createEventualResponder(); + const cancelledResponder2 = createEventualResponder(); const result1 = response.execute(doc1, () => cancelledResponder.promise); const result2 = response.execute(doc1, respondWith('test-0')); @@ -79,8 +79,8 @@ suite('CachedResponse', () => { const result5 = response.execute(doc2, respondWith('test-2')); const result6 = response.execute(doc1, respondWith('test-3')); - cancelledResponder.resolve(new CancelledResponse('cancelled')); - cancelledResponder2.resolve(new CancelledResponse('cancelled')); + cancelledResponder.resolve(new ServerResponse.Cancelled('cancelled')); + cancelledResponder2.resolve(new ServerResponse.Cancelled('cancelled')); assert.strictEqual((await result1).type, 'cancelled'); assertResult(await result2, 'test-0'); @@ -99,7 +99,7 @@ function createTextDocument() { return vscode.workspace.openTextDocument({ language: 'javascript', content: '' }); } -function assertResult(result: ServerResponse, command: string) { +function assertResult(result: ServerResponse.Response, command: string) { if (result.type === 'response') { assert.strictEqual(result.command, command); } else { diff --git a/extensions/typescript-language-features/src/tsServer/cachedResponse.ts b/extensions/typescript-language-features/src/tsServer/cachedResponse.ts index ea8414cf8a5..2fb9b542281 100644 --- a/extensions/typescript-language-features/src/tsServer/cachedResponse.ts +++ b/extensions/typescript-language-features/src/tsServer/cachedResponse.ts @@ -7,13 +7,13 @@ import * as vscode from 'vscode'; import * as Proto from '../protocol'; import { ServerResponse } from '../typescriptService'; -type Resolve = () => Promise>; +type Resolve = () => Promise>; /** * Caches a class of TS Server request based on document. */ export class CachedResponse { - private response?: Promise>; + private response?: Promise>; private version: number = -1; private document: string = ''; @@ -25,7 +25,7 @@ export class CachedResponse { public execute( document: vscode.TextDocument, resolve: Resolve - ): Promise> { + ): Promise> { if (this.response && this.matches(document)) { // Chain so that on cancellation we fall back to the next resolve return this.response = this.response.then(result => result.type === 'cancelled' ? resolve() : result); @@ -40,7 +40,7 @@ export class CachedResponse { private async reset( document: vscode.TextDocument, resolve: Resolve - ): Promise> { + ): Promise> { this.version = document.version; this.document = document.uri.toString(); return this.response = resolve(); diff --git a/extensions/typescript-language-features/src/tsServer/callbackMap.ts b/extensions/typescript-language-features/src/tsServer/callbackMap.ts index 897a587b924..7f96de57159 100644 --- a/extensions/typescript-language-features/src/tsServer/callbackMap.ts +++ b/extensions/typescript-language-features/src/tsServer/callbackMap.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as Proto from '../protocol'; -import { CancelledResponse, ServerResponse } from '../typescriptService'; +import { ServerResponse } from '../typescriptService'; export interface CallbackItem { readonly onSuccess: (value: R) => void; @@ -14,11 +14,11 @@ export interface CallbackItem { } export class CallbackMap { - private readonly _callbacks = new Map | undefined>>(); - private readonly _asyncCallbacks = new Map | undefined>>(); + private readonly _callbacks = new Map | undefined>>(); + private readonly _asyncCallbacks = new Map | undefined>>(); public destroy(cause: string): void { - const cancellation = new CancelledResponse(cause); + const cancellation = new ServerResponse.Cancelled(cause); for (const callback of this._callbacks.values()) { callback.onSuccess(cancellation); } @@ -29,7 +29,7 @@ export class CallbackMap { this._asyncCallbacks.clear(); } - public add(seq: number, callback: CallbackItem | undefined>, isAsync: boolean) { + public add(seq: number, callback: CallbackItem | undefined>, isAsync: boolean) { if (isAsync) { this._asyncCallbacks.set(seq, callback); } else { @@ -37,7 +37,7 @@ export class CallbackMap { } } - public fetch(seq: number): CallbackItem | undefined> | undefined { + public fetch(seq: number): CallbackItem | undefined> | undefined { const callback = this._callbacks.get(seq) || this._asyncCallbacks.get(seq); this.delete(seq); return callback; diff --git a/extensions/typescript-language-features/src/tsServer/server.ts b/extensions/typescript-language-features/src/tsServer/server.ts index b657449ee32..6c237aa538d 100644 --- a/extensions/typescript-language-features/src/tsServer/server.ts +++ b/extensions/typescript-language-features/src/tsServer/server.ts @@ -8,7 +8,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as vscode from 'vscode'; import * as Proto from '../protocol'; -import { CancelledResponse, NoContentResponse, ServerResponse } from '../typescriptService'; +import { ServerResponse } from '../typescriptService'; import API from '../utils/api'; import { TsServerLogLevel, TypeScriptServiceConfiguration } from '../utils/configuration'; import { Disposable } from '../utils/dispose'; @@ -299,7 +299,7 @@ export class TypeScriptServer extends Disposable { } finally { const callback = this.fetchCallback(seq); if (callback) { - callback.onSuccess(new CancelledResponse(`Cancelled request ${seq} - ${command}`)); + callback.onSuccess(new ServerResponse.Cancelled(`Cancelled request ${seq} - ${command}`)); } } } @@ -315,15 +315,15 @@ export class TypeScriptServer extends Disposable { callback.onSuccess(response); } else if (response.message === 'No content available.') { // Special case where response itself is successful but there is not any data to return. - callback.onSuccess(NoContentResponse); + callback.onSuccess(ServerResponse.NoContent); } else { callback.onError(new TypeScriptServerError(this._version, response)); } } public executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: false, lowPriority?: boolean }): undefined; - public executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise>; - public executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise> | undefined { + public executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise>; + public executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise> | undefined { const request = this._requestQueue.createRequest(command, args); const requestInfo: RequestItem = { request, @@ -331,9 +331,9 @@ export class TypeScriptServer extends Disposable { isAsync: executeInfo.isAsync, queueingType: getQueueingType(command, executeInfo.lowPriority) }; - let result: Promise> | undefined; + let result: Promise> | undefined; if (executeInfo.expectsResult) { - result = new Promise>((resolve, reject) => { + result = new Promise>((resolve, reject) => { this._callbacks.add(request.seq, { onSuccess: resolve, onError: reject, startTime: Date.now(), isAsync: executeInfo.isAsync }, executeInfo.isAsync); if (executeInfo.token) { diff --git a/extensions/typescript-language-features/src/typescriptService.ts b/extensions/typescript-language-features/src/typescriptService.ts index 8f004c0e5eb..90ba448e9ed 100644 --- a/extensions/typescript-language-features/src/typescriptService.ts +++ b/extensions/typescript-language-features/src/typescriptService.ts @@ -11,19 +11,22 @@ import { TypeScriptServiceConfiguration } from './utils/configuration'; import Logger from './utils/logger'; import { PluginManager } from './utils/plugins'; -export class CancelledResponse { - public readonly type: 'cancelled' = 'cancelled'; +export namespace ServerResponse { - constructor( - public readonly reason: string - ) { } + export class Cancelled { + public readonly type = 'cancelled'; + + constructor( + public readonly reason: string + ) { } + } + + export const NoContent = new class { readonly type = 'noContent'; }; + export const LanguageServiceDisabled = new class { readonly type = 'languageServiceDisabled'; }; + + export type Response = T | Cancelled | typeof NoContent | typeof LanguageServiceDisabled; } -export const NoContentResponse = new class { readonly type = 'noContent'; }; -export const LanguageServiceDisabledContentResponse = new class { readonly type = 'languageServiceDisabled'; }; - -export type ServerResponse = T | CancelledResponse | typeof NoContentResponse | typeof LanguageServiceDisabledContentResponse; - export interface TypeScriptRequestTypes { 'applyCodeActionCommand': [Proto.ApplyCodeActionCommandRequestArgs, Proto.ApplyCodeActionCommandResponse]; 'completionEntryDetails': [Proto.CompletionDetailsRequestArgs, Proto.CompletionDetailsResponse]; @@ -103,7 +106,7 @@ export interface ITypeScriptServiceClient { args: TypeScriptRequestTypes[K][0], token: vscode.CancellationToken, lowPriority?: boolean - ): Promise>; + ): Promise>; executeWithoutWaitingForResponse(command: 'open', args: Proto.OpenRequestArgs): void; executeWithoutWaitingForResponse(command: 'close', args: Proto.FileRequestArgs): void; @@ -111,7 +114,7 @@ export interface ITypeScriptServiceClient { executeWithoutWaitingForResponse(command: 'compilerOptionsForInferredProjects', args: Proto.SetCompilerOptionsForInferredProjectsArgs): void; executeWithoutWaitingForResponse(command: 'reloadProjects', args: null): void; - executeAsync(command: 'geterr', args: Proto.GeterrRequestArgs, token: vscode.CancellationToken): Promise>; + executeAsync(command: 'geterr', args: Proto.GeterrRequestArgs, token: vscode.CancellationToken): Promise>; /** * Cancel on going geterr requests and re-queue them after `f` has been evaluated. diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 799f24864c1..91353cd1055 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -11,7 +11,7 @@ import BufferSyncSupport from './features/bufferSyncSupport'; import { DiagnosticKind, DiagnosticsManager } from './features/diagnostics'; import * as Proto from './protocol'; import { TypeScriptServer, TypeScriptServerSpawner } from './tsServer/server'; -import { ITypeScriptServiceClient, ServerResponse, LanguageServiceDisabledContentResponse } from './typescriptService'; +import { ITypeScriptServiceClient, ServerResponse } from './typescriptService'; import API from './utils/api'; import { TsServerLogLevel, TypeScriptServiceConfiguration } from './utils/configuration'; import { Disposable } from './utils/dispose'; @@ -590,7 +590,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType return undefined; } - public execute(command: string, args: any, token: vscode.CancellationToken, lowPriority?: boolean): Promise> { + public execute(command: string, args: any, token: vscode.CancellationToken, lowPriority?: boolean): Promise> { return this.executeImpl(command, args, { isAsync: false, token, @@ -607,7 +607,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType }); } - public executeAsync(command: string, args: Proto.GeterrRequestArgs, token: vscode.CancellationToken): Promise> { + public executeAsync(command: string, args: Proto.GeterrRequestArgs, token: vscode.CancellationToken): Promise> { return this.executeImpl(command, args, { isAsync: true, token, @@ -616,8 +616,8 @@ export default class TypeScriptServiceClient extends Disposable implements IType } private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: false, lowPriority?: boolean }): undefined; - private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise>; - private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise> | undefined { + private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise>; + private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise> | undefined { const runningServerState = this.service(); if (!runningServerState.langaugeServiceEnabled) { @@ -634,7 +634,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType 'reloadProjects', ]; if (nonSemanticCommands.indexOf(command) === -1) { - return Promise.resolve(LanguageServiceDisabledContentResponse); + return Promise.resolve(ServerResponse.LanguageServiceDisabled); } } From a70b1317a183999d0c8205fcacdb22518014bbce Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 25 Jan 2019 17:10:10 -0800 Subject: [PATCH 054/429] Removing languageServiceEnabled check After further discussion with the TS team, we determined that we do not need to stop sending semantic commands when the language service disables itself --- .../src/typescriptService.ts | 3 +-- .../src/typescriptServiceClient.ts | 19 ------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/extensions/typescript-language-features/src/typescriptService.ts b/extensions/typescript-language-features/src/typescriptService.ts index 90ba448e9ed..14a4d895800 100644 --- a/extensions/typescript-language-features/src/typescriptService.ts +++ b/extensions/typescript-language-features/src/typescriptService.ts @@ -22,9 +22,8 @@ export namespace ServerResponse { } export const NoContent = new class { readonly type = 'noContent'; }; - export const LanguageServiceDisabled = new class { readonly type = 'languageServiceDisabled'; }; - export type Response = T | Cancelled | typeof NoContent | typeof LanguageServiceDisabled; + export type Response = T | Cancelled | typeof NoContent; } export interface TypeScriptRequestTypes { diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 91353cd1055..4328948b23e 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -619,25 +619,6 @@ export default class TypeScriptServiceClient extends Disposable implements IType private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise>; private executeImpl(command: string, args: any, executeInfo: { isAsync: boolean, token?: vscode.CancellationToken, expectsResult: boolean, lowPriority?: boolean }): Promise> | undefined { const runningServerState = this.service(); - - if (!runningServerState.langaugeServiceEnabled) { - const nonSemanticCommands: string[] = [ - 'change', - 'close', - 'compilerOptionsForInferredProjects', - 'configure', - 'format', - 'formatonkey', - 'getOutliningSpans', - 'open', - 'projectInfo', - 'reloadProjects', - ]; - if (nonSemanticCommands.indexOf(command) === -1) { - return Promise.resolve(ServerResponse.LanguageServiceDisabled); - } - } - return runningServerState.server.executeImpl(command, args, executeInfo); } From 70f4460005960451fbbd89cb2ce661bfc7912a77 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 25 Jan 2019 17:26:19 -0800 Subject: [PATCH 055/429] Extract getCodeActionProviders --- .../editor/contrib/codeAction/codeAction.ts | 51 ++++++++++--------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/vs/editor/contrib/codeAction/codeAction.ts b/src/vs/editor/contrib/codeAction/codeAction.ts index 5282fbb9dc7..e6015b5d02b 100644 --- a/src/vs/editor/contrib/codeAction/codeAction.ts +++ b/src/vs/editor/contrib/codeAction/codeAction.ts @@ -13,7 +13,7 @@ import { Selection } from 'vs/editor/common/core/selection'; import { ITextModel } from 'vs/editor/common/model'; import { CodeAction, CodeActionContext, CodeActionProviderRegistry, CodeActionTrigger as CodeActionTriggerKind } from 'vs/editor/common/modes'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { CodeActionKind, CodeActionTrigger, filtersAction, mayIncludeActionsOfKind } from './codeActionTrigger'; +import { CodeActionKind, CodeActionTrigger, filtersAction, mayIncludeActionsOfKind, CodeActionFilter } from './codeActionTrigger'; export function getCodeActions( model: ITextModel, @@ -32,35 +32,40 @@ export function getCodeActions( rangeOrSelection = model.getFullModelRange(); } - const promises = CodeActionProviderRegistry.all(model) - // Avoid calling providers that we know will not return code actions of interest + const promises = getCodeActionProviders(model, filter).map(provider => { + return Promise.resolve(provider.provideCodeActions(model, rangeOrSelection, codeActionContext, token)).then(providedCodeActions => { + if (!Array.isArray(providedCodeActions)) { + return []; + } + return providedCodeActions.filter(action => action && filtersAction(filter, action)); + }, (err): CodeAction[] => { + if (isPromiseCanceledError(err)) { + throw err; + } + + onUnexpectedExternalError(err); + return []; + }); + }); + + return Promise.all(promises) + .then(flatten) + .then(allCodeActions => mergeSort(allCodeActions, codeActionsComparator)); +} + +function getCodeActionProviders( + model: ITextModel, + filter: CodeActionFilter +) { + return CodeActionProviderRegistry.all(model) + // Don't include providers that we know will not return code actions of interest .filter(provider => { if (!provider.providedCodeActionKinds) { // We don't know what type of actions this provider will return. return true; } - return provider.providedCodeActionKinds.some(kind => mayIncludeActionsOfKind(filter, new CodeActionKind(kind))); - }) - .map(support => { - return Promise.resolve(support.provideCodeActions(model, rangeOrSelection, codeActionContext, token)).then(providedCodeActions => { - if (!Array.isArray(providedCodeActions)) { - return []; - } - return providedCodeActions.filter(action => action && filtersAction(filter, action)); - }, (err): CodeAction[] => { - if (isPromiseCanceledError(err)) { - throw err; - } - - onUnexpectedExternalError(err); - return []; - }); }); - - return Promise.all(promises) - .then(flatten) - .then(allCodeActions => mergeSort(allCodeActions, codeActionsComparator)); } function codeActionsComparator(a: CodeAction, b: CodeAction): number { From 61efc1d7d19a8a81ecc4a40a9c073efb0021ce4e Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 13:40:00 -0800 Subject: [PATCH 056/429] Add webview specific copy/paste, undo/redo commands Fixes #65452 Adds copy/paste, undo/redo commands that are specific to the webview. This is very similar to the approach we already use to implement 'select all' --- .../electron-browser/baseWebviewEditor.ts | 38 ++++++++---- .../electron-browser/webview.contribution.ts | 60 ++++++++++++++++--- .../electron-browser/webviewCommands.ts | 55 +++++++++++++++++ .../electron-browser/webviewElement.ts | 20 +++++++ 4 files changed, 156 insertions(+), 17 deletions(-) diff --git a/src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts b/src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts index 7d3a3a77fbc..0851ec06807 100644 --- a/src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts +++ b/src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts @@ -55,26 +55,44 @@ export abstract class BaseWebviewEditor extends BaseEditor { } public reload() { - if (this._webview) { - this._webview.reload(); - } + this.withWebviewElement(webview => webview.reload()); } public layout(dimension: Dimension): void { - if (this._webview) { - this._webview.layout(); - } + this.withWebviewElement(webview => webview.layout()); } public focus(): void { - if (this._webview) { - this._webview.focus(); - } + this.withWebviewElement(webview => webview.focus()); } public selectAll(): void { + this.withWebviewElement(webview => webview.selectAll()); + } + + public copy(): void { + this.withWebviewElement(webview => webview.copy()); + } + + public paste(): void { + this.withWebviewElement(webview => webview.paste()); + } + + public cut(): void { + this.withWebviewElement(webview => webview.cut()); + } + + public undo(): void { + this.withWebviewElement(webview => webview.undo()); + } + + public redo(): void { + this.withWebviewElement(webview => webview.redo()); + } + + private withWebviewElement(f: (element: WebviewElement) => void): void { if (this._webview) { - this._webview.selectAll(); + f(this._webview); } } } diff --git a/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts index 8adfb937562..7a686405379 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts @@ -16,7 +16,7 @@ import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/wor import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; import { WebviewEditorInputFactory } from 'vs/workbench/parts/webview/electron-browser/webviewEditorInputFactory'; import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE } from './baseWebviewEditor'; -import { HideWebViewEditorFindCommand, OpenWebviewDeveloperToolsAction, ReloadWebviewAction, ShowWebViewEditorFindWidgetCommand, SelectAllWebviewEditorCommand } from './webviewCommands'; +import { HideWebViewEditorFindCommand, OpenWebviewDeveloperToolsAction, ReloadWebviewAction, ShowWebViewEditorFindWidgetCommand, SelectAllWebviewEditorCommand, CopyWebviewEditorCommand, PasteWebviewEditorCommand, CutWebviewEditorCommand, UndoWebviewEditorCommand, RedoWebviewEditorCommand } from './webviewCommands'; import { WebviewEditor } from './webviewEditor'; import { WebviewEditorInput } from './webviewEditorInput'; import { IWebviewEditorService, WebviewEditorService } from './webviewEditorService'; @@ -52,7 +52,7 @@ export function registerWebViewCommands(editorId: string): void { }); showNextFindWidgetCommand.register(); - const hideCommand = new HideWebViewEditorFindCommand({ + (new HideWebViewEditorFindCommand({ id: HideWebViewEditorFindCommand.ID, precondition: ContextKeyExpr.and( contextKeyExpr, @@ -61,18 +61,64 @@ export function registerWebViewCommands(editorId: string): void { primary: KeyCode.Escape, weight: KeybindingWeight.EditorContrib } - }); - hideCommand.register(); + })).register(); - const selectAllCommand = new SelectAllWebviewEditorCommand({ + (new SelectAllWebviewEditorCommand({ id: SelectAllWebviewEditorCommand.ID, precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), kbOpts: { primary: KeyMod.CtrlCmd | KeyCode.KEY_A, weight: KeybindingWeight.EditorContrib } - }); - selectAllCommand.register(); + })).register(); + + (new CopyWebviewEditorCommand({ + id: CopyWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_C, + weight: KeybindingWeight.EditorContrib + } + })).register(); + + (new PasteWebviewEditorCommand({ + id: PasteWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_V, + weight: KeybindingWeight.EditorContrib + } + })).register(); + + + (new CutWebviewEditorCommand({ + id: CutWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_X, + weight: KeybindingWeight.EditorContrib + } + })).register(); + + (new UndoWebviewEditorCommand({ + id: UndoWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_Z, + weight: KeybindingWeight.EditorContrib + } + })).register(); + + (new RedoWebviewEditorCommand({ + id: RedoWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_Y, + secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z], + mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z }, + weight: KeybindingWeight.EditorContrib + } + })).register(); } registerWebViewCommands(WebviewEditor.ID); diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts b/src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts index 4f42f3bf403..b91a3fa1224 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts @@ -43,6 +43,61 @@ export class SelectAllWebviewEditorCommand extends Command { } } +export class CopyWebviewEditorCommand extends Command { + public static readonly ID = 'editor.action.webvieweditor.copy'; + + public runCommand(accessor: ServicesAccessor, args: any): void { + const webViewEditor = getActiveWebviewEditor(accessor); + if (webViewEditor) { + webViewEditor.copy(); + } + } +} + +export class PasteWebviewEditorCommand extends Command { + public static readonly ID = 'editor.action.webvieweditor.paste'; + + public runCommand(accessor: ServicesAccessor, args: any): void { + const webViewEditor = getActiveWebviewEditor(accessor); + if (webViewEditor) { + webViewEditor.paste(); + } + } +} + +export class CutWebviewEditorCommand extends Command { + public static readonly ID = 'editor.action.webvieweditor.cut'; + + public runCommand(accessor: ServicesAccessor, args: any): void { + const webViewEditor = getActiveWebviewEditor(accessor); + if (webViewEditor) { + webViewEditor.cut(); + } + } +} + +export class UndoWebviewEditorCommand extends Command { + public static readonly ID = 'editor.action.webvieweditor.undo'; + + public runCommand(accessor: ServicesAccessor, args: any): void { + const webViewEditor = getActiveWebviewEditor(accessor); + if (webViewEditor) { + webViewEditor.undo(); + } + } +} + +export class RedoWebviewEditorCommand extends Command { + public static readonly ID = 'editor.action.webvieweditor.redo'; + + public runCommand(accessor: ServicesAccessor, args: any): void { + const webViewEditor = getActiveWebviewEditor(accessor); + if (webViewEditor) { + webViewEditor.redo(); + } + } +} + export class OpenWebviewDeveloperToolsAction extends Action { static readonly ID = 'workbench.action.webview.openDeveloperTools'; static readonly LABEL = nls.localize('openToolsLabel', "Open Webview Developer Tools"); diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts index b6a9ea29e72..57af438d221 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts @@ -574,6 +574,26 @@ export class WebviewElement extends Disposable { public selectAll() { this._webview.selectAll(); } + + public copy() { + this._webview.copy(); + } + + public paste() { + this._webview.paste(); + } + + public cut() { + this._webview.cut(); + } + + public undo() { + this._webview.undo(); + } + + public redo() { + this._webview.redo(); + } } From 2c1040da1f086a1c1feafc8bade2bae8b246df31 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Mon, 28 Jan 2019 13:51:06 -0800 Subject: [PATCH 057/429] Update Octicons and license attributions --- cgmanifest.json | 14 +++++++++++++- .../ui/octiconLabel/octicons/octicons.css | 5 +++-- .../ui/octiconLabel/octicons/octicons.svg | 3 +++ .../ui/octiconLabel/octicons/octicons.ttf | Bin 36668 -> 36832 bytes 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/cgmanifest.json b/cgmanifest.json index 37d52feb36c..b7e74e39456 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -111,12 +111,24 @@ "git": { "name": "vscode-octicons-font", "repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font", - "commitHash": "174697a8d28a65dc6600c44d239bd75f7d157c71" + "commitHash": "5095860bb929919670646e2dfa0ee47d9b93bcb9" } }, "license": "MIT", "version": "1.0.0" }, + { + "component": { + "type": "git", + "git": { + "name": "octicons", + "repositoryUrl": "https://github.com/primer/octicons", + "commitHash": "d120bf97bc9a12fb415f69fedaf31fe58427ca56" + } + }, + "license": "MIT", + "version": "8.3.0" + }, { "component": { "type": "npm", diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css index f4744af5bb4..d24cc0b5258 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.css @@ -1,7 +1,7 @@ @font-face { font-family: "octicons"; - src: url("./octicons.ttf?7b4c09277b7efac707b034fae8e52ed0") format("truetype"), -url("./octicons.svg?7b4c09277b7efac707b034fae8e52ed0#octicons") format("svg"); + src: url("./octicons.ttf?4cd2299755e93a2430ba5703f4476584") format("truetype"), +url("./octicons.svg?4cd2299755e93a2430ba5703f4476584#octicons") format("svg"); } .octicon, .mega-octicon { @@ -240,3 +240,4 @@ url("./octicons.svg?7b4c09277b7efac707b034fae8e52ed0#octicons") format("svg"); .octicon-fold-up:before { content: "\f105" } .octicon-github-action:before { content: "\f106" } .octicon-play:before { content: "\f107" } +.octicon-request-changes:before { content: "\f108" } diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg index 4309475d790..4581795255c 100644 --- a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg +++ b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.svg @@ -445,6 +445,9 @@ + diff --git a/src/vs/base/browser/ui/octiconLabel/octicons/octicons.ttf b/src/vs/base/browser/ui/octiconLabel/octicons/octicons.ttf index 747e34216cac83a6e77e6b7971a532a5c47016e2..12b561cd47a71c8e3acfd42b45752b42082666e8 100644 GIT binary patch delta 1251 zcmXw%e@s(X6vw~!wFPWxOZgQj=q%4xX0+|vzS77nnVZuHi;Ft9fRR)z;Gj^T7`9o_ zkts7^Y3R}t_9Re#OQ0?HX6`Ce7+Ta{mGzrGEm-9SQhag6wBjPIeaM zudVY1{AYTN-=+fZrO<`UV0}|aHM@fYr}BZMiI1klqDe5yCF&*KRjz;j4`>t%IH>|&PfpBURv>clY9+pU?q`GHY9Mna%6SxQ#TZuP&~CZ(ypcl=Rzqg z^1qd3EGe>AWnh|87Gy!Hum`t!Fk$_kA#BDLwBi7Yu@kSL31!%iQVhV1b}H44mvI`S z=)=eO1Z!{(Z^Mck$V33O&>#UysBj$Hu^ZQ5!87RMiwQY7W4MY+wBZu+a2VC7!uuG9 zh%@+0xn_)Uc(^LQ3DU2MGx$da0IW@LlWuzImkjbuA>A+ z@S-2DB7z3IgES1I9_z6UZ{P}!Vk-=I7poCM1x9cg8;}ewCUBM%RKSfF@e+2W-~>1} z;XFRW=lB9QBh!f{W{USazGyZqei>2kOugz?HpG`!b+7?`T5V(9d{QlL83m#a z8Bz*SrwnO^s7r>_LsXI>9T9cQ;2bwvW>_0!7+oaFKg;A{*ofb%m^l z_vzZ$b)KiUW%pA&UY#Iy5uKDlgukh`v0>h$FJxEvtiD`3LXkNcT;^L-Y}yGr{UU?2 z{8-Aq-M`To$03~&J1RqpBNmn+?GZaBLtQ|uRfhV3*l`)^3}Po_aFZJi;Yhb(9osc% zg>|#_fVJQH$mX@p*z@gm_I~?M&+T_)Ib4o|j#0-WXQ^|{Iqyn$gjc<%rt^9xZF;YBQwL0o*anIUF~k|;SPXPQYenT?8?Y_r+8ym9W1(Ok3?W{;N-hr{0Zw>-@} z!k_WzlTM>~ZqA%7G(PDFhlPeIIbQ4~nIbcRhgobgGJdj=3G7ZJzx@YQioVg`(Clvt SZK|mD)m8bMBL95&0{ag?GElhy delta 1109 zcmXw&YfzL`7=WL%T-{|C5Hehm)J?QTcY$TsoyZ&u(UESGMI=qILtH8@i)>}3p`1%bxqV0){-8s3wJ#DN2oj&&0#nJa8qZ~3M?`N2Q2#LP&BspsDP z`2TV4_qk&8OpH(76EQ`z@Z_>Wl!NvAFX=2iexf89D(JULb6Kk5$ z|HhW7givW*sv)JBo@AUR-YO)GQ#7)I4U}@09Xw1b@35F4m7L);_mhN`OLU9a7`!|}Ay2TI z)f}gvK|)*zeUY$KEgg$Wm*)y(R~d*svil6gW6HeW)X5Lc`&F;*FuT-YeckL>I}G7G z1CdAAZ6F#6=NpJn!X5)rOW13`F}=j%Q0H}_rB#jUn-U+?zgh;Z=cHa{z=-Zma;PEw zY0}2!7bPd37DW^jmOm|u$R=E4K$p(34yvPi%37c<>vWsLdO|8~1`Oyzn?v>KT3dlS zqWf*FYD}+8b}j6Y`XvKVOZch*<2sP+Qm1rpa)COle@HI3o{`G;2AtNLQe4((-;V}# z>pdwYMG?6UQA9G4od%+t$lC@Yo=A&<908GC267lgb{lX(uS(q+8cfYr#n)H=?aXpk zI7gkcu6?eV9A{2NPG@dr?o{p{dCT(Z@ Date: Mon, 28 Jan 2019 13:55:55 -0800 Subject: [PATCH 058/429] Fix CSS imports --- extensions/css-language-features/.vscode/launch.json | 6 ++---- .../css-language-features/server/src/customData.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/extensions/css-language-features/.vscode/launch.json b/extensions/css-language-features/.vscode/launch.json index d6393141c5d..4f7166e6dce 100644 --- a/extensions/css-language-features/.vscode/launch.json +++ b/extensions/css-language-features/.vscode/launch.json @@ -23,8 +23,7 @@ "outFiles": [ "${workspaceFolder}/client/out/**/*.js" ], - "smartStep": true, - "preLaunchTask": "npm: compile" + "smartStep": true }, { "name": "Launch Tests", @@ -39,8 +38,7 @@ "sourceMaps": true, "outFiles": [ "${workspaceFolder}/client/out/test/**/*.js" - ], - "preLaunchTask": "npm: compile" + ] }, { "name": "Attach Language Server", diff --git a/extensions/css-language-features/server/src/customData.ts b/extensions/css-language-features/server/src/customData.ts index 3b253648d42..b5cbdc27c7a 100644 --- a/extensions/css-language-features/server/src/customData.ts +++ b/extensions/css-language-features/server/src/customData.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { CSSData, ICSSDataProvider } from 'vscode-css-languageservice'; +import { CSSDataV1, ICSSDataProvider } from 'vscode-css-languageservice'; import * as fs from 'fs'; export function getDataProviders(dataPaths: string[]): ICSSDataProvider[] { @@ -29,16 +29,19 @@ export function getDataProviders(dataPaths: string[]): ICSSDataProvider[] { return providers; } -function parseCSSData(source: string): CSSData { +function parseCSSData(source: string): CSSDataV1 { let rawData: any; try { rawData = JSON.parse(source); } catch (err) { - return {}; + return { + version: 1 + }; } return { + version: 1, properties: rawData.properties || [], atDirectives: rawData.atdirectives || [], pseudoClasses: rawData.pseudoclasses || [], From 85119f3faf4f0dedbd5185ddca717418db734da7 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 28 Jan 2019 22:59:25 +0100 Subject: [PATCH 059/429] Language features not supported for ".pyi" python type files. Fixes #66652 --- extensions/python/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/python/package.json b/extensions/python/package.json index 48151bd6245..c81942af764 100644 --- a/extensions/python/package.json +++ b/extensions/python/package.json @@ -10,7 +10,7 @@ "contributes": { "languages": [{ "id": "python", - "extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi", ".snakefile", ".smk"], + "extensions": [ ".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi", ".snakefile", ".smk", ".pyi"], "aliases": [ "Python", "py" ], "firstLine": "^#!\\s*/.*\\bpython[0-9.-]*\\b", "configuration": "./language-configuration.json" From 7640e80f0b34af5892b029f93f76dd6376376eaf Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Mon, 28 Jan 2019 14:30:45 -0800 Subject: [PATCH 060/429] Sbatten/hideable views (#67291) Use hideable views for workbench parts --- src/vs/base/browser/ui/grid/grid.ts | 63 ++++- .../workbench/electron-browser/workbench.ts | 246 ++++++++---------- 2 files changed, 164 insertions(+), 145 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 39bbdeb9181..5bbe5d9c30f 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -8,7 +8,9 @@ import { Orientation } from 'vs/base/browser/ui/sash/sash'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { tail2 as tail, equals } from 'vs/base/common/arrays'; import { orthogonal, IView, GridView, Sizing as GridViewSizing, Box, IGridViewStyles } from './gridview'; -import { Event } from 'vs/base/common/event'; +import { Event, Emitter } from 'vs/base/common/event'; +import { $ } from 'vs/base/browser/dom'; +import { LayoutPriority } from 'vs/base/browser/ui/splitview/splitview'; export { Orientation } from './gridview'; @@ -647,3 +649,62 @@ export function createSerializedGrid(gridDescriptor: GridDescriptor): ISerialize height: height || 1 }; } + +export class View implements IView { + + readonly element = $('.grid-view-view'); + + private visible = false; + private width: number | undefined; + private height: number | undefined; + private orientation: Orientation = Orientation.HORIZONTAL; + + get minimumWidth(): number { return this.visible ? this.view.minimumWidth : 0; } + get maximumWidth(): number { return this.visible ? this.view.maximumWidth : (this.orientation === Orientation.HORIZONTAL ? 0 : Number.POSITIVE_INFINITY); } + get minimumHeight(): number { return this.visible ? this.view.minimumHeight : 0; } + get maximumHeight(): number { return this.visible ? this.view.maximumHeight : (this.orientation === Orientation.VERTICAL ? 0 : Number.POSITIVE_INFINITY); } + + private onDidChangeVisibility = new Emitter<{ width: number; height: number; } | undefined>(); + readonly onDidChange: Event<{ width: number; height: number; } | undefined>; + + get priority(): LayoutPriority | undefined { return this.view.priority; } + get snapSize(): number | undefined { return this.visible ? this.view.snapSize : undefined; } + + constructor(private view: IView) { + this.show(); + this.onDidChange = Event.any(this.onDidChangeVisibility.event, Event.filter(view.onDidChange, () => this.visible)); + } + + show(): void { + if (this.visible) { + return; + } + + this.visible = true; + + this.element.appendChild(this.view.element); + this.onDidChangeVisibility.fire(typeof this.width === 'number' ? { width: this.width, height: this.height! } : undefined); + } + + hide(): void { + if (!this.visible) { + return; + } + + this.visible = false; + + this.element.removeChild(this.view.element); + this.onDidChangeVisibility.fire(undefined); + } + + layout(width: number, height: number, orientation: Orientation): void { + if (!this.visible) { + return; + } + + this.view.layout(width, height, orientation); + this.width = width; + this.height = height; + this.orientation = orientation; + } +} \ No newline at end of file diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 929dda515de..7cc7eab56b1 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -113,7 +113,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { FileDialogService } from 'vs/workbench/services/dialogs/electron-browser/dialogService'; import { LogStorageAction } from 'vs/platform/storage/node/storageService'; -import { Sizing, Direction, SerializableGrid, ISerializedGrid } from 'vs/base/browser/ui/grid/grid'; +import { Sizing, Direction, Grid, View } from 'vs/base/browser/ui/grid/grid'; import { IEditor } from 'vs/editor/common/editorCommon'; import { WorkbenchLayout } from 'vs/workbench/browser/layout'; @@ -143,8 +143,6 @@ type FontAliasingOption = 'default' | 'antialiased' | 'none' | 'auto'; const fontAliasingValues: FontAliasingOption[] = ['antialiased', 'none', 'auto']; -type WorkbenchView = StatusbarPart | TitlebarPart | SidebarPart | EditorPart | ActivitybarPart | PanelPart; - const Identifiers = { WORKBENCH_CONTAINER: 'workbench.main.container', TITLEBAR_PART: 'workbench.parts.titlebar', @@ -180,7 +178,6 @@ interface IWorkbenchUIState { export class Workbench extends Disposable implements IPartService { - private static readonly workbenchGridUIStateStorageKey = 'workbench.layout.state'; private static readonly sidebarHiddenStorageKey = 'workbench.sidebar.hidden'; private static readonly menubarVisibilityConfigurationKey = 'window.menuBarVisibility'; private static readonly panelHiddenStorageKey = 'workbench.panel.hidden'; @@ -211,7 +208,7 @@ export class Workbench extends Disposable implements IPartService { private fileService: IFileService; private quickInput: QuickInputService; - private workbenchGrid: SerializableGrid | WorkbenchLayout; + private workbenchGrid: Grid | WorkbenchLayout; private titlebarPart: TitlebarPart; private activitybarPart: ActivitybarPart; @@ -219,6 +216,14 @@ export class Workbench extends Disposable implements IPartService { private panelPart: PanelPart; private editorPart: EditorPart; private statusbarPart: StatusbarPart; + + private titlebarPartView: View; + private activitybarPartView: View; + private sidebarPartView: View; + private panelPartView: View; + private editorPartView: View; + private statusbarPartView: View; + private quickOpen: QuickOpenController; private notificationsCenter: NotificationsCenter; private notificationsToasts: NotificationsToasts; @@ -961,14 +966,14 @@ export class Workbench extends Disposable implements IPartService { } private saveLastPanelDimension(): void { - if (!(this.workbenchGrid instanceof SerializableGrid)) { + if (!(this.workbenchGrid instanceof Grid)) { return; } if (this.panelPosition === Position.BOTTOM) { - this.uiState.lastPanelHeight = this.workbenchGrid.getViewSize(this.panelPart); + this.uiState.lastPanelHeight = this.workbenchGrid.getViewSize(this.panelPartView); } else { - this.uiState.lastPanelWidth = this.workbenchGrid.getViewSize(this.panelPart); + this.uiState.lastPanelWidth = this.workbenchGrid.getViewSize(this.panelPartView); } } @@ -988,7 +993,7 @@ export class Workbench extends Disposable implements IPartService { // Layout if (!skipLayout) { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { this.layout(); } else { this.workbenchGrid.layout(); @@ -1010,27 +1015,15 @@ export class Workbench extends Disposable implements IPartService { private createWorkbenchLayout(): void { if (this.configurationService.getValue('workbench.useExperimentalGridLayout')) { - const serializedWorkbenchGridString = this.storageService.get(Workbench.workbenchGridUIStateStorageKey, StorageScope.GLOBAL, undefined); + // Create view wrappers for all parts + this.titlebarPartView = new View(this.titlebarPart); + this.sidebarPartView = new View(this.sidebarPart); + this.activitybarPartView = new View(this.activitybarPart); + this.editorPartView = new View(this.editorPart); + this.panelPartView = new View(this.panelPart); + this.statusbarPartView = new View(this.statusbarPart); - if (serializedWorkbenchGridString) { - const serializedWorkbenchGrid = JSON.parse(serializedWorkbenchGridString) as ISerializedGrid; - this.workbenchGrid = SerializableGrid.deserialize(serializedWorkbenchGrid, { - fromJSON: (serializedView: { type: Parts }): WorkbenchView => { - switch (serializedView.type) { - case Parts.ACTIVITYBAR_PART: return this.activitybarPart; - case Parts.EDITOR_PART: return this.editorPart; - case Parts.PANEL_PART: return this.panelPart; - case Parts.SIDEBAR_PART: return this.sidebarPart; - case Parts.STATUSBAR_PART: return this.statusbarPart; - case Parts.TITLEBAR_PART: return this.titlebarPart; - } - - return null; - } - }); - } else { - this.workbenchGrid = new SerializableGrid(this.editorPart, { proportionalLayout: false }); - } + this.workbenchGrid = new Grid(this.editorPartView, { proportionalLayout: false }); this.workbench.prepend(this.workbenchGrid.element); this.layout(); @@ -1196,10 +1189,6 @@ export class Workbench extends Disposable implements IPartService { this.toggleZenMode(true); } } - - if (this.workbenchGrid instanceof SerializableGrid) { - this.storageService.store(Workbench.workbenchGridUIStateStorageKey, JSON.stringify(this.workbenchGrid.serialize()), StorageScope.GLOBAL); - } } dispose(): void { @@ -1287,8 +1276,8 @@ export class Workbench extends Disposable implements IPartService { getTitleBarOffset(): number { let offset = 0; if (this.isVisible(Parts.TITLEBAR_PART)) { - if (this.workbenchGrid instanceof SerializableGrid) { - offset = this.gridHasView(this.titlebarPart) ? this.workbenchGrid.getViewSize2(this.titlebarPart).height : 0; + if (this.workbenchGrid instanceof Grid) { + offset = this.gridHasView(this.titlebarPartView) ? this.workbenchGrid.getViewSize2(this.titlebarPartView).height : 0; } else { offset = this.workbenchGrid.partLayoutInfo.titlebar.height; } @@ -1390,8 +1379,8 @@ export class Workbench extends Disposable implements IPartService { } } - private gridHasView(view: WorkbenchView): boolean { - if (!(this.workbenchGrid instanceof SerializableGrid)) { + private gridHasView(view: View): boolean { + if (!(this.workbenchGrid instanceof Grid)) { return false; } @@ -1404,123 +1393,90 @@ export class Workbench extends Disposable implements IPartService { } private updateGrid(): void { - if (!(this.workbenchGrid instanceof SerializableGrid)) { + if (!(this.workbenchGrid instanceof Grid)) { return; } - let panelInGrid = this.gridHasView(this.panelPart); - let sidebarInGrid = this.gridHasView(this.sidebarPart); - let activityBarInGrid = this.gridHasView(this.activitybarPart); - let statusBarInGrid = this.gridHasView(this.statusbarPart); - let titlebarInGrid = this.gridHasView(this.titlebarPart); + let panelInGrid = this.gridHasView(this.panelPartView); + let sidebarInGrid = this.gridHasView(this.sidebarPartView); + let activityBarInGrid = this.gridHasView(this.activitybarPartView); + let statusBarInGrid = this.gridHasView(this.statusbarPartView); + let titlebarInGrid = this.gridHasView(this.titlebarPartView); - // Remove hidden parts - if (this.panelHidden && panelInGrid) { - this.saveLastPanelDimension(); - this.workbenchGrid.removeView(this.panelPart); - panelInGrid = false; + // Hide parts + if (this.panelHidden) { + this.panelPartView.hide(); } - if (this.statusBarHidden && statusBarInGrid) { - this.workbenchGrid.removeView(this.statusbarPart); - statusBarInGrid = false; + if (this.statusBarHidden) { + this.statusbarPartView.hide(); } - if (!this.isVisible(Parts.TITLEBAR_PART) && titlebarInGrid) { - this.workbenchGrid.removeView(this.titlebarPart); - titlebarInGrid = false; + if (!this.isVisible(Parts.TITLEBAR_PART)) { + this.titlebarPartView.hide(); } - if (this.activityBarHidden && activityBarInGrid) { - this.workbenchGrid.removeView(this.activitybarPart); - activityBarInGrid = false; + if (this.activityBarHidden) { + this.activitybarPartView.hide(); } - if (this.sideBarHidden && sidebarInGrid) { - this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPart); - this.workbenchGrid.removeView(this.sidebarPart); - sidebarInGrid = false; + if (this.sideBarHidden) { + this.sidebarPartView.hide(); } - - // Add visible parts - if (!this.statusBarHidden && !statusBarInGrid) { - if (sidebarInGrid) { - this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPart); - this.workbenchGrid.removeView(this.sidebarPart); - sidebarInGrid = false; - } - - if (activityBarInGrid) { - this.workbenchGrid.removeView(this.activitybarPart); - activityBarInGrid = false; - } - - if (panelInGrid) { - this.saveLastPanelDimension(); - this.workbenchGrid.removeView(this.panelPart); - panelInGrid = false; - } - - this.workbenchGrid.addView(this.statusbarPart, Sizing.Split, this.editorPart, Direction.Down); + // Add parts to grid + if (!statusBarInGrid) { + this.workbenchGrid.addView(this.statusbarPartView, Sizing.Split, this.editorPartView, Direction.Down); statusBarInGrid = true; } - if (this.isVisible(Parts.TITLEBAR_PART) && !titlebarInGrid) { - if (sidebarInGrid) { - this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPart); - this.workbenchGrid.removeView(this.sidebarPart); - sidebarInGrid = false; - } - - if (activityBarInGrid) { - this.workbenchGrid.removeView(this.activitybarPart); - activityBarInGrid = false; - } - - if (panelInGrid && this.panelPosition !== Position.BOTTOM) { - this.saveLastPanelDimension(); - this.workbenchGrid.removeView(this.panelPart); - panelInGrid = false; - } - - this.workbenchGrid.addView(this.titlebarPart, Sizing.Split, this.editorPart, Direction.Up); + if (!titlebarInGrid) { + this.workbenchGrid.addView(this.titlebarPartView, Sizing.Split, this.editorPartView, Direction.Up); titlebarInGrid = true; } - if (!this.activityBarHidden && !activityBarInGrid) { - if (sidebarInGrid) { - this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPart); - this.workbenchGrid.removeView(this.sidebarPart); - sidebarInGrid = false; - } - - this.workbenchGrid.addView(this.activitybarPart, Sizing.Split, this.editorPart, this.sideBarPosition === Position.RIGHT ? Direction.Right : Direction.Left); + if (!activityBarInGrid) { + this.workbenchGrid.addView(this.activitybarPartView, Sizing.Split, panelInGrid && this.sideBarPosition === this.panelPosition ? this.panelPartView : this.editorPartView, this.sideBarPosition === Position.RIGHT ? Direction.Right : Direction.Left); activityBarInGrid = true; } - if (!this.sideBarHidden && !sidebarInGrid) { - if (panelInGrid && this.panelPosition === Position.BOTTOM) { - this.saveLastPanelDimension(); - this.workbenchGrid.removeView(this.panelPart); - panelInGrid = false; - } - - this.workbenchGrid.addView(this.sidebarPart, this.uiState.lastSidebarDimension !== undefined ? this.uiState.lastSidebarDimension : Sizing.Split, this.editorPart, this.sideBarPosition === Position.RIGHT ? Direction.Right : Direction.Left); + if (!sidebarInGrid) { + this.workbenchGrid.addView(this.sidebarPartView, this.uiState.lastSidebarDimension !== undefined ? this.uiState.lastSidebarDimension : Sizing.Split, this.activitybarPartView, this.sideBarPosition === Position.LEFT ? Direction.Right : Direction.Left); sidebarInGrid = true; } - if (!this.panelHidden && !panelInGrid) { - this.workbenchGrid.addView(this.panelPart, this.getLastPanelDimension(this.panelPosition) !== undefined ? this.getLastPanelDimension(this.panelPosition) : Sizing.Split, this.editorPart, this.panelPosition === Position.BOTTOM ? Direction.Down : Direction.Right); + if (!panelInGrid) { + this.workbenchGrid.addView(this.panelPartView, this.getLastPanelDimension(this.panelPosition) !== undefined ? this.getLastPanelDimension(this.panelPosition) : Sizing.Split, this.editorPartView, this.panelPosition === Position.BOTTOM ? Direction.Down : Direction.Right); panelInGrid = true; } + + // Show visible parts + if (!this.statusBarHidden) { + this.statusbarPartView.show(); + } + + if (this.isVisible(Parts.TITLEBAR_PART)) { + this.titlebarPartView.show(); + } + + if (!this.activityBarHidden) { + this.activitybarPartView.show(); + } + + if (!this.sideBarHidden) { + this.sidebarPartView.show(); + } + + if (!this.panelHidden) { + this.panelPartView.show(); + } } layout(options?: ILayoutOptions): void { this.contextViewService.layout(); if (this.workbenchStarted && !this.workbenchShutdown) { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { const dimensions = DOM.getClientArea(this.container); DOM.position(this.workbench, 0, 0, 0, 0, 'relative'); DOM.size(this.workbench, dimensions.width, dimensions.height); @@ -1565,15 +1521,15 @@ export class Workbench extends Disposable implements IPartService { } resizePart(part: Parts, sizeChange: number): void { - let view: WorkbenchView; + let view: View; switch (part) { case Parts.SIDEBAR_PART: - view = this.sidebarPart; + view = this.sidebarPartView; case Parts.PANEL_PART: - view = this.panelPart; + view = this.panelPartView; case Parts.EDITOR_PART: - view = this.editorPart; - if (this.workbenchGrid instanceof SerializableGrid) { + view = this.editorPartView; + if (this.workbenchGrid instanceof Grid) { this.workbenchGrid.resizeView(view, this.workbenchGrid.getViewSize(view) + sizeChange); } else { this.workbenchGrid.resizePart(part, sizeChange); @@ -1589,7 +1545,7 @@ export class Workbench extends Disposable implements IPartService { // Layout if (!skipLayout) { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { this.layout(); } else { this.workbenchGrid.layout(); @@ -1643,7 +1599,7 @@ export class Workbench extends Disposable implements IPartService { // Layout if (!skipLayout) { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { this.layout(); } else { this.workbenchGrid.layout(); @@ -1685,7 +1641,7 @@ export class Workbench extends Disposable implements IPartService { // Layout if (!skipLayout) { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { this.layout(); } else { this.workbenchGrid.layout(); @@ -1694,17 +1650,17 @@ export class Workbench extends Disposable implements IPartService { } toggleMaximizedPanel(): void { - if (this.workbenchGrid instanceof SerializableGrid) { - this.workbenchGrid.maximizeViewSize(this.panelPart); + if (this.workbenchGrid instanceof Grid) { + this.workbenchGrid.maximizeViewSize(this.panelPartView); } else { this.workbenchGrid.layout({ toggleMaximizedPanel: true, source: Parts.PANEL_PART }); } } isPanelMaximized(): boolean { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { try { - return this.workbenchGrid.getViewSize2(this.panelPart).height === this.panelPart.maximumHeight; + return this.workbenchGrid.getViewSize2(this.panelPartView).height === this.panelPart.maximumHeight; } catch (e) { return false; } @@ -1739,15 +1695,19 @@ export class Workbench extends Disposable implements IPartService { this.sidebarPart.updateStyles(); // Layout - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { if (!wasHidden) { - this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPart); - this.workbenchGrid.removeView(this.sidebarPart); + this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPartView); + this.workbenchGrid.removeView(this.sidebarPartView); } if (!this.activityBarHidden) { - this.workbenchGrid.removeView(this.activitybarPart); + this.workbenchGrid.removeView(this.activitybarPartView); + } + + if (!this.panelHidden && this.panelPosition === Position.BOTTOM) { + this.workbenchGrid.removeView(this.panelPartView); } this.layout(); @@ -1762,7 +1722,7 @@ export class Workbench extends Disposable implements IPartService { // Layout if (!skipLayout) { - if (this.workbenchGrid instanceof SerializableGrid) { + if (this.workbenchGrid instanceof Grid) { const dimensions = DOM.getClientArea(this.container); this.workbenchGrid.layout(dimensions.width, dimensions.height); } else { @@ -1802,15 +1762,13 @@ export class Workbench extends Disposable implements IPartService { this.panelPart.updateStyles(); // Layout - if (this.workbenchGrid instanceof SerializableGrid) { - if (wasHidden) { - this.workbenchGrid.addView(this.panelPart, this.getLastPanelDimension(position) !== undefined ? this.getLastPanelDimension(position) : Sizing.Split, this.editorPart, position === Position.BOTTOM ? Direction.Down : Direction.Right); - } else { - this.workbenchGrid.moveView(this.panelPart, this.getLastPanelDimension(position) !== undefined ? this.getLastPanelDimension(position) : Sizing.Split, this.editorPart, position === Position.BOTTOM ? Direction.Down : Direction.Right); + if (this.workbenchGrid instanceof Grid) { + if (!wasHidden) { + this.saveLastPanelDimension(); + this.workbenchGrid.removeView(this.panelPartView); } - const dimensions = DOM.getClientArea(this.container); - this.workbenchGrid.layout(dimensions.width, dimensions.height); + this.layout(); } else { this.workbenchGrid.layout(); } From f93786c3d5832797003f979780b3b2d209950092 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 14:30:20 -0800 Subject: [PATCH 061/429] Prevent double dispatch of copy/paste commands in webviews on platforms where we don't need workaround --- .../electron-browser/webview.contribution.ts | 88 ++++++++++--------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts index 7a686405379..033bd98d007 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts @@ -21,6 +21,7 @@ import { WebviewEditor } from './webviewEditor'; import { WebviewEditorInput } from './webviewEditorInput'; import { IWebviewEditorService, WebviewEditorService } from './webviewEditorService'; import { InputFocusedContextKey } from 'vs/platform/workbench/common/contextkeys'; +import { isMacintosh } from 'vs/base/common/platform'; (Registry.as(EditorExtensions.Editors)).registerEditor(new EditorDescriptor( WebviewEditor, @@ -72,53 +73,56 @@ export function registerWebViewCommands(editorId: string): void { } })).register(); - (new CopyWebviewEditorCommand({ - id: CopyWebviewEditorCommand.ID, - precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), - kbOpts: { - primary: KeyMod.CtrlCmd | KeyCode.KEY_C, - weight: KeybindingWeight.EditorContrib - } - })).register(); + // These commands are only needed on MacOS where we have to disable the menu bar commands + if (isMacintosh) { + (new CopyWebviewEditorCommand({ + id: CopyWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_C, + weight: KeybindingWeight.EditorContrib + } + })).register(); - (new PasteWebviewEditorCommand({ - id: PasteWebviewEditorCommand.ID, - precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), - kbOpts: { - primary: KeyMod.CtrlCmd | KeyCode.KEY_V, - weight: KeybindingWeight.EditorContrib - } - })).register(); + (new PasteWebviewEditorCommand({ + id: PasteWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_V, + weight: KeybindingWeight.EditorContrib + } + })).register(); - (new CutWebviewEditorCommand({ - id: CutWebviewEditorCommand.ID, - precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), - kbOpts: { - primary: KeyMod.CtrlCmd | KeyCode.KEY_X, - weight: KeybindingWeight.EditorContrib - } - })).register(); + (new CutWebviewEditorCommand({ + id: CutWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_X, + weight: KeybindingWeight.EditorContrib + } + })).register(); - (new UndoWebviewEditorCommand({ - id: UndoWebviewEditorCommand.ID, - precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), - kbOpts: { - primary: KeyMod.CtrlCmd | KeyCode.KEY_Z, - weight: KeybindingWeight.EditorContrib - } - })).register(); + (new UndoWebviewEditorCommand({ + id: UndoWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_Z, + weight: KeybindingWeight.EditorContrib + } + })).register(); - (new RedoWebviewEditorCommand({ - id: RedoWebviewEditorCommand.ID, - precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), - kbOpts: { - primary: KeyMod.CtrlCmd | KeyCode.KEY_Y, - secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z], - mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z }, - weight: KeybindingWeight.EditorContrib - } - })).register(); + (new RedoWebviewEditorCommand({ + id: RedoWebviewEditorCommand.ID, + precondition: ContextKeyExpr.and(contextKeyExpr, ContextKeyExpr.not(InputFocusedContextKey)), + kbOpts: { + primary: KeyMod.CtrlCmd | KeyCode.KEY_Y, + secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z], + mac: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_Z }, + weight: KeybindingWeight.EditorContrib + } + })).register(); + } } registerWebViewCommands(WebviewEditor.ID); From 58d3dade0e03d0a1b6687725168e8b5aaf50908d Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 28 Jan 2019 23:36:03 +0100 Subject: [PATCH 062/429] [html] update service (new formatter) --- extensions/html-language-features/server/package.json | 2 +- extensions/html-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 170deb801b2..b57df13fe19 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -10,7 +10,7 @@ "main": "./out/htmlServerMain", "dependencies": { "vscode-css-languageservice": "^3.0.13-next.10", - "vscode-html-languageservice": "^2.1.11-next.7", + "vscode-html-languageservice": "^2.1.11-next.8", "vscode-languageserver": "^5.1.0", "vscode-languageserver-types": "^3.13.0", "vscode-nls": "^4.0.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index bb1b921c1c6..4918bf833a4 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -237,10 +237,10 @@ vscode-css-languageservice@^3.0.13-next.10: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" -vscode-html-languageservice@^2.1.11-next.7: - version "2.1.11-next.7" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.7.tgz#4de88828ffa8b133b94a00de31512856f1cd1998" - integrity sha512-k6xFtjw7mk7MIokNxPV+BTLLUTK9OwLxeIgJPibDi2v5b078FNgpD7Yb/h1sZ3ZHVTbd2ARfe4EY6QOTSQ1eaw== +vscode-html-languageservice@^2.1.11-next.8: + version "2.1.11-next.8" + resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.8.tgz#060c69163ad65ad50988841011b86e423fd0a6d3" + integrity sha512-K6jCKx0xPQHQ/poicbMvCKwWc+XxBzZlT74C5SLbDfS6llkVIBThoIl6qrJhDuAqPNmyFmaFbT4+YvfqBUdpAA== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" From 807759ecff332b94bb17a6955d7a4d44f3e06706 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 14:03:20 -0800 Subject: [PATCH 063/429] Rename `jsDocCompletion.enabled` to `javascript.suggest.completeJsDocs` and `typescript.suggest.completeJsDocs` Fixes #67146 --- .../typescript-language-features/package.json | 13 +++++++++++++ .../typescript-language-features/package.nls.json | 4 +++- .../src/features/jsDocCompletions.ts | 3 ++- .../src/languageProvider.ts | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index 63fcf31bad9..dc8b9dd2e34 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -362,6 +362,7 @@ "type": "boolean", "default": true, "description": "%jsDocCompletion.enabled%", + "deprecationMessage": "jsDocCompletion.deprecationMessage", "scope": "resource" }, "javascript.implicitProjectConfig.checkJs": { @@ -424,6 +425,18 @@ "description": "%configuration.suggest.autoImports%", "scope": "resource" }, + "javascript.suggest.completeJSDocs": { + "type": "boolean", + "default": true, + "description": "%configuration.suggest.completeJSDocs%", + "scope": "resource" + }, + "typescript.suggest.completeJSDocs": { + "type": "boolean", + "default": true, + "description": "%configuration.suggest.completeJSDocs%", + "scope": "resource" + }, "typescript.locale": { "type": [ "string", diff --git a/extensions/typescript-language-features/package.nls.json b/extensions/typescript-language-features/package.nls.json index 2cd347a012a..d945ca0876b 100644 --- a/extensions/typescript-language-features/package.nls.json +++ b/extensions/typescript-language-features/package.nls.json @@ -38,6 +38,7 @@ "typescript.selectTypeScriptVersion.title": "Select TypeScript Version.", "typescript.reportStyleChecksAsWarnings": "Report style checks as warnings.", "jsDocCompletion.enabled": "Enable/disable auto JSDoc comments.", + "jsDocCompletion.deprecationMessage": "This setting has renamed to `javascript.suggest.completeJSDocs` and `typescript.suggest.completeJSDocs` and will be removed.", "javascript.implicitProjectConfig.checkJs": "Enable/disable semantic checking of JavaScript files. Existing jsconfig.json or tsconfig.json files override this setting. Requires using TypeScript 2.3.1 or newer in the workspace.", "typescript.npm": "Specifies the path to the NPM executable used for Automatic Type Acquisition. Requires using TypeScript 2.3.4 or newer in the workspace.", "typescript.check.npmIsInstalled": "Check if NPM is installed for Automatic Type Acquisition.", @@ -67,5 +68,6 @@ "typescript.updateImportsOnFileMove.enabled.never": "Never rename paths and don't prompt.", "typescript.autoClosingTags": "Enable/disable automatic closing of JSX tags. Requires using TypeScript 3.0 or newer in the workspace.", "typescript.suggest.enabled": "Enabled/disable autocomplete suggestions.", - "configuration.surveys.enabled": "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support." + "configuration.surveys.enabled": "Enabled/disable occasional surveys that help us improve VS Code's JavaScript and TypeScript support.", + "configuration.suggest.completeJSDocs": "Enable/disable suggestion to complete JSDoc comments." } \ No newline at end of file diff --git a/extensions/typescript-language-features/src/features/jsDocCompletions.ts b/extensions/typescript-language-features/src/features/jsDocCompletions.ts index e84b27ed2b8..36f7a751522 100644 --- a/extensions/typescript-language-features/src/features/jsDocCompletions.ts +++ b/extensions/typescript-language-features/src/features/jsDocCompletions.ts @@ -112,9 +112,10 @@ export function templateToSnippet(template: string): vscode.SnippetString { export function register( selector: vscode.DocumentSelector, + modeId: string, client: ITypeScriptServiceClient, ): vscode.Disposable { - return new ConfigurationDependentRegistration('jsDocCompletion', 'enabled', () => { + return new ConfigurationDependentRegistration(modeId, 'suggest.completeJSDocs', () => { return vscode.languages.registerCompletionItemProvider(selector, new JsDocCompletionProvider(client), '*'); diff --git a/extensions/typescript-language-features/src/languageProvider.ts b/extensions/typescript-language-features/src/languageProvider.ts index 3a927cf777d..6f122fcb633 100644 --- a/extensions/typescript-language-features/src/languageProvider.ts +++ b/extensions/typescript-language-features/src/languageProvider.ts @@ -65,7 +65,7 @@ export default class LanguageProvider extends Disposable { this._register((await import('./features/hover')).register(selector, this.client)); this._register((await import('./features/implementations')).register(selector, this.client)); this._register((await import('./features/implementationsCodeLens')).register(selector, this.description.id, this.client, cachedResponse)); - this._register((await import('./features/jsDocCompletions')).register(selector, this.client)); + this._register((await import('./features/jsDocCompletions')).register(selector, this.description.id, this.client)); this._register((await import('./features/organizeImports')).register(selector, this.client, this.commandManager, this.fileConfigurationManager, this.telemetryReporter)); this._register((await import('./features/quickFix')).register(selector, this.client, this.fileConfigurationManager, this.commandManager, this.client.diagnosticsManager, this.telemetryReporter)); this._register((await import('./features/fixAll')).register(selector, this.client, this.fileConfigurationManager, this.client.diagnosticsManager)); From b15877def6af62a9488f8157baa012d0b3e157f6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 14:23:26 -0800 Subject: [PATCH 064/429] Handle some edge cases of #18131 --- .../src/features/completions.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index f07e335daeb..c0020fdfef0 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -638,25 +638,23 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider try { const args: Proto.FileLocationRequestArgs = typeConverters.Position.toFileLocationRequestArgs(filepath, position); const response = await this.client.execute('quickinfo', args, token); - if (response.type !== 'response' || !response.body) { - return true; + if (response.type === 'response' && response.body) { + switch (response.body.kind) { + case 'var': + case 'let': + case 'const': + case 'alias': + return false; + } } - - switch (response.body.kind) { - case 'var': - case 'let': - case 'const': - case 'alias': - return false; - } - } catch (e) { - return true; + } catch { + // Noop } - // Don't complete function call if there is already something that looks like a funciton call + // Don't complete function call if there is already something that looks like a function call // https://github.com/Microsoft/vscode/issues/18131 const after = document.lineAt(position.line).text.slice(position.character); - return after.match(/^\s*\(/g) === null; + return after.match(/^[a-z_$0-9]*\s*\(/gi) === null; } } From 71ee61ef2d96865b563c517aa25ba5791447eede Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 14:43:49 -0800 Subject: [PATCH 065/429] Fix active signature not being propagated properly #33413 --- src/vs/workbench/api/node/extHostLanguageFeatures.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 8379fa3ad79..76b8b1fbe00 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -756,11 +756,14 @@ class SignatureHelpAdapter { private reviveContext(context: modes.SignatureHelpContext): vscode.SignatureHelpContext { let activeSignatureHelp: vscode.SignatureHelp | undefined = undefined; if (context.activeSignatureHelp) { + const revivedSignatureHelp = typeConvert.SignatureHelp.to(context.activeSignatureHelp); const saved = this._heap.get(ObjectIdentifier.of(context.activeSignatureHelp)); if (saved) { activeSignatureHelp = saved; + activeSignatureHelp.activeSignature = revivedSignatureHelp.activeSignature; + activeSignatureHelp.activeParameter = revivedSignatureHelp.activeParameter; } else { - activeSignatureHelp = typeConvert.SignatureHelp.to(context.activeSignatureHelp); + activeSignatureHelp = revivedSignatureHelp; } } return { ...context, activeSignatureHelp }; From 89275bcf594eb2602b9efe5e6e28f7fc9d20bee0 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 28 Jan 2019 23:49:54 +0100 Subject: [PATCH 066/429] Add preserve-aligned to the UI settings for html.format.wrapAttributes. Fixes #66644 --- extensions/html-language-features/package.json | 8 ++++++-- extensions/html-language-features/package.nls.json | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index ebcde114c3f..0fc7ed3ce11 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -117,14 +117,18 @@ "force", "force-aligned", "force-expand-multiline", - "aligned-multiple" + "aligned-multiple", + "preserve", + "preserve-aligned" ], "enumDescriptions": [ "%html.format.wrapAttributes.auto%", "%html.format.wrapAttributes.force%", "%html.format.wrapAttributes.forcealign%", "%html.format.wrapAttributes.forcemultiline%", - "%html.format.wrapAttributes.alignedmultiple%" + "%html.format.wrapAttributes.alignedmultiple%", + "%html.format.wrapAttributes.preserve%", + "%html.format.wrapAttributes.preservealigned%" ], "description": "%html.format.wrapAttributes.desc%" }, diff --git a/extensions/html-language-features/package.nls.json b/extensions/html-language-features/package.nls.json index c6923ce881e..343a5a7e2d9 100644 --- a/extensions/html-language-features/package.nls.json +++ b/extensions/html-language-features/package.nls.json @@ -17,6 +17,8 @@ "html.format.wrapAttributes.forcealign": "Wrap each attribute except first and keep aligned.", "html.format.wrapAttributes.forcemultiline": "Wrap each attribute.", "html.format.wrapAttributes.alignedmultiple": "Wrap when line length is exceeded, align attributes vertically.", + "html.format.wrapAttributes.preserve": "Preserve wrapping of attributes", + "html.format.wrapAttributes.preservealigned": "Preserve wrapping of attributes but align.", "html.suggest.angular1.desc": "Controls whether the built-in HTML language support suggests Angular V1 tags and properties.", "html.suggest.ionic.desc": "Controls whether the built-in HTML language support suggests Ionic tags, properties and values.", "html.suggest.html5.desc": "Controls whether the built-in HTML language support suggests HTML5 tags, properties and values.", From 3af611c7590383f34756ab5cbbe063cdd2f8ebe2 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 28 Jan 2019 23:56:43 +0100 Subject: [PATCH 067/429] make jsonValidation dynamic (for #66574) --- extensions/json-language-features/client/src/jsonMain.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/json-language-features/client/src/jsonMain.ts b/extensions/json-language-features/client/src/jsonMain.ts index 585a908afe7..0ea7b420e3a 100644 --- a/extensions/json-language-features/client/src/jsonMain.ts +++ b/extensions/json-language-features/client/src/jsonMain.ts @@ -194,6 +194,10 @@ export function activate(context: ExtensionContext) { client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); + extensions.onDidChange(_ => { + client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); + }); + documentSelector.forEach(selector => { toDispose.push(languages.registerSelectionRangeProvider(selector, { async provideSelectionRanges(document: TextDocument, position: Position): Promise { From b79f3a68999c8f80ffd0c8ab43ea859d804e678c Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 29 Jan 2019 00:02:06 +0100 Subject: [PATCH 068/429] cli server: open folders in separate windows --- src/vs/workbench/api/node/extHostTerminalService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 884bd047a33..1136debe9a1 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -603,8 +603,11 @@ class CLIServer { req.setEncoding('utf8'); req.on('data', (d: string) => chunks.push(d)); req.on('end', () => { - const { fileURIs, folderURIs, forceNewWindow, diffMode, addMode, forceReuseWindow } = JSON.parse(chunks.join('')); + let { fileURIs, folderURIs, forceNewWindow, diffMode, addMode, forceReuseWindow } = JSON.parse(chunks.join('')); if (folderURIs && folderURIs.length || fileURIs && fileURIs.length) { + if (folderURIs && folderURIs.length && !forceReuseWindow) { + forceNewWindow = true; + } this._commands.executeCommand('_files.windowOpen', { folderURIs: this.toURIs(folderURIs), fileURIs: this.toURIs(fileURIs), forceNewWindow, diffMode, addMode, forceReuseWindow }); } res.writeHead(200); From ab8a277c9c12da1d47c5cae49ded77c670f8905d Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Mon, 28 Jan 2019 15:13:26 -0800 Subject: [PATCH 069/429] don't add titlebar to the grid when using native --- src/vs/workbench/electron-browser/workbench.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 7cc7eab56b1..df339344737 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -1430,7 +1430,7 @@ export class Workbench extends Disposable implements IPartService { statusBarInGrid = true; } - if (!titlebarInGrid) { + if (!titlebarInGrid && this.useCustomTitleBarStyle()) { this.workbenchGrid.addView(this.titlebarPartView, Sizing.Split, this.editorPartView, Direction.Up); titlebarInGrid = true; } From 6a7000f2cc27e0fccbe84e2d866d5448292742ff Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 14:49:51 -0800 Subject: [PATCH 070/429] Better description of activeSignatureHelp --- src/vs/vscode.proposed.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index a32810ebda4..7419b80e47d 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1112,7 +1112,8 @@ declare module 'vscode' { /** * The currently active [`SignatureHelp`](#SignatureHelp). * - * Will have the [`SignatureHelp.activeSignature`] field updated based on user arrowing through sig help + * The `activeSignatureHelp` has its [`SignatureHelp.activeSignature`] field updated based on + * the user arrowing through available signatures. */ readonly activeSignatureHelp?: SignatureHelp; } From 951d795023ccae1c9f44e4d3e185c346dba03d31 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 15:24:25 -0800 Subject: [PATCH 071/429] Improving documentation --- src/vs/vscode.proposed.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 7419b80e47d..43a627b4c93 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1122,7 +1122,7 @@ declare module 'vscode' { //#region CodeAction.isPreferred - mjbvz export interface CodeAction { /** - * If the action is a preferred action or fix to take. + * Marks this as a preferred action. Preferred actions are used by the `auto fix` command. * * A quick fix should be marked preferred if it properly addresses the underlying error. * A refactoring should be marked preferred if it is the most reasonable choice of actions to take. @@ -1143,9 +1143,9 @@ declare module 'vscode' { //#region Autofix - mjbvz export namespace CodeActionKind { /** - * Base kind for an auto fix source action: `source.fixAll`. + * Base kind for auto-fix source actions: `source.fixAll`. * - * Fix all actions automatically fix errors in the code that have a clear fix that does not require user input. + * Fix all actions automatically fix errors that have a clear fix that do not require user input. * They should not suppress errors or perform unsafe fixes such as generating new types or classes. */ export const SourceFixAll: CodeActionKind; From c1c3e5eab0f2fb9e04a32b4fc6473023a9c25697 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 15:45:30 -0800 Subject: [PATCH 072/429] Properly encode markdown file path for open links Fixes #59523 Double encode the path so that `Uri.parse`'s decoding only strips out the first level of encoding --- .../markdown-language-features/src/commands/openDocumentLink.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/markdown-language-features/src/commands/openDocumentLink.ts b/extensions/markdown-language-features/src/commands/openDocumentLink.ts index 42dfe67df25..ea929f484f6 100644 --- a/extensions/markdown-language-features/src/commands/openDocumentLink.ts +++ b/extensions/markdown-language-features/src/commands/openDocumentLink.ts @@ -25,7 +25,7 @@ export class OpenDocumentLinkCommand implements Command { path: string, fragment: string ): vscode.Uri { - return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path, fragment }))}`); + return vscode.Uri.parse(`command:${OpenDocumentLinkCommand.id}?${encodeURIComponent(JSON.stringify({ path: encodeURIComponent(path), fragment }))}`); } public constructor( From 62468cb3562d97141424eb84f863cc0d8701ba2d Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 28 Jan 2019 23:48:53 +0000 Subject: [PATCH 073/429] Sync settings tree scroll position to TOC - #64749 --- .../parts/preferences/browser/settingsTree.ts | 7 ++ .../electron-browser/settingsEditor2.ts | 103 +++++++++++++----- 2 files changed, 80 insertions(+), 30 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/settingsTree.ts b/src/vs/workbench/parts/preferences/browser/settingsTree.ts index 0b9ccb098bc..ab40cc8e798 100644 --- a/src/vs/workbench/parts/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/parts/preferences/browser/settingsTree.ts @@ -257,6 +257,7 @@ export abstract class AbstractSettingRenderer implements ITreeRenderer(); readonly onDidClickOverrideElement: Event = this._onDidClickOverrideElement.event; @@ -385,6 +386,7 @@ export abstract class AbstractSettingRenderer implements ITreeRenderer; + private tocFocusedElement: SettingsTreeGroupElement; + private settingsTreeScrollTop = 0; + constructor( @ITelemetryService telemetryService: ITelemetryService, @IConfigurationService private readonly configurationService: IConfigurationService, @@ -542,21 +545,22 @@ export class SettingsEditor2 extends BaseEditor { this.viewState)); this._register(this.tocTree.onDidChangeFocus(e => { - this.tocTree.setSelection(e.elements); const element: SettingsTreeGroupElement = e.elements[0]; + if (this.tocFocusedElement === e.elements[0]) { + return; + } + + this.tocFocusedElement = element; + this.tocTree.setSelection(e.elements); if (this.searchResultModel) { if (this.viewState.filterToCategory !== element) { this.viewState.filterToCategory = element; this.renderTree(); this.settingsTree.scrollTop = 0; } - } else if (element) { + } else if (element && (!e.browserEvent || !(e.browserEvent).fromScroll)) { this.settingsTree.reveal(element, 0); } - - // else if (element && (!e.payload || !e.payload.fromScroll)) { - // this.settingsTree.reveal(element, 0); - // } })); this._register(this.tocTree.onDidFocus(() => { @@ -606,7 +610,17 @@ export class SettingsEditor2 extends BaseEditor { this.settingsTree.getHTMLElement().attributes.removeNamedItem('tabindex'); this._register(this.settingsTree.onDidScroll(() => { - this.updateTreeScrollSync(); + if (this.settingsTree.scrollTop === this.settingsTreeScrollTop) { + return; + } + + this.settingsTreeScrollTop = this.settingsTree.scrollTop; + + // setTimeout because calling setChildren on the settingsTree can trigger onDidScroll, so it fires when + // setChildren has called on the settings tree but not the toc tree yet, so their rendered elements are out of sync + setTimeout(() => { + this.updateTreeScrollSync(); + }, 0); })); } @@ -642,29 +656,56 @@ export class SettingsEditor2 extends BaseEditor { return; } - // this.updateTreePagingByScroll(); + // Hack, see https://github.com/Microsoft/vscode/issues/64749 + const settingItems = this.settingsTree.getHTMLElement().querySelectorAll('.setting-item'); + const firstEl = settingItems[1] || settingItems[0]; + if (!firstEl) { + return; + } - // const element = this.tocTreeModel.children[0]; - // const elementToSync = this.settingsTree.getFirstVisibleElement(); - // const element = elementToSync instanceof SettingsTreeSettingElement ? elementToSync.parent : - // elementToSync instanceof SettingsTreeGroupElement ? elementToSync : - // null; + const firstSettingId = this.settingRenderers.getIdForDOMElementInSetting(firstEl); + const elementToSync = this.settingsTreeModel.getElementById(firstSettingId); + const element = elementToSync instanceof SettingsTreeSettingElement ? elementToSync.parent : + elementToSync instanceof SettingsTreeGroupElement ? elementToSync : + null; - // if (element && this.tocTree.getSelection()[0] !== element) { - // this.tocTree.reveal(element); - // const elementTop = this.tocTree.getRelativeTop(element); - // collapseAll(this.tocTree, element); - // if (elementTop < 0 || elementTop > 1) { - // this.tocTree.reveal(element); - // } else { - // this.tocTree.reveal(element, elementTop); - // } + if (element && this.tocTree.getSelection()[0] !== element) { + const ancestors = this.getAncestors(element); + ancestors.forEach(e => this.tocTree.expand(e)); - // this.tocTree.expand(element); + this.tocTree.reveal(element); + const elementTop = this.tocTree.getRelativeTop(element); + this.tocTree.collapseAll(); - // this.tocTree.setSelection([element]); - // this.tocTree.setFocus(element, { fromScroll: true }); - // } + ancestors.forEach(e => this.tocTree.expand(e)); + if (elementTop < 0 || elementTop > 1) { + this.tocTree.reveal(element); + } else { + this.tocTree.reveal(element, elementTop); + } + + this.tocTree.expand(element); + + this.tocTree.setSelection([element]); + + const fakeKeyboardEvent = new KeyboardEvent('keydown'); + (fakeKeyboardEvent).fromScroll = true; + this.tocTree.setFocus([element], fakeKeyboardEvent); + } + } + + private getAncestors(element: SettingsTreeElement): SettingsTreeElement[] { + const ancestors: any[] = []; + + while (element.parent) { + if (element.parent.id !== 'root') { + ancestors.push(element.parent); + } + + element = element.parent; + } + + return ancestors.reverse(); } private updateChangedSetting(key: string, value: any): Promise { @@ -843,10 +884,11 @@ export class SettingsEditor2 extends BaseEditor { } else { this.settingsTreeModel = this.instantiationService.createInstance(SettingsTreeModel, this.viewState); this.settingsTreeModel.update(resolvedSettingsRoot); + this.tocTreeModel.settingsTreeRoot = this.settingsTreeModel.root as SettingsTreeGroupElement; + + this.refreshTOCTree(); this.refreshTree(); - this.tocTreeModel.settingsTreeRoot = this.settingsTreeModel.root as SettingsTreeGroupElement; - this.refreshTOCTree(); this.tocTree.collapseAll(); } @@ -980,7 +1022,6 @@ export class SettingsEditor2 extends BaseEditor { this.viewState.filterToCategory = null; this.tocTreeModel.currentSearchModel = this.searchResultModel; - this.refreshTOCTree(); this.onSearchModeToggled(); if (this.searchResultModel) { @@ -995,6 +1036,8 @@ export class SettingsEditor2 extends BaseEditor { this.refreshTree(); this.renderResultCountMessages(); } + + this.refreshTOCTree(); } return Promise.resolve(null); From 0abf8dcbd0185277e305b9e09c01ff4ebc2168eb Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Mon, 28 Jan 2019 15:45:53 -0800 Subject: [PATCH 074/429] Fix typo --- extensions/html-language-features/.vscode/launch.json | 6 ++---- extensions/html-language-features/server/src/customData.ts | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/extensions/html-language-features/.vscode/launch.json b/extensions/html-language-features/.vscode/launch.json index 28ec3d3dc89..032dc46bb43 100644 --- a/extensions/html-language-features/.vscode/launch.json +++ b/extensions/html-language-features/.vscode/launch.json @@ -17,8 +17,7 @@ ], "stopOnEntry": false, "sourceMaps": true, - "outFiles": ["${workspaceFolder}/client/out/**/*.js"], - "preLaunchTask": "npm" + "outFiles": ["${workspaceFolder}/client/out/**/*.js"] }, { "name": "Launch Tests", @@ -28,8 +27,7 @@ "args": ["--extensionDevelopmentPath=${workspaceFolder}", "--extensionTestsPath=${workspaceFolder}/client/out/test" ], "stopOnEntry": false, "sourceMaps": true, - "outFiles": ["${workspaceFolder}/client/out/test/**/*.js"], - "preLaunchTask": "npm" + "outFiles": ["${workspaceFolder}/client/out/test/**/*.js"] }, { "name": "Attach Language Server", diff --git a/extensions/html-language-features/server/src/customData.ts b/extensions/html-language-features/server/src/customData.ts index 8aa57038288..673e4a4ab9d 100644 --- a/extensions/html-language-features/server/src/customData.ts +++ b/extensions/html-language-features/server/src/customData.ts @@ -21,7 +21,7 @@ export function getDataProviders(dataPaths?: string[]): IHTMLDataProvider[] { providers.push(new HTMLDataProvider(`customProvider${i}`, htmlData)); } } catch (err) { - console.log(`Failed to laod tag from ${path}`); + console.log(`Failed to load tag from ${path}`); } }); From a608c35e0d9c7a0761fd7c0b5574ebf010caabfb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 15:54:55 -0800 Subject: [PATCH 075/429] Only update setIgnoreMenuShortcuts on keydown --- .../parts/webview/electron-browser/webviewElement.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts index 57af438d221..5d9110300fb 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts @@ -157,7 +157,9 @@ class WebviewKeyboardHandler extends Disposable { const contents = this.getWebContents(); if (contents) { contents.on('before-input-event', (_event, input) => { - this.setIgnoreMenuShortcuts(input.control || input.meta); + if (input.type === 'keyDown') { + this.setIgnoreMenuShortcuts(input.control || input.meta); + } }); } })); From a7ad8306dd7d18b1e6e03da6689ba7b0dbf1bb3d Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Mon, 28 Jan 2019 16:47:25 -0800 Subject: [PATCH 076/429] adding toggle editor --- .../browser/actions/layoutActions.ts | 26 +++++++ .../workbench/electron-browser/workbench.ts | 76 ++++++++++++++----- .../services/part/common/partService.ts | 6 ++ .../workbench/test/workbenchTestServices.ts | 2 + 4 files changed, 89 insertions(+), 21 deletions(-) diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index fa168b918d7..14585858c91 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -210,6 +210,32 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { // --- Toggle Sidebar Visibility +export class ToggleEditorVisibilityAction extends Action { + static readonly ID = 'workbench.action.toggleEditorVisibility'; + static readonly LABEL = nls.localize('toggleEditor', "Toggle Editor Area"); + + constructor( + id: string, + label: string, + @IPartService private readonly partService: IPartService + ) { + super(id, label); + + this.enabled = !!this.partService; + } + + run(): Promise { + const hideEditor = this.partService.isVisible(Parts.EDITOR_PART); + this.partService.setEditorHidden(hideEditor); + + return Promise.resolve(null); + } + +} + +registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleEditorVisibilityAction, ToggleEditorVisibilityAction.ID, ToggleEditorVisibilityAction.LABEL), 'View: Toggle Editor Area Visibility', viewCategory); + + export class ToggleSidebarVisibilityAction extends Action { static readonly ID = 'workbench.action.toggleSidebarVisibility'; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index df339344737..f20aff0ed3b 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -228,6 +228,7 @@ export class Workbench extends Disposable implements IPartService { private notificationsCenter: NotificationsCenter; private notificationsToasts: NotificationsToasts; + private editorHidden: boolean; private sideBarHidden: boolean; private statusBarHidden: boolean; private activityBarHidden: boolean; @@ -911,6 +912,9 @@ export class Workbench extends Disposable implements IPartService { private initSettings(): void { + // Editor visiblity + this.editorHidden = false; + // Sidebar visibility this.sideBarHidden = this.storageService.getBoolean(Workbench.sidebarHiddenStorageKey, StorageScope.WORKSPACE, this.contextService.getWorkbenchState() === WorkbenchState.EMPTY); @@ -1403,27 +1407,6 @@ export class Workbench extends Disposable implements IPartService { let statusBarInGrid = this.gridHasView(this.statusbarPartView); let titlebarInGrid = this.gridHasView(this.titlebarPartView); - // Hide parts - if (this.panelHidden) { - this.panelPartView.hide(); - } - - if (this.statusBarHidden) { - this.statusbarPartView.hide(); - } - - if (!this.isVisible(Parts.TITLEBAR_PART)) { - this.titlebarPartView.hide(); - } - - if (this.activityBarHidden) { - this.activitybarPartView.hide(); - } - - if (this.sideBarHidden) { - this.sidebarPartView.hide(); - } - // Add parts to grid if (!statusBarInGrid) { this.workbenchGrid.addView(this.statusbarPartView, Sizing.Split, this.editorPartView, Direction.Down); @@ -1450,7 +1433,36 @@ export class Workbench extends Disposable implements IPartService { panelInGrid = true; } + // Hide parts + if (this.panelHidden) { + this.panelPartView.hide(); + } + + if (this.statusBarHidden) { + this.statusbarPartView.hide(); + } + + if (!this.isVisible(Parts.TITLEBAR_PART)) { + this.titlebarPartView.hide(); + } + + if (this.activityBarHidden) { + this.activitybarPartView.hide(); + } + + if (this.sideBarHidden) { + this.sidebarPartView.hide(); + } + + if (this.editorHidden) { + this.editorPartView.hide(); + } + // Show visible parts + if (!this.editorHidden) { + this.editorPartView.show(); + } + if (!this.statusBarHidden) { this.statusbarPartView.show(); } @@ -1553,6 +1565,23 @@ export class Workbench extends Disposable implements IPartService { } } + setEditorHidden(hidden: boolean, skipLayout?: boolean): void { + if (!(this.workbenchGrid instanceof Grid)) { + return; + } + + this.editorHidden = hidden; + + // The editor and the panel cannot be hidden at the same time + if (this.editorHidden && this.panelHidden) { + this.setPanelHidden(false, true); + } + + if (!skipLayout) { + this.layout(); + } + } + setSideBarHidden(hidden: boolean, skipLayout?: boolean): void { this.sideBarHidden = hidden; this.sideBarVisibleContext.set(!hidden); @@ -1639,6 +1668,11 @@ export class Workbench extends Disposable implements IPartService { this.storageService.remove(Workbench.panelHiddenStorageKey, StorageScope.WORKSPACE); } + // The editor and panel cannot be hiddne at the same time + if (hidden && this.editorHidden) { + this.setEditorHidden(false, true); + } + // Layout if (!skipLayout) { if (this.workbenchGrid instanceof Grid) { diff --git a/src/vs/workbench/services/part/common/partService.ts b/src/vs/workbench/services/part/common/partService.ts index 23d75ea37e1..6c63edf6559 100644 --- a/src/vs/workbench/services/part/common/partService.ts +++ b/src/vs/workbench/services/part/common/partService.ts @@ -86,6 +86,12 @@ export interface IPartService { */ getTitleBarOffset(): number; + /** + * + * Set editor area hidden or not + */ + setEditorHidden(hidden: boolean): void; + /** * Set sidebar hidden or not */ diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 6096db99a7c..3de18af03d2 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -492,6 +492,8 @@ export class TestPartService implements IPartService { return false; } + public setEditorHidden(_hidden: boolean): Promise { return Promise.resolve(null); } + public setSideBarHidden(_hidden: boolean): Promise { return Promise.resolve(null); } public isPanelHidden(): boolean { From 6f457c75ab1fda07f682f5e7659dbbd44ab03933 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 28 Jan 2019 17:05:50 -0800 Subject: [PATCH 077/429] Turn conpty off for next stable release Fixes #66158 --- .../parts/terminal/electron-browser/terminal.contribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts index 47070e0350d..fb600958c8b 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts @@ -285,7 +285,7 @@ configurationRegistry.registerConfiguration({ 'terminal.integrated.windowsEnableConpty': { description: nls.localize('terminal.integrated.windowsEnableConpty', "Whether to use ConPTY for Windows terminal process communication (requires Windows 10 build number 18309+). Winpty will be used if this is false."), type: 'boolean', - default: true + default: false } } }); From 81b9b09cd3e8c4d2e602b6e6375bd2863e79554a Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Mon, 28 Jan 2019 17:12:24 -0800 Subject: [PATCH 078/429] Update HTML language service for NPE --- extensions/html-language-features/server/package.json | 2 +- extensions/html-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index b57df13fe19..e631b8e2db0 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -10,7 +10,7 @@ "main": "./out/htmlServerMain", "dependencies": { "vscode-css-languageservice": "^3.0.13-next.10", - "vscode-html-languageservice": "^2.1.11-next.8", + "vscode-html-languageservice": "^2.1.11-next.9", "vscode-languageserver": "^5.1.0", "vscode-languageserver-types": "^3.13.0", "vscode-nls": "^4.0.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index 4918bf833a4..e0a65914a11 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -237,10 +237,10 @@ vscode-css-languageservice@^3.0.13-next.10: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" -vscode-html-languageservice@^2.1.11-next.8: - version "2.1.11-next.8" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.8.tgz#060c69163ad65ad50988841011b86e423fd0a6d3" - integrity sha512-K6jCKx0xPQHQ/poicbMvCKwWc+XxBzZlT74C5SLbDfS6llkVIBThoIl6qrJhDuAqPNmyFmaFbT4+YvfqBUdpAA== +vscode-html-languageservice@^2.1.11-next.9: + version "2.1.11-next.9" + resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.9.tgz#1471b945351a4b179bc9b995e9617f07ab12d647" + integrity sha512-iSQPafYHDv62dDpwXVmaJzuS3y8yuehPwtWEBC9QysNBm5LxrRWy293pC7b9CehVly6mDnrLVXSRfgwAtg9xzA== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" From e9708716f24c01d6caec596c960556ec5b034d2e Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Mon, 28 Jan 2019 17:14:28 -0800 Subject: [PATCH 079/429] Move html/css custom data contribution to experimental --- extensions/css-language-features/client/src/customData.ts | 2 +- extensions/html-language-features/client/src/customData.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/css-language-features/client/src/customData.ts b/extensions/css-language-features/client/src/customData.ts index c9954de8c51..8ba0770235a 100644 --- a/extensions/css-language-features/client/src/customData.ts +++ b/extensions/css-language-features/client/src/customData.ts @@ -43,7 +43,7 @@ export function getCustomDataPathsFromAllExtensions(): string[] { for (const extension of extensions.all) { const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (contributes && contributes.css && contributes.css.customData && Array.isArray(contributes.css.customData)) { + if (contributes && contributes.css && contributes.css.experimental.customData && Array.isArray(contributes.css.experimental.customData)) { const relativePaths: string[] = contributes.css.customData; relativePaths.forEach(rp => { dataPaths.push(path.resolve(extension.extensionPath, rp)); diff --git a/extensions/html-language-features/client/src/customData.ts b/extensions/html-language-features/client/src/customData.ts index 467940bc736..8e9bf2863b6 100644 --- a/extensions/html-language-features/client/src/customData.ts +++ b/extensions/html-language-features/client/src/customData.ts @@ -45,7 +45,7 @@ export function getCustomDataPathsFromAllExtensions(): string[] { for (const extension of extensions.all) { const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (contributes && contributes.html && contributes.html.customData && Array.isArray(contributes.html.customData)) { + if (contributes && contributes.html && contributes.html.experimental.customData && Array.isArray(contributes.html.experimental.customData)) { const relativePaths: string[] = contributes.html.customData; relativePaths.forEach(rp => { dataPaths.push(path.resolve(extension.extensionPath, rp)); From 13aff1eff21f71b29e8daf83eb7e07516a56f3d3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 17:12:05 -0800 Subject: [PATCH 080/429] Add workaround for TS not supporting providePrefixAndSuffixTextForRename not being supported per-file Workaround for https://github.com/Microsoft/TypeScript/issues/29585 --- .../src/features/fileConfigurationManager.ts | 2 +- .../src/typescriptServiceClient.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/fileConfigurationManager.ts b/extensions/typescript-language-features/src/features/fileConfigurationManager.ts index 0091aa1dac5..676e80bafd1 100644 --- a/extensions/typescript-language-features/src/features/fileConfigurationManager.ts +++ b/extensions/typescript-language-features/src/features/fileConfigurationManager.ts @@ -183,7 +183,7 @@ export default class FileConfigurationManager extends Disposable { allowTextChangesInNewFiles: document.uri.scheme === 'file', providePrefixAndSuffixTextForRename: true, allowRenameOfImportPath: true, - } as Proto.UserPreferences; + }; } } diff --git a/extensions/typescript-language-features/src/typescriptServiceClient.ts b/extensions/typescript-language-features/src/typescriptServiceClient.ts index 4328948b23e..134942e4696 100644 --- a/extensions/typescript-language-features/src/typescriptServiceClient.ts +++ b/extensions/typescript-language-features/src/typescriptServiceClient.ts @@ -423,6 +423,10 @@ export default class TypeScriptServiceClient extends Disposable implements IType private serviceStarted(resendModels: boolean): void { const configureOptions: Proto.ConfigureRequestArguments = { hostInfo: 'vscode', + preferences: { + providePrefixAndSuffixTextForRename: true, + allowRenameOfImportPath: true, + } }; this.executeWithoutWaitingForResponse('configure', configureOptions); this.setCompilerOptionsForInferredProjects(this._configuration); From 248aea7fd51a703a7ab94ae5a582c85c11fbff33 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 17:16:35 -0800 Subject: [PATCH 081/429] Fix some spelling errors in api docs --- src/vs/vscode.d.ts | 22 +++++++++++----------- src/vs/vscode.proposed.d.ts | 8 ++++---- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 6bfa75c148c..b2d1771d638 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -70,7 +70,7 @@ declare module 'vscode' { /** * The offset of the first character which is not a whitespace character as defined - * by `/\s/`. **Note** that if a line is all whitespaces the length of the line is returned. + * by `/\s/`. **Note** that if a line is all whitespace the length of the line is returned. */ readonly firstNonWhitespaceCharacterIndex: number; @@ -3218,7 +3218,7 @@ declare module 'vscode' { /** * List of characters that re-trigger signature help. * - * These trigger characters are only active when signature help is alread showing. All trigger characters + * These trigger characters are only active when signature help is already showing. All trigger characters * are also counted as re-trigger characters. */ readonly retriggerCharacters: ReadonlyArray; @@ -4681,7 +4681,7 @@ declare module 'vscode' { storagePath: string | undefined; /** - * An absolute file path in which the extension can store gloabal state. + * An absolute file path in which the extension can store global state. * The directory might not exist on disk and creation is * up to the extension. However, the parent directory is guaranteed to be existent. * @@ -5633,7 +5633,7 @@ declare module 'vscode' { * * @param source The existing file. * @param destination The destination location. - * @param options Defines if existing files should be overwriten. + * @param options Defines if existing files should be overwritten. * @throws [`FileNotFound`](#FileSystemError.FileNotFound) when `source` doesn't exist. * @throws [`FileNotFound`](#FileSystemError.FileNotFound) when parent of `destination` doesn't exist, e.g. no mkdirp-logic required. * @throws [`FileExists`](#FileSystemError.FileExists) when `destination` exists and when the `overwrite` option is not `true`. @@ -5855,7 +5855,7 @@ declare module 'vscode' { */ interface WebviewPanelSerializer { /** - * Restore a webview panel from its seriailzed `state`. + * Restore a webview panel from its serialized `state`. * * Called when a serialized webview first becomes visible. * @@ -5863,7 +5863,7 @@ declare module 'vscode' { * serializer must restore the webview's `.html` and hook up all webview events. * @param state Persisted state from the webview content. * - * @return Thanble indicating that the webview has been fully restored. + * @return Thenble indicating that the webview has been fully restored. */ deserializeWebviewPanel(webviewPanel: WebviewPanel, state: any): Thenable; } @@ -6926,13 +6926,13 @@ declare module 'vscode' { } /** - * A light-weight user input UI that is intially not visible. After + * A light-weight user input UI that is initially not visible. After * configuring it through its properties the extension can make it * visible by calling [QuickInput.show](#QuickInput.show). * * There are several reasons why this UI might have to be hidden and * the extension will be notified through [QuickInput.onDidHide](#QuickInput.onDidHide). - * (Examples include: an explict call to [QuickInput.hide](#QuickInput.hide), + * (Examples include: an explicit call to [QuickInput.hide](#QuickInput.hide), * the user pressing Esc, some other input UI opening, etc.) * * A user pressing Enter or some other gesture implying acceptance @@ -7001,7 +7001,7 @@ declare module 'vscode' { * * There are several reasons why this UI might have to be hidden and * the extension will be notified through [QuickInput.onDidHide](#QuickInput.onDidHide). - * (Examples include: an explict call to [QuickInput.hide](#QuickInput.hide), + * (Examples include: an explicit call to [QuickInput.hide](#QuickInput.hide), * the user pressing Esc, some other input UI opening, etc.) */ onDidHide: Event; @@ -7495,7 +7495,7 @@ declare module 'vscode' { * cause failure of the operation. * * When applying a workspace edit that consists only of text edits an 'all-or-nothing'-strategy is used. - * A workspace edit with resource creations or deletions aborts the operation, e.g. consective edits will + * A workspace edit with resource creations or deletions aborts the operation, e.g. consecutive edits will * not be attempted, when a single edit fails. * * @param edit A workspace edit. @@ -8534,7 +8534,7 @@ declare module 'vscode' { */ onWillStopSession?(): void; /** - * An error with the debug adapter has occured. + * An error with the debug adapter has occurred. */ onError?(error: Error): void; /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 43a627b4c93..62aabce3dba 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -26,7 +26,7 @@ declare module 'vscode' { static readonly Empty: SelectionRangeKind; /** - * The statment kind, its value is `statement`, possible extensions can be + * The statement kind, its value is `statement`, possible extensions can be * `statement.if` etc */ static readonly Statement: SelectionRangeKind; @@ -915,7 +915,7 @@ declare module 'vscode' { /** * Represents a terminal without a process where all interaction and output in the terminal is * controlled by an extension. This is similar to an output window but has the same VT sequence - * compatility as the regular terminal. + * compatibility as the regular terminal. * * Note that an instance of [Terminal](#Terminal) will be created when a TerminalRenderer is * created with all its APIs available for use by extensions. When using the Terminal object @@ -963,7 +963,7 @@ declare module 'vscode' { readonly maximumDimensions: TerminalDimensions | undefined; /** - * The corressponding [Terminal](#Terminal) for this TerminalRenderer. + * The corresponding [Terminal](#Terminal) for this TerminalRenderer. */ readonly terminal: Terminal; @@ -995,7 +995,7 @@ declare module 'vscode' { * ```typescript * const terminalRenderer = window.createTerminalRenderer('test'); * terminalRenderer.onDidAcceptInput(data => { - * cosole.log(data); // 'Hello world' + * console.log(data); // 'Hello world' * }); * terminalRenderer.terminal.then(t => t.sendText('Hello world')); * ``` From c37d497f2b8df58aab6ac6555cda3540a1925b61 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 28 Jan 2019 18:12:32 -0800 Subject: [PATCH 082/429] Mark add missing async as auto fixable --- extensions/typescript-language-features/src/features/quickFix.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/typescript-language-features/src/features/quickFix.ts b/extensions/typescript-language-features/src/features/quickFix.ts index 24866ac9403..91c3f3b3265 100644 --- a/extensions/typescript-language-features/src/features/quickFix.ts +++ b/extensions/typescript-language-features/src/features/quickFix.ts @@ -307,6 +307,7 @@ const preferredFixes = new Set([ 'annotateWithTypeFromJSDoc', 'constructorForDerivedNeedSuperCall', 'extendsInterfaceBecomesImplements', + 'fixAwaitInSyncFunction', 'fixClassIncorrectlyImplementsInterface', 'fixUnreachableCode', 'forgottenThisPropertyAccess', From ccb98c2c9bb6aa3af3cb4a27be80cea88ecee37f Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 28 Jan 2019 21:52:52 -0800 Subject: [PATCH 083/429] Fix TOC items expanding on second settings editor open --- .../workbench/parts/preferences/browser/tocTree.ts | 12 ++++++++++-- .../preferences/electron-browser/settingsEditor2.ts | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/tocTree.ts b/src/vs/workbench/parts/preferences/browser/tocTree.ts index a30929be24b..72acc8e1417 100644 --- a/src/vs/workbench/parts/preferences/browser/tocTree.ts +++ b/src/vs/workbench/parts/preferences/browser/tocTree.ts @@ -126,15 +126,23 @@ class TOCTreeDelegate implements IListVirtualDelegate { } } -export function createTOCIterator(model: TOCTreeModel | SettingsTreeGroupElement): Iterator> { +export function createTOCIterator(model: TOCTreeModel | SettingsTreeGroupElement, tree: TOCTree): Iterator> { const groupChildren = model.children.filter(c => c instanceof SettingsTreeGroupElement); const groupsIt = Iterator.fromArray(groupChildren); + return Iterator.map(groupsIt, g => { + let nodeExists = true; + try { tree.getNode(g); } catch (e) { nodeExists = false; } + + const hasGroupChildren = g.children.some(c => c instanceof SettingsTreeGroupElement); + return { element: g, + collapsed: nodeExists ? undefined : true, + collapsible: hasGroupChildren, children: g instanceof SettingsTreeGroupElement ? - createTOCIterator(g) : + createTOCIterator(g, tree) : undefined }; }); diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index 1d084f3521f..9f52f2b6459 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -967,7 +967,7 @@ export class SettingsEditor2 extends BaseEditor { } private refreshTOCTree(): void { - this.tocTree.setChildren(null, createTOCIterator(this.tocTreeModel)); + this.tocTree.setChildren(null, createTOCIterator(this.tocTreeModel, this.tocTree)); } private updateModifiedLabelForKey(key: string): void { From acc7365e41f9cb380e79bf78d7d102184f1ffe0d Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 05:53:32 +0000 Subject: [PATCH 084/429] Enable type to find in search view --- .../parts/search/browser/media/searchview.css | 1 + .../parts/search/browser/searchResultsView.ts | 9 +++++++-- .../workbench/parts/search/browser/searchView.ts | 15 ++++++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/search/browser/media/searchview.css b/src/vs/workbench/parts/search/browser/media/searchview.css index fd591c75b55..9538b2816c4 100644 --- a/src/vs/workbench/parts/search/browser/media/searchview.css +++ b/src/vs/workbench/parts/search/browser/media/searchview.css @@ -177,6 +177,7 @@ line-height: 22px; display: flex; overflow: hidden; + padding-left: 22px; } .search-view .linematch > .match { diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index 18a8d159b78..499495c2387 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -26,6 +26,7 @@ import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels'; import { RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction } from 'vs/workbench/parts/search/browser/searchActions'; import { SearchView } from 'vs/workbench/parts/search/browser/searchView'; import { FileMatch, FolderMatch, Match, RenderableMatch, SearchModel, BaseFolderMatch } from 'vs/workbench/parts/search/common/searchModel'; +import { createMatches } from 'vs/base/common/filters'; interface IFolderMatchTemplate { label: IResourceLabel; @@ -162,7 +163,7 @@ export class FileMatchRenderer extends Disposable implements ITreeRenderer, index: number, templateData: IFileMatchTemplate): void { const fileMatch = node.element; templateData.el.setAttribute('data-resource', fileMatch.resource().toString()); - templateData.label.setFile(fileMatch.resource(), { hideIcon: false }); + templateData.label.setFile( + fileMatch.resource(), { + hideIcon: false, + matches: createMatches(node.filterData) + }); const count = fileMatch.count(); templateData.badge.setCount(count); templateData.badge.setTitleFormat(count > 1 ? nls.localize('searchMatches', "{0} matches found", count) : nls.localize('searchMatch', "{0} match found", count)); diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 31f506bd990..3260f6cee2e 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -62,6 +62,8 @@ import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorG import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPreferencesService, ISettingsEditorOptions } from 'vs/workbench/services/preferences/common/preferences'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; +import { createFileIconThemableTreeContainerScope } from 'vs/workbench/browser/parts/views/views'; +import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; const $ = dom.$; @@ -143,10 +145,11 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { @IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService, @IPreferencesService private readonly preferencesService: IPreferencesService, @IThemeService protected themeService: IThemeService, + @IWorkbenchThemeService protected workbenchThemeService: IWorkbenchThemeService, @ISearchHistoryService private readonly searchHistoryService: ISearchHistoryService, @IEditorGroupsService private readonly editorGroupsService: IEditorGroupsService, @IContextMenuService private readonly contextMenuService: IContextMenuService, - @IMenuService private readonly menuService: IMenuService + @IMenuService private readonly menuService: IMenuService, ) { super(VIEW_ID, configurationService, partService, telemetryService, themeService, storageService); @@ -615,6 +618,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { private createSearchResultsView(container: HTMLElement): void { this.resultsElement = dom.append(container, $('.results.show-file-icons')); const delegate = this.instantiationService.createInstance(SearchDelegate); + this._register(createFileIconThemableTreeContainerScope(this.resultsElement, this.workbenchThemeService)); const identityProvider: IIdentityProvider = { getId(element: RenderableMatch) { @@ -632,6 +636,15 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this._register(this.instantiationService.createInstance(MatchRenderer, this.viewModel, this)), ], { + keyboardNavigationLabelProvider: { + getKeyboardNavigationLabel: (element: RenderableMatch) => { + if (element instanceof FolderMatch || element instanceof FileMatch) { + return element.name(); + } + + return ''; + } + }, identityProvider, accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider, this.viewModel) })); From b21209d92c4934dc0a3664a71a36c1acc9a2f20a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 29 Jan 2019 07:45:09 +0100 Subject: [PATCH 085/429] fix grid view bug --- src/vs/base/browser/ui/grid/gridview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index a3f483632d0..05fdd8ce033 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -414,7 +414,7 @@ class LeafNode implements ISplitView, IDisposable { ) { this._orthogonalSize = orthogonalSize; - this._onDidViewChange = Event.map(this.view.onDidChange, this.orientation === Orientation.HORIZONTAL ? e => e && e.width : e => e && e.height); + this._onDidViewChange = Event.map(this.view.onDidChange, this.orientation === Orientation.VERTICAL ? e => e && e.width : e => e && e.height); this.onDidChange = Event.any(this._onDidViewChange, this._onDidSetLinkedNode.event, this._onDidLinkedWidthNodeChange.event, this._onDidLinkedHeightNodeChange.event); } From af608864808988ed5c6ef7259514d9386864f2b6 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 29 Jan 2019 09:02:24 +0100 Subject: [PATCH 086/429] grid: should check orientation at the time of the event --- src/vs/base/browser/ui/grid/gridview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index 05fdd8ce033..9011a578e51 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -414,7 +414,7 @@ class LeafNode implements ISplitView, IDisposable { ) { this._orthogonalSize = orthogonalSize; - this._onDidViewChange = Event.map(this.view.onDidChange, this.orientation === Orientation.VERTICAL ? e => e && e.width : e => e && e.height); + this._onDidViewChange = Event.map(this.view.onDidChange, e => e && (this.orientation === Orientation.VERTICAL ? e.width : e.height)); this.onDidChange = Event.any(this._onDidViewChange, this._onDidSetLinkedNode.event, this._onDidLinkedWidthNodeChange.event, this._onDidLinkedHeightNodeChange.event); } From c2ee16954d9a31997c000a154ea102cda984422c Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Tue, 29 Jan 2019 11:39:01 +0100 Subject: [PATCH 087/429] Ran OSS Tool --- ThirdPartyNotices.txt | 212 ++++++++++++++++++------------------------ 1 file changed, 88 insertions(+), 124 deletions(-) diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt index 4541dbbb24d..91876a89245 100644 --- a/ThirdPartyNotices.txt +++ b/ThirdPartyNotices.txt @@ -5,47 +5,47 @@ Do Not Translate or Localize This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise. -1. atom/language-c (https://github.com/atom/language-c) -2. atom/language-clojure (https://github.com/atom/language-clojure) -3. atom/language-coffee-script (https://github.com/atom/language-coffee-script) +1. atom/language-c version 0.58.1 (https://github.com/atom/language-c) +2. atom/language-clojure version 0.22.6 (https://github.com/atom/language-clojure) +3. atom/language-coffee-script version 0.49.3 (https://github.com/atom/language-coffee-script) 4. atom/language-css (https://github.com/atom/language-css) -5. atom/language-java (https://github.com/atom/language-java) -6. atom/language-objective-c (https://github.com/atom/language-objective-c) -7. atom/language-sass version 0.52.0 (https://github.com/atom/language-sass) -8. atom/language-shellscript (https://github.com/atom/language-shellscript) -9. atom/language-xml (https://github.com/atom/language-xml) +5. atom/language-java version 0.31.1 (https://github.com/atom/language-java) +6. atom/language-objective-c version 0.15.0 (https://github.com/atom/language-objective-c) +7. atom/language-sass version 0.61.4 (https://github.com/atom/language-sass) +8. atom/language-shellscript version 0.26.0 (https://github.com/atom/language-shellscript) +9. atom/language-xml version 0.35.2 (https://github.com/atom/language-xml) 10. chriskempson/tomorrow-theme (https://github.com/chriskempson/tomorrow-theme) 11. Colorsublime-Themes version 0.1.0 (https://github.com/Colorsublime/Colorsublime-Themes) -12. daaain/Handlebars (https://github.com/daaain/Handlebars) +12. daaain/Handlebars version 1.7.1 (https://github.com/daaain/Handlebars) 13. davidrios/pug-tmbundle (https://github.com/davidrios/pug-tmbundle) 14. definitelytyped (https://github.com/DefinitelyTyped/DefinitelyTyped) -15. demyte/language-cshtml (https://github.com/demyte/language-cshtml) +15. demyte/language-cshtml version 0.3.0 (https://github.com/demyte/language-cshtml) 16. Document Object Model version 4.0.0 (https://www.w3.org/DOM/) 17. dotnet/csharp-tmLanguage version 0.1.0 (https://github.com/dotnet/csharp-tmLanguage) 18. expand-abbreviation version 0.5.8 (https://github.com/emmetio/expand-abbreviation) 19. fadeevab/make.tmbundle (https://github.com/fadeevab/make.tmbundle) 20. freebroccolo/atom-language-swift (https://github.com/freebroccolo/atom-language-swift) 21. HTML 5.1 W3C Working Draft version 08 October 2015 (http://www.w3.org/TR/2015/WD-html51-20151008/) -22. Ikuyadeu/vscode-R (https://github.com/Ikuyadeu/vscode-R) +22. Ikuyadeu/vscode-R version 0.5.5 (https://github.com/Ikuyadeu/vscode-R) 23. Ionic documentation version 1.2.4 (https://github.com/ionic-team/ionic-site) 24. ionide/ionide-fsgrammar (https://github.com/ionide/ionide-fsgrammar) 25. js-beautify version 1.6.8 (https://github.com/beautify-web/js-beautify) 26. Jxck/assert version 1.0.0 (https://github.com/Jxck/assert) 27. language-docker (https://github.com/moby/moby) -28. language-go version 0.39.0 (https://github.com/atom/language-go) -29. language-less (https://github.com/atom/language-less) -30. language-php (https://github.com/atom/language-php) -31. language-rust version 0.4.9 (https://github.com/zargony/atom-language-rust) -32. MagicStack/MagicPython (https://github.com/MagicStack/MagicPython) +28. language-go version 0.44.3 (https://github.com/atom/language-go) +29. language-less version 0.34.2 (https://github.com/atom/language-less) +30. language-php version 0.43.2 (https://github.com/atom/language-php) +31. language-rust version 0.4.12 (https://github.com/zargony/atom-language-rust) +32. MagicStack/MagicPython version 1.1.1 (https://github.com/MagicStack/MagicPython) 33. marked version 0.5.0 (https://github.com/markedjs/marked) 34. mdn-data version 1.1.12 (https://github.com/mdn/data) 35. Microsoft/TypeScript-TmLanguage version 0.0.1 (https://github.com/Microsoft/TypeScript-TmLanguage) 36. Microsoft/vscode-JSON.tmLanguage (https://github.com/Microsoft/vscode-JSON.tmLanguage) -37. Microsoft/vscode-mssql (https://github.com/Microsoft/vscode-mssql) -38. mmims/language-batchfile (https://github.com/mmims/language-batchfile) -39. octicons-code version 3.1.0 (https://registry.npmjs.org/octicons/-/octicons-3.1.0.tgz) -40. octicons-font version 3.1.0 (https://registry.npmjs.org/octicons/-/octicons-3.1.0.tgz) -41. PowerShell/EditorSyntax (https://github.com/powershell/editorsyntax) +37. Microsoft/vscode-mssql version 1.4.0 (https://github.com/Microsoft/vscode-mssql) +38. mmims/language-batchfile version 0.7.4 (https://github.com/mmims/language-batchfile) +39. octicons version 8.3.0 (https://github.com/primer/octicons) +40. PowerShell/EditorSyntax (https://github.com/powershell/editorsyntax) +41. promise-polyfill version 8.0.0 (https://github.com/taylorhakes/promise-polyfill) 42. seti-ui version 0.1.0 (https://github.com/jesseweed/seti-ui) 43. shaders-tmLanguage version 0.1.0 (https://github.com/tgjones/shaders-tmLanguage) 44. textmate/asp.vb.net.tmbundle (https://github.com/textmate/asp.vb.net.tmbundle) @@ -62,10 +62,12 @@ This project incorporates components from the projects listed below. The origina 55. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle) 56. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle) 57. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage) -58. Unicode version 12.0.0 (http://www.unicode.org/) -59. vscode-logfile-highlighter version 1.2.0 (https://github.com/emilast/vscode-logfile-highlighter) -60. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) -61. Web Background Synchronization (https://github.com/WICG/BackgroundSync) +58. TypeScript-TmLanguage version 1.0.0 (https://github.com/Microsoft/TypeScript-TmLanguage) +59. Unicode version 12.0.0 (http://www.unicode.org/) +60. vscode-logfile-highlighter version 2.4.1 (https://github.com/emilast/vscode-logfile-highlighter) +61. vscode-octicons-font version 1.0.0 (https://github.com/Microsoft/vscode-octicons-font) +62. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift) +63. Web Background Synchronization (https://github.com/WICG/BackgroundSync) %% atom/language-c NOTICES AND INFORMATION BEGIN HERE @@ -1800,11 +1802,11 @@ THE SOFTWARE. ========================================= END OF mmims/language-batchfile NOTICES AND INFORMATION -%% octicons-code NOTICES AND INFORMATION BEGIN HERE +%% octicons NOTICES AND INFORMATION BEGIN HERE ========================================= -The MIT License (MIT) +MIT License -(c) 2012-2015 GitHub +Copyright (c) 2019 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -1813,109 +1815,18 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. ========================================= -END OF octicons-code NOTICES AND INFORMATION - -%% octicons-font NOTICES AND INFORMATION BEGIN HERE -========================================= -(c) 2012-2015 GitHub - -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font creation -efforts of academic and linguistic communities, and to provide a free and -open framework in which fonts may be shared and improved in partnership -with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply -to any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software components as -distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, deleting, -or substituting -- in part or in whole -- any of the components of the -Original Version, by changing formats or by porting the Font Software to a -new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, modify, -redistribute, and sell modified and unmodified copies of the Font -Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, -in Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the corresponding -Copyright Holder. This restriction only applies to the primary font name as -presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created -using the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. -========================================= -END OF octicons-font NOTICES AND INFORMATION +END OF octicons NOTICES AND INFORMATION %% PowerShell/EditorSyntax NOTICES AND INFORMATION BEGIN HERE ========================================= @@ -1945,6 +1856,33 @@ SOFTWARE. ========================================= END OF PowerShell/EditorSyntax NOTICES AND INFORMATION +%% promise-polyfill NOTICES AND INFORMATION BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) 2014 Taylor Hakes +Copyright (c) 2014 Forbes Lindesay + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +========================================= +END OF promise-polyfill NOTICES AND INFORMATION + %% seti-ui NOTICES AND INFORMATION BEGIN HERE ========================================= Copyright (c) 2014 Jesse Weed @@ -2357,6 +2295,32 @@ SOFTWARE. ========================================= END OF vscode-logfile-highlighter NOTICES AND INFORMATION +%% vscode-octicons-font NOTICES AND INFORMATION BEGIN HERE +========================================= +MIT License + + Copyright (c) Microsoft Corporation. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE +========================================= +END OF vscode-octicons-font NOTICES AND INFORMATION + %% vscode-swift NOTICES AND INFORMATION BEGIN HERE ========================================= The MIT License (MIT) From 9c510825d6a7f8b9d428c35378dc4adb1900dd6e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 29 Jan 2019 12:13:56 +0100 Subject: [PATCH 088/429] fix #67368 --- src/vs/workbench/browser/actions/layoutActions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 14585858c91..70bafe35ada 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -3,6 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import 'vs/css!./media/actions'; + import * as nls from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; import { Action } from 'vs/base/common/actions'; From 77b8c29d80d030cdb17861e8167eacfa36f8b241 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 29 Jan 2019 16:47:45 +0100 Subject: [PATCH 089/429] improve setting docs fixes #67407 --- src/vs/platform/update/node/update.config.contribution.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/update/node/update.config.contribution.ts b/src/vs/platform/update/node/update.config.contribution.ts index a3f7981e336..b68349fa06d 100644 --- a/src/vs/platform/update/node/update.config.contribution.ts +++ b/src/vs/platform/update/node/update.config.contribution.ts @@ -23,8 +23,8 @@ configurationRegistry.registerConfiguration({ tags: ['usesOnlineServices'], enumDescriptions: [ localize('none', "Disable updates."), - localize('manual', "Disable automatic update checks."), - localize('default', "Enable automatic update checks.") + localize('manual', "Disable automatic background update checks. Updates will be available if you manually check for updates."), + localize('default', "Enable automatic update checks. Code will check for updates automatically and periodically.") ] }, 'update.enableWindowsBackgroundUpdates': { From 8247d14edbc0a58b31f0abf6fd97d9513ad0502a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 29 Jan 2019 16:51:45 +0100 Subject: [PATCH 090/429] fixes #67406 --- src/vs/base/browser/ui/list/listView.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index b599fe92406..078c3e50227 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -442,7 +442,7 @@ export class ListView implements ISpliceable, IDisposable { layout(height?: number, width?: number): void { let scrollDimensions: INewScrollDimensions = { - height: height || DOM.getContentHeight(this.domNode) + height: typeof height === 'number' ? height : DOM.getContentHeight(this.domNode) }; if (this.scrollableElementUpdateDisposable) { @@ -462,7 +462,7 @@ export class ListView implements ISpliceable, IDisposable { if (this.horizontalScrolling) { this.scrollableElement.setScrollDimensions({ - width: width || DOM.getContentWidth(this.domNode) + width: typeof width === 'number' ? width : DOM.getContentWidth(this.domNode) }); } } From 61e19a66f21d686289daae5a57e934cc66a2f1e6 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 29 Jan 2019 16:57:40 +0100 Subject: [PATCH 091/429] make jsonValidation dynamic (for #67362) --- .../services/jsonschemas/common/jsonValidationExtensionPoint.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/services/jsonschemas/common/jsonValidationExtensionPoint.ts b/src/vs/workbench/services/jsonschemas/common/jsonValidationExtensionPoint.ts index 8e20f407866..487ca13beda 100644 --- a/src/vs/workbench/services/jsonschemas/common/jsonValidationExtensionPoint.ts +++ b/src/vs/workbench/services/jsonschemas/common/jsonValidationExtensionPoint.ts @@ -15,6 +15,7 @@ interface IJSONValidationExtensionPoint { const configurationExtPoint = ExtensionsRegistry.registerExtensionPoint({ extensionPoint: 'jsonValidation', + isDynamic: true, jsonSchema: { description: nls.localize('contributes.jsonValidation', 'Contributes json schema configuration.'), type: 'array', From 7ccd79898d004dd6195f493d736acf9408586c9a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 29 Jan 2019 17:29:58 +0100 Subject: [PATCH 092/429] Add canAddExtension & canRemoveExtension methods to IExtensionService --- .../test/common/commandService.test.ts | 2 + .../services/extensions/common/extensions.ts | 12 ++++++ .../electron-browser/extensionService.ts | 38 +++++++++++++++++++ .../workbench/test/workbenchTestServices.ts | 2 + 4 files changed, 54 insertions(+) diff --git a/src/vs/workbench/services/commands/test/common/commandService.test.ts b/src/vs/workbench/services/commands/test/common/commandService.test.ts index e25c3f662ba..b686e562f1b 100644 --- a/src/vs/workbench/services/commands/test/common/commandService.test.ts +++ b/src/vs/workbench/services/commands/test/common/commandService.test.ts @@ -55,6 +55,8 @@ class SimpleExtensionService implements IExtensionService { } stopExtensionHost(): void { } + canAddExtension(): boolean { return false; } + canRemoveExtension(): boolean { return false; } } suite('CommandService', function () { diff --git a/src/vs/workbench/services/extensions/common/extensions.ts b/src/vs/workbench/services/extensions/common/extensions.ts index 4057ccb4c56..4a7f1019f4a 100644 --- a/src/vs/workbench/services/extensions/common/extensions.ts +++ b/src/vs/workbench/services/extensions/common/extensions.ts @@ -181,6 +181,18 @@ export interface IExtensionService extends ICpuProfilerTarget { */ getExtension(id: string): Promise; + /** + * Returns `true` if the given extension can be added. Otherwise `false`. + * @param extension An extension + */ + canAddExtension(extension: IExtensionDescription): boolean; + + /** + * Returns `true` if the given extension can be removed. Otherwise `false`. + * @param extension An extension + */ + canRemoveExtension(extension: IExtensionDescription): boolean; + /** * Read all contributions to an extension point. */ diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index d61e59c3041..8d8af492103 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -275,6 +275,44 @@ export class ExtensionService extends Disposable implements IExtensionService { return true; } + public canAddExtension(extension: IExtensionDescription): boolean { + if (this._windowService.getConfiguration().remoteAuthority) { + return false; + } + + if (extension.extensionLocation.scheme !== Schemas.file) { + return false; + } + + const extensionDescription = this._registry.getExtensionDescription(extension.identifier); + if (extensionDescription) { + // ignore adding an extension which is already running and cannot be removed + if (!this._canRemoveExtension(extensionDescription)) { + return false; + } + } + + return this._usesOnlyDynamicExtensionPoints(extension); + } + + public canRemoveExtension(extension: IExtensionDescription): boolean { + if (this._windowService.getConfiguration().remoteAuthority) { + return false; + } + + if (extension.extensionLocation.scheme !== Schemas.file) { + return false; + } + + const extensionDescription = this._registry.getExtensionDescription(extension.identifier); + if (!extensionDescription) { + // ignore removing an extension which is not running + return false; + } + + return this._canRemoveExtension(extensionDescription); + } + private _canRemoveExtension(extension: IExtensionDescription): boolean { if (this._extensionHostActiveExtensions.has(ExtensionIdentifier.toKey(extension.identifier))) { // Extension is running, cannot remove it safely diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 3de18af03d2..f902c08b46c 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -329,6 +329,8 @@ export class TestExtensionService implements IExtensionService { restartExtensionHost(): void { } startExtensionHost(): void { } stopExtensionHost(): void { } + canAddExtension(): boolean { return false; } + canRemoveExtension(): boolean { return false; } } export class TestMenuService implements IMenuService { From bcd8dbff5cf9f9949f045e5609e15261c337a090 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 29 Jan 2019 08:44:50 -0800 Subject: [PATCH 093/429] Fix ext host terminal --- .../api/electron-browser/mainThreadTerminalService.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index bb267c2dbb4..4a846cf2952 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -12,6 +12,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC export class MainThreadTerminalService implements MainThreadTerminalServiceShape { private _proxy: ExtHostTerminalServiceShape; + private _remoteAuthority: string | null; private _toDispose: IDisposable[] = []; private _terminalProcesses: { [id: number]: ITerminalProcessExtHostProxy } = {}; private _terminalOnDidWriteDataListeners: { [id: number]: IDisposable } = {}; @@ -22,6 +23,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape @ITerminalService private readonly terminalService: ITerminalService ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostTerminalService); + this._remoteAuthority = extHostContext.remoteAuthority; this._toDispose.push(terminalService.onInstanceCreated((instance) => { // Delay this message so the TerminalInstance constructor has a chance to finish and // return the ID normally to the extension host. The ID that is passed here will be used @@ -202,6 +204,11 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape } private _onTerminalRequestExtHostProcess(request: ITerminalProcessExtHostRequest): void { + // Only allow processes on remote ext hosts + if (!this._remoteAuthority) { + return; + } + this._terminalProcesses[request.proxy.terminalId] = request.proxy; const shellLaunchConfigDto: ShellLaunchConfigDto = { name: request.shellLaunchConfig.name, From 5caaaf13c106b2eade5a98d91088bcce7d1992bf Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 08:59:49 -0800 Subject: [PATCH 094/429] Fix #67412 --- src/vs/workbench/parts/search/browser/media/searchview.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vs/workbench/parts/search/browser/media/searchview.css b/src/vs/workbench/parts/search/browser/media/searchview.css index 9538b2816c4..b0a438d8771 100644 --- a/src/vs/workbench/parts/search/browser/media/searchview.css +++ b/src/vs/workbench/parts/search/browser/media/searchview.css @@ -177,6 +177,9 @@ line-height: 22px; display: flex; overflow: hidden; +} + +.search-view .results.align-icons-and-twisties .linematch { padding-left: 22px; } From cdfaca550685dd60923247e2aadfe7023e45c716 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 09:59:07 -0800 Subject: [PATCH 095/429] Fix #67334 - disable multiselect on TOC tree --- src/vs/workbench/parts/preferences/browser/tocTree.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/parts/preferences/browser/tocTree.ts b/src/vs/workbench/parts/preferences/browser/tocTree.ts index 72acc8e1417..b3459279b3c 100644 --- a/src/vs/workbench/parts/preferences/browser/tocTree.ts +++ b/src/vs/workbench/parts/preferences/browser/tocTree.ts @@ -160,6 +160,7 @@ export class TOCTree extends ObjectTree { const filter = instantiationService.createInstance(SettingsTreeFilter, viewState); const options: IObjectTreeOptions = { filter, + multipleSelectionSupport: false, identityProvider: { getId(e) { return e.id; From bb96111b32e3304f29827e723c69582998fa07e5 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Tue, 29 Jan 2019 10:37:23 -0800 Subject: [PATCH 096/429] [HTML] Update language service --- extensions/html-language-features/server/package.json | 2 +- extensions/html-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index e631b8e2db0..3c95ec49a4e 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -10,7 +10,7 @@ "main": "./out/htmlServerMain", "dependencies": { "vscode-css-languageservice": "^3.0.13-next.10", - "vscode-html-languageservice": "^2.1.11-next.9", + "vscode-html-languageservice": "^2.1.11-next.10", "vscode-languageserver": "^5.1.0", "vscode-languageserver-types": "^3.13.0", "vscode-nls": "^4.0.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index e0a65914a11..1cf165efbca 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -237,10 +237,10 @@ vscode-css-languageservice@^3.0.13-next.10: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" -vscode-html-languageservice@^2.1.11-next.9: - version "2.1.11-next.9" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.9.tgz#1471b945351a4b179bc9b995e9617f07ab12d647" - integrity sha512-iSQPafYHDv62dDpwXVmaJzuS3y8yuehPwtWEBC9QysNBm5LxrRWy293pC7b9CehVly6mDnrLVXSRfgwAtg9xzA== +vscode-html-languageservice@^2.1.11-next.10: + version "2.1.11-next.10" + resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.10.tgz#35c879e14fcf4d68870231eb5c46aa9a041b4aa1" + integrity sha512-HrQl0gIDLhTJB139nsMLhPkmG0YmweTgmd2MQlq7oki1+QFbIm3F/VyWpmGZR1aXGhRUmY58p1omg74NDy+4Lg== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" From 6f1cb1990953f58a67cccf0cf2f9b8e76e542835 Mon Sep 17 00:00:00 2001 From: Greg Van Liew Date: Tue, 29 Jan 2019 10:51:13 -0800 Subject: [PATCH 097/429] Fix jSDocCompletion deprecation message --- extensions/typescript-language-features/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/package.json b/extensions/typescript-language-features/package.json index dc8b9dd2e34..b8161c9d79b 100644 --- a/extensions/typescript-language-features/package.json +++ b/extensions/typescript-language-features/package.json @@ -362,7 +362,7 @@ "type": "boolean", "default": true, "description": "%jsDocCompletion.enabled%", - "deprecationMessage": "jsDocCompletion.deprecationMessage", + "deprecationMessage": "%jsDocCompletion.deprecationMessage%", "scope": "resource" }, "javascript.implicitProjectConfig.checkJs": { From 1066572f4327dee7ad45a2c7b4c9601a2b38fc77 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 29 Jan 2019 17:53:20 +0100 Subject: [PATCH 098/429] Fix #67389 --- .../parts/extensions/common/extensions.ts | 8 +- .../electron-browser/extensionsActions.ts | 109 +++++++++++------- .../node/extensionsWorkbenchService.ts | 48 ++++---- 3 files changed, 96 insertions(+), 69 deletions(-) diff --git a/src/vs/workbench/parts/extensions/common/extensions.ts b/src/vs/workbench/parts/extensions/common/extensions.ts index 803a1e6a512..4684950b9a0 100644 --- a/src/vs/workbench/parts/extensions/common/extensions.ts +++ b/src/vs/workbench/parts/extensions/common/extensions.ts @@ -83,11 +83,11 @@ export interface IExtensionsWorkbenchService { queryLocal(): Promise; queryGallery(options?: IQueryOptions): Promise>; canInstall(extension: IExtension): boolean; - install(vsix: string): Promise; - install(extension: IExtension, promptToInstallDependencies?: boolean): Promise; + install(vsix: string): Promise; + install(extension: IExtension, promptToInstallDependencies?: boolean): Promise; uninstall(extension: IExtension): Promise; - installVersion(extension: IExtension, version: string): Promise; - reinstall(extension: IExtension): Promise; + installVersion(extension: IExtension, version: string): Promise; + reinstall(extension: IExtension): Promise; setEnablement(extensions: IExtension | IExtension[], enablementState: EnablementState): Promise; loadDependencies(extension: IExtension, token: CancellationToken): Promise; open(extension: IExtension, sideByside?: boolean): Promise; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 013105be402..04d14ae6cae 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -16,9 +16,9 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer } from 'vs/workbench/parts/extensions/common/extensions'; import { ExtensionsConfigurationInitialContent } from 'vs/workbench/parts/extensions/common/extensionsFileTemplate'; -import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionType } from 'vs/platform/extensions/common/extensions'; +import { ExtensionType, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ShowViewletAction } from 'vs/workbench/browser/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @@ -56,6 +56,16 @@ import { IPartService } from 'vs/workbench/services/part/common/partService'; import { alert } from 'vs/base/browser/ui/aria/aria'; import { coalesce } from 'vs/base/common/arrays'; +function toExtensionDescription(local: ILocalExtension): IExtensionDescription { + return { + identifier: new ExtensionIdentifier(local.identifier.id), + isBuiltin: local.type === ExtensionType.System, + isUnderDevelopment: false, + extensionLocation: local.location, + ...local.manifest + }; +} + const promptDownloadManually = (extension: IGalleryExtension | undefined, message: string, error: Error, instantiationService: IInstantiationService, notificationService: INotificationService, openerService: IOpenerService) => { if (!extension || error.name === INSTALL_ERROR_INCOMPATIBLE || error.name === INSTALL_ERROR_MALICIOUS) { return Promise.reject(error); @@ -171,9 +181,7 @@ export class InstallAction extends ExtensionAction { } private install(extension: IExtension): Promise { - return this.extensionsWorkbenchService.install(extension).then(() => { - alert(localize('installExtensionComplete', "Installing extension {0} is completed. Please reload Visual Studio Code to enable it.", this.extension.displayName)); - }, err => { + return this.extensionsWorkbenchService.install(extension).then(null, err => { if (!extension.gallery) { return this.notificationService.error(err); } @@ -574,10 +582,9 @@ export class InstallAnotherVersionAction extends ExtensionAction { if (this.extension.version === pick.id) { return Promise.resolve(); } - return (pick.latest ? this.extensionsWorkbenchService.install(this.extension) : this.extensionsWorkbenchService.installVersion(this.extension, pick.id)) - .then(() => { - alert(localize('installExtensionComplete', "Installing extension {0} is completed. Please reload Visual Studio Code to enable it.", this.extension.displayName)); - }, err => { + const promise: Promise = pick.latest ? this.extensionsWorkbenchService.install(this.extension) : this.extensionsWorkbenchService.installVersion(this.extension, pick.id); + return promise + .then(null, err => { if (!this.extension.gallery) { return this.notificationService.error(err); } @@ -1022,6 +1029,7 @@ export class ReloadAction extends ExtensionAction { this.enabled = true; if (!isEnabled) { this.tooltip = localize('postInstallTooltip', "Please reload Visual Studio Code to complete the installation of this extension."); + alert(localize('installExtensionComplete', "Installing extension {0} is completed. Please reload Visual Studio Code to enable it.", this.extension.displayName)); } else { this.tooltip = localize('postEnableTooltip', "Please reload Visual Studio Code to complete the enabling of this extension."); } @@ -1035,6 +1043,7 @@ export class ReloadAction extends ExtensionAction { // Requires reload to deactivate the extension this.enabled = true; this.tooltip = localize('postUninstallTooltip', "Please reload Visual Studio Code to complete the uninstallation of this extension."); + alert(localize('uninstallExtensionComplete', "Please reload Visual Studio Code to complete the uninstallation of the extension {0}.", this.extension.displayName)); return; } } @@ -2228,7 +2237,9 @@ export class InstallVSIXAction extends Action { label = InstallVSIXAction.LABEL, @IExtensionsWorkbenchService private readonly extensionsWorkbenchService: IExtensionsWorkbenchService, @INotificationService private readonly notificationService: INotificationService, - @IWindowService private readonly windowService: IWindowService + @IWindowService private readonly windowService: IWindowService, + @IExtensionService private readonly extensionService: IExtensionService, + @IInstantiationService private readonly instantiationService: IInstantiationService ) { super(id, label, 'extension-action install-vsix', true); } @@ -2244,17 +2255,25 @@ export class InstallVSIXAction extends Action { return Promise.resolve(null); } - return Promise.all(result.map(vsix => this.extensionsWorkbenchService.install(vsix))).then(() => { - this.notificationService.prompt( - Severity.Info, - localize('InstallVSIXAction.success', "Successfully installed the extension. Reload to enable it."), - [{ - label: localize('InstallVSIXAction.reloadNow', "Reload Now"), - run: () => this.windowService.reloadWindow() - }], - { sticky: true } - ); - }); + return Promise.all(result.map(vsix => this.extensionsWorkbenchService.install(vsix))) + .then(extensions => { + for (const extension of extensions) { + const requireReload = !(extension.local && this.extensionService.canAddExtension(toExtensionDescription(extension.local))); + const message = requireReload ? localize('InstallVSIXAction.successReload', "Please reload Visual Studio Code to complete installing the extension {0}.", extension.identifier.id) + : localize('InstallVSIXAction.success', "Installing the extension {0} is completed.", extension.identifier.id); + const actions = requireReload ? [{ + label: localize('InstallVSIXAction.reloadNow', "Reload Now"), + run: () => this.windowService.reloadWindow() + }] : []; + this.notificationService.prompt( + Severity.Info, + message, + actions, + { sticky: true } + ); + } + return this.instantiationService.createInstance(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL).run(); + }); }); } } @@ -2270,7 +2289,8 @@ export class ReinstallAction extends Action { @IQuickInputService private readonly quickInputService: IQuickInputService, @INotificationService private readonly notificationService: INotificationService, @IWindowService private readonly windowService: IWindowService, - @IViewletService private readonly viewletService: IViewletService + @IInstantiationService private readonly instantiationService: IInstantiationService, + @IExtensionService private readonly extensionService: IExtensionService ) { super(id, label); } @@ -2302,18 +2322,21 @@ export class ReinstallAction extends Action { } private reinstallExtension(extension: IExtension): Promise { - return this.viewletService.openViewlet(VIEWLET_ID) - .then((viewlet: IExtensionsViewlet) => { - viewlet.search(''); + return this.instantiationService.createInstance(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL).run() + .then(() => { return this.extensionsWorkbenchService.reinstall(extension) - .then(() => { + .then(extension => { + const requireReload = !(extension.local && this.extensionService.canAddExtension(toExtensionDescription(extension.local))); + const message = requireReload ? localize('ReinstallAction.successReload', "Please reload Visual Studio Code to complete reinstalling the extension {0}.", extension.identifier.id) + : localize('ReinstallAction.success', "Reinstalling the extension {0} is completed.", extension.identifier.id); + const actions = requireReload ? [{ + label: localize('InstallVSIXAction.reloadNow', "Reload Now"), + run: () => this.windowService.reloadWindow() + }] : []; this.notificationService.prompt( Severity.Info, - localize('ReinstallAction.success', "Successfully reinstalled the extension."), - [{ - label: localize('ReinstallAction.reloadNow', "Reload Now"), - run: () => this.windowService.reloadWindow() - }], + message, + actions, { sticky: true } ); }, error => this.notificationService.error(error)); @@ -2333,7 +2356,8 @@ export class InstallSpecificVersionOfExtensionAction extends Action { @IQuickInputService private readonly quickInputService: IQuickInputService, @INotificationService private readonly notificationService: INotificationService, @IWindowService private readonly windowService: IWindowService, - @IViewletService private readonly viewletService: IViewletService + @IInstantiationService private readonly instantiationService: IInstantiationService, + @IExtensionService private readonly extensionService: IExtensionService ) { super(id, label); } @@ -2383,18 +2407,21 @@ export class InstallSpecificVersionOfExtensionAction extends Action { } private install(extension: IExtension, version: string): Promise { - return this.viewletService.openViewlet(VIEWLET_ID) - .then((viewlet: IExtensionsViewlet) => { - viewlet.search(''); + return this.instantiationService.createInstance(ShowInstalledExtensionsAction, ShowInstalledExtensionsAction.ID, ShowInstalledExtensionsAction.LABEL).run() + .then(() => { return this.extensionsWorkbenchService.installVersion(extension, version) - .then(() => { + .then(extension => { + const requireReload = !(extension.local && this.extensionService.canAddExtension(toExtensionDescription(extension.local))); + const message = requireReload ? localize('InstallAnotherVersionExtensionAction.successReload', "Please reload Visual Studio Code to complete installing the extension {0}.", extension.identifier.id) + : localize('InstallAnotherVersionExtensionAction.success', "Installing the extension {0} is completed.", extension.identifier.id); + const actions = requireReload ? [{ + label: localize('InstallAnotherVersionExtensionAction.reloadNow', "Reload Now"), + run: () => this.windowService.reloadWindow() + }] : []; this.notificationService.prompt( Severity.Info, - localize('Install Success', "Successfully installed the extension."), - [{ - label: localize('InstallAnotherVersionExtensionAction.reloadNow', "Reload Now"), - run: () => this.windowService.reloadWindow() - }], + message, + actions, { sticky: true } ); }, error => this.notificationService.error(error)); diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 167b592c380..6d25977a663 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -624,30 +624,30 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, return !!(extension as Extension).gallery; } - install(extension: string | IExtension): Promise { + install(extension: string | IExtension): Promise { if (typeof extension === 'string') { - return this.installWithProgress(() => this.extensionService.install(URI.file(extension)).then(extensionIdentifier => this.checkAndEnableDisabledDependencies(extensionIdentifier))); - } - - if (!(extension instanceof Extension)) { - return Promise.resolve(undefined); + return this.installWithProgress(async () => { + const extensionIdentifier = await this.extensionService.install(URI.file(extension)); + this.checkAndEnableDisabledDependencies(extensionIdentifier); + return this.local.filter(local => areSameExtensions(local.identifier, extensionIdentifier))[0]; + }); } if (extension.isMalicious) { return Promise.reject(new Error(nls.localize('malicious', "This extension is reported to be problematic."))); } - const ext = extension as Extension; - const gallery = ext.gallery; + const gallery = extension.gallery; if (!gallery) { return Promise.reject(new Error('Missing gallery')); } - return this.installWithProgress( - () => this.extensionService.installFromGallery(gallery) - .then(() => this.checkAndEnableDisabledDependencies(gallery.identifier)) - , gallery.displayName); + return this.installWithProgress(async () => { + await this.extensionService.installFromGallery(gallery); + this.checkAndEnableDisabledDependencies(gallery.identifier); + return this.local.filter(local => areSameExtensions(local.identifier, gallery.identifier))[0]; + }, gallery.displayName); } setEnablement(extensions: IExtension | IExtension[], enablementState: EnablementState): Promise { @@ -671,7 +671,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, }, () => this.extensionService.uninstall(toUninstall).then(() => undefined)); } - installVersion(extension: IExtension, version: string): Promise { + installVersion(extension: IExtension, version: string): Promise { if (!(extension instanceof Extension)) { return Promise.resolve(); } @@ -683,20 +683,20 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, return this.galleryService.getCompatibleExtension(extension.gallery.identifier, version) .then(gallery => { if (!gallery) { - return undefined; + return Promise.reject(new Error(nls.localize('incompatible', "Unable to install extension '{0}' with version '{1}' as it is not compatible with VS Code.", extension.gallery!.identifier.id, version))); + } + return this.installWithProgress(async () => { + await this.extensionService.installFromGallery(gallery); + if (extension.latestVersion !== version) { + this.ignoreAutoUpdate(new ExtensionIdentifierWithVersion(gallery.identifier, version)); + } + return this.local.filter(local => areSameExtensions(local.identifier, gallery.identifier))[0]; } - return this.installWithProgress( - () => this.extensionService.installFromGallery(gallery) - .then(() => { - if (extension.latestVersion !== version) { - this.ignoreAutoUpdate(new ExtensionIdentifierWithVersion(gallery.identifier, version)); - } - }) , gallery.displayName); }); } - reinstall(extension: IExtension): Promise { + reinstall(extension: IExtension): Promise { const ext = extension.local ? extension : this.installed.filter(e => areSameExtensions(e.identifier, extension.identifier))[0]; const toReinstall: ILocalExtension | null = ext && ext.local ? ext.local : null; @@ -707,10 +707,10 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, return this.progressService.withProgress({ location: ProgressLocation.Extensions, source: `${toReinstall.identifier.id}` - }, () => this.extensionService.reinstallFromGallery(toReinstall).then(() => undefined)); + }, () => this.extensionService.reinstallFromGallery(toReinstall).then(() => this.local.filter(local => areSameExtensions(local.identifier, extension.identifier))[0])); } - private installWithProgress(installTask: () => Promise, extensionName?: string): Promise { + private installWithProgress(installTask: () => Promise, extensionName?: string): Promise { const title = extensionName ? nls.localize('installing named extension', "Installing '{0}' extension....", extensionName) : nls.localize('installing extension', 'Installing extension....'); return this.progressService.withProgress({ location: ProgressLocation.Extensions, From 2df07eba28887df77dc07eb2ac37676d9bbc1248 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 29 Jan 2019 23:04:59 +0100 Subject: [PATCH 099/429] #66931 - Show feedback when action is completed - Verbose reload action --- .../electron-browser/extensionEditor.ts | 3 +- .../electron-browser/extensionsActions.ts | 101 ++++++++++++++++-- .../electron-browser/extensionsList.ts | 3 +- .../media/extensionActions.css | 12 ++- .../extensionsActions.test.ts | 4 +- 5 files changed, 107 insertions(+), 16 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts index 763454e1e94..65574224a7d 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts @@ -28,7 +28,7 @@ import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension import { RatingsWidget, InstallCountWidget, RemoteBadgeWidget } from 'vs/workbench/parts/extensions/electron-browser/extensionsWidgets'; import { EditorOptions } from 'vs/workbench/common/editor'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +import { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction, StatusLabelAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; import { WebviewElement } from 'vs/workbench/parts/webview/electron-browser/webviewElement'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; @@ -360,6 +360,7 @@ export class ExtensionEditor extends BaseEditor { const reloadAction = this.instantiationService.createInstance(ReloadAction); const actions = [ reloadAction, + this.instantiationService.createInstance(StatusLabelAction), this.instantiationService.createInstance(UpdateAction), this.instantiationService.createInstance(EnableDropDownAction), this.instantiationService.createInstance(DisableDropDownAction, runningExtensions), diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 04d14ae6cae..69866708e18 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -6,7 +6,7 @@ import 'vs/css!./media/extensionActions'; import { localize } from 'vs/nls'; import { IAction, Action } from 'vs/base/common/actions'; -import { ThrottledDelayer } from 'vs/base/common/async'; +import { Throttler } from 'vs/base/common/async'; import * as DOM from 'vs/base/browser/dom'; import * as paths from 'vs/base/common/paths'; import { Event } from 'vs/base/common/event'; @@ -964,7 +964,7 @@ export class ReloadAction extends ExtensionAction { private static readonly DisabledClass = `${ReloadAction.EnabledClass} disabled`; // Use delayer to wait for more updates - private throttler: ThrottledDelayer; + private throttler: Throttler; private disposables: IDisposable[] = []; constructor( @@ -974,13 +974,13 @@ export class ReloadAction extends ExtensionAction { @IExtensionEnablementService private readonly extensionEnablementService: IExtensionEnablementService ) { super('extensions.reload', localize('reloadAction', "Reload"), ReloadAction.DisabledClass, false); - this.throttler = new ThrottledDelayer(50); + this.throttler = new Throttler(); this.extensionService.onDidChangeExtensions(this.update, this, this.disposables); this.update(); } update(): Promise { - return this.throttler.trigger(() => { + return this.throttler.queue(() => { this.enabled = false; this.tooltip = ''; if (!this.extension) { @@ -999,7 +999,6 @@ export class ReloadAction extends ExtensionAction { .then(runningExtensions => this.computeReloadState(runningExtensions, installed)); }).then(() => { this.class = this.enabled ? ReloadAction.EnabledClass : ReloadAction.DisabledClass; - this.label = localize('reloadAction', "Reload"); }); } @@ -1015,25 +1014,28 @@ export class ReloadAction extends ExtensionAction { if (isDifferentVersionRunning && !isDisabled) { // Requires reload to run the updated extension this.enabled = true; + this.label = localize('reloadToUpdateAction', "Reload to Update"); this.tooltip = localize('postUpdateTooltip', "Please reload Visual Studio Code to complete the updating of this extension."); return; } if (isDisabled) { // Requires reload to disable the extension this.enabled = true; + this.label = localize('reloadToDisable', "Reload to Disable"); this.tooltip = localize('postDisableTooltip', "Please reload Visual Studio Code to complete the disabling of this extension."); return; } } else { - if (!isDisabled) { + if (!isDisabled && !(this.extension.local && this.extensionService.canAddExtension(toExtensionDescription(this.extension.local)))) { this.enabled = true; - if (!isEnabled) { + if (isEnabled) { + this.label = localize('reloadToEnable', "Reload to Enable"); + this.tooltip = localize('postEnableTooltip', "Please reload Visual Studio Code to complete the enabling of this extension."); + } else { + this.label = localize('reloadToInstall', "Reload to Install"); this.tooltip = localize('postInstallTooltip', "Please reload Visual Studio Code to complete the installation of this extension."); alert(localize('installExtensionComplete', "Installing extension {0} is completed. Please reload Visual Studio Code to enable it.", this.extension.displayName)); - } else { - this.tooltip = localize('postEnableTooltip', "Please reload Visual Studio Code to complete the enabling of this extension."); } - return; } } return; @@ -1042,6 +1044,7 @@ export class ReloadAction extends ExtensionAction { if (isUninstalled && runningExtension) { // Requires reload to deactivate the extension this.enabled = true; + this.label = localize('reloadToUninstall', "Reload to Uninstall"); this.tooltip = localize('postUninstallTooltip', "Please reload Visual Studio Code to complete the uninstallation of this extension."); alert(localize('uninstallExtensionComplete', "Please reload Visual Studio Code to complete the uninstallation of the extension {0}.", this.extension.displayName)); return; @@ -2045,6 +2048,84 @@ export class AddToWorkspaceRecommendationsAction extends AbstractConfigureRecomm } } +export class StatusLabelAction extends Action implements IExtensionContainer { + + private static readonly ENABLED_CLASS = 'extension-status-label'; + private static readonly DISABLED_CLASS = `${StatusLabelAction.ENABLED_CLASS} hide`; + + private status: ExtensionState | null = null; + private enablementState: EnablementState | null = null; + + private _extension: IExtension; + get extension(): IExtension { return this._extension; } + set extension(extension: IExtension) { + if (!(this._extension && areSameExtensions(this._extension.identifier, extension.identifier))) { + // Different extension. Reset + this.status = null; + this.enablementState = null; + } + this._extension = extension; + this.update(); + } + + constructor( + @IExtensionService private readonly extensionService: IExtensionService + ) { + super('extensions.action.statusLabel', '', StatusLabelAction.DISABLED_CLASS, false); + } + + update(): void { + this.computeLabel() + .then(label => { + this.label = label || ''; + this.class = label ? StatusLabelAction.ENABLED_CLASS : StatusLabelAction.DISABLED_CLASS; + }); + } + + private async computeLabel(): Promise { + if (!this.extension) { + return null; + } + + const currentStatus = this.status; + const currentEnablementState = this.enablementState; + this.status = this.extension.state; + this.enablementState = this.extension.enablementState; + + const runningExtensions = await this.extensionService.getExtensions(); + const canAddExtension = () => this.extension.local && (runningExtensions.some(e => areSameExtensions({ id: e.identifier.value }, this.extension.identifier)) || this.extensionService.canAddExtension(toExtensionDescription(this.extension.local))); + const canRemoveExtension = () => this.extension.local && (runningExtensions.every(e => !areSameExtensions({ id: e.identifier.value }, this.extension.identifier)) || this.extensionService.canRemoveExtension(toExtensionDescription(this.extension.local))); + + if (currentStatus !== null) { + if (currentStatus === ExtensionState.Installing && this.status === ExtensionState.Installed) { + return canAddExtension() ? localize('installed', "Installed") : null; + } + if (currentStatus === ExtensionState.Uninstalling && this.status === ExtensionState.Uninstalled) { + return canRemoveExtension() ? localize('uninstalled', "Uninstalled") : null; + } + } + + if (currentEnablementState !== null) { + const currentlyEnabled = currentEnablementState === EnablementState.Enabled || currentEnablementState === EnablementState.WorkspaceEnabled; + const enabled = this.enablementState === EnablementState.Enabled || this.enablementState === EnablementState.WorkspaceEnabled; + if (!currentlyEnabled && enabled) { + return canAddExtension() ? localize('enabled', "Enabled") : null; + } + if (currentlyEnabled && !enabled) { + return canRemoveExtension() ? localize('disabled', "Disabled") : null; + } + + } + + return null; + } + + run(): Promise { + return Promise.resolve(null); + } + +} + export class MaliciousStatusLabelAction extends ExtensionAction { private static readonly Class = 'malicious-status'; diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts index fb69a556f6d..24c894eca8c 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts @@ -13,7 +13,7 @@ import { IPagedRenderer } from 'vs/base/browser/ui/list/listPaging'; import { Event } from 'vs/base/common/event'; import { domEvent } from 'vs/base/browser/event'; import { IExtension, IExtensionsWorkbenchService, ExtensionContainers } from 'vs/workbench/parts/extensions/common/extensions'; -import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionItem } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionItem, StatusLabelAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { Label, RatingsWidget, InstallCountWidget, RecommendationWidget, RemoteBadgeWidget } from 'vs/workbench/parts/extensions/electron-browser/extensionsWidgets'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; @@ -95,6 +95,7 @@ export class Renderer implements IPagedRenderer { this.instantiationService.createInstance(RatingsWidget, ratings, true) ]; const actions = [ + this.instantiationService.createInstance(StatusLabelAction), this.instantiationService.createInstance(UpdateAction), this.instantiationService.createInstance(ReloadAction), this.instantiationService.createInstance(InstallAction), diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css index 2c976fa20b0..3f81cec95f9 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css @@ -34,26 +34,34 @@ .monaco-action-bar .action-item.disabled .action-label.extension-action.extension-editor-dropdown-action, .monaco-action-bar .action-item.disabled .action-label.extension-action.reload, .monaco-action-bar .action-item.disabled .action-label.disable-status.hide, +.monaco-action-bar .action-item.disabled .action-label.extension-status-label.hide, .monaco-action-bar .action-item.disabled .action-label.malicious-status.not-malicious { display: none; } .monaco-action-bar .action-item .action-label.disable-status, -.monaco-action-bar .action-item .action-label.malicious-status { +.monaco-action-bar .action-item .action-label.malicious-status, +.monaco-action-bar .action-item.disabled .action-label.extension-status-label { border-radius: 4px; color: inherit; background-color: transparent; opacity: 0.9; - font-style: italic; padding: 0 5px; line-height: initial; } +.monaco-action-bar .action-item .action-label.disable-status, +.monaco-action-bar .action-item .action-label.malicious-status { + font-style: italic; +} + +.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label, .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status, .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status { font-weight: normal; } +.extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.extension-status-label:hover, .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.disable-status:hover, .extension-editor>.header>.details>.actions>.monaco-action-bar .action-item .action-label.malicious-status:hover { opacity: 0.9; diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts index 281958141b7..3cebcc96d55 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts @@ -24,7 +24,7 @@ import { Emitter } from 'vs/base/common/event'; import { IPager } from 'vs/base/common/paging'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; +import { IExtensionService, IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestContextService, TestWindowService } from 'vs/workbench/test/workbenchTestServices'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -84,7 +84,7 @@ suite('ExtensionsActions Test', () => { instantiationService.stubPromise(IExtensionManagementService, 'getInstalled', []); instantiationService.stubPromise(IExtensionManagementService, 'getExtensionsReport', []); instantiationService.stubPromise(IExtensionGalleryService, 'query', aPage()); - instantiationService.stub(IExtensionService, { getExtensions: () => Promise.resolve([]), onDidChangeExtensions: new Emitter().event }); + instantiationService.stub(IExtensionService, { getExtensions: () => Promise.resolve([]), onDidChangeExtensions: new Emitter().event, canAddExtension: (extension: IExtensionDescription) => false, canRemoveExtension: (extension: IExtensionDescription) => false }); await (instantiationService.get(IExtensionEnablementService)).reset(); instantiationService.set(IExtensionsWorkbenchService, instantiationService.createInstance(ExtensionsWorkbenchService)); From be29fda7ee8a07f38535faf678a8b3f578bb2eba Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 29 Jan 2019 23:24:02 +0100 Subject: [PATCH 100/429] Fix #67432 --- .../extensions/electron-browser/media/extensionsViewlet.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css index 648b9c762a8..9089f6ff17d 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css @@ -108,11 +108,11 @@ bottom: 5px; } -.extensions-viewlet.narrow > .extensions .extension > .icon { +.extensions-viewlet.narrow > .extensions .extension > .icon-container > .icon { display: none; } -.extensions-viewlet > .extensions .extension.loading > .icon { +.extensions-viewlet > .extensions .extension.loading > .icon-container > .icon { display: none; } From b2f7a7f9f8d39f494104af02f8f0aac556cab5f8 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Tue, 29 Jan 2019 14:28:53 -0800 Subject: [PATCH 101/429] Update filter icons --- .../browser/ui/list/media/filter-dark.svg | 54 ++----------------- .../browser/ui/list/media/no-filter-dark.svg | 54 ++----------------- 2 files changed, 8 insertions(+), 100 deletions(-) diff --git a/src/vs/base/browser/ui/list/media/filter-dark.svg b/src/vs/base/browser/ui/list/media/filter-dark.svg index 67a29ec0eeb..b480653ee44 100644 --- a/src/vs/base/browser/ui/list/media/filter-dark.svg +++ b/src/vs/base/browser/ui/list/media/filter-dark.svg @@ -1,51 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + + diff --git a/src/vs/base/browser/ui/list/media/no-filter-dark.svg b/src/vs/base/browser/ui/list/media/no-filter-dark.svg index 2189e00d559..6a272f99d83 100644 --- a/src/vs/base/browser/ui/list/media/no-filter-dark.svg +++ b/src/vs/base/browser/ui/list/media/no-filter-dark.svg @@ -1,51 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + + From 35ecc489d91b77e1a04c6be1de8652903aec824f Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 29 Jan 2019 23:45:09 +0100 Subject: [PATCH 102/429] Fix #67270 --- src/vs/editor/contrib/hover/hover.ts | 2 +- src/vs/editor/contrib/hover/modesContentHover.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/hover/hover.ts b/src/vs/editor/contrib/hover/hover.ts index d729d098ccc..f6feacb8517 100644 --- a/src/vs/editor/contrib/hover/hover.ts +++ b/src/vs/editor/contrib/hover/hover.ts @@ -206,7 +206,7 @@ export class ModesHoverController implements IEditorContribution { private _createHoverWidget() { const renderer = new MarkdownRenderer(this._editor, this._modeService, this._openerService); - this._contentWidget = new ModesContentHoverWidget(this._editor, renderer, this._markerDecorationsService, this._themeService); + this._contentWidget = new ModesContentHoverWidget(this._editor, renderer, this._markerDecorationsService, this._themeService, this._openerService); this._glyphWidget = new ModesGlyphHoverWidget(this._editor, renderer); } diff --git a/src/vs/editor/contrib/hover/modesContentHover.ts b/src/vs/editor/contrib/hover/modesContentHover.ts index 94e66e196e4..f2d99c20e0d 100644 --- a/src/vs/editor/contrib/hover/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/modesContentHover.ts @@ -27,6 +27,8 @@ import { coalesce, isNonEmptyArray } from 'vs/base/common/arrays'; import { IMarker, IMarkerData } from 'vs/platform/markers/common/markers'; import { basename } from 'vs/base/common/paths'; import { IMarkerDecorationsService } from 'vs/editor/common/services/markersDecorationService'; +import { onUnexpectedError } from 'vs/base/common/errors'; +import { IOpenerService, NullOpenerService } from 'vs/platform/opener/common/opener'; const $ = dom.$; @@ -203,7 +205,8 @@ export class ModesContentHoverWidget extends ContentHoverWidget { editor: ICodeEditor, markdownRenderer: MarkdownRenderer, markerDecorationsService: IMarkerDecorationsService, - private readonly _themeService: IThemeService + private readonly _themeService: IThemeService, + private readonly _openerService: IOpenerService | null = NullOpenerService, ) { super(ModesContentHoverWidget.ID, editor); @@ -485,8 +488,13 @@ export class ModesContentHoverWidget extends ContentHoverWidget { for (const { message, resource, startLineNumber, startColumn } of relatedInformation) { const item = dom.append(listElement, $('li')); const a = dom.append(item, $('a')); - a.setAttribute('data-href', `${resource.toString(false)}#${startLineNumber},${startColumn}`); a.innerText = `${basename(resource.path)}(${startLineNumber}, ${startColumn})`; + a.style.cursor = 'pointer'; + a.onclick = e => { + e.stopPropagation(); + e.preventDefault(); + this._openerService.open(resource.with({ fragment: `${startLineNumber},${startColumn}` })).catch(onUnexpectedError); + }; const messageElement = dom.append(item, $('span')); messageElement.innerText = `: ${message}`; } From 330018c3cebb9512d821e550676310f9956f8960 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 30 Jan 2019 00:04:12 +0100 Subject: [PATCH 103/429] fix null check --- src/vs/editor/contrib/hover/modesContentHover.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/hover/modesContentHover.ts b/src/vs/editor/contrib/hover/modesContentHover.ts index f2d99c20e0d..af956cabdfb 100644 --- a/src/vs/editor/contrib/hover/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/modesContentHover.ts @@ -493,7 +493,9 @@ export class ModesContentHoverWidget extends ContentHoverWidget { a.onclick = e => { e.stopPropagation(); e.preventDefault(); - this._openerService.open(resource.with({ fragment: `${startLineNumber},${startColumn}` })).catch(onUnexpectedError); + if (this._openerService) { + this._openerService.open(resource.with({ fragment: `${startLineNumber},${startColumn}` })).catch(onUnexpectedError); + } }; const messageElement = dom.append(item, $('span')); messageElement.innerText = `: ${message}`; From 077a83ee6d2173170b17bfa11b31bfe2ca7cff01 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Tue, 29 Jan 2019 15:14:48 -0800 Subject: [PATCH 104/429] Update icons and colors --- .../browser/ui/list/media/filter-dark.svg | 6 +-- .../base/browser/ui/list/media/filter-hc.svg | 54 ++----------------- src/vs/base/browser/ui/list/media/filter.svg | 54 ++----------------- .../browser/ui/list/media/no-filter-dark.svg | 6 +-- .../browser/ui/list/media/no-filter-hc.svg | 54 ++----------------- .../base/browser/ui/list/media/no-filter.svg | 54 ++----------------- 6 files changed, 22 insertions(+), 206 deletions(-) diff --git a/src/vs/base/browser/ui/list/media/filter-dark.svg b/src/vs/base/browser/ui/list/media/filter-dark.svg index b480653ee44..0925909a117 100644 --- a/src/vs/base/browser/ui/list/media/filter-dark.svg +++ b/src/vs/base/browser/ui/list/media/filter-dark.svg @@ -1,5 +1,5 @@ - - - + + + diff --git a/src/vs/base/browser/ui/list/media/filter-hc.svg b/src/vs/base/browser/ui/list/media/filter-hc.svg index b81a030f51b..0e2724f52e2 100644 --- a/src/vs/base/browser/ui/list/media/filter-hc.svg +++ b/src/vs/base/browser/ui/list/media/filter-hc.svg @@ -1,51 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + + diff --git a/src/vs/base/browser/ui/list/media/filter.svg b/src/vs/base/browser/ui/list/media/filter.svg index 7d7d5f4fd35..f8c011064b1 100644 --- a/src/vs/base/browser/ui/list/media/filter.svg +++ b/src/vs/base/browser/ui/list/media/filter.svg @@ -1,51 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + + diff --git a/src/vs/base/browser/ui/list/media/no-filter-dark.svg b/src/vs/base/browser/ui/list/media/no-filter-dark.svg index 6a272f99d83..5f495c006dc 100644 --- a/src/vs/base/browser/ui/list/media/no-filter-dark.svg +++ b/src/vs/base/browser/ui/list/media/no-filter-dark.svg @@ -1,5 +1,5 @@ - - - + + + diff --git a/src/vs/base/browser/ui/list/media/no-filter-hc.svg b/src/vs/base/browser/ui/list/media/no-filter-hc.svg index 173adcfa511..31d8f70f05a 100644 --- a/src/vs/base/browser/ui/list/media/no-filter-hc.svg +++ b/src/vs/base/browser/ui/list/media/no-filter-hc.svg @@ -1,51 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + + diff --git a/src/vs/base/browser/ui/list/media/no-filter.svg b/src/vs/base/browser/ui/list/media/no-filter.svg index 55141722d66..760cc3c4403 100644 --- a/src/vs/base/browser/ui/list/media/no-filter.svg +++ b/src/vs/base/browser/ui/list/media/no-filter.svg @@ -1,51 +1,5 @@ - - - - - - image/svg+xml - - - - - - - - - - - + + + + From f5e8022d5aaa20e880a7e78a92a9e33561492f2b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 29 Jan 2019 17:25:39 -0800 Subject: [PATCH 105/429] Change from using `"apply": "preferred"` to using a new `"preferred": true` setting Fixes #67514 --- .../contrib/codeAction/codeActionCommands.ts | 46 +++++++++++++------ .../contrib/codeAction/codeActionTrigger.ts | 1 - 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index ee1e733a267..81ffd354aab 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -97,13 +97,6 @@ export class QuickFixController implements IEditorContribution { this._onApplyCodeAction(fixes[0]); return; } - - // Or if we have a single preferred action - const preferred = fixes.filter(fix => fix.isPreferred); - if (preferred.length === 1) { - this._onApplyCodeAction(preferred[0]); - return; - } } this._codeActionContextMenu.show(newState.actions, newState.position); @@ -217,11 +210,12 @@ export class QuickFixAction extends EditorAction { class CodeActionCommandArgs { public static fromUser(arg: any, defaults: { kind: CodeActionKind, apply: CodeActionAutoApply }): CodeActionCommandArgs { if (!arg || typeof arg !== 'object') { - return new CodeActionCommandArgs(defaults.kind, defaults.apply); + return new CodeActionCommandArgs(defaults.kind, defaults.apply, false); } return new CodeActionCommandArgs( CodeActionCommandArgs.getKindFromUser(arg, defaults.kind), - CodeActionCommandArgs.getApplyFromUser(arg, defaults.apply)); + CodeActionCommandArgs.getApplyFromUser(arg, defaults.apply), + CodeActionCommandArgs.getPreferredUser(arg)); } private static getApplyFromUser(arg: any, defaultAutoApply: CodeActionAutoApply) { @@ -229,7 +223,6 @@ class CodeActionCommandArgs { case 'first': return CodeActionAutoApply.First; case 'never': return CodeActionAutoApply.Never; case 'ifsingle': return CodeActionAutoApply.IfSingle; - case 'preferred': return CodeActionAutoApply.Preferred; default: return defaultAutoApply; } } @@ -240,9 +233,16 @@ class CodeActionCommandArgs { : defaultKind; } + private static getPreferredUser(arg: any): boolean { + return typeof arg.preferred === 'boolean' + ? arg.preferred + : false; + } + private constructor( public readonly kind: CodeActionKind, - public readonly apply: CodeActionAutoApply + public readonly apply: CodeActionAutoApply, + public readonly preferred: boolean, ) { } } @@ -262,7 +262,13 @@ export class CodeActionCommand extends EditorCommand { kind: CodeActionKind.Empty, apply: CodeActionAutoApply.IfSingle, }); - return showCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', "No code actions available"), { kind: args.kind, includeSourceActions: true }, args.apply); + return showCodeActionsForEditorSelection(editor, nls.localize('editor.action.quickFix.noneMessage', "No code actions available"), + { + kind: args.kind, + includeSourceActions: true, + onlyIncludePreferredActions: args.preferred, + }, + args.apply); } } @@ -302,7 +308,10 @@ export class RefactorAction extends EditorAction { }); return showCodeActionsForEditorSelection(editor, nls.localize('editor.action.refactor.noneMessage', "No refactorings available"), - { kind: CodeActionKind.Refactor.contains(args.kind) ? args.kind : CodeActionKind.Empty }, + { + kind: CodeActionKind.Refactor.contains(args.kind) ? args.kind : CodeActionKind.Empty, + onlyIncludePreferredActions: args.preferred, + }, args.apply); } } @@ -335,7 +344,11 @@ export class SourceAction extends EditorAction { }); return showCodeActionsForEditorSelection(editor, nls.localize('editor.action.source.noneMessage', "No source actions available"), - { kind: CodeActionKind.Source.contains(args.kind) ? args.kind : CodeActionKind.Empty, includeSourceActions: true }, + { + kind: CodeActionKind.Source.contains(args.kind) ? args.kind : CodeActionKind.Empty, + includeSourceActions: true, + onlyIncludePreferredActions: args.preferred, + }, args.apply); } } @@ -391,7 +404,10 @@ export class AutoFixAction extends EditorAction { public run(_accessor: ServicesAccessor, editor: ICodeEditor): void { return showCodeActionsForEditorSelection(editor, nls.localize('editor.action.autoFix.noneMessage', "No auto fixes available"), - { kind: CodeActionKind.QuickFix, onlyIncludePreferredActions: true }, + { + kind: CodeActionKind.QuickFix, + onlyIncludePreferredActions: true + }, CodeActionAutoApply.IfSingle); } } diff --git a/src/vs/editor/contrib/codeAction/codeActionTrigger.ts b/src/vs/editor/contrib/codeAction/codeActionTrigger.ts index 1332c015bd3..d782e836367 100644 --- a/src/vs/editor/contrib/codeAction/codeActionTrigger.ts +++ b/src/vs/editor/contrib/codeAction/codeActionTrigger.ts @@ -31,7 +31,6 @@ export class CodeActionKind { export const enum CodeActionAutoApply { IfSingle, First, - Preferred, Never, } From 8e7479e247fd296e4bed437949c20ec9fbcb56fd Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 17:36:49 -0800 Subject: [PATCH 106/429] Fix missing outline on search result actions --- src/vs/workbench/parts/search/browser/searchView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 3260f6cee2e..029ed682d95 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -1730,6 +1730,6 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const outlineSelectionColor = theme.getColor(listActiveSelectionForeground); if (outlineSelectionColor) { - collector.addRule(`.monaco-workbench .search-view .monaco-tree.focused .monaco-tree-row.focused.selected:not(.highlighted) .action-label:focus { outline-color: ${outlineSelectionColor} }`); + collector.addRule(`.monaco-workbench .search-view .monaco-list.element-focused .monaco-list-row.focused.selected:not(.highlighted) .action-label:focus { outline-color: ${outlineSelectionColor} }`); } }); From 549afeee62ac49dfc56cc3e841794868af890f40 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 17:40:27 -0800 Subject: [PATCH 107/429] Fix #67500 - disable type to filter in search view --- .../parts/search/browser/media/searchview.css | 4 ---- .../parts/search/browser/searchResultsView.ts | 9 ++------- .../workbench/parts/search/browser/searchView.ts | 15 +-------------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/src/vs/workbench/parts/search/browser/media/searchview.css b/src/vs/workbench/parts/search/browser/media/searchview.css index b0a438d8771..fd591c75b55 100644 --- a/src/vs/workbench/parts/search/browser/media/searchview.css +++ b/src/vs/workbench/parts/search/browser/media/searchview.css @@ -179,10 +179,6 @@ overflow: hidden; } -.search-view .results.align-icons-and-twisties .linematch { - padding-left: 22px; -} - .search-view .linematch > .match { overflow: hidden; text-overflow: ellipsis; diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index 499495c2387..18a8d159b78 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -26,7 +26,6 @@ import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels'; import { RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction } from 'vs/workbench/parts/search/browser/searchActions'; import { SearchView } from 'vs/workbench/parts/search/browser/searchView'; import { FileMatch, FolderMatch, Match, RenderableMatch, SearchModel, BaseFolderMatch } from 'vs/workbench/parts/search/common/searchModel'; -import { createMatches } from 'vs/base/common/filters'; interface IFolderMatchTemplate { label: IResourceLabel; @@ -163,7 +162,7 @@ export class FileMatchRenderer extends Disposable implements ITreeRenderer, index: number, templateData: IFileMatchTemplate): void { const fileMatch = node.element; templateData.el.setAttribute('data-resource', fileMatch.resource().toString()); - templateData.label.setFile( - fileMatch.resource(), { - hideIcon: false, - matches: createMatches(node.filterData) - }); + templateData.label.setFile(fileMatch.resource(), { hideIcon: false }); const count = fileMatch.count(); templateData.badge.setCount(count); templateData.badge.setTitleFormat(count > 1 ? nls.localize('searchMatches', "{0} matches found", count) : nls.localize('searchMatch', "{0} match found", count)); diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 029ed682d95..a6ef7c274c9 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -62,8 +62,6 @@ import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorG import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPreferencesService, ISettingsEditorOptions } from 'vs/workbench/services/preferences/common/preferences'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; -import { createFileIconThemableTreeContainerScope } from 'vs/workbench/browser/parts/views/views'; -import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; const $ = dom.$; @@ -145,11 +143,10 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { @IUntitledEditorService private readonly untitledEditorService: IUntitledEditorService, @IPreferencesService private readonly preferencesService: IPreferencesService, @IThemeService protected themeService: IThemeService, - @IWorkbenchThemeService protected workbenchThemeService: IWorkbenchThemeService, @ISearchHistoryService private readonly searchHistoryService: ISearchHistoryService, @IEditorGroupsService private readonly editorGroupsService: IEditorGroupsService, @IContextMenuService private readonly contextMenuService: IContextMenuService, - @IMenuService private readonly menuService: IMenuService, + @IMenuService private readonly menuService: IMenuService ) { super(VIEW_ID, configurationService, partService, telemetryService, themeService, storageService); @@ -618,7 +615,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { private createSearchResultsView(container: HTMLElement): void { this.resultsElement = dom.append(container, $('.results.show-file-icons')); const delegate = this.instantiationService.createInstance(SearchDelegate); - this._register(createFileIconThemableTreeContainerScope(this.resultsElement, this.workbenchThemeService)); const identityProvider: IIdentityProvider = { getId(element: RenderableMatch) { @@ -636,15 +632,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this._register(this.instantiationService.createInstance(MatchRenderer, this.viewModel, this)), ], { - keyboardNavigationLabelProvider: { - getKeyboardNavigationLabel: (element: RenderableMatch) => { - if (element instanceof FolderMatch || element instanceof FileMatch) { - return element.name(); - } - - return ''; - } - }, identityProvider, accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider, this.viewModel) })); From 11338652050c7dd40a0100b36f8f1058d6910216 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 18:31:34 -0800 Subject: [PATCH 108/429] Fix #64974 - error in raw default settings json --- .../preferences/common/preferencesModels.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/services/preferences/common/preferencesModels.ts b/src/vs/workbench/services/preferences/common/preferencesModels.ts index 498bbc64ddd..c738a41fc92 100644 --- a/src/vs/workbench/services/preferences/common/preferencesModels.ts +++ b/src/vs/workbench/services/preferences/common/preferencesModels.ts @@ -469,7 +469,7 @@ export class DefaultSettings extends Disposable { private initialize(): void { this._allSettingsGroups = this.parse(); - this._content = this.toContent(true, this._allSettingsGroups); + this._content = this.toContent(this._allSettingsGroups); } private parse(): ISettingsGroup[] { @@ -481,7 +481,7 @@ export class DefaultSettings extends Disposable { get raw(): string { if (!DefaultSettings._RAW) { - DefaultSettings._RAW = this.toContent(false, this.getRegisteredGroups()); + DefaultSettings._RAW = this.toContent(this.getRegisteredGroups()); } return DefaultSettings._RAW; @@ -673,18 +673,14 @@ export class DefaultSettings extends Disposable { return c1.order - c2.order; } - private toContent(asArray: boolean, settingsGroups: ISettingsGroup[]): string { + private toContent(settingsGroups: ISettingsGroup[]): string { const builder = new SettingsContentBuilder(); - if (asArray) { - builder.pushLine('['); - } + builder.pushLine('['); settingsGroups.forEach((settingsGroup, i) => { builder.pushGroup(settingsGroup); builder.pushLine(','); }); - if (asArray) { - builder.pushLine(']'); - } + builder.pushLine(']'); return builder.getContent(); } From 976e6bc828d4274f72dfc8e17c361ee91efbae71 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 19:53:35 -0800 Subject: [PATCH 109/429] Fix leak of suggest widget in settings editor - #67499 --- .../parts/codeEditor/electron-browser/suggestEnabledInput.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts b/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts index 3e2991208c4..4c4340a3db9 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts @@ -132,6 +132,7 @@ export class SuggestEnabledInput extends Widget implements IThemable { contributions: [SuggestController, SnippetController2, ContextMenuController, MenuPreventer, SelectionClipboard], isSimpleWidget: true, }); + this.disposables.push(this.inputWidget); let scopeHandle = uri.parse(resourceHandle); this.inputWidget.setModel(modelService.createModel('', null, scopeHandle, true)); From 603bf3837af6271aa609c645adab59e356953097 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 20:46:38 -0800 Subject: [PATCH 110/429] Clear lastFocusedSettingElement when focus moves to setting search --- .../parts/codeEditor/electron-browser/suggestEnabledInput.ts | 2 ++ .../parts/preferences/electron-browser/settingsEditor2.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts b/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts index 4c4340a3db9..8c692b4fcc2 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts @@ -196,6 +196,8 @@ export class SuggestEnabledInput extends Widget implements IThemable { })); } + public get onFocus(): Event { return this.inputWidget.onDidFocusEditorText; } + public setValue(val: string) { val = val.replace(/\s/g, ' '); const fullRange = new Range(1, 1, 1, this.getValue().length + 1); diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index 9f52f2b6459..b177f2ce4f0 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -370,6 +370,10 @@ export class SettingsEditor2 extends BaseEditor { }) ); + this._register(this.searchWidget.onFocus(() => { + this.lastFocusedSettingElement = ''; + })); + this._register(attachSuggestEnabledInputBoxStyler(this.searchWidget, this.themeService, { inputBorder: settingsTextInputBorder })); From 2c987b20a4d65ee51c48b9e4eb8f50c926199468 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 29 Jan 2019 21:05:28 -0800 Subject: [PATCH 111/429] Fix #67330 - settings tree styles overridden by other lists --- src/vs/workbench/parts/preferences/browser/settingsTree.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/preferences/browser/settingsTree.ts b/src/vs/workbench/parts/preferences/browser/settingsTree.ts index ab40cc8e798..9f13b1ae66e 100644 --- a/src/vs/workbench/parts/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/parts/preferences/browser/settingsTree.ts @@ -13,6 +13,7 @@ import { Button } from 'vs/base/browser/ui/button/button'; import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox'; import { InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { IListVirtualDelegate, ListAriaRootRole } from 'vs/base/browser/ui/list/list'; +import { DefaultStyleController } from 'vs/base/browser/ui/list/listWidget'; import { ISelectOptionItem, SelectBox } from 'vs/base/browser/ui/selectBox/selectBox'; import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar'; import { IObjectTreeOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree'; @@ -1306,6 +1307,7 @@ export class SettingsTree extends ObjectTree { return e.id; } }, + styleController: new DefaultStyleController(DOM.createStyleSheet(container), treeClass), filter: new SettingsTreeFilter(viewState) }); @@ -1372,7 +1374,9 @@ export class SettingsTree extends ObjectTree { listHoverOutline: editorBackground, listFocusOutline: editorBackground, listInactiveSelectionBackground: editorBackground, - listInactiveSelectionForeground: foreground + listInactiveSelectionForeground: foreground, + listInactiveFocusBackground: editorBackground, + listInactiveFocusOutline: editorBackground }, colors => { this.style(colors); })); From d5af2a20fc708b567f580144f97c1e946970400d Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Tue, 29 Jan 2019 22:37:41 -0800 Subject: [PATCH 112/429] fixes issue where hidden element orientation is not updated when hidden --- src/vs/base/browser/ui/grid/grid.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 5bbe5d9c30f..08a48e7b6f5 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -698,13 +698,19 @@ export class View implements IView { } layout(width: number, height: number, orientation: Orientation): void { - if (!this.visible) { + if (!this.visible && this.orientation === orientation) { return; } - this.view.layout(width, height, orientation); - this.width = width; - this.height = height; + + + if (this.visible) { + this.view.layout(width, height, orientation); + + this.width = width; + this.height = height; + } + this.orientation = orientation; } } \ No newline at end of file From 5a0091f4597720df2b5e674b2026cb1e0ecb5ebc Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 09:30:53 +0100 Subject: [PATCH 113/429] :lipstick: --- src/vs/base/browser/ui/grid/grid.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 08a48e7b6f5..2272913ff4a 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -698,19 +698,14 @@ export class View implements IView { } layout(width: number, height: number, orientation: Orientation): void { - if (!this.visible && this.orientation === orientation) { + this.orientation = orientation; + + if (!this.visible) { return; } - - - if (this.visible) { - this.view.layout(width, height, orientation); - - this.width = width; - this.height = height; - } - - this.orientation = orientation; + this.view.layout(width, height, orientation); + this.width = width; + this.height = height; } } \ No newline at end of file From be402f0320f3d1bee4fa04cb4868aa4a455a77af Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 09:41:58 +0100 Subject: [PATCH 114/429] grid branch nodes should not forward children's preferred sizes --- src/vs/base/browser/ui/grid/gridview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/grid/gridview.ts b/src/vs/base/browser/ui/grid/gridview.ts index 9011a578e51..e4e6f8909ad 100644 --- a/src/vs/base/browser/ui/grid/gridview.ts +++ b/src/vs/base/browser/ui/grid/gridview.ts @@ -300,7 +300,7 @@ class BranchNode implements ISplitView, IDisposable { } private onDidChildrenChange(): void { - const onDidChildrenChange = Event.any(...this.children.map(c => c.onDidChange)); + const onDidChildrenChange = Event.map(Event.any(...this.children.map(c => c.onDidChange)), () => undefined); this.childrenChangeDisposable.dispose(); this.childrenChangeDisposable = onDidChildrenChange(this._onDidChange.fire, this._onDidChange); From 27aed2d87a2a94c2f78d4aa2343cabdfa62cb4d7 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 09:56:59 +0100 Subject: [PATCH 115/429] fixes #67446 --- src/vs/base/common/color.ts | 16 ---------------- src/vs/platform/theme/common/colorRegistry.ts | 19 ++++--------------- src/vs/platform/theme/common/styler.ts | 9 +++++---- 3 files changed, 9 insertions(+), 35 deletions(-) diff --git a/src/vs/base/common/color.ts b/src/vs/base/common/color.ts index fd8f70afd8d..f63e7aa86f1 100644 --- a/src/vs/base/common/color.ts +++ b/src/vs/base/common/color.ts @@ -399,22 +399,6 @@ export class Color { return new Color(new RGBA(r, g, b, a)); } - blend2(c: Color): Color { - const otherRgba = c.rgba; - - // Convert to 0..1 opacity - const thisA = this.rgba.a; - const otherA = otherRgba.a; - - const totalA = thisA + otherA; - - const r = this.rgba.r * thisA / totalA + otherRgba.r * otherA / totalA; - const g = this.rgba.g * thisA / totalA + otherRgba.g * otherA / totalA; - const b = this.rgba.b * thisA / totalA + otherRgba.b * otherA / totalA; - - return new Color(new RGBA(r, g, b, 1)); - } - flatten(...backgrounds: Color[]): Color { const background = backgrounds.reduceRight((accumulator, color) => { return Color._flatten(color, accumulator); diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index aafd80bf811..b253d48e95e 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -235,6 +235,10 @@ export const listHighlightForeground = registerColor('list.highlightForeground', export const listInvalidItemForeground = registerColor('list.invalidItemForeground', { dark: '#B89500', light: '#B89500', hc: '#B89500' }, nls.localize('invalidItemForeground', 'List/Tree foreground color for invalid items, for example an unresolved root in explorer.')); export const listErrorForeground = registerColor('list.errorForeground', { dark: '#F88070', light: '#B01011', hc: null }, nls.localize('listErrorForeground', 'Foreground color of list items containing errors.')); export const listWarningForeground = registerColor('list.warningForeground', { dark: '#4d9e4d', light: '#117711', hc: null }, nls.localize('listWarningForeground', 'Foreground color of list items containing warnings.')); +export const listMatchesBackground = registerColor('list.matchesBackground', { light: '#efc1ad', dark: '#653723', hc: Color.black }, nls.localize('listMatchesBackground', 'Background color of the type filter widget in lists and trees.')); +export const listMatchesOutline = registerColor('list.matchesOutline', { dark: Color.transparent, light: Color.transparent, hc: '#f38518' }, nls.localize('listMatchesOutline', 'Outline color of the type filter widget in lists and trees.')); +export const listNoMatchesOutline = registerColor('list.noMatchesOutline', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, nls.localize('listNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.')); +export const listMatchesShadow = registerColor('list.matchesShadow', { dark: '#000000', light: '#A8A8A8', hc: null }, nls.localize('listMatchesShadow', 'Shadow color of the type filter widget in lists and trees.')); export const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hc: Color.white }, nls.localize('pickerGroupForeground', "Quick picker color for grouping labels.")); export const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hc: Color.white }, nls.localize('pickerGroupBorder', "Quick picker color for grouping borders.")); @@ -435,21 +439,6 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue, }; } -export function blend2(transparentColorValue: ColorValue, opaqueColorValue: ColorValue): ColorFunction { - return (theme) => { - let transparentColor = resolveColorValue(transparentColorValue, theme); - let opaqueColor = resolveColorValue(opaqueColorValue, theme); - if (transparentColor && opaqueColor) { - return opaqueColor.blend2(transparentColor); - } else if (transparentColor) { - return transparentColor; - } else if (opaqueColor) { - return opaqueColor; - } - return null; - }; -} - // ----- implementation /** diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index a1f3ee581d6..e96a4270c33 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, editorFindMatchHighlight, darken, editorWidgetBackground, blend2 } from 'vs/platform/theme/common/colorRegistry'; +import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listMatchesOutline, listNoMatchesOutline, listMatchesShadow, listMatchesBackground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; import { mixin } from 'vs/base/common/objects'; @@ -249,9 +249,10 @@ export const defaultListStyles: IColorMapping = { listFocusOutline: activeContrastBorder, listSelectionOutline: activeContrastBorder, listHoverOutline: activeContrastBorder, - listMatchesBackground: blend2(editorFindMatchHighlight, editorWidgetBackground), - listNoMatchesOutline: inputValidationWarningBorder, - listMatchesShadow: widgetShadow + listMatchesBackground, + listMatchesOutline, + listNoMatchesOutline, + listMatchesShadow }; export interface IButtonStyleOverrides extends IStyleOverrides { From 4aa8c83b545f6a5c08fac367eb213c37fcce6039 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 11:40:15 +0100 Subject: [PATCH 116/429] Clear out windows, linux and osx fields to not have cycles inside the properties object fixes #67532 --- src/vs/workbench/parts/debug/node/debugger.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/parts/debug/node/debugger.ts b/src/vs/workbench/parts/debug/node/debugger.ts index 3c99a7123f1..7d0d8bff16d 100644 --- a/src/vs/workbench/parts/debug/node/debugger.ts +++ b/src/vs/workbench/parts/debug/node/debugger.ts @@ -289,6 +289,10 @@ export class Debugger implements IDebugger { description: nls.localize('debugPostDebugTask', "Task to run after debug session ends.") }; properties['internalConsoleOptions'] = INTERNAL_CONSOLE_OPTIONS_SCHEMA; + // Clear out windows, linux and osx fields to not have cycles inside the properties object + properties['windows'] = undefined; + properties['osx'] = undefined; + properties['linux'] = undefined; const osProperties = objects.deepClone(properties); properties['windows'] = { From 84424c84fd56cd0825e3e4bf9d786dd1011516f1 Mon Sep 17 00:00:00 2001 From: Thai Pangsakulyanont Date: Wed, 30 Jan 2019 17:46:45 +0700 Subject: [PATCH 117/429] Use jsonc parser to parse a config file This fixes a problem where the `typescript` VSCode task runs `tsc` with `-p` when it should run `-b` when `tsconfig.json` has the `"references"` property. ```js { "extends": "./tsconfig.app.json", // meow "references": [{ "path": "./tsconfig.lib.json" }] } ``` This bug happens because while `tsconfig.json` file allows comment, the parsing logic here uses vanilla `JSON.parse` which cannot parse comments. This commit fixes it by using `jsonc.parse` instead. --- extensions/typescript-language-features/src/features/task.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/task.ts b/extensions/typescript-language-features/src/features/task.ts index 550921e1488..1b1d4d3bded 100644 --- a/extensions/typescript-language-features/src/features/task.ts +++ b/extensions/typescript-language-features/src/features/task.ts @@ -7,6 +7,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as vscode from 'vscode'; import * as nls from 'vscode-nls'; +import * as jsonc from 'jsonc-parser'; import { ITypeScriptServiceClient } from '../typescriptService'; import { Lazy } from '../utils/lazy'; import { isImplicitProjectConfigFile } from '../utils/tsconfig'; @@ -217,7 +218,7 @@ class TscTaskProvider implements vscode.TaskProvider { } try { - const tsconfig = JSON.parse(result.toString()); + const tsconfig = jsonc.parse(result.toString()); if (tsconfig.references) { return resolve(['-b', project.path]); } From 9338d14634c2f2fb93728531759706f85dc4f86c Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 30 Jan 2019 12:03:44 +0100 Subject: [PATCH 118/429] Fix #66931 --- .../electron-browser/extensionsActions.ts | 49 ++++++++++++++----- .../media/extensionActions.css | 13 +++-- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 69866708e18..675cf034634 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -1012,16 +1012,18 @@ export class ReloadAction extends ExtensionAction { if (runningExtension) { const isDifferentVersionRunning = this.extension.version !== runningExtension.version; if (isDifferentVersionRunning && !isDisabled) { - // Requires reload to run the updated extension - this.enabled = true; - this.label = localize('reloadToUpdateAction', "Reload to Update"); - this.tooltip = localize('postUpdateTooltip', "Please reload Visual Studio Code to complete the updating of this extension."); + if (!(this.extension.local && this.extensionService.canAddExtension(toExtensionDescription(this.extension.local)))) { + // Requires reload to run the updated extension + this.enabled = true; + this.label = localize('reloadRequired', "Reload Required"); + this.tooltip = localize('postUpdateTooltip', "Please reload Visual Studio Code to complete the updating of this extension."); + } return; } if (isDisabled) { // Requires reload to disable the extension this.enabled = true; - this.label = localize('reloadToDisable', "Reload to Disable"); + this.label = localize('reloadRequired', "Reload Required"); this.tooltip = localize('postDisableTooltip', "Please reload Visual Studio Code to complete the disabling of this extension."); return; } @@ -1029,10 +1031,10 @@ export class ReloadAction extends ExtensionAction { if (!isDisabled && !(this.extension.local && this.extensionService.canAddExtension(toExtensionDescription(this.extension.local)))) { this.enabled = true; if (isEnabled) { - this.label = localize('reloadToEnable', "Reload to Enable"); + this.label = localize('reloadRequired', "Reload Required"); this.tooltip = localize('postEnableTooltip', "Please reload Visual Studio Code to complete the enabling of this extension."); } else { - this.label = localize('reloadToInstall', "Reload to Install"); + this.label = localize('reloadRequired', "Reload Required"); this.tooltip = localize('postInstallTooltip', "Please reload Visual Studio Code to complete the installation of this extension."); alert(localize('installExtensionComplete', "Installing extension {0} is completed. Please reload Visual Studio Code to enable it.", this.extension.displayName)); } @@ -1044,7 +1046,7 @@ export class ReloadAction extends ExtensionAction { if (isUninstalled && runningExtension) { // Requires reload to deactivate the extension this.enabled = true; - this.label = localize('reloadToUninstall', "Reload to Uninstall"); + this.label = localize('reloadRequired', "Reload Required"); this.tooltip = localize('postUninstallTooltip', "Please reload Visual Studio Code to complete the uninstallation of this extension."); alert(localize('uninstallExtensionComplete', "Please reload Visual Studio Code to complete the uninstallation of the extension {0}.", this.extension.displayName)); return; @@ -2055,6 +2057,7 @@ export class StatusLabelAction extends Action implements IExtensionContainer { private status: ExtensionState | null = null; private enablementState: EnablementState | null = null; + private version: string | null = null; private _extension: IExtension; get extension(): IExtension { return this._extension; } @@ -2063,6 +2066,7 @@ export class StatusLabelAction extends Action implements IExtensionContainer { // Different extension. Reset this.status = null; this.enablementState = null; + this.version = null; } this._extension = extension; this.update(); @@ -2089,16 +2093,35 @@ export class StatusLabelAction extends Action implements IExtensionContainer { const currentStatus = this.status; const currentEnablementState = this.enablementState; + const currentVersion = this.version; this.status = this.extension.state; this.enablementState = this.extension.enablementState; + this.version = this.extension.version; const runningExtensions = await this.extensionService.getExtensions(); - const canAddExtension = () => this.extension.local && (runningExtensions.some(e => areSameExtensions({ id: e.identifier.value }, this.extension.identifier)) || this.extensionService.canAddExtension(toExtensionDescription(this.extension.local))); - const canRemoveExtension = () => this.extension.local && (runningExtensions.every(e => !areSameExtensions({ id: e.identifier.value }, this.extension.identifier)) || this.extensionService.canRemoveExtension(toExtensionDescription(this.extension.local))); + const canAddExtension = () => { + const runningExtension = runningExtensions.filter(e => areSameExtensions({ id: e.identifier.value }, this.extension.identifier))[0]; + if (this.extension.local) { + if (runningExtension && this.extension.version === runningExtension.version) { + return true; + } + return this.extensionService.canAddExtension(toExtensionDescription(this.extension.local)); + } + return false; + }; + const canRemoveExtension = () => { + if (this.extension.local) { + if (runningExtensions.every(e => !areSameExtensions({ id: e.identifier.value }, this.extension.identifier))) { + return true; + } + return this.extensionService.canRemoveExtension(toExtensionDescription(this.extension.local)); + } + return false; + }; if (currentStatus !== null) { if (currentStatus === ExtensionState.Installing && this.status === ExtensionState.Installed) { - return canAddExtension() ? localize('installed', "Installed") : null; + return canAddExtension() ? currentVersion !== this.version ? localize('updated', "Updated") : localize('installed', "Installed") : null; } if (currentStatus === ExtensionState.Uninstalling && this.status === ExtensionState.Uninstalled) { return canRemoveExtension() ? localize('uninstalled', "Uninstalled") : null; @@ -2587,13 +2610,17 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const extensionButtonProminentBackgroundColor = theme.getColor(extensionButtonProminentBackground); if (extensionButtonProminentBackground) { collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`); + collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-status-label { background-color: ${extensionButtonProminentBackgroundColor}; }`); collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`); + collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-status-label { background-color: ${extensionButtonProminentBackgroundColor}; }`); } const extensionButtonProminentForegroundColor = theme.getColor(extensionButtonProminentForeground); if (extensionButtonProminentForeground) { collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`); + collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-status-label { color: ${extensionButtonProminentForegroundColor}; }`); collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`); + collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-status-label { color: ${extensionButtonProminentForegroundColor}; }`); } const extensionButtonProminentHoverBackgroundColor = theme.getColor(extensionButtonProminentHoverBackground); diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css index 3f81cec95f9..fbfdba03550 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css @@ -39,19 +39,24 @@ display: none; } +.monaco-action-bar .action-item.disabled .action-label.extension-status-label:before { + content: '✓'; + padding-right: 4px; +} + .monaco-action-bar .action-item .action-label.disable-status, .monaco-action-bar .action-item .action-label.malicious-status, .monaco-action-bar .action-item.disabled .action-label.extension-status-label { - border-radius: 4px; - color: inherit; - background-color: transparent; opacity: 0.9; - padding: 0 5px; line-height: initial; + border-radius: 4px; + padding: 0 5px; } .monaco-action-bar .action-item .action-label.disable-status, .monaco-action-bar .action-item .action-label.malicious-status { + color: inherit; + background-color: transparent; font-style: italic; } From f6a0f99be8d4c666b5be2904aad883a522cb2e48 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 30 Jan 2019 12:09:00 +0100 Subject: [PATCH 119/429] revert finally -> always --- .../node/extensionManagementService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index ab6982abed3..eec60635669 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -24,7 +24,7 @@ import { import { areSameExtensions, getGalleryExtensionId, groupByExtension, getMaliciousExtensionsSet, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { localizeManifest } from '../common/extensionNls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { Limiter, createCancelablePromise, CancelablePromise, Queue } from 'vs/base/common/async'; +import { Limiter, always, createCancelablePromise, CancelablePromise, Queue } from 'vs/base/common/async'; import { Event, Emitter } from 'vs/base/common/event'; import * as semver from 'semver'; import { URI } from 'vs/base/common/uri'; @@ -306,7 +306,7 @@ export class ExtensionManagementService extends Disposable implements IExtension this.downloadInstallableExtension(extension, operation) .then(installableExtension => this.installExtension(installableExtension, ExtensionType.User, cancellationToken) - .then(local => pfs.rimraf(installableExtension.zipPath).finally(() => null).then(() => local))) + .then(local => always(pfs.rimraf(installableExtension.zipPath), () => null).then(() => local))) .then(local => this.installDependenciesAndPackExtensions(local, existingExtension) .then(() => local, error => this.uninstall(local, true).then(() => Promise.reject(error), () => Promise.reject(error)))) .then( @@ -464,7 +464,7 @@ export class ExtensionManagementService extends Disposable implements IExtension () => this.logService.info('Renamed to', renamePath), e => { this.logService.info('Rename failed. Deleting from extracted location', extractPath); - return pfs.rimraf(extractPath).finally(() => null).then(() => Promise.reject(e)); + return always(pfs.rimraf(extractPath), () => null).then(() => Promise.reject(e)); })); } @@ -475,7 +475,7 @@ export class ExtensionManagementService extends Disposable implements IExtension () => extract(zipPath, extractPath, { sourcePath: 'extension', overwrite: true }, this.logService, token) .then( () => this.logService.info(`Extracted extension to ${extractPath}:`, identifier.id), - e => pfs.rimraf(extractPath).finally(() => null) + e => always(pfs.rimraf(extractPath), () => null) .then(() => Promise.reject(new ExtensionManagementError(e.message, e instanceof ExtractError && e.type ? e.type : INSTALL_ERROR_EXTRACTING)))), e => Promise.reject(new ExtensionManagementError(this.joinErrors(e).message, INSTALL_ERROR_DELETING))); } From 6c2d081690a145ba06824526786e075292534ad4 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 12:14:18 +0100 Subject: [PATCH 120/429] fixes #67538 --- .../parts/files/electron-browser/views/explorerViewer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index e9f412f022b..ae2ded7dbc3 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -470,7 +470,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { if (!target) { // Droping onto the empty area. Do not accept if items dragged are already children of the root - if (items.every(i => i.parent.isRoot)) { + if (items.every(i => i.parent && i.parent.isRoot)) { return false; } From b1f4f266fa7b03bfc4c523eb69af2ce8beab955c Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 12:25:25 +0100 Subject: [PATCH 121/429] explorer: We did a top level refresh, reveal the active file fixes #67118 --- .../electron-browser/views/explorerView.ts | 34 +++++++++++-------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 67b3aa76db8..ac741dd597f 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -193,13 +193,8 @@ export class ExplorerView extends ViewletPanel { // When the explorer viewer is loaded, listen to changes to the editor input this.disposables.push(this.editorService.onDidActiveEditorChange(() => { - if (this.autoReveal && !this.ignoreActiveEditorChange) { - const activeFile = this.getActiveFile(); - if (activeFile) { - this.explorerService.select(this.getActiveFile()); - } else { - this.tree.setSelection([]); - } + if (!this.ignoreActiveEditorChange) { + this.selectActiveFile(); } })); @@ -214,12 +209,7 @@ export class ExplorerView extends ViewletPanel { await this.setTreeInput(); } // Find resource to focus from active editor input if set - if (this.autoReveal) { - const activeFile = this.getActiveFile(); - if (activeFile) { - this.explorerService.select(activeFile, true); - } - } + this.selectActiveFile(true); } })); } @@ -243,6 +233,17 @@ export class ExplorerView extends ViewletPanel { this.tree.domFocus(); } + private selectActiveFile(reveal?: boolean): void { + if (this.autoReveal) { + const activeFile = this.getActiveFile(); + if (activeFile) { + this.explorerService.select(this.getActiveFile(), reveal); + } else { + this.tree.setSelection([]); + } + } + } + private createTree(container: HTMLElement): void { this.filter = this.instantiationService.createInstance(FilesFilter); this.disposables.push(this.filter); @@ -406,7 +407,12 @@ export class ExplorerView extends ViewletPanel { const recursive = !item; const toRefresh = item || this.tree.getInput(); - return this.tree.updateChildren(toRefresh, recursive); + return this.tree.updateChildren(toRefresh, recursive).then(() => { + if (!item) { + // We did a top level refresh, reveal the active file #67118 + this.selectActiveFile(true); + } + }); } getOptimalWidth(): number { From 6544b17b495645f2d6391c1b84d65f8d52e9d6b9 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 12:32:15 +0100 Subject: [PATCH 122/429] fix #67353 --- src/vs/editor/contrib/smartSelect/smartSelect.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/contrib/smartSelect/smartSelect.ts b/src/vs/editor/contrib/smartSelect/smartSelect.ts index 73878ae4990..cc62d7b0016 100644 --- a/src/vs/editor/contrib/smartSelect/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/smartSelect.ts @@ -20,6 +20,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/wordSelections'; import { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/bracketSelections'; +import { CommandsRegistry } from 'vs/platform/commands/common/commands'; class SelectionRanges { @@ -153,9 +154,9 @@ abstract class AbstractSmartSelect extends EditorAction { class GrowSelectionAction extends AbstractSmartSelect { constructor() { super(true, { - id: 'editor.action.smartSelect.grow', - label: nls.localize('smartSelect.grow', "Expand Select"), - alias: 'Expand Select', + id: 'editor.action.smartSelect.expand', + label: nls.localize('smartSelect.expand', "Expand Selection"), + alias: 'Expand Selection', precondition: null, kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, @@ -173,12 +174,15 @@ class GrowSelectionAction extends AbstractSmartSelect { } } +// renamed command id +CommandsRegistry.registerCommandAlias('editor.action.smartSelect.grow', 'editor.action.smartSelect.expand'); + class ShrinkSelectionAction extends AbstractSmartSelect { constructor() { super(false, { id: 'editor.action.smartSelect.shrink', - label: nls.localize('smartSelect.shrink', "Shrink Select"), - alias: 'Shrink Select', + label: nls.localize('smartSelect.shrink', "Shrink Selection"), + alias: 'Shrink Selection', precondition: null, kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, From da79ab785b7487ecba564f1b3502c6f060acc440 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 12:36:29 +0100 Subject: [PATCH 123/429] fix #67478 --- .../browser/parts/editor/media/notabstitlecontrol.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css index 4c96ebbc1f1..066987b790b 100644 --- a/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css +++ b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css @@ -61,8 +61,7 @@ .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item.root_folder::before, .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item.root_folder + .monaco-breadcrumb-item::before, .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control.relative-path .monaco-breadcrumb-item:nth-child(2)::before, -.windows > .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item:nth-child(2)::before, -{ +.windows > .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item:nth-child(2)::before { /* workspace folder, item following workspace folder, or relative path -> hide first seperator */ display: none; } From 19d2f2195014ba46a1cfa26b76fdb7820391c9f5 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 12:42:03 +0100 Subject: [PATCH 124/429] enforce that uri have scheme, #67373 --- src/vs/workbench/api/node/extHostWindow.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostWindow.ts b/src/vs/workbench/api/node/extHostWindow.ts index 244dd5675f5..87256bdd78e 100644 --- a/src/vs/workbench/api/node/extHostWindow.ts +++ b/src/vs/workbench/api/node/extHostWindow.ts @@ -8,6 +8,7 @@ import { ExtHostWindowShape, MainContext, MainThreadWindowShape, IMainContext } import { WindowState } from 'vscode'; import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; +import { isFalsyOrWhitespace } from 'vs/base/common/strings'; export class ExtHostWindow implements ExtHostWindowShape { @@ -38,7 +39,9 @@ export class ExtHostWindow implements ExtHostWindowShape { } openUri(uri: URI): Promise { - if (uri.scheme === Schemas.command) { + if (isFalsyOrWhitespace(uri.scheme)) { + return Promise.reject('Invalid scheme - cannot be empty'); + } else if (uri.scheme === Schemas.command) { return Promise.reject(`Invalid scheme '${uri.scheme}'`); } return this._proxy.$openUri(uri); From 6a914669c1fc8db7eac3c0dbcc845dc37c848419 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 12:51:33 +0100 Subject: [PATCH 125/429] increase opacity to 0.5 for cut items fixes #67436 --- .../parts/files/electron-browser/media/explorerviewlet.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/files/electron-browser/media/explorerviewlet.css b/src/vs/workbench/parts/files/electron-browser/media/explorerviewlet.css index 746324d6769..e993c16c5ff 100644 --- a/src/vs/workbench/parts/files/electron-browser/media/explorerviewlet.css +++ b/src/vs/workbench/parts/files/electron-browser/media/explorerviewlet.css @@ -48,7 +48,7 @@ } .explorer-viewlet .explorer-item.cut { - opacity: 0.3; + opacity: 0.5; } .explorer-viewlet .explorer-item.explorer-item-edited .label-name { From 707ac5ab2a8a578bd8a5122db950091884d625ed Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 14:22:23 +0100 Subject: [PATCH 126/429] fixes #67348 fixes #67345 --- .../parts/files/electron-browser/fileActions.ts | 11 ++++++----- .../files/electron-browser/views/explorerViewer.ts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.ts index 3c64e250710..0b22d39d37d 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.ts @@ -45,6 +45,7 @@ import { coalesce } from 'vs/base/common/arrays'; import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree'; import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; import { onUnexpectedError } from 'vs/base/common/errors'; +import { sequence } from 'vs/base/common/async'; export const NEW_FILE_COMMAND_ID = 'explorer.newFile'; export const NEW_FILE_LABEL = nls.localize('newFile', "New File"); @@ -469,7 +470,7 @@ class PasteFileAction extends BaseErrorReportingAction { target = this.element.isDirectory ? this.element : this.element.parent; } - const targetFile = findValidPasteFileTarget(target, { resource: fileToPaste, isDirectory: fileToPasteStat.isDirectory }); + const targetFile = findValidPasteFileTarget(target, { resource: fileToPaste, isDirectory: fileToPasteStat.isDirectory, allowOverwirte: pasteShouldMove }); // Copy File const promise = pasteShouldMove ? this.fileService.moveFile(fileToPaste, targetFile) : this.fileService.copyFile(fileToPaste, targetFile); @@ -490,11 +491,11 @@ class PasteFileAction extends BaseErrorReportingAction { } } -export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste: { resource: URI, isDirectory?: boolean }): URI { +export function findValidPasteFileTarget(targetFolder: ExplorerItem, fileToPaste: { resource: URI, isDirectory?: boolean, allowOverwirte: boolean }): URI { let name = resources.basenameOrAuthority(fileToPaste.resource); let candidate = resources.joinPath(targetFolder.resource, name); - while (true) { + while (true && !fileToPaste.allowOverwirte) { if (!targetFolder.root.find(candidate)) { break; } @@ -1126,8 +1127,8 @@ export const pasteFileHandler = (accessor: ServicesAccessor) => { const clipboardService = accessor.get(IClipboardService); const explorerContext = getContext(listService.lastFocusedList); - return Promise.all(resources.distinctParents(clipboardService.readResources(), r => r).map(toCopy => { + return sequence(resources.distinctParents(clipboardService.readResources(), r => r).map(toCopy => { const pasteFileAction = instantationService.createInstance(PasteFileAction, explorerContext.stat); - return pasteFileAction.run(toCopy); + return () => pasteFileAction.run(toCopy); })); }; diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index ae2ded7dbc3..cc0e63da297 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -769,7 +769,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { // Reuse duplicate action if user copies if (isCopy) { - return this.fileService.copyFile(source.resource, findValidPasteFileTarget(target, { resource: source.resource, isDirectory: source.isDirectory })).then(stat => { + return this.fileService.copyFile(source.resource, findValidPasteFileTarget(target, { resource: source.resource, isDirectory: source.isDirectory, allowOverwirte: false })).then(stat => { if (!stat.isDirectory) { return this.editorService.openEditor({ resource: stat.resource, options: { pinned: true } }).then(() => undefined); } From c1ae93ef0acef242b04618227b217519142430a3 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 14:45:58 +0100 Subject: [PATCH 127/429] Tree: ctrl/shift+click should not expand fixes #67539 --- src/vs/base/browser/ui/tree/abstractTree.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 921d5101b44..e4a366569f7 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/tree'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IListOptions, List, IListStyles, mightProducePrintableCharacter } from 'vs/base/browser/ui/list/listWidget'; +import { IListOptions, List, IListStyles, mightProducePrintableCharacter, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass } from 'vs/base/browser/dom'; import { Event, Relay, Emitter } from 'vs/base/common/event'; @@ -915,6 +915,9 @@ export abstract class AbstractTree implements IDisposable if (!node) { return; } + if (isSelectionRangeChangeEvent(e) || isSelectionSingleChangeEvent(e)) { + return; + } const location = this.model.getNodeLocation(node); const recursive = e.browserEvent.altKey; From 4d57e22acdeddb1e3650f15aa0a429150b9b325a Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 14:51:38 +0100 Subject: [PATCH 128/429] fix #67504 --- src/vs/platform/actions/common/actions.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 6632fd1841a..6c8df2fabcd 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -133,15 +133,20 @@ export interface ICommandsMap { export const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry { private readonly _commands: { [id: string]: ICommandAction } = Object.create(null); - private readonly _menuItems: { [loc: string]: Array } = Object.create(null); + private readonly _menuItems: { [loc: number]: Array } = Object.create(null); private readonly _onDidChangeMenu = new Emitter(); readonly onDidChangeMenu: Event = this._onDidChangeMenu.event; addCommand(command: ICommandAction): IDisposable { this._commands[command.id] = command; + this._onDidChangeMenu.fire(MenuId.CommandPalette); return { - dispose: () => delete this._commands[command.id] + dispose: () => { + if (delete this._commands[command.id]) { + this._onDidChangeMenu.fire(MenuId.CommandPalette); + } + } }; } @@ -177,7 +182,7 @@ export const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry { } getMenuItems(id: MenuId): Array { - const result = this._menuItems[id] || []; + const result = this._menuItems[id].slice(0) || []; if (id === MenuId.CommandPalette) { // CommandPalette is special because it shows From fd4f54ee3683a91b3babc7a67b82d79c5b23f509 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 15:04:03 +0100 Subject: [PATCH 129/429] Revert "fixes #67041" This reverts commit 389e4283c0b3839aa3717346d745cd85cfd8efa3. --- .../electron-browser/views/openEditorsView.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index 06474606ccd..398894eee0a 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -146,11 +146,8 @@ export class OpenEditorsView extends ViewletPanel { break; } case GroupChangeKind.EDITOR_OPEN: { - setTimeout(() => { - this.list.splice(index, 0, [new OpenEditor(e.editor, group)]); - this.updateSize(); - this.focusActiveEditor(); - }, this.structuralRefreshDelay); + this.list.splice(index, 0, [new OpenEditor(e.editor, group)]); + setTimeout(() => this.updateSize(), this.structuralRefreshDelay); break; } case GroupChangeKind.EDITOR_CLOSE: { @@ -398,11 +395,9 @@ export class OpenEditorsView extends ViewletPanel { private focusActiveEditor(): void { if (this.list.length && this.editorGroupService.activeGroup) { const index = this.getIndex(this.editorGroupService.activeGroup, this.editorGroupService.activeGroup.activeEditor); - if (index < this.list.length) { - this.list.setFocus([index]); - this.list.setSelection([index]); - this.list.reveal(index); - } + this.list.setFocus([index]); + this.list.setSelection([index]); + this.list.reveal(index); } else { this.list.setFocus([]); this.list.setSelection([]); From f62961367f3e8125fa38189e381007fa4f572a20 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 30 Jan 2019 15:04:58 +0100 Subject: [PATCH 130/429] fix #66678 --- src/vs/base/browser/ui/tree/abstractTree.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index e4a366569f7..baf6d4ba919 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -691,6 +691,7 @@ export abstract class AbstractTree implements IDisposable this.model = this.createModel(this.view, _options); onDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState; + this.view.onTap(this.reactOnMouseClick, this, this.disposables); this.view.onMouseClick(this.reactOnMouseClick, this, this.disposables); if (_options.keyboardSupport !== false) { From 6d2dd05f91cc23ae05e5e26dc5b0a9eee4e2da4c Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 14:35:02 +0100 Subject: [PATCH 131/429] missing dispose call in explorer viewer --- .../parts/files/electron-browser/views/explorerViewer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index cc0e63da297..fe5b0957b70 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -247,7 +247,7 @@ export class FilesRenderer implements ITreeRenderer, index: number, templateData: IFileTemplateData): void { - // noop + templateData.elementDisposable.dispose(); } disposeTemplate(templateData: IFileTemplateData): void { From b1d8e8dca9116f60e32e60539aba615f207eb129 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 15:13:17 +0100 Subject: [PATCH 132/429] refactor async data tree to render less fixes #66659 --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 275 ++++++++++--------- src/vs/base/browser/ui/tree/media/tree.css | 1 + 2 files changed, 153 insertions(+), 123 deletions(-) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index c4ea62fed4a..bfcb32022e6 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -11,18 +11,16 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { Emitter, Event } from 'vs/base/common/event'; import { timeout, always, CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; import { IListStyles } from 'vs/base/browser/ui/list/listWidget'; -import { toggleClass } from 'vs/base/browser/dom'; import { Iterator } from 'vs/base/common/iterator'; import { IDragAndDropData } from 'vs/base/browser/dnd'; import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; import { isPromiseCanceledError } from 'vs/base/common/errors'; +import { toggleClass } from 'vs/base/browser/dom'; -enum AsyncDataTreeNodeState { - Uninitialized, - Loaded, - Loading, - Slow, - Disposed +const enum AsyncDataTreeNodeState { + Uninitialized = 'uninitialized', + Loaded = 'loaded', + Loading = 'loading' } interface IAsyncDataTreeNode { @@ -31,6 +29,10 @@ interface IAsyncDataTreeNode { readonly children: IAsyncDataTreeNode[]; readonly id?: string | null; state: AsyncDataTreeNodeState; + hasChildren: boolean; + needsRefresh: boolean; + slow: boolean; + disposed: boolean; } function isAncestor(ancestor: IAsyncDataTreeNode, descendant: IAsyncDataTreeNode): boolean { @@ -88,7 +90,7 @@ class DataTreeRenderer implements ITreeRe } renderTwistie(element: IAsyncDataTreeNode, twistieElement: HTMLElement): boolean { - toggleClass(twistieElement, 'loading', element.state === AsyncDataTreeNodeState.Slow); + toggleClass(twistieElement, 'loading', element.slow); return false; } @@ -221,10 +223,18 @@ function asObjectTreeOptions(options?: IAsyncDataTreeOpt }; } -function asTreeElement(node: IAsyncDataTreeNode): ITreeElement> { +function asTreeElement(node: IAsyncDataTreeNode, viewStateContext?: IAsyncDataTreeViewStateContext): ITreeElement> { + let collapsed: boolean | undefined; + + if (viewStateContext && node.id) { + collapsed = viewStateContext.viewState.expanded.indexOf(node.id) === -1; + } + return { element: node, - children: Iterator.map(Iterator.fromArray(node.children), asTreeElement) + children: Iterator.map(Iterator.fromArray(node.children), child => asTreeElement(child, viewStateContext)), + collapsible: node.hasChildren, + collapsed }; } @@ -252,14 +262,16 @@ export class AsyncDataTree implements IDisposable private readonly tree: ObjectTree, TFilterData>; private readonly root: IAsyncDataTreeNode; - private readonly nodes = new Map>(); - private readonly currentRefreshCalls = new Map, Promise>(); + private readonly renderedNodes = new Map>(); + private readonly subTreeRefreshPromises = new Map, Promise>(); private readonly refreshPromises = new Map, CancelablePromise>(); + private readonly identityProvider?: IIdentityProvider; private readonly autoExpandSingleChildren: boolean; - private readonly _onDidChangeNodeState = new Emitter>(); + private readonly _onDidRender = new Emitter(); + private readonly _onDidChangeNodeSlowState = new Emitter>(); protected readonly disposables: IDisposable[] = []; @@ -288,7 +300,7 @@ export class AsyncDataTree implements IDisposable this.autoExpandSingleChildren = typeof options.autoExpandSingleChildren === 'undefined' ? false : options.autoExpandSingleChildren; const objectTreeDelegate = new ComposedTreeDelegate>(delegate); - const objectTreeRenderers = renderers.map(r => new DataTreeRenderer(r, this._onDidChangeNodeState.event)); + const objectTreeRenderers = renderers.map(r => new DataTreeRenderer(r, this._onDidChangeNodeSlowState.event)); const objectTreeOptions = asObjectTreeOptions(options) || {}; this.tree = new ObjectTree(container, objectTreeDelegate, objectTreeRenderers, objectTreeOptions); @@ -298,6 +310,10 @@ export class AsyncDataTree implements IDisposable parent: null, children: [], state: AsyncDataTreeNodeState.Uninitialized, + hasChildren: true, + needsRefresh: false, + disposed: false, + slow: false }; if (this.identityProvider) { @@ -307,7 +323,7 @@ export class AsyncDataTree implements IDisposable }; } - this.nodes.set(null, this.root); + this.renderedNodes.set(null, this.root); this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables); } @@ -380,12 +396,12 @@ export class AsyncDataTree implements IDisposable } } - updateChildren(element: TInput | T = this.root.element, recursive = true, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { + async updateChildren(element: TInput | T = this.root.element, recursive = true, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { if (typeof this.root.element === 'undefined') { throw new Error('Tree input not set'); } - return this.refreshNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh, viewStateContext); + await this.refreshAndRenderNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh, viewStateContext); } // View @@ -423,7 +439,8 @@ export class AsyncDataTree implements IDisposable const result = this.tree.expand(node === this.root ? null : node, recursive); if (node.state === AsyncDataTreeNodeState.Loading) { - await this.currentRefreshCalls.get(node)!; + await this.subTreeRefreshPromises.get(node)!; + await Event.toPromise(this._onDidRender.event); } return result; @@ -532,7 +549,7 @@ export class AsyncDataTree implements IDisposable // Implementation private getDataNode(element: TInput | T): IAsyncDataTreeNode { - const node: IAsyncDataTreeNode | undefined = this.nodes.get((element === this.root.element ? null : element) as T); + const node: IAsyncDataTreeNode | undefined = this.renderedNodes.get((element === this.root.element ? null : element) as T); if (!node) { throw new Error(`Data tree node not found: ${element}`); @@ -541,25 +558,31 @@ export class AsyncDataTree implements IDisposable return node; } - private async refreshNode(node: IAsyncDataTreeNode, recursive: boolean, reason: ChildrenResolutionReason, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { - await this.queueRefresh(node, recursive, reason, viewStateContext); + private async refreshAndRenderNode(node: IAsyncDataTreeNode, recursive: boolean, reason: ChildrenResolutionReason, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { + await this.refreshNode(node, recursive, viewStateContext); + this.render(node, viewStateContext); - if (recursive) { - await Promise.all(node.children.map(child => this.refreshNode(child, recursive, reason, viewStateContext))); + if (node !== this.root && this.autoExpandSingleChildren && reason === ChildrenResolutionReason.Expand) { + const treeNode = this.tree.getNode(node); + const visibleChildren = treeNode.children.filter(node => node.visible); + + if (visibleChildren.length === 1) { + await this.tree.expand(visibleChildren[0].element, false); + } } } - private async queueRefresh(node: IAsyncDataTreeNode, recursive: boolean, reason: ChildrenResolutionReason, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { - if (node.state === AsyncDataTreeNodeState.Disposed) { + private async refreshNode(node: IAsyncDataTreeNode, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { + if (node.disposed) { console.error('Async data tree node is disposed'); return; } let result: Promise | undefined; - this.currentRefreshCalls.forEach((refreshPromise, refreshNode) => { + this.subTreeRefreshPromises.forEach((refreshPromise, refreshNode) => { if (!result && intersects(refreshNode, node)) { - result = refreshPromise.then(() => this.queueRefresh(node, recursive, reason, viewStateContext)); + result = refreshPromise.then(() => this.refreshNode(node, recursive, viewStateContext)); } }); @@ -567,65 +590,85 @@ export class AsyncDataTree implements IDisposable return result; } - result = this.doRefresh(node, recursive, reason, viewStateContext); - - this.currentRefreshCalls.set(node, result); - return always(result, () => this.currentRefreshCalls.delete(node)); - } - - private async doRefresh(node: IAsyncDataTreeNode, recursive: boolean, reason: ChildrenResolutionReason, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { - const hasChildren = !!this.dataSource.hasChildren(node.element!); - - if (!hasChildren) { - this.setChildren(node, [], recursive, viewStateContext); - return; - } - - if (node !== this.root && (!this.tree.isCollapsible(node) || this.tree.isCollapsed(node))) { - node.state = AsyncDataTreeNodeState.Uninitialized; - return; - } - - node.state = AsyncDataTreeNodeState.Loading; - this._onDidChangeNodeState.fire(node); - - const slowTimeout = timeout(800); - - slowTimeout.then(() => { - node.state = AsyncDataTreeNodeState.Slow; - this._onDidChangeNodeState.fire(node); - }, _ => null); + result = this.doRefreshSubTree(node, recursive, viewStateContext); + this.subTreeRefreshPromises.set(node, result); try { - const children = await this.doGetChildren(node); - slowTimeout.cancel(); - node.state = AsyncDataTreeNodeState.Loaded; - this._onDidChangeNodeState.fire(node); + await result; + } finally { + this.subTreeRefreshPromises.delete(node); + } + } - this.setChildren(node, children, recursive, viewStateContext); + private async doRefreshSubTree(node: IAsyncDataTreeNode, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { + node.state = AsyncDataTreeNodeState.Loading; - if (node !== this.root && this.autoExpandSingleChildren && reason === ChildrenResolutionReason.Expand) { - const treeNode = this.tree.getNode(node); - const visibleChildren = treeNode.children.filter(node => node.visible); + try { + await this.doRefreshNode(node, recursive, viewStateContext); - if (visibleChildren.length === 1) { - this.tree.expand(visibleChildren[0].element, false); - } + if (recursive) { + const childrenToRefresh = node.children + .filter(child => { + if (child.needsRefresh) { + child.needsRefresh = false; + return true; + } + + // TODO@joao: is this still needed? + if (child.hasChildren && child.state === AsyncDataTreeNodeState.Loaded) { + return true; + } + + if (!viewStateContext || !child.id) { + return false; + } + + return viewStateContext.viewState.expanded.indexOf(child.id) > -1; + }); + + await Promise.all(childrenToRefresh.map(child => this.doRefreshSubTree(child, recursive, viewStateContext))); } + } finally { + node.state = AsyncDataTreeNodeState.Loaded; + } + } + + private async doRefreshNode(node: IAsyncDataTreeNode, recursive: boolean, viewStateContext?: IAsyncDataTreeViewStateContext): Promise { + node.hasChildren = !!this.dataSource.hasChildren(node.element!); + + let childrenPromise: Promise; + + if (!node.hasChildren) { + childrenPromise = Promise.resolve([]); + } else { + const slowTimeout = timeout(800); + + slowTimeout.then(() => { + node.slow = true; + this._onDidChangeNodeSlowState.fire(node); + }, _ => null); + + childrenPromise = always(this.doGetChildren(node), () => slowTimeout.cancel()); + } + + try { + const children = await childrenPromise; + this.setChildren(node, children, recursive, viewStateContext); } catch (err) { if (isPromiseCanceledError(err)) { return; } - slowTimeout.cancel(); - node.state = AsyncDataTreeNodeState.Uninitialized; - this._onDidChangeNodeState.fire(node); - if (node !== this.root) { this.tree.collapse(node === this.root ? null : node); } throw err; + } finally { + if (node.slow) { + node.slow = false; + this._onDidChangeNodeSlowState.fire(node); + } } } @@ -646,7 +689,7 @@ export class AsyncDataTree implements IDisposable if (deep) { this.collapse(node.element.element as T); } else { - this.refreshNode(node.element, false, ChildrenResolutionReason.Expand); + this.refreshAndRenderNode(node.element, false, ChildrenResolutionReason.Expand); } } } @@ -662,17 +705,19 @@ export class AsyncDataTree implements IDisposable } } - const children = childrenElements.map>>(element => { + const children = childrenElements.map>(element => { if (!this.identityProvider) { + const hasChildren = !!this.dataSource.hasChildren(element); + return { - element: { - element, - parent: node, - children: [], - state: AsyncDataTreeNodeState.Uninitialized - }, - collapsible: !!this.dataSource.hasChildren(element), - collapsed: true + element, + parent: node, + children: [], + state: AsyncDataTreeNodeState.Uninitialized, + hasChildren, + needsRefresh: false, + disposed: false, + slow: false }; } @@ -683,9 +728,13 @@ export class AsyncDataTree implements IDisposable const childAsyncDataTreeNode: IAsyncDataTreeNode = { element, parent: node, - id, children: [], - state: AsyncDataTreeNodeState.Uninitialized + id, + state: AsyncDataTreeNodeState.Uninitialized, + hasChildren: !!this.dataSource.hasChildren(element), + needsRefresh: false, + disposed: false, + slow: false }; if (viewStateContext) { @@ -698,69 +747,49 @@ export class AsyncDataTree implements IDisposable } } - return { - element: childAsyncDataTreeNode, - collapsible: !!this.dataSource.hasChildren(element), - collapsed: typeof viewStateContext === 'undefined' ? true : viewStateContext.viewState.expanded.indexOf(id) === -1 - }; + return childAsyncDataTreeNode; } asyncDataTreeNode.element = element; - const collapsible = !!this.dataSource.hasChildren(element); - const collapsed = !collapsible || this.tree.isCollapsed(asyncDataTreeNode === this.root ? null : asyncDataTreeNode); - - if (recursive) { - asyncDataTreeNode.state = AsyncDataTreeNodeState.Uninitialized; - - if (this.tree.isCollapsed(asyncDataTreeNode === this.root ? null : asyncDataTreeNode)) { - asyncDataTreeNode.children.length = 0; - - return { - element: asyncDataTreeNode, - collapsible, - collapsed - }; - } + if (asyncDataTreeNode.state === AsyncDataTreeNodeState.Loaded || asyncDataTreeNode.hasChildren !== !!this.dataSource.hasChildren(asyncDataTreeNode.element)) { + asyncDataTreeNode.needsRefresh = true; } - let children: Iterator>> | undefined = undefined; - - if (collapsible) { - children = Iterator.map(Iterator.fromArray(asyncDataTreeNode.children), asTreeElement); - } - - return { - element: asyncDataTreeNode, - children, - collapsible, - collapsed - }; + return asyncDataTreeNode; }); + // perf: if the node was and still is a leaf, avoid all these expensive no-ops + if (node.children.length === 0 && childrenElements.length === 0) { + return; + } + + node.children.splice(0, node.children.length, ...children); + } + + private render(node: IAsyncDataTreeNode, viewStateContext?: IAsyncDataTreeViewStateContext): void { const insertedElements = new Set(); const onDidCreateNode = (treeNode: ITreeNode, TFilterData>) => { if (treeNode.element.element) { insertedElements.add(treeNode.element.element as T); - this.nodes.set(treeNode.element.element as T, treeNode.element); + this.renderedNodes.set(treeNode.element.element as T, treeNode.element); } }; const onDidDeleteNode = (treeNode: ITreeNode, TFilterData>) => { if (treeNode.element.element) { if (!insertedElements.has(treeNode.element.element as T)) { - treeNode.element.state = AsyncDataTreeNodeState.Disposed; - this.nodes.delete(treeNode.element.element as T); + treeNode.element.disposed = true; + this.renderedNodes.delete(treeNode.element.element as T); } } }; - // perf: if the node was and still is a leaf, avoid all these expensive no-ops - if (node.children.length > 0 || children.length > 0) { - this.tree.setChildren(node === this.root ? null : node, children, onDidCreateNode, onDidDeleteNode); - node.children.splice(0, node.children.length, ...children.map(c => c.element)); - } + const children = node.children.map(c => asTreeElement(c, viewStateContext)); + this.tree.setChildren(node === this.root ? null : node, children, onDidCreateNode, onDidDeleteNode); + + this._onDidRender.fire(); } // view state @@ -781,7 +810,7 @@ export class AsyncDataTree implements IDisposable while (queue.length > 0) { const node = queue.shift()!; - if (node !== root && !node.collapsed) { + if (node !== root && node.collapsible && !node.collapsed) { expanded.push(getId(node.element!.element as T)); } diff --git a/src/vs/base/browser/ui/tree/media/tree.css b/src/vs/base/browser/ui/tree/media/tree.css index aa46437ecd7..4f86f971f97 100644 --- a/src/vs/base/browser/ui/tree/media/tree.css +++ b/src/vs/base/browser/ui/tree/media/tree.css @@ -57,6 +57,7 @@ .monaco-tl-twistie.loading { background-image: url("loading.svg"); + background-position: 0 center; } .vs-dark .monaco-tl-twistie.loading { From b10316e62f48da1c3689418ae24355a527829f03 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 15:22:45 +0100 Subject: [PATCH 133/429] slice the right array --- src/vs/platform/actions/common/actions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/actions/common/actions.ts b/src/vs/platform/actions/common/actions.ts index 6c8df2fabcd..c0b5b2f8879 100644 --- a/src/vs/platform/actions/common/actions.ts +++ b/src/vs/platform/actions/common/actions.ts @@ -182,7 +182,7 @@ export const MenuRegistry: IMenuRegistry = new class implements IMenuRegistry { } getMenuItems(id: MenuId): Array { - const result = this._menuItems[id].slice(0) || []; + const result = (this._menuItems[id] || []).slice(0); if (id === MenuId.CommandPalette) { // CommandPalette is special because it shows From cce8a050d2aeab05f38d19224147f4fd37e00e99 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 15:43:49 +0100 Subject: [PATCH 134/429] async data tree should prevent updateChildren, expand, before input is resolved --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index bfcb32022e6..2485cf1bd9e 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -401,6 +401,11 @@ export class AsyncDataTree implements IDisposable throw new Error('Tree input not set'); } + if (this.root.state === AsyncDataTreeNodeState.Loading) { + await this.subTreeRefreshPromises.get(this.root)!; + await Event.toPromise(this._onDidRender.event); + } + await this.refreshAndRenderNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh, viewStateContext); } @@ -430,6 +435,15 @@ export class AsyncDataTree implements IDisposable } async expand(element: T, recursive: boolean = false): Promise { + if (typeof this.root.element === 'undefined') { + throw new Error('Tree input not set'); + } + + if (this.root.state === AsyncDataTreeNodeState.Loading) { + await this.subTreeRefreshPromises.get(this.root)!; + await Event.toPromise(this._onDidRender.event); + } + const node = this.getDataNode(element); if (node !== this.root && node.state !== AsyncDataTreeNodeState.Loading && !this.tree.isCollapsed(node)) { From 6b5bed6a851386d53e5cca6b736088d22c6db7fb Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 15:51:07 +0100 Subject: [PATCH 135/429] fix #67495 --- .../smartSelect/test/smartSelect.test.ts | 33 +++++++++++++++++-- .../contrib/smartSelect/wordSelections.ts | 6 ++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts index 164a2314fed..99212b3b201 100644 --- a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts @@ -18,6 +18,7 @@ import { isLinux, isMacintosh } from 'vs/base/common/platform'; import { BracketSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/bracketSelections'; import { provideSelectionRanges } from 'vs/editor/contrib/smartSelect/smartSelect'; import { CancellationToken } from 'vs/base/common/cancellation'; +import { WordSelectionRangeProvider } from 'vs/editor/contrib/smartSelect/wordSelections'; class TestTextResourcePropertiesService implements ITextResourcePropertiesService { @@ -53,7 +54,8 @@ class MockJSMode extends MockMode { ['[', ']'] ], - onEnterRules: javascriptOnEnterRules + onEnterRules: javascriptOnEnterRules, + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g })); } } @@ -204,7 +206,7 @@ suite('SmartSelect', () => { assert.equal(expected.length, ranges!.length); for (const range of ranges!) { let exp = expected.shift() || null; - assert.ok(Range.equalsRange(range.range, exp), `A=${range} <> E=${exp}`); + assert.ok(Range.equalsRange(range.range, exp), `A=${range.range} <> E=${exp}`); } } @@ -253,4 +255,31 @@ suite('SmartSelect', () => { new Range(1, 1, 4, 2), new Range(1, 1, 4, 2), ); }); + + test('in-word ranges', async () => { + + await assertRanges(new WordSelectionRangeProvider(), 'fIooBar', + new Range(1, 1, 1, 5), // foo + new Range(1, 1, 1, 8), // fooBar + new Range(1, 1, 1, 8), // line (triva) + new Range(1, 1, 1, 8), // line + new Range(1, 1, 1, 8), // doc + ); + + await assertRanges(new WordSelectionRangeProvider(), 'fIoo_Ba', + new Range(1, 1, 1, 5), + new Range(1, 1, 1, 8), + new Range(1, 1, 1, 8), + new Range(1, 1, 1, 8), + new Range(1, 1, 1, 8), + ); + + await assertRanges(new WordSelectionRangeProvider(), 'fIoo-Ba', + new Range(1, 1, 1, 5), + new Range(1, 1, 1, 8), + new Range(1, 1, 1, 8), + new Range(1, 1, 1, 8), + new Range(1, 1, 1, 8), + ); + }); }); diff --git a/src/vs/editor/contrib/smartSelect/wordSelections.ts b/src/vs/editor/contrib/smartSelect/wordSelections.ts index efb30104bbc..512e0352654 100644 --- a/src/vs/editor/contrib/smartSelect/wordSelections.ts +++ b/src/vs/editor/contrib/smartSelect/wordSelections.ts @@ -42,6 +42,12 @@ export class WordSelectionRangeProvider implements SelectionRangeProvider { // ^^^^^^^ bucket.push({ range: new Range(pos.lineNumber, startColumn, pos.lineNumber, startColumn + offset), kind: 'statement.word.part' }); offset += 1; + } else if (ch === CharCode.Dash && lastCh !== CharCode.Dash) { + // foo-bar + // ^^^ + // ^^^^^^^ + bucket.push({ range: new Range(pos.lineNumber, startColumn, pos.lineNumber, startColumn + offset), kind: 'statement.word.part' }); + offset += 1; } lastCh = ch; } From 9606490e26f8cbe4d615305389d45e9b144ded7c Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 30 Jan 2019 15:55:26 +0100 Subject: [PATCH 136/429] fix #67245 (again) --- src/vs/platform/menubar/electron-main/menubar.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index 7bda195c819..7070576c1c1 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -708,16 +708,18 @@ export class Menubar { } if (activeWindow) { - if (invocation.type === 'commandId') { - this.windowsMainService.sendToFocused('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest); - } else { - if (isMacintosh && invocation.userSettingsLabel === 'alt+cmd+i' && !this.environmentService.isBuilt && !activeWindow.isReady) { + if (isMacintosh && !this.environmentService.isBuilt && !activeWindow.isReady) { + if ((invocation.type === 'commandId' && invocation.commandId === 'workbench.action.toggleDevTools') || (invocation.type !== 'commandId' && invocation.userSettingsLabel === 'alt+cmd+i')) { // prevent this action from running twice on macOS (https://github.com/Microsoft/vscode/issues/62719) // we already register a keybinding in bootstrap-window.js for opening developer tools in case something // goes wrong and that keybinding is only removed when the application has loaded (= window ready). return; } + } + if (invocation.type === 'commandId') { + this.windowsMainService.sendToFocused('vscode:runAction', { id: invocation.commandId, from: 'menu' } as IRunActionInWindowRequest); + } else { this.windowsMainService.sendToFocused('vscode:runKeybinding', { userSettingsLabel: invocation.userSettingsLabel } as IRunKeybindingInWindowRequest); } } From ab99f2ce88fa9388782413e34afc5dcc9dae3317 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 16:06:58 +0100 Subject: [PATCH 137/429] better fix for revealing active file after refresh --- .../parts/files/electron-browser/explorerService.ts | 9 ++++++++- .../parts/files/electron-browser/views/explorerView.ts | 7 +------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/parts/files/electron-browser/explorerService.ts index 8ac994aede6..0942fe7ad4b 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerService.ts @@ -17,6 +17,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IExpression } from 'vs/base/common/glob'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; function getFileEventsExcludes(configurationService: IConfigurationService, root?: URI): IExpression { const scope = root ? { resource: root } : undefined; @@ -45,7 +46,8 @@ export class ExplorerService implements IExplorerService { @IInstantiationService private instantiationService: IInstantiationService, @IConfigurationService private configurationService: IConfigurationService, @IWorkspaceContextService private contextService: IWorkspaceContextService, - @IClipboardService private clipboardService: IClipboardService + @IClipboardService private clipboardService: IClipboardService, + @IEditorService private editorService: IEditorService ) { } get roots(): ExplorerItem[] { @@ -158,6 +160,11 @@ export class ExplorerService implements IExplorerService { refresh(): void { this.model.roots.forEach(r => r.forgetChildren()); this._onDidChangeItem.fire(undefined); + const active = this.editorService.activeEditor; + if (active && active.getResource()) { + // We did a top level refresh, reveal the active file #67118 + this.select(active.getResource(), true); + } } // File events diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index ac741dd597f..9f4fcb57c13 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -407,12 +407,7 @@ export class ExplorerView extends ViewletPanel { const recursive = !item; const toRefresh = item || this.tree.getInput(); - return this.tree.updateChildren(toRefresh, recursive).then(() => { - if (!item) { - // We did a top level refresh, reveal the active file #67118 - this.selectActiveFile(true); - } - }); + return this.tree.updateChildren(toRefresh, recursive); } getOptimalWidth(): number { From f3c7479d6c881f3b2e1fe9d4e0d0b3d7f3b26c69 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 16:06:59 +0100 Subject: [PATCH 138/429] make word and bracket range provider default when no other providers exist, otherwise have word range provider only, #67490 --- src/vs/editor/contrib/smartSelect/smartSelect.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/smartSelect/smartSelect.ts b/src/vs/editor/contrib/smartSelect/smartSelect.ts index cc62d7b0016..e483cbbb30c 100644 --- a/src/vs/editor/contrib/smartSelect/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/smartSelect.ts @@ -204,13 +204,18 @@ registerEditorContribution(SmartSelectController); registerEditorAction(GrowSelectionAction); registerEditorAction(ShrinkSelectionAction); -modes.SelectionRangeRegistry.register('*', new WordSelectionRangeProvider()); -modes.SelectionRangeRegistry.register('*', new BracketSelectionRangeProvider()); - export function provideSelectionRanges(model: ITextModel, position: Position, token: CancellationToken): Promise { const provider = modes.SelectionRangeRegistry.orderedGroups(model); + if (provider.length === 0) { + // add word selection and bracket selection when no provider exists + provider.unshift([new WordSelectionRangeProvider(), new BracketSelectionRangeProvider()]); + } else { + // only word selections when other providers exist + provider.unshift([new WordSelectionRangeProvider()]); + } + interface RankedRange { rank: number; range: Range; From 00d1ec8778bd7fa6c5b4f49e4337516547deae78 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 16:13:23 +0100 Subject: [PATCH 139/429] fixes #65252 --- src/vs/platform/list/browser/listService.ts | 43 ++++++++++++++++--- .../parts/debug/browser/loadedScriptsView.ts | 2 +- .../debug/electron-browser/callStackView.ts | 2 +- .../electron-browser/views/explorerView.ts | 7 +++ .../markers/electron-browser/markersPanel.ts | 2 +- .../parts/search/browser/searchView.ts | 2 +- 6 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 515329e5de1..776395ccbcf 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -601,15 +601,14 @@ export interface IResourceResultsNavigationOptions { export class TreeResourceNavigator2 extends Disposable { - private readonly _openResource = new Emitter>(); - readonly openResource: Event> = this._openResource.event; + private readonly _onDidOpenResource = new Emitter>(); + readonly onDidOpenResource: Event> = this._onDidOpenResource.event; constructor( - private tree: WorkbenchObjectTree | WorkbenchAsyncDataTree, + private tree: WorkbenchObjectTree | WorkbenchDataTree | WorkbenchAsyncDataTree, private options?: IResourceResultsNavigationOptions ) { super(); - this.registerListeners(); } @@ -642,12 +641,15 @@ export class TreeResourceNavigator2 extends Disposable { } const isDoubleClick = e.browserEvent.detail === 2; - const sideBySide = e.browserEvent instanceof MouseEvent && (e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey); - this.open(!isDoubleClick, isDoubleClick, sideBySide); + + if (this.tree.openOnSingleClick || isDoubleClick) { + const sideBySide = e.browserEvent instanceof MouseEvent && (e.browserEvent.ctrlKey || e.browserEvent.metaKey || e.browserEvent.altKey); + this.open(!isDoubleClick, isDoubleClick, sideBySide); + } } private open(preserveFocus: boolean, pinned: boolean, sideBySide: boolean): void { - this._openResource.fire({ + this._onDidOpenResource.fire({ editorOptions: { preserveFocus, pinned, @@ -904,6 +906,7 @@ export class WorkbenchObjectTree, TFilterData = void> private hasDoubleSelection: IContextKey; private hasMultiSelection: IContextKey; + private _openOnSingleClick: boolean; private _useAltAsMultipleSelectionModifier: boolean; constructor( @@ -940,6 +943,7 @@ export class WorkbenchObjectTree, TFilterData = void> this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); + this._openOnSingleClick = useSingleClickToOpen(configurationService); this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); this.disposables.push( @@ -961,6 +965,9 @@ export class WorkbenchObjectTree, TFilterData = void> this.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); }), configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(openModeSettingKey)) { + this._openOnSingleClick = useSingleClickToOpen(configurationService); + } if (e.affectsConfiguration(multiSelectModifierSettingKey)) { this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); } @@ -979,6 +986,10 @@ export class WorkbenchObjectTree, TFilterData = void> ); } + get openOnSingleClick(): boolean { + return this._openOnSingleClick; + } + get useAltAsMultipleSelectionModifier(): boolean { return this._useAltAsMultipleSelectionModifier; } @@ -997,6 +1008,7 @@ export class WorkbenchDataTree extends DataTree; private hasMultiSelection: IContextKey; + private _openOnSingleClick: boolean; private _useAltAsMultipleSelectionModifier: boolean; constructor( @@ -1034,6 +1046,7 @@ export class WorkbenchDataTree extends DataTree extends DataTree 0 || focus.length > 0); }), configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(openModeSettingKey)) { + this._openOnSingleClick = useSingleClickToOpen(configurationService); + } if (e.affectsConfiguration(multiSelectModifierSettingKey)) { this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); } @@ -1073,6 +1089,10 @@ export class WorkbenchDataTree extends DataTree extends Async private hasDoubleSelection: IContextKey; private hasMultiSelection: IContextKey; + private _openOnSingleClick: boolean; private _useAltAsMultipleSelectionModifier: boolean; constructor( @@ -1123,6 +1144,7 @@ export class WorkbenchAsyncDataTree extends Async this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); + this._openOnSingleClick = useSingleClickToOpen(configurationService); this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); this.disposables.push( @@ -1144,6 +1166,9 @@ export class WorkbenchAsyncDataTree extends Async this.hasSelectionOrFocus.set(selection.length > 0 || focus.length > 0); }), configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(openModeSettingKey)) { + this._openOnSingleClick = useSingleClickToOpen(configurationService); + } if (e.affectsConfiguration(multiSelectModifierSettingKey)) { this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); } @@ -1162,6 +1187,10 @@ export class WorkbenchAsyncDataTree extends Async ); } + get openOnSingleClick(): boolean { + return this._openOnSingleClick; + } + get useAltAsMultipleSelectionModifier(): boolean { return this._useAltAsMultipleSelectionModifier; } diff --git a/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts b/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts index fabd77cd8c0..c59a90734ca 100644 --- a/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts @@ -429,7 +429,7 @@ export class LoadedScriptsView extends ViewletPanel { const loadedScriptsNavigator = new TreeResourceNavigator2(this.tree); this.disposables.push(loadedScriptsNavigator); - this.disposables.push(loadedScriptsNavigator.openResource(e => { + this.disposables.push(loadedScriptsNavigator.onDidOpenResource(e => { if (e.element instanceof BaseTreeItem) { const source = e.element.getSource(); if (source && source.available) { diff --git a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts index aef0de79a27..a4dfb9bea3c 100644 --- a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts @@ -149,7 +149,7 @@ export class CallStackView extends ViewletPanel { const callstackNavigator = new TreeResourceNavigator2(this.tree); this.disposables.push(callstackNavigator); - this.disposables.push(callstackNavigator.openResource(e => { + this.disposables.push(callstackNavigator.onDidOpenResource(e => { if (this.ignoreSelectionChangedEvent) { return; } diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 9f4fcb57c13..4f3b10f4513 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -289,6 +289,8 @@ export class ExplorerView extends ViewletPanel { this.rootContext.set(!stat || (stat && stat.isRoot)); })); + // TODO@Isidor: use TreeResourceNavigator2 just like search and listen to the `onDidOpenResource` instead + // Open when selecting via keyboard this.disposables.push(this.tree.onDidChangeSelection(e => { if (!e.browserEvent) { @@ -318,6 +320,11 @@ export class ExplorerView extends ViewletPanel { if (e.browserEvent instanceof MouseEvent) { isDoubleClick = e.browserEvent.detail === 2; + + if (!this.tree.openOnSingleClick && !isDoubleClick) { + return; + } + isMiddleClick = e.browserEvent.button === 1; sideBySide = this.tree.useAltAsMultipleSelectionModifier ? (e.browserEvent.ctrlKey || e.browserEvent.metaKey) : e.browserEvent.altKey; } diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts index 128c751cd08..c86ac4dca7c 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts @@ -354,7 +354,7 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { })); const markersNavigator = this._register(new TreeResourceNavigator2(this.tree, { openOnFocus: true })); - this._register(Event.debounce(markersNavigator.openResource, (last, event) => event, 75, true)(options => { + this._register(Event.debounce(markersNavigator.onDidOpenResource, (last, event) => event, 75, true)(options => { this.openFileAtElement(options.element, options.editorOptions.preserveFocus, options.sideBySide, options.editorOptions.pinned); })); this._register(this.tree.onDidChangeCollapseState(({ node }) => { diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index a6ef7c274c9..25a2ec1b093 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -638,7 +638,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); const resourceNavigator = this._register(new TreeResourceNavigator2(this.tree, { openOnFocus: true })); - this._register(Event.debounce(resourceNavigator.openResource, (last, event) => event, 75, true)(options => { + this._register(Event.debounce(resourceNavigator.onDidOpenResource, (last, event) => event, 75, true)(options => { if (options.element instanceof Match) { const selectedMatch: Match = options.element; if (this.currentSelectedFileMatch) { From 47bf2388965ae797a0b9556ffa90132dfdede1bc Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 16:19:10 +0100 Subject: [PATCH 140/429] better fix for #67495 --- src/vs/editor/contrib/smartSelect/smartSelect.ts | 10 +++++----- .../contrib/smartSelect/test/smartSelect.test.ts | 4 ++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/vs/editor/contrib/smartSelect/smartSelect.ts b/src/vs/editor/contrib/smartSelect/smartSelect.ts index e483cbbb30c..19ed2246954 100644 --- a/src/vs/editor/contrib/smartSelect/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/smartSelect.ts @@ -204,16 +204,16 @@ registerEditorContribution(SmartSelectController); registerEditorAction(GrowSelectionAction); registerEditorAction(ShrinkSelectionAction); +// word selection +modes.SelectionRangeRegistry.register('*', new WordSelectionRangeProvider()); + export function provideSelectionRanges(model: ITextModel, position: Position, token: CancellationToken): Promise { const provider = modes.SelectionRangeRegistry.orderedGroups(model); - if (provider.length === 0) { + if (provider.length === 1) { // add word selection and bracket selection when no provider exists - provider.unshift([new WordSelectionRangeProvider(), new BracketSelectionRangeProvider()]); - } else { - // only word selections when other providers exist - provider.unshift([new WordSelectionRangeProvider()]); + provider.unshift([new BracketSelectionRangeProvider()]); } interface RankedRange { diff --git a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts index 99212b3b201..efe1e8d2056 100644 --- a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts @@ -282,4 +282,8 @@ suite('SmartSelect', () => { new Range(1, 1, 1, 8), ); }); + + test('Default selection should select current word/hump first in camelCase #67493', function () { + + }); }); From c47ea5b61f70fd08f60e7a5b0d4229707aed00e3 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 16:36:53 +0100 Subject: [PATCH 141/429] fixes #67233 --- src/vs/base/browser/ui/tree/indexTreeModel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/tree/indexTreeModel.ts b/src/vs/base/browser/ui/tree/indexTreeModel.ts index 3df971f5b55..bea50064994 100644 --- a/src/vs/base/browser/ui/tree/indexTreeModel.ts +++ b/src/vs/base/browser/ui/tree/indexTreeModel.ts @@ -95,7 +95,7 @@ export class IndexTreeModel, TFilterData = voi throw new Error('Invalid tree location'); } - const { parentNode, listIndex, revealed } = this.getParentNodeWithListIndex(location); + const { parentNode, listIndex, revealed, visible } = this.getParentNodeWithListIndex(location); const treeListElementsToInsert: ITreeNode[] = []; const nodesToInsertIterator = Iterator.map(Iterator.from(toInsert), el => this.createTreeNode(el, parentNode, parentNode.visible ? TreeVisibility.Visible : TreeVisibility.Hidden, revealed, treeListElementsToInsert, onDidCreateNode)); @@ -110,7 +110,7 @@ export class IndexTreeModel, TFilterData = voi const lastIndex = location[location.length - 1]; const deletedNodes = parentNode.children.splice(lastIndex, deleteCount, ...nodesToInsert); - if (revealed) { + if (revealed && visible) { const visibleDeleteCount = deletedNodes.reduce((r, node) => r + node.renderNodeCount, 0); this._updateAncestorsRenderNodeCount(parentNode, renderNodeCount - visibleDeleteCount); From 245dce024977145ea5f366dd5639ad11d0fc5572 Mon Sep 17 00:00:00 2001 From: isidor Date: Wed, 30 Jan 2019 16:32:01 +0100 Subject: [PATCH 142/429] strickt null --- .../parts/files/electron-browser/explorerService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/parts/files/electron-browser/explorerService.ts index 0942fe7ad4b..234117fd39c 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerService.ts @@ -160,10 +160,10 @@ export class ExplorerService implements IExplorerService { refresh(): void { this.model.roots.forEach(r => r.forgetChildren()); this._onDidChangeItem.fire(undefined); - const active = this.editorService.activeEditor; - if (active && active.getResource()) { + const resource = this.editorService.activeEditor ? this.editorService.activeEditor.getResource() : undefined; + if (resource) { // We did a top level refresh, reveal the active file #67118 - this.select(active.getResource(), true); + this.select(resource, true); } } From 4d9677a76131d54dde29c693be6207f00a2d443e Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 16:42:29 +0100 Subject: [PATCH 143/429] fixes #67279 --- src/vs/base/browser/ui/list/listWidget.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 87da7ffcb11..2cc18d00b3a 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -351,7 +351,9 @@ class TypeLabelController implements IDisposable { } private onDidUpdateListOptions(options: IListOptions): void { - if (options.enableKeyboardNavigation) { + const enableKeyboardNavigation = typeof options.enableKeyboardNavigation === 'undefined' ? true : !!options.enableKeyboardNavigation; + + if (enableKeyboardNavigation) { this.enable(); } else { this.disable(); From 1079ea5a08df478e5f960124304d4d32ffc9ea7d Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 16:48:26 +0100 Subject: [PATCH 144/429] fixes #67083 --- src/vs/base/browser/ui/tree/abstractTree.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index baf6d4ba919..e71bf94434c 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -485,6 +485,17 @@ class TypeFilterController implements IDisposable { this.filter.pattern = pattern; this.tree.refilter(); this.tree.focusNext(0, true); + + const focus = this.tree.getFocus(); + + if (focus.length > 0) { + const element = focus[0]; + + if (this.tree.getRelativeTop(element) === null) { + this.tree.reveal(focus[0], 0.5); + } + } + this.render(); } From 7e1724d8a58524b2e2508b2d53589c4ccb9c50e6 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 16:54:11 +0100 Subject: [PATCH 145/429] disable horizontal scrolling for scm repositories related to #67378 --- src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index 2f7895892bb..1d0d52e3c95 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -260,7 +260,7 @@ class MainPanel extends ViewletPanel { const renderer = this.instantiationService.createInstance(ProviderRenderer); const identityProvider = { getId: r => r.provider.id }; - this.list = this.instantiationService.createInstance(WorkbenchList, container, delegate, [renderer], { identityProvider }) as WorkbenchList; + this.list = this.instantiationService.createInstance(WorkbenchList, container, delegate, [renderer], { identityProvider, horizontalScrolling: false }) as WorkbenchList; this.list.onSelectionChange(this.onListSelectionChange, this, this.disposables); this.list.onContextMenu(this.onListContextMenu, this, this.disposables); From 07055a5f2112e26e000ccd7703a0be223ad0db4b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 17:02:40 +0100 Subject: [PATCH 146/429] fixes #67395 --- src/vs/base/browser/ui/tree/abstractTree.ts | 22 ++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index e71bf94434c..1ff4a7f6dc0 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -363,11 +363,12 @@ class TypeFilter implements ITreeFilter, IDisposable { class TypeFilterController implements IDisposable { - get pattern(): string { - return this._pattern; - } + private _enabled = false; + get enabled(): boolean { return this._enabled; } + + private _pattern = ''; + get pattern(): string { return this._pattern; } - private enabled = false; private positionClassName = 'ne'; private domNode: HTMLElement; private messageDomNode: HTMLElement; @@ -375,7 +376,6 @@ class TypeFilterController implements IDisposable { private filterOnTypeDomNode: HTMLInputElement; private clearDomNode: HTMLElement; - private _pattern = ''; private enabledDisposables: IDisposable[] = []; private disposables: IDisposable[] = []; @@ -425,7 +425,7 @@ class TypeFilterController implements IDisposable { } private enable(): void { - if (this.enabled) { + if (this._enabled) { return; } @@ -456,11 +456,11 @@ class TypeFilterController implements IDisposable { this.filter.pattern = ''; this.tree.refilter(); this.render(); - this.enabled = true; + this._enabled = true; } private disable(): void { - if (!this.enabled) { + if (!this._enabled) { return; } @@ -468,7 +468,7 @@ class TypeFilterController implements IDisposable { this.enabledDisposables = dispose(this.enabledDisposables); this.tree.refilter(); this.render(); - this.enabled = false; + this._enabled = false; } private onInput(pattern: string): void { @@ -559,7 +559,7 @@ class TypeFilterController implements IDisposable { } private onDidSpliceModel(): void { - if (!this.enabled || this.pattern.length === 0) { + if (!this._enabled || this.pattern.length === 0) { return; } @@ -718,7 +718,7 @@ export abstract class AbstractTree implements IDisposable if (_options.keyboardNavigationLabelProvider) { const typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, _options.keyboardNavigationLabelProvider); this.focusNavigationFilter = node => { - if (!typeFilterController.pattern) { + if (!typeFilterController.enabled || !typeFilterController.pattern) { return true; } From 8e3595ae0f492629aad883df59bcd9eed86df808 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 17:10:22 +0100 Subject: [PATCH 147/429] fixes #67376 --- .../editor/contrib/referenceSearch/referencesWidget.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index 1978ad1e501..d238db4cd88 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -253,6 +253,8 @@ export class ReferenceWidget extends PeekViewWidget { private _previewNotAvailableMessage: TextModel; private _previewContainer: HTMLElement; private _messageContainer: HTMLElement; + private height: number | undefined; + private width: number | undefined; constructor( editor: ICodeEditor, @@ -346,7 +348,7 @@ export class ReferenceWidget extends PeekViewWidget { this._previewContainer.style.width = left; this._treeContainer.style.width = right; this._preview.layout(); - this._tree.layout(); + this._tree.layout(this.height, this.width && this.width * (1 - this._sash.ratio)); this.layoutData.ratio = this._sash.ratio; }); @@ -417,6 +419,9 @@ export class ReferenceWidget extends PeekViewWidget { protected _doLayoutBody(heightInPixel: number, widthInPixel: number): void { super._doLayoutBody(heightInPixel, widthInPixel); + this.height = heightInPixel; + this.width = widthInPixel; + const height = heightInPixel + 'px'; this._sash.height = heightInPixel; this._sash.width = widthInPixel; @@ -428,7 +433,8 @@ export class ReferenceWidget extends PeekViewWidget { this._treeContainer.style.height = height; this._treeContainer.style.width = right; // forward - this._tree.layout(heightInPixel, widthInPixel); + console.log(widthInPixel, this._sash.ratio, widthInPixel * (1 - this._sash.ratio)); + this._tree.layout(heightInPixel, widthInPixel * (1 - this._sash.ratio)); this._preview.layout(); // store layout data From 07ab562666e3044feaab5a072948009257e5874b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 17:17:21 +0100 Subject: [PATCH 148/429] fixes #67378 --- .../parts/scm/electron-browser/scmViewlet.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts index 1d0d52e3c95..920cc42b0a6 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts @@ -143,6 +143,9 @@ class ProviderRenderer implements IListRenderer(); + readonly onDidRenderElement = this._onDidRenderElement.event; + constructor( @ICommandService protected commandService: ICommandService, @IThemeService protected themeService: IThemeService @@ -197,6 +200,8 @@ class ProviderRenderer implements IListRenderer r.provider.id }; - this.list = this.instantiationService.createInstance(WorkbenchList, container, delegate, [renderer], { identityProvider, horizontalScrolling: false }) as WorkbenchList; + this.list = this.instantiationService.createInstance(WorkbenchList, container, delegate, [renderer], { identityProvider }) as WorkbenchList; + renderer.onDidRenderElement(e => this.list.updateWidth(this.viewModel.repositories.indexOf(e)), null, this.disposables); this.list.onSelectionChange(this.onListSelectionChange, this, this.disposables); this.list.onContextMenu(this.onListContextMenu, this, this.disposables); @@ -293,8 +299,8 @@ class MainPanel extends ViewletPanel { } } - protected layoutBody(size: number): void { - this.list.layout(size); + protected layoutBody(height: number, width: number): void { + this.list.layout(height, width); } private updateBodySize(): void { From 8059a5895f6593389740d956ee56de0d318e4136 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Jan 2019 16:28:45 +0100 Subject: [PATCH 149/429] Improve doc comment --- src/vs/vscode.proposed.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 62aabce3dba..f9d86d51263 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1058,7 +1058,8 @@ declare module 'vscode' { //#region Alex - extensions.all change event export namespace extensions { /** - * An event which fires when `extensions.all` changes. + * An event which fires when `extensions.all` changes. This can happen when extensions are + * installed, uninstalled, enabled or disabled. */ export const onDidChange: Event; } From 26ed3e96dc08260fb4b250001f908dc234e9518a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Jan 2019 17:09:01 +0100 Subject: [PATCH 150/429] Fixes #67326: Update trie when adding / removing extensions --- .../api/node/extHostExtensionService.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index 8edbff284ea..76a04e06978 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -669,8 +669,25 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { ); } - public $deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise { + public async $deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): Promise { toAdd.forEach((extension) => (extension).extensionLocation = URI.revive(extension.extensionLocation)); + + const trie = await this.getExtensionPathIndex(); + + await Promise.all(toRemove.map(async (extensionId) => { + const extensionDescription = this._registry.getExtensionDescription(extensionId); + if (!extensionDescription) { + return; + } + const realpath = await pfs.realpath(extensionDescription.extensionLocation.fsPath); + trie.delete(URI.file(realpath).fsPath); + })); + + await Promise.all(toAdd.map(async (extensionDescription) => { + const realpath = await pfs.realpath(extensionDescription.extensionLocation.fsPath); + trie.set(URI.file(realpath).fsPath, extensionDescription); + })); + this._registry.deltaExtensions(toAdd, toRemove); return Promise.resolve(undefined); } From 520ae76bc5c870a43e239cc814a9cf940809f3c8 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Jan 2019 17:10:10 +0100 Subject: [PATCH 151/429] Move extensions.onDidChange to finalized API --- src/vs/vscode.d.ts | 6 ++++++ src/vs/vscode.proposed.d.ts | 10 ---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index b2d1771d638..42de798fe0e 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -8813,6 +8813,12 @@ declare module 'vscode' { * All extensions currently known to the system. */ export let all: Extension[]; + + /** + * An event which fires when `extensions.all` changes. This can happen when extensions are + * installed, uninstalled, enabled or disabled. + */ + export const onDidChange: Event; } } diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index f9d86d51263..99761bd3fb4 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1055,16 +1055,6 @@ declare module 'vscode' { } //#endregion - //#region Alex - extensions.all change event - export namespace extensions { - /** - * An event which fires when `extensions.all` changes. This can happen when extensions are - * installed, uninstalled, enabled or disabled. - */ - export const onDidChange: Event; - } - //#endregion - //#region Tree View export interface TreeView { From 15e77e8cf8dd8d2c67f679909e2d572f34e2925c Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 30 Jan 2019 17:33:39 +0100 Subject: [PATCH 152/429] fix #66936 --- src/vs/workbench/api/node/extHostExtensionService.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index 76a04e06978..1f4a1e100b0 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -591,6 +591,10 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { return Promise.resolve(undefined); } + if (this._initData.autoStart) { + return Promise.resolve(undefined); // https://github.com/Microsoft/vscode/issues/66936 + } + // Require the test runner via node require from the provided path let testRunner: ITestRunner; let requireError: Error; From f62abe488876e32643270c0be55b0800da0d84ff Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 30 Jan 2019 17:57:34 +0100 Subject: [PATCH 153/429] fix #67246 --- .../files/browser/editors/textFileEditor.ts | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index 09aaa5edc68..dceca11ee4d 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -11,7 +11,7 @@ import { Action } from 'vs/base/common/actions'; import { VIEWLET_ID, TEXT_FILE_EDITOR_ID, IExplorerService } from 'vs/workbench/parts/files/common/files'; import { ITextFileEditorModel, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { BaseTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor'; -import { EditorOptions, TextEditorOptions } from 'vs/workbench/common/editor'; +import { EditorOptions, TextEditorOptions, IEditorCloseEvent } from 'vs/workbench/common/editor'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; @@ -99,11 +99,22 @@ export class TextFileEditor extends BaseTextEditor { // in the onWillCloseEditor because at that time the editor has not yet // been disposed and we can safely persist the view state still as needed. this.groupListener = dispose(this.groupListener); - this.groupListener = ((group as IEditorGroupView).onWillCloseEditor(e => { - if (e.editor === this.input) { - this.doSaveOrClearTextEditorViewState(this.input); - } - })); + this.groupListener = ((group as IEditorGroupView).onWillCloseEditor(e => this.onWillCloseEditorInGroup(e))); + } + + private onWillCloseEditorInGroup(e: IEditorCloseEvent): void { + const editor = e.editor; + if (!(editor instanceof FileEditorInput)) { + return; // only handle files + } + + // If the editor is currently active we can always save or clear the view state. + // If the editor is not active, we can only clear the view state because it needs + // an active editor with the file opened, so we check for the restoreViewState flag + // being set. + if (editor === this.input || !this.restoreViewState) { + this.doSaveOrClearTextEditorViewState(editor); + } } setOptions(options: EditorOptions): void { From 8eade79bcccabbe73232f20deead26ed26610ef3 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 30 Jan 2019 18:03:21 +0100 Subject: [PATCH 154/429] call it openExternal, #67344 --- src/vs/vscode.d.ts | 2 +- src/vs/workbench/api/node/extHost.api.impl.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 42de798fe0e..e68bdf1b04f 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5932,7 +5932,7 @@ declare module 'vscode' { * @param target The uri that should be opened. * @returns A promise indicating if open was successful. */ - export function open(target: Uri): Thenable; + export function openExternal(target: Uri): Thenable; } /** diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index ebdf93c02d4..02fd3f33913 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -256,7 +256,7 @@ export function createApiFactory( get clipboard(): vscode.Clipboard { return extHostClipboard; }, - open(uri: URI) { + openExternal(uri: URI) { return extHostWindow.openUri(uri); } }); From 6d02b80403cfe96a416e36a55b5905061597d2f2 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 30 Jan 2019 18:14:04 +0100 Subject: [PATCH 155/429] Fixes #67391: fix delta computation --- .../workbench/services/extensions/common/extensionsRegistry.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/services/extensions/common/extensionsRegistry.ts b/src/vs/workbench/services/extensions/common/extensionsRegistry.ts index 029a08153ba..41e381496d8 100644 --- a/src/vs/workbench/services/extensions/common/extensionsRegistry.ts +++ b/src/vs/workbench/services/extensions/common/extensionsRegistry.ts @@ -84,7 +84,7 @@ export class ExtensionPointUserDelta { return new ExtensionPointUserDelta(current, []); } if (!current || !current.length) { - return new ExtensionPointUserDelta([], current); + return new ExtensionPointUserDelta([], previous); } const previousSet = this._toSet(previous); From 699ee7e1cf8890b8c38fedc9f3d8046a714a327a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 18:38:26 +0100 Subject: [PATCH 156/429] fixes #67314 --- src/vs/base/browser/ui/list/listView.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index 078c3e50227..40c16806df2 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -959,12 +959,15 @@ export class ListView implements ISpliceable, IDisposable { // Let's remember the second element's position, this helps in scrolling up // and preserving a linear upwards scroll movement - let secondElementIndex: number | undefined; - let secondElementTopDelta: number | undefined; + let anchorElementIndex: number | undefined; + let anchorElementTopDelta: number | undefined; - if (previousRenderRange.end - previousRenderRange.start > 1) { - secondElementIndex = previousRenderRange.start + 1; - secondElementTopDelta = this.elementTop(secondElementIndex) - renderTop; + if (renderTop === this.elementTop(previousRenderRange.start)) { + anchorElementIndex = previousRenderRange.start; + anchorElementTopDelta = 0; + } else if (previousRenderRange.end - previousRenderRange.start > 1) { + anchorElementIndex = previousRenderRange.start + 1; + anchorElementTopDelta = this.elementTop(anchorElementIndex) - renderTop; } let heightDiff = 0; @@ -1017,8 +1020,8 @@ export class ListView implements ISpliceable, IDisposable { } } - if (typeof secondElementIndex === 'number') { - this.scrollTop = this.elementTop(secondElementIndex) - secondElementTopDelta!; + if (typeof anchorElementIndex === 'number') { + this.scrollTop = this.elementTop(anchorElementIndex) - anchorElementTopDelta!; } this._onDidChangeContentHeight.fire(this.contentHeight); From 5710af7264ae04f51f408fe91f7e61c249db9345 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 30 Jan 2019 09:38:13 -0800 Subject: [PATCH 157/429] update platform css structure fixes #54049 --- src/vs/workbench/electron-browser/media/shell.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/electron-browser/media/shell.css b/src/vs/workbench/electron-browser/media/shell.css index 47e9490b7d2..e3e3172eafe 100644 --- a/src/vs/workbench/electron-browser/media/shell.css +++ b/src/vs/workbench/electron-browser/media/shell.css @@ -122,7 +122,7 @@ margin-bottom: 0.2em; } -.monaco-shell .linux .monaco-menu .monaco-action-bar.vertical .action-label.separator { +.monaco-shell.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator { margin-left: 0; margin-right: 0; } @@ -132,7 +132,7 @@ padding: 0 1.8em; } -.monaco-shell .linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator { +.monaco-shell.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator { height: 100%; -webkit-mask-size: 10px 10px; mask-size: 10px 10px; From 1ef0aa12cbb0d2a8bd16fb83a054603edbd64b45 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 30 Jan 2019 10:00:24 -0800 Subject: [PATCH 158/429] Fix old code in proposed API --- src/vs/vscode.proposed.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 99761bd3fb4..e8d0f99c563 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -997,7 +997,7 @@ declare module 'vscode' { * terminalRenderer.onDidAcceptInput(data => { * console.log(data); // 'Hello world' * }); - * terminalRenderer.terminal.then(t => t.sendText('Hello world')); + * terminalRenderer.terminal.sendText('Hello world'); * ``` */ readonly onDidAcceptInput: Event; From 351dc7377fc55b3f4a1846aeb4bb9864a9138189 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 30 Jan 2019 10:04:38 -0800 Subject: [PATCH 159/429] mitigation for #66796 --- .../electron-browser/settingsEditor2.ts | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index b177f2ce4f0..30d99008bc7 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -549,22 +549,24 @@ export class SettingsEditor2 extends BaseEditor { this.viewState)); this._register(this.tocTree.onDidChangeFocus(e => { - const element: SettingsTreeGroupElement = e.elements[0]; - if (this.tocFocusedElement === e.elements[0]) { - return; - } - - this.tocFocusedElement = element; - this.tocTree.setSelection(e.elements); - if (this.searchResultModel) { - if (this.viewState.filterToCategory !== element) { - this.viewState.filterToCategory = element; - this.renderTree(); - this.settingsTree.scrollTop = 0; + setTimeout(() => { + const element: SettingsTreeGroupElement = e.elements[0]; + if (this.tocFocusedElement === e.elements[0]) { + return; } - } else if (element && (!e.browserEvent || !(e.browserEvent).fromScroll)) { - this.settingsTree.reveal(element, 0); - } + + this.tocFocusedElement = element; + this.tocTree.setSelection(e.elements); + if (this.searchResultModel) { + if (this.viewState.filterToCategory !== element) { + this.viewState.filterToCategory = element; + this.renderTree(); + this.settingsTree.scrollTop = 0; + } + } else if (element && (!e.browserEvent || !(e.browserEvent).fromScroll)) { + this.settingsTree.reveal(element, 0); + } + }, 0); })); this._register(this.tocTree.onDidFocus(() => { From 7ca3f253db3371604e390ef1ceca88cc6dff95f5 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 30 Jan 2019 11:07:20 -0800 Subject: [PATCH 160/429] fixes custom viewlet icons in activity bar with grid layout update monaco-workbench > CSS --- .../api/browser/viewsExtensionPoint.ts | 2 +- .../parts/activitybar/activitybarActions.ts | 34 +++++++++---------- .../parts/editor/media/notabstitlecontrol.css | 2 +- .../debug/browser/media/debugViewlet.css | 2 +- .../page/electron-browser/welcomePage.css | 12 +++---- .../electron-browser/walkThroughPart.css | 6 ++-- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index 6ab333bf1e4..fbffb5d002f 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -326,7 +326,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution { ); // Generate CSS to show the icon in the activity bar - const iconClass = `.monaco-workbench > .activitybar .monaco-action-bar .action-label.${cssClass}`; + const iconClass = `.monaco-workbench .activitybar .monaco-action-bar .action-label.${cssClass}`; createCSSRule(iconClass, `-webkit-mask: url('${icon}') no-repeat 50% 50%`); } diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index 2fe84cf2ba5..2144bb90f7e 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -175,7 +175,7 @@ export class PlaceHolderViewletActivityAction extends ViewletActivityAction { ) { super({ id, name: id, cssClass: `extensionViewlet-placeholder-${id.replace(/\./g, '-')}` }, viewletService, partService, telemetryService); - const iconClass = `.monaco-workbench > .activitybar .monaco-action-bar .action-label.${this.class}`; // Generate Placeholder CSS to show the icon in the activity bar + const iconClass = `.monaco-workbench .activitybar .monaco-action-bar .action-label.${this.class}`; // Generate Placeholder CSS to show the icon in the activity bar DOM.createCSSRule(iconClass, `-webkit-mask: url('${iconUrl || ''}') no-repeat 50% 50%`); } @@ -271,9 +271,9 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const activeForegroundColor = theme.getColor(ACTIVITY_BAR_FOREGROUND); if (activeForegroundColor) { collector.addRule(` - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active .action-label, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus .action-label, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover .action-label { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.active .action-label, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:focus .action-label, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:hover .action-label { background-color: ${activeForegroundColor} !important; } `); @@ -283,7 +283,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const outline = theme.getColor(activeContrastBorder); if (outline) { collector.addRule(` - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:before { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:before { content: ""; position: absolute; top: 9px; @@ -292,26 +292,26 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { width: 32px; } - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:hover:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:hover:before { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.active:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.active:hover:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.checked:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.checked:hover:before { outline: 1px solid; } - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover:before { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:hover:before { outline: 1px dashed; } - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus:before { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:focus:before { border-left-color: ${outline}; } - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.active:hover:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item.checked:hover:before, - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:hover:before { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.active:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.active:hover:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.checked:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item.checked:hover:before, + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:hover:before { outline-color: ${outline}; } `); @@ -322,7 +322,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const focusBorderColor = theme.getColor(focusBorder); if (focusBorderColor) { collector.addRule(` - .monaco-workbench > .activitybar > .content .monaco-action-bar .action-item:focus:before { + .monaco-workbench .activitybar > .content .monaco-action-bar .action-item:focus:before { border-left-color: ${focusBorderColor}; } `); diff --git a/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css index 066987b790b..1190f855b69 100644 --- a/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css +++ b/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css @@ -54,7 +54,7 @@ background-image: none; } -.windows > .monaco-workbench > .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item::before { +.windows > .monaco-workbench .part.editor > .content .editor-group-container > .title.breadcrumbs .breadcrumbs-control .monaco-breadcrumb-item::before { content: '\\'; } diff --git a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css b/src/vs/workbench/parts/debug/browser/media/debugViewlet.css index 7cf772fb7b0..9d27545f44b 100644 --- a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css +++ b/src/vs/workbench/parts/debug/browser/media/debugViewlet.css @@ -64,7 +64,7 @@ margin-top: 7px; } -.mac > .monaco-workbench > .part > .title > .title-actions .start-debug-action-item { +.mac > .monaco-workbench .part > .title > .title-actions .start-debug-action-item { border-radius: 4px; } diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css index 75a18c03da3..a24da657f52 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css @@ -228,21 +228,21 @@ .monaco-workbench .part.editor > .content .welcomePage .linux-only { display: none; } -.mac > .monaco-workbench > .part.editor > .content .welcomePage .mac-only { +.mac > .monaco-workbench .part.editor > .content .welcomePage .mac-only { display: initial; } -.windows > .monaco-workbench > .part.editor > .content .welcomePage .windows-only { +.windows > .monaco-workbench .part.editor > .content .welcomePage .windows-only { display: initial; } -.linux > .monaco-workbench > .part.editor > .content .welcomePage .linux-only { +.linux > .monaco-workbench .part.editor > .content .welcomePage .linux-only { display: initial; } -.mac > .monaco-workbench > .part.editor > .content .welcomePage li.mac-only { +.mac > .monaco-workbench .part.editor > .content .welcomePage li.mac-only { display: list-item; } -.windows > .monaco-workbench > .part.editor > .content .welcomePage li.windows-only { +.windows > .monaco-workbench .part.editor > .content .welcomePage li.windows-only { display: list-item; } -.linux > .monaco-workbench > .part.editor > .content .welcomePage li.linux-only { +.linux > .monaco-workbench .part.editor > .content .welcomePage li.linux-only { display: list-item; } diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css index c83ac377cae..2194a2a98c7 100644 --- a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css +++ b/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css @@ -123,13 +123,13 @@ .monaco-workbench .part.editor > .content .walkThroughContent .linux-only { display: none; } -.mac > .monaco-workbench > .part.editor > .content .walkThroughContent .mac-only { +.mac > .monaco-workbench .part.editor > .content .walkThroughContent .mac-only { display: initial; } -.windows > .monaco-workbench > .part.editor > .content .walkThroughContent .windows-only { +.windows > .monaco-workbench .part.editor > .content .walkThroughContent .windows-only { display: initial; } -.linux > .monaco-workbench > .part.editor > .content .walkThroughContent .linux-only { +.linux > .monaco-workbench .part.editor > .content .walkThroughContent .linux-only { display: initial; } From f337fa838e23c77b0233cbbc28c40d4f2c2c6cf8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 11:23:20 -0800 Subject: [PATCH 161/429] Change windows keybinding of the auto fix command Fixes #67411 --- src/vs/editor/contrib/codeAction/codeActionCommands.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index 81ffd354aab..02527482401 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -395,7 +395,10 @@ export class AutoFixAction extends EditorAction { contextKeyForSupportedActions(CodeActionKind.QuickFix)), kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, - primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_DOT, + primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.US_DOT, + mac: { + primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_DOT + }, weight: KeybindingWeight.EditorContrib } }); From 3b5538c31fe0ab13265f17a6dbbbd307af2d3323 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 11:23:46 -0800 Subject: [PATCH 162/429] Mark that auto fix can show a menu --- src/vs/editor/contrib/codeAction/codeActionCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index 02527482401..7eb09212d89 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -388,7 +388,7 @@ export class AutoFixAction extends EditorAction { constructor() { super({ id: AutoFixAction.Id, - label: nls.localize('autoFix.label', "Auto Fix"), + label: nls.localize('autoFix.label', "Auto Fix..."), alias: 'Auto Fix', precondition: ContextKeyExpr.and( EditorContextKeys.writable, From d17fc40536418cb15c75288bf3629a3b8e1d6531 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 11:24:43 -0800 Subject: [PATCH 163/429] Fix name --- .../api/electron-browser/mainThreadSaveParticipant.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts index 783a76ab020..fb211f7de79 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts @@ -290,7 +290,7 @@ class FormatOnSaveParticipant implements ISaveParticipantParticipant { } } -class CodeActionOnParticipant implements ISaveParticipant { +class CodeActionOnSaveParticipant implements ISaveParticipant { constructor( @IBulkEditService private readonly _bulkEditService: IBulkEditService, @@ -404,7 +404,7 @@ export class SaveParticipant implements ISaveParticipant { ) { this._saveParticipants = new IdleValue(() => [ instantiationService.createInstance(TrimWhitespaceParticipant), - instantiationService.createInstance(CodeActionOnParticipant), + instantiationService.createInstance(CodeActionOnSaveParticipant), instantiationService.createInstance(FormatOnSaveParticipant), instantiationService.createInstance(FinalNewLineParticipant), instantiationService.createInstance(TrimFinalNewLinesParticipant), From f0d1dbcd2c976ce9e7d845d01a61992b6a5f2d5f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 11:32:44 -0800 Subject: [PATCH 164/429] On save, always run fixAll before other source actions Fixes #67482 --- .../editor/contrib/codeAction/codeActionTrigger.ts | 1 + .../electron-browser/mainThreadSaveParticipant.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionTrigger.ts b/src/vs/editor/contrib/codeAction/codeActionTrigger.ts index d782e836367..15e90604ed6 100644 --- a/src/vs/editor/contrib/codeAction/codeActionTrigger.ts +++ b/src/vs/editor/contrib/codeAction/codeActionTrigger.ts @@ -14,6 +14,7 @@ export class CodeActionKind { public static readonly Refactor = new CodeActionKind('refactor'); public static readonly Source = new CodeActionKind('source'); public static readonly SourceOrganizeImports = new CodeActionKind('source.organizeImports'); + public static readonly SourceFixAll = new CodeActionKind('source.fixAll'); constructor( public readonly value: string diff --git a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts index fb211f7de79..8682ee6a2ed 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts @@ -311,7 +311,17 @@ class CodeActionOnSaveParticipant implements ISaveParticipant { return undefined; } - const codeActionsOnSave = Object.keys(setting).filter(x => setting[x]).map(x => new CodeActionKind(x)); + const codeActionsOnSave = Object.keys(setting) + .filter(x => setting[x]).map(x => new CodeActionKind(x)) + .sort((a, b) => { + if (a.value === CodeActionKind.SourceFixAll.value) { + return -1; + } + if (b.value === CodeActionKind.SourceFixAll.value) { + return 1; + } + return 0; + }); if (!codeActionsOnSave.length) { return undefined; } From 6787bd1f2593434da7961132bea56f9954bea266 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 30 Jan 2019 11:46:57 -0800 Subject: [PATCH 165/429] Update html/css custom data config schema for #67544 --- extensions/css-language-features/package.json | 3 +++ extensions/html-language-features/package.json | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index 514196d3608..79b32dd352b 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -37,6 +37,9 @@ "type": "array", "description": "A list of JSON file paths that define custom CSS data that loads custom properties, at directives, pseudo classes / elements.", "default": [], + "items": { + "type": "string" + }, "scope": "resource" }, "css.validate": { diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index 0fc7ed3ce11..9449c662605 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -34,7 +34,12 @@ "properties": { "html.experimental.customData": { "type": "array", - "description": "A list of JSON file paths that define custom tags, properties and other HTML syntax constructs. Only workspace folder setting will be read." + "description": "A list of JSON file paths that define custom tags, properties and other HTML syntax constructs. Only workspace folder setting will be read.", + "default": [], + "items": { + "type": "string" + }, + "scope": "resource" }, "html.format.enable": { "type": "boolean", From af57ecdf9d303b2b1a3e93caf285795ba0550cab Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 30 Jan 2019 11:58:42 -0800 Subject: [PATCH 166/429] Fix #67544 --- .../client/src/customData.ts | 11 ++++++++--- .../client/src/customData.ts | 19 ++++++++++++++----- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/extensions/css-language-features/client/src/customData.ts b/extensions/css-language-features/client/src/customData.ts index 8ba0770235a..b6db79db75d 100644 --- a/extensions/css-language-features/client/src/customData.ts +++ b/extensions/css-language-features/client/src/customData.ts @@ -28,9 +28,14 @@ export function getCustomDataPathsInAllWorkspaces(workspaceFolders: WorkspaceFol wfCSSConfig.workspaceFolderValue.experimental && wfCSSConfig.workspaceFolderValue.experimental.customData ) { - wfCSSConfig.workspaceFolderValue.experimental.customData.forEach(p => [ - dataPaths.push(path.resolve(wf.uri.fsPath, p)) - ]); + const customData = wfCSSConfig.workspaceFolderValue.experimental.customData; + if (Array.isArray(customData)) { + customData.forEach(t => { + if (typeof t === 'string') { + dataPaths.push(path.resolve(wf.uri.fsPath, t)); + } + }); + } } }); diff --git a/extensions/html-language-features/client/src/customData.ts b/extensions/html-language-features/client/src/customData.ts index 8e9bf2863b6..2c8c7615a35 100644 --- a/extensions/html-language-features/client/src/customData.ts +++ b/extensions/html-language-features/client/src/customData.ts @@ -26,11 +26,15 @@ export function getCustomDataPathsInAllWorkspaces(workspaceFolders: WorkspaceFol if ( wfHtmlConfig && wfHtmlConfig.workspaceFolderValue && - wfHtmlConfig.workspaceFolderValue.experimental + wfHtmlConfig.workspaceFolderValue.experimental && + wfHtmlConfig.workspaceFolderValue.experimental.customData ) { - if (wfHtmlConfig.workspaceFolderValue.experimental.customData) { - wfHtmlConfig.workspaceFolderValue.experimental.customData.forEach(t => { - dataPaths.push(path.resolve(wf.uri.fsPath, t)); + const customData = wfHtmlConfig.workspaceFolderValue.experimental.customData; + if (Array.isArray(customData)) { + customData.forEach(t => { + if (typeof t === 'string') { + dataPaths.push(path.resolve(wf.uri.fsPath, t)); + } }); } } @@ -45,7 +49,12 @@ export function getCustomDataPathsFromAllExtensions(): string[] { for (const extension of extensions.all) { const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (contributes && contributes.html && contributes.html.experimental.customData && Array.isArray(contributes.html.experimental.customData)) { + if ( + contributes && + contributes.html && + contributes.html.experimental.customData && + Array.isArray(contributes.html.experimental.customData) + ) { const relativePaths: string[] = contributes.html.customData; relativePaths.forEach(rp => { dataPaths.push(path.resolve(extension.extensionPath, rp)); From 2d1da69fea6d0c210fed52bdc8aa9d06cdbeb2c7 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 20:58:22 +0100 Subject: [PATCH 167/429] remove leftover console.log --- src/vs/editor/contrib/referenceSearch/referencesWidget.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index d238db4cd88..e04ca9e6c5d 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -433,7 +433,6 @@ export class ReferenceWidget extends PeekViewWidget { this._treeContainer.style.height = height; this._treeContainer.style.width = right; // forward - console.log(widthInPixel, this._sash.ratio, widthInPixel * (1 - this._sash.ratio)); this._tree.layout(heightInPixel, widthInPixel * (1 - this._sash.ratio)); this._preview.layout(); From 31feeba3f33dfb86ff481b77e91b9089475da8a1 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 30 Jan 2019 21:42:01 +0100 Subject: [PATCH 168/429] true tree focus and selection traits fixes #67220 --- src/vs/base/browser/ui/tree/abstractTree.ts | 161 ++++++++++++++++-- src/vs/base/browser/ui/tree/indexTreeModel.ts | 10 +- .../base/browser/ui/tree/objectTreeModel.ts | 4 +- src/vs/base/browser/ui/tree/tree.ts | 6 +- 4 files changed, 160 insertions(+), 21 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 1ff4a7f6dc0..036b4ddf543 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -8,7 +8,7 @@ import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/l import { IListOptions, List, IListStyles, mightProducePrintableCharacter, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass } from 'vs/base/browser/dom'; -import { Event, Relay, Emitter } from 'vs/base/common/event'; +import { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event'; import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; import { ITreeModel, ITreeNode, ITreeRenderer, ITreeEvent, ITreeMouseEvent, ITreeContextMenuEvent, ITreeFilter, ITreeNavigator, ICollapseStateChangeEvent, ITreeDragAndDrop, TreeDragOverBubble, TreeVisibility, TreeFilterResult } from 'vs/base/browser/ui/tree/tree'; @@ -22,6 +22,7 @@ import { getVisibleState, isFilterResult } from 'vs/base/browser/ui/tree/indexTr import { localize } from 'vs/nls'; import { disposableTimeout } from 'vs/base/common/async'; import { isMacintosh } from 'vs/base/common/platform'; +import { values } from 'vs/base/common/map'; function asTreeDragAndDropData(data: IDragAndDropData): IDragAndDropData { if (data instanceof ElementsDragAndDropData) { @@ -641,12 +642,135 @@ export interface IAbstractTreeOptions extends IAbstractTr readonly autoExpandSingleChildren?: boolean; } +/** + * The trait concept needs to exist at the tree level, because collapsed + * tree nodes will not be known by the list. + */ +class Trait { + + private nodes: ITreeNode[] = []; + private elements: T[] | undefined; + + private _onDidChange = new Emitter>(); + readonly onDidChange = this._onDidChange.event; + + private _nodeSet: Set> | undefined; + private get nodeSet(): Set> { + if (!this._nodeSet) { + this._nodeSet = new Set(); + + for (const node of this.nodes) { + this._nodeSet.add(node); + } + } + + return this._nodeSet; + } + + set(nodes: ITreeNode[], browserEvent?: UIEvent): void { + this.nodes = [...nodes]; + this.elements = undefined; + this._nodeSet = undefined; + + const that = this; + this._onDidChange.fire({ get elements() { return that.get(); }, browserEvent }); + } + + get(): T[] { + if (!this.elements) { + this.elements = this.nodes.map(node => node.element); + } + + return [...this.elements]; + } + + has(node: ITreeNode): boolean { + return this.nodeSet.has(node); + } + + remove(nodes: ITreeNode[]): void { + const set = this.nodeSet; + + for (const node of nodes) { + set.delete(node); + } + + this.set(values(set)); + } +} + +/** + * We use this List subclass to restore selection and focus as nodes + * get rendered in the list, possibly due to a node expand() call. + */ +class TreeNodeList extends List> { + + constructor( + container: HTMLElement, + virtualDelegate: IListVirtualDelegate>, + renderers: IListRenderer[], + private focusTrait: Trait, + private selectionTrait: Trait, + options?: IListOptions> + ) { + super(container, virtualDelegate, renderers, options); + } + + splice(start: number, deleteCount: number, elements: ITreeNode[] = []): void { + super.splice(start, deleteCount, elements); + + if (elements.length === 0) { + return; + } + + const additionalFocus: number[] = []; + const additionalSelection: number[] = []; + + elements.forEach((node, index) => { + if (this.selectionTrait.has(node)) { + additionalFocus.push(start + index); + } + + if (this.selectionTrait.has(node)) { + additionalSelection.push(start + index); + } + }); + + if (additionalFocus.length > 0) { + super.setFocus([...super.getFocus(), ...additionalFocus]); + } + + if (additionalSelection.length > 0) { + super.setSelection([...super.getSelection(), ...additionalSelection]); + } + } + + setFocus(indexes: number[], browserEvent?: UIEvent, fromAPI = false): void { + super.setFocus(indexes, browserEvent); + + if (!fromAPI) { + this.focusTrait.set(indexes.map(i => this.element(i)), browserEvent); + } + } + + setSelection(indexes: number[], browserEvent?: UIEvent, fromAPI = false): void { + super.setSelection(indexes, browserEvent); + + if (!fromAPI) { + this.selectionTrait.set(indexes.map(i => this.element(i)), browserEvent); + } + } +} + export abstract class AbstractTree implements IDisposable { - private view: List>; + private view: TreeNodeList; private renderers: TreeRenderer[]; private focusNavigationFilter: ((node: ITreeNode) => boolean) | undefined; protected model: ITreeModel; + private focus = new Trait(); + private selection = new Trait(); + private eventBufferer = new EventBufferer(); protected disposables: IDisposable[] = []; private _onDidUpdateOptions = new Emitter>(); @@ -654,8 +778,8 @@ export abstract class AbstractTree implements IDisposable get onDidScroll(): Event { return this.view.onDidScroll; } - get onDidChangeFocus(): Event> { return Event.map(this.view.onFocusChange, asTreeEvent); } - get onDidChangeSelection(): Event> { return Event.map(this.view.onSelectionChange, asTreeEvent); } + readonly onDidChangeFocus: Event> = this.eventBufferer.wrapEvent(this.focus.onDidChange); + readonly onDidChangeSelection: Event> = this.eventBufferer.wrapEvent(this.selection.onDidChange); get onDidOpen(): Event> { return Event.map(this.view.onDidOpen, asTreeEvent); } get onMouseClick(): Event> { return Event.map(this.view.onMouseClick, asTreeMouseEvent); } @@ -697,11 +821,18 @@ export abstract class AbstractTree implements IDisposable this.disposables.push(filter); } - this.view = new List(container, treeDelegate, this.renderers, asListOptions(() => this.model, _options)); + this.view = new TreeNodeList(container, treeDelegate, this.renderers, this.focus, this.selection, asListOptions(() => this.model, _options)); this.model = this.createModel(this.view, _options); onDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState; + this.model.onDidSplice(e => { + this.eventBufferer.bufferEvents(() => { + this.focus.remove(e.deletedNodes); + this.selection.remove(e.deletedNodes); + }); + }, null, this.disposables); + this.view.onTap(this.reactOnMouseClick, this, this.disposables); this.view.onMouseClick(this.reactOnMouseClick, this, this.disposables); @@ -853,18 +984,23 @@ export abstract class AbstractTree implements IDisposable } setSelection(elements: TRef[], browserEvent?: UIEvent): void { - const indexes = elements.map(e => this.model.getListIndex(e)); - this.view.setSelection(indexes, browserEvent); + const nodes = elements.map(e => this.model.getNode(e)); + this.selection.set(nodes, browserEvent); + + const indexes = elements.map(e => this.model.getListIndex(e)).filter(i => i > -1); + this.view.setSelection(indexes, browserEvent, true); } getSelection(): T[] { - const nodes = this.view.getSelectedElements(); - return nodes.map(n => n.element); + return this.selection.get(); } setFocus(elements: TRef[], browserEvent?: UIEvent): void { - const indexes = elements.map(e => this.model.getListIndex(e)); - this.view.setFocus(indexes, browserEvent); + const nodes = elements.map(e => this.model.getNode(e)); + this.focus.set(nodes, browserEvent); + + const indexes = elements.map(e => this.model.getListIndex(e)).filter(i => i > -1); + this.view.setFocus(indexes, browserEvent, true); } focusNext(n = 1, loop = false, browserEvent?: UIEvent): void { @@ -892,8 +1028,7 @@ export abstract class AbstractTree implements IDisposable } getFocus(): T[] { - const nodes = this.view.getFocusedElements(); - return nodes.map(n => n.element); + return this.focus.get(); } open(elements: TRef[]): void { diff --git a/src/vs/base/browser/ui/tree/indexTreeModel.ts b/src/vs/base/browser/ui/tree/indexTreeModel.ts index bea50064994..cc6555950aa 100644 --- a/src/vs/base/browser/ui/tree/indexTreeModel.ts +++ b/src/vs/base/browser/ui/tree/indexTreeModel.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ICollapseStateChangeEvent, ITreeElement, ITreeFilter, ITreeFilterDataResult, ITreeModel, ITreeNode, TreeVisibility } from 'vs/base/browser/ui/tree/tree'; +import { ICollapseStateChangeEvent, ITreeElement, ITreeFilter, ITreeFilterDataResult, ITreeModel, ITreeNode, TreeVisibility, ITreeModelSpliceEvent } from 'vs/base/browser/ui/tree/tree'; import { tail2 } from 'vs/base/common/arrays'; import { Emitter, Event, EventBufferer } from 'vs/base/common/event'; import { ISequence, Iterator } from 'vs/base/common/iterator'; @@ -61,7 +61,7 @@ export class IndexTreeModel, TFilterData = voi private filter?: ITreeFilter; private autoExpandSingleChildren: boolean; - private _onDidSplice = new Emitter(); + private _onDidSplice = new Emitter>(); readonly onDidSplice = this._onDidSplice.event; constructor(private list: ISpliceable>, rootElement: T, options: IIndexTreeModelOptions = {}) { @@ -127,7 +127,7 @@ export class IndexTreeModel, TFilterData = voi } const result = Iterator.map(Iterator.fromArray(deletedNodes), treeNodeToElement); - this._onDidSplice.fire(undefined); + this._onDidSplice.fire({ deletedNodes }); return result; } @@ -144,8 +144,8 @@ export class IndexTreeModel, TFilterData = voi } getListIndex(location: number[]): number { - const { listIndex, visible } = this.getTreeNodeWithListIndex(location); - return visible ? listIndex : -1; + const { listIndex, visible, revealed } = this.getTreeNodeWithListIndex(location); + return visible && revealed ? listIndex : -1; } getListRenderCount(location: number[]): number { diff --git a/src/vs/base/browser/ui/tree/objectTreeModel.ts b/src/vs/base/browser/ui/tree/objectTreeModel.ts index 467a7c76e2f..3169271298e 100644 --- a/src/vs/base/browser/ui/tree/objectTreeModel.ts +++ b/src/vs/base/browser/ui/tree/objectTreeModel.ts @@ -7,7 +7,7 @@ import { ISpliceable } from 'vs/base/common/sequence'; import { Iterator, ISequence, getSequenceIterator } from 'vs/base/common/iterator'; import { IndexTreeModel, IIndexTreeModelOptions } from 'vs/base/browser/ui/tree/indexTreeModel'; import { Event } from 'vs/base/common/event'; -import { ITreeModel, ITreeNode, ITreeElement, ITreeSorter, ICollapseStateChangeEvent } from 'vs/base/browser/ui/tree/tree'; +import { ITreeModel, ITreeNode, ITreeElement, ITreeSorter, ICollapseStateChangeEvent, ITreeModelSpliceEvent } from 'vs/base/browser/ui/tree/tree'; export interface IObjectTreeModelOptions extends IIndexTreeModelOptions { readonly sorter?: ITreeSorter; @@ -21,7 +21,7 @@ export class ObjectTreeModel, TFilterData extends Non private nodes = new Map>(); private sorter?: ITreeSorter>; - readonly onDidSplice: Event; + readonly onDidSplice: Event>; readonly onDidChangeCollapseState: Event>; readonly onDidChangeRenderNodeCount: Event>; diff --git a/src/vs/base/browser/ui/tree/tree.ts b/src/vs/base/browser/ui/tree/tree.ts index 7cf94dbb023..4880293c269 100644 --- a/src/vs/base/browser/ui/tree/tree.ts +++ b/src/vs/base/browser/ui/tree/tree.ts @@ -95,10 +95,14 @@ export interface ICollapseStateChangeEvent { deep: boolean; } +export interface ITreeModelSpliceEvent { + deletedNodes: ITreeNode[]; +} + export interface ITreeModel { readonly rootRef: TRef; - readonly onDidSplice: Event; + readonly onDidSplice: Event>; readonly onDidChangeCollapseState: Event>; readonly onDidChangeRenderNodeCount: Event>; From b9a116e11b0c9150ff40f99a21a63ed09796c39c Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 30 Jan 2019 12:57:02 -0800 Subject: [PATCH 169/429] [HTML] Update language service --- extensions/html-language-features/server/package.json | 2 +- extensions/html-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index 3c95ec49a4e..ce5845b7345 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -10,7 +10,7 @@ "main": "./out/htmlServerMain", "dependencies": { "vscode-css-languageservice": "^3.0.13-next.10", - "vscode-html-languageservice": "^2.1.11-next.10", + "vscode-html-languageservice": "^2.1.11-next.11", "vscode-languageserver": "^5.1.0", "vscode-languageserver-types": "^3.13.0", "vscode-nls": "^4.0.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index 1cf165efbca..056fdd468ad 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -237,10 +237,10 @@ vscode-css-languageservice@^3.0.13-next.10: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" -vscode-html-languageservice@^2.1.11-next.10: - version "2.1.11-next.10" - resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.10.tgz#35c879e14fcf4d68870231eb5c46aa9a041b4aa1" - integrity sha512-HrQl0gIDLhTJB139nsMLhPkmG0YmweTgmd2MQlq7oki1+QFbIm3F/VyWpmGZR1aXGhRUmY58p1omg74NDy+4Lg== +vscode-html-languageservice@^2.1.11-next.11: + version "2.1.11-next.11" + resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.1.11-next.11.tgz#7dd00c07790d05751d5a40164b6983b0fd8cd02b" + integrity sha512-NOJRP1hCuEORd/Zs7yK4sQBRML6APDZ5zOMvbXRCVk5VyFx+KD0/uWjJWKnvgQMUONEMGD5emSFbSy8h80MtXw== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" From 823e747e683e4d9b478521af3ea9e86ad3fe2d9f Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 30 Jan 2019 21:57:12 +0100 Subject: [PATCH 170/429] switch to theme when installing --- .../electron-browser/colorThemeStore.ts | 25 +++++-- .../electron-browser/fileIconThemeStore.ts | 23 ++++-- .../electron-browser/workbenchThemeService.ts | 72 +++++++++++++------ 3 files changed, 88 insertions(+), 32 deletions(-) diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts index 641dc73a13c..73a58b9b08d 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts @@ -46,22 +46,32 @@ const themesExtPoint = ExtensionsRegistry.registerExtensionPoint; + private readonly onDidChangeEmitter: Emitter; - public get onDidChange(): Event { return this.onDidChangeEmitter.event; } + public get onDidChange(): Event { return this.onDidChangeEmitter.event; } constructor(@IExtensionService private readonly extensionService: IExtensionService, defaultTheme: ColorThemeData) { this.extensionsColorThemes = [defaultTheme]; - this.onDidChangeEmitter = new Emitter(); + this.onDidChangeEmitter = new Emitter(); this.initialize(); } private initialize() { - themesExtPoint.setHandler((extensions) => { + themesExtPoint.setHandler((extensions, delta) => { + const previousIds = {}; + const added = []; + for (const theme of this.extensionsColorThemes) { + previousIds[theme.id] = true; + } this.extensionsColorThemes.length = 1; // remove all but the default theme for (let ext of extensions) { let extensionData = { @@ -72,7 +82,12 @@ export class ColorThemeStore { }; this.onThemes(ext.description.extensionLocation, extensionData, ext.value, ext.collector); } - this.onDidChangeEmitter.fire(this.extensionsColorThemes); + for (const theme of this.extensionsColorThemes) { + if (!previousIds[theme.id]) { + added.push(theme); + } + } + this.onDidChangeEmitter.fire({ themes: this.extensionsColorThemes, added }); }); } diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts index 39d83bf5ef7..45d43d7d0d5 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts @@ -42,21 +42,31 @@ const iconThemeExtPoint = ExtensionsRegistry.registerExtensionPoint; + private readonly onDidChangeEmitter: Emitter; - public get onDidChange(): Event { return this.onDidChangeEmitter.event; } + public get onDidChange(): Event { return this.onDidChangeEmitter.event; } constructor(@IExtensionService private readonly extensionService: IExtensionService) { this.knownIconThemes = []; - this.onDidChangeEmitter = new Emitter(); + this.onDidChangeEmitter = new Emitter(); this.initialize(); } private initialize() { iconThemeExtPoint.setHandler((extensions) => { + const previousIds = {}; + const added = []; + for (const theme of this.knownIconThemes) { + previousIds[theme.id] = true; + } this.knownIconThemes.length = 0; for (let ext of extensions) { let extensionData = { @@ -67,7 +77,12 @@ export class FileIconThemeStore { }; this.onIconThemes(ext.description.extensionLocation, extensionData, ext.value, ext.collector); } - this.onDidChangeEmitter.fire(this.knownIconThemes); + for (const theme of this.knownIconThemes) { + if (!previousIds[theme.id]) { + added.push(theme); + } + } + this.onDidChangeEmitter.fire({ themes: this.knownIconThemes, added }); }); } diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index fb1ffc5a0ab..f53629370b3 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -145,14 +145,16 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { this.installConfigurationListener(); }); + let prevColorId: string | undefined = undefined; + // update settings schema setting for theme specific settings - this.colorThemeStore.onDidChange(themes => { + this.colorThemeStore.onDidChange(async event => { const themeSpecificWorkbenchColors: IJSONSchema = { properties: {} }; const themeSpecificTokenColors: IJSONSchema = { properties: {} }; const workbenchColors = { $ref: workbenchColorsSchemaId, additionalProperties: false }; const tokenColors = { properties: tokenColorSchema.properties, additionalProperties: false }; - for (let t of themes) { + for (let t of event.themes) { // add a enum value to the 'workbench.colorTheme` setting colorThemeSettingSchema.enum!.push(t.settingsId); colorThemeSettingSchema.enumDescriptions!.push(t.description || ''); @@ -169,28 +171,42 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration, tokenColorCustomizationConfiguration); if (this.currentColorTheme.isLoaded) { - this.colorThemeStore.findThemeData(this.currentColorTheme.id).then(theme => { - if (!theme) { - this.setColorTheme(DEFAULT_THEME_ID, undefined); - } else { - this.restoreColorTheme(); + if (event.added.length > 0 && event.added.length < event.themes.length) { + prevColorId = this.currentColorTheme.id; + this.setColorTheme(event.added[0].id, 'auto'); + } else { + const themeData = await this.colorThemeStore.findThemeData(this.currentColorTheme.id); + if (!themeData) { + if (prevColorId && await this.colorThemeStore.findThemeData(prevColorId)) { + this.setColorTheme(prevColorId, 'auto'); + } else { + this.setColorTheme(DEFAULT_THEME_ID, 'auto'); + } } - }); + } } }); - this.iconThemeStore.onDidChange(themes => { - iconThemeSettingSchema.enum = [null, ...themes.map(t => t.settingsId)]; - iconThemeSettingSchema.enumDescriptions = [iconThemeSettingSchema.enumDescriptions![0], ...themes.map(t => t.description || '')]; + + let prevFileIconId: string | undefined = undefined; + this.iconThemeStore.onDidChange(async event => { + iconThemeSettingSchema.enum = [null, ...event.themes.map(t => t.settingsId)]; + iconThemeSettingSchema.enumDescriptions = [iconThemeSettingSchema.enumDescriptions![0], ...event.themes.map(t => t.description || '')]; configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration); if (this.currentIconTheme.isLoaded) { - this.iconThemeStore.findThemeData(this.currentIconTheme.id).then(theme => { + if (event.added.length > 0 && event.added.length < event.themes.length) { + prevFileIconId = this.currentIconTheme.id; + this.setFileIconTheme(event.added[0].id, 'auto'); + } else { + const theme = await this.iconThemeStore.findThemeData(this.currentIconTheme.id); if (!theme) { - this.setFileIconTheme(DEFAULT_ICON_THEME_SETTING_VALUE, undefined); - } else { - this.restoreFileIconTheme(); + if (prevFileIconId && await this.iconThemeStore.findThemeData(prevColorId)) { + this.setFileIconTheme(prevFileIconId, 'auto'); + } else { + this.setFileIconTheme(DEFAULT_ICON_THEME_SETTING_VALUE, 'auto'); + } } - }); + } } }); } @@ -301,7 +317,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { return this.getColorTheme(); } - public setColorTheme(themeId: string | undefined, settingsTarget: ConfigurationTarget | undefined): Promise { + public setColorTheme(themeId: string | undefined, settingsTarget: ConfigurationTarget | undefined | 'auto'): Promise { if (!themeId) { return Promise.resolve(null); } @@ -360,7 +376,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { _applyRules(cssRules.join('\n'), colorThemeRulesClassName); } - private applyTheme(newTheme: ColorThemeData, settingsTarget: ConfigurationTarget | undefined, silent = false): Promise { + private applyTheme(newTheme: ColorThemeData, settingsTarget: ConfigurationTarget | undefined | 'auto', silent = false): Promise { if (this.container) { if (this.currentColorTheme) { removeClasses(this.container, this.currentColorTheme.id); @@ -399,7 +415,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { return this.writeColorThemeConfiguration(settingsTarget); } - private writeColorThemeConfiguration(settingsTarget: ConfigurationTarget | undefined): Promise { + private writeColorThemeConfiguration(settingsTarget: ConfigurationTarget | undefined | 'auto'): Promise { if (!types.isUndefinedOrNull(settingsTarget)) { return this.configurationWriter.writeConfiguration(COLOR_THEME_SETTING, this.currentColorTheme.settingsId, settingsTarget).then(_ => this.currentColorTheme); } @@ -444,7 +460,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { return this.currentIconTheme; } - public setFileIconTheme(iconTheme: string | undefined, settingsTarget: ConfigurationTarget | undefined): Promise { + public setFileIconTheme(iconTheme: string | undefined, settingsTarget: ConfigurationTarget | undefined | 'auto'): Promise { iconTheme = iconTheme || ''; if (iconTheme === this.currentIconTheme.id && this.currentIconTheme.isLoaded) { return this.writeFileIconConfiguration(settingsTarget); @@ -506,7 +522,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { } - private writeFileIconConfiguration(settingsTarget: ConfigurationTarget | undefined): Promise { + private writeFileIconConfiguration(settingsTarget: ConfigurationTarget | undefined | 'auto'): Promise { if (!types.isUndefinedOrNull(settingsTarget)) { return this.configurationWriter.writeConfiguration(ICON_THEME_SETTING, this.currentIconTheme.settingsId, settingsTarget).then(_ => this.currentIconTheme); } @@ -559,8 +575,18 @@ class ConfigurationWriter { constructor(@IConfigurationService private readonly configurationService: IConfigurationService) { } - public writeConfiguration(key: string, value: any, settingsTarget: ConfigurationTarget): Promise { + public writeConfiguration(key: string, value: any, settingsTarget: ConfigurationTarget | 'auto'): Promise { let settings = this.configurationService.inspect(key); + if (settingsTarget === 'auto') { + if (!types.isUndefined(settings.workspaceFolder)) { + settingsTarget = ConfigurationTarget.WORKSPACE_FOLDER; + } else if (!types.isUndefined(settings.workspace)) { + settingsTarget = ConfigurationTarget.WORKSPACE; + } else { + settingsTarget = ConfigurationTarget.USER; + } + } + if (settingsTarget === ConfigurationTarget.USER) { if (value === settings.user) { return Promise.resolve(undefined); // nothing to do @@ -570,7 +596,7 @@ class ConfigurationWriter { } value = undefined; // remove configuration from user settings } - } else if (settingsTarget === ConfigurationTarget.WORKSPACE) { + } else if (settingsTarget === ConfigurationTarget.WORKSPACE || settingsTarget === ConfigurationTarget.WORKSPACE_FOLDER) { if (value === settings.value) { return Promise.resolve(undefined); // nothing to do } From 10c3fcb4fc6d8e6ddc5a995763ce188d9656f364 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 12:58:01 -0800 Subject: [PATCH 171/429] Fixes #67430 --- .../typescript-language-features/src/features/completions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/typescript-language-features/src/features/completions.ts b/extensions/typescript-language-features/src/features/completions.ts index c0020fdfef0..d5822dede34 100644 --- a/extensions/typescript-language-features/src/features/completions.ts +++ b/extensions/typescript-language-features/src/features/completions.ts @@ -457,7 +457,7 @@ class TypeScriptCompletionItemProvider implements vscode.CompletionItemProvider }; const response = await this.client.interruptGetErr(() => this.client.execute('completionEntryDetails', args, token)); - if (response.type !== 'response' || !response.body) { + if (response.type !== 'response' || !response.body || !response.body.length) { return item; } From 3e255d98cf6598fbc923a45da83e9b9bdd254355 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 30 Jan 2019 22:16:35 +0100 Subject: [PATCH 172/429] fix null checks --- .../services/themes/electron-browser/colorThemeStore.ts | 4 ++-- .../services/themes/electron-browser/fileIconThemeStore.ts | 4 ++-- .../services/themes/electron-browser/workbenchThemeService.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts index 73a58b9b08d..0b724501115 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts @@ -67,8 +67,8 @@ export class ColorThemeStore { private initialize() { themesExtPoint.setHandler((extensions, delta) => { - const previousIds = {}; - const added = []; + const previousIds: { [key: string]: boolean } = {}; + const added: ColorThemeData[] = []; for (const theme of this.extensionsColorThemes) { previousIds[theme.id] = true; } diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts index 45d43d7d0d5..437387c81f4 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts @@ -62,8 +62,8 @@ export class FileIconThemeStore { private initialize() { iconThemeExtPoint.setHandler((extensions) => { - const previousIds = {}; - const added = []; + const previousIds: { [key: string]: boolean } = {}; + const added: FileIconThemeData[] = []; for (const theme of this.knownIconThemes) { previousIds[theme.id] = true; } diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index f53629370b3..a64c0f8be21 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -200,7 +200,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { } else { const theme = await this.iconThemeStore.findThemeData(this.currentIconTheme.id); if (!theme) { - if (prevFileIconId && await this.iconThemeStore.findThemeData(prevColorId)) { + if (prevFileIconId && await this.iconThemeStore.findThemeData(prevFileIconId)) { this.setFileIconTheme(prevFileIconId, 'auto'); } else { this.setFileIconTheme(DEFAULT_ICON_THEME_SETTING_VALUE, 'auto'); From 4833debfe0c07d2631a180250ab7821f6baa47e8 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Wed, 30 Jan 2019 14:27:40 -0800 Subject: [PATCH 173/429] Update css grammar. Fix #66775 --- extensions/css/syntaxes/css.tmLanguage.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/css/syntaxes/css.tmLanguage.json b/extensions/css/syntaxes/css.tmLanguage.json index 488c8f12c30..a45463c8b9b 100644 --- a/extensions/css/syntaxes/css.tmLanguage.json +++ b/extensions/css/syntaxes/css.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/octref/language-css/commit/7e06c88b89218fe6e8eba77fb674152f1cea0b10", + "version": "https://github.com/octref/language-css/commit/6d3a2d01dd67ef062030f4520dd42a5424330a3b", "name": "CSS", "scopeName": "source.css", "patterns": [ @@ -1397,7 +1397,7 @@ "property-names": { "patterns": [ { - "match": "(?xi) (? Date: Wed, 30 Jan 2019 14:51:58 -0800 Subject: [PATCH 174/429] Fixes keybinding `args` contribution type #31372 --- .../services/keybinding/electron-browser/keybindingService.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts index 24399d5b830..817b087ec8e 100644 --- a/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts +++ b/src/vs/workbench/services/keybinding/electron-browser/keybindingService.ts @@ -209,8 +209,7 @@ let keybindingType: IJSONSchema = { type: 'string' }, args: { - 'description': nls.localize('vscode.extension.contributes.keybindings.args', "Arguments to pass to the command to execute."), - type: 'any' + description: nls.localize('vscode.extension.contributes.keybindings.args', "Arguments to pass to the command to execute.") }, key: { description: nls.localize('vscode.extension.contributes.keybindings.key', 'Key or key sequence (separate keys with plus-sign and sequences with space, e.g Ctrl+O and Ctrl+L L for a chord).'), From 1fb26f9b5791f612e322589383fb99fbcb005e7b Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 30 Jan 2019 14:53:00 -0800 Subject: [PATCH 175/429] make editor area return more intuitive --- src/vs/workbench/browser/parts/editor/editorPart.ts | 4 ++++ src/vs/workbench/electron-browser/workbench.ts | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index d64cb6ecce4..e27bd5db5de 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -110,6 +110,9 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor private _onDidPreferredSizeChange: Emitter = this._register(new Emitter()); get onDidPreferredSizeChange(): Event { return this._onDidPreferredSizeChange.event; } + private _onDidActivateGroup: Emitter = this._register(new Emitter()); + get onDidActivateGroup(): Event { return this._onDidActivateGroup.event; } + //#endregion private dimension: Dimension; @@ -319,6 +322,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor const groupView = this.assertGroupView(group); this.doSetGroupActive(groupView); + this._onDidActivateGroup.fire(groupView); return groupView; } diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index f20aff0ed3b..9a61a7653a3 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -502,6 +502,9 @@ export class Workbench extends Disposable implements IPartService { // Listen to visible editor changes this._register(this.editorService.onDidVisibleEditorsChange(() => this.onDidVisibleEditorsChange())); + // Listen to editor group activations when editor is hidden + this._register(this.editorPart.onDidActivateGroup(() => { if (this.editorHidden) { this.setEditorHidden(false); } })); + // Listen to editor closing (if we run with --wait) const filesToWait = this.workbenchParams.configuration.filesToWait; if (filesToWait) { @@ -1272,6 +1275,8 @@ export class Workbench extends Disposable implements IPartService { return !this.statusBarHidden; case Parts.ACTIVITYBAR_PART: return !this.activityBarHidden; + case Parts.EDITOR_PART: + return this.workbenchGrid instanceof Grid ? !this.editorHidden : true; } return true; // any other part cannot be hidden From 498eb67b0c2d7bd29f8a724d619675a18a988687 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Wed, 30 Jan 2019 14:56:04 -0800 Subject: [PATCH 176/429] Scope reactions css for comments --- .../workbench/parts/comments/electron-browser/media/review.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/media/review.css b/src/vs/workbench/parts/comments/electron-browser/media/review.css index b8cf5584e59..040faaee75b 100644 --- a/src/vs/workbench/parts/comments/electron-browser/media/review.css +++ b/src/vs/workbench/parts/comments/electron-browser/media/review.css @@ -86,7 +86,7 @@ } -.monaco-editor .review-widget .body .monaco-text-button { +.monaco-editor .review-widget .body .comment-reactions .monaco-text-button { margin: 0 7px 0 0; width: 30px; background-color: transparent; From 0d7a9b186034af672637df3faf6c6b735c674283 Mon Sep 17 00:00:00 2001 From: kieferrm Date: Wed, 30 Jan 2019 15:59:04 -0800 Subject: [PATCH 177/429] update distro --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4f78caf443e..eea0c327466 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.31.0", - "distro": "455b23e66edb0fb17a1d7f5764ff35eec7c1b2d1", + "distro": "cb7599e6323871114d034681abb30ed5e2066d3c", "author": { "name": "Microsoft Corporation" }, From 536b8cc95af732c010567392ae2db55dc92c4758 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 30 Jan 2019 16:03:20 -0800 Subject: [PATCH 178/429] fix moving panel while hidden in grid layout fixes #67370 --- src/vs/workbench/electron-browser/workbench.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 9a61a7653a3..9ed3fc19dba 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -1804,9 +1804,9 @@ export class Workbench extends Disposable implements IPartService { if (this.workbenchGrid instanceof Grid) { if (!wasHidden) { this.saveLastPanelDimension(); - this.workbenchGrid.removeView(this.panelPartView); } + this.workbenchGrid.removeView(this.panelPartView); this.layout(); } else { this.workbenchGrid.layout(); From f28a9f918d8b056a05aeb2cd2800058c71786bc9 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Wed, 30 Jan 2019 16:07:52 -0800 Subject: [PATCH 179/429] fix moving sidebar while hidden fixes #67370 --- src/vs/workbench/electron-browser/workbench.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 9ed3fc19dba..f222c743e7d 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -1738,12 +1738,10 @@ export class Workbench extends Disposable implements IPartService { if (!wasHidden) { this.uiState.lastSidebarDimension = this.workbenchGrid.getViewSize(this.sidebarPartView); - this.workbenchGrid.removeView(this.sidebarPartView); } - if (!this.activityBarHidden) { - this.workbenchGrid.removeView(this.activitybarPartView); - } + this.workbenchGrid.removeView(this.sidebarPartView); + this.workbenchGrid.removeView(this.activitybarPartView); if (!this.panelHidden && this.panelPosition === Position.BOTTOM) { this.workbenchGrid.removeView(this.panelPartView); From d6a9c8c6144d2e58dfb6570981763163cbe5f04a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 16:00:25 -0800 Subject: [PATCH 180/429] Recomend new tslint extension on welcome page --- .../parts/welcome/page/electron-browser/welcomePage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts index 3e7bb14b1af..9a60c85c0e6 100644 --- a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts @@ -146,7 +146,7 @@ interface ExtensionSuggestion { const extensionPacks: ExtensionSuggestion[] = [ { name: localize('welcomePage.javaScript', "JavaScript"), id: 'dbaeumer.vscode-eslint' }, - { name: localize('welcomePage.typeScript', "TypeScript"), id: 'eg2.tslint' }, + { name: localize('welcomePage.typeScript', "TypeScript"), id: 'ms-vscode.vscode-typescript-tslint-plugin' }, { name: localize('welcomePage.python', "Python"), id: 'ms-python.python' }, // { name: localize('welcomePage.go', "Go"), id: 'lukehoban.go' }, { name: localize('welcomePage.php', "PHP"), id: 'felixfbecker.php-pack' }, From 7a53ca7deca120e8e60a4fe4a4b429272d2da9b8 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 16:10:49 -0800 Subject: [PATCH 181/429] Update distro version --- package.json | 2 +- .../electron-browser/extensionsTipsService.test.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index eea0c327466..5653c44fcae 100644 --- a/package.json +++ b/package.json @@ -150,4 +150,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.3" } -} +} \ No newline at end of file diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts index fbe007ccbed..64a23326120 100644 --- a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts +++ b/src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts @@ -370,7 +370,7 @@ suite('ExtensionsTipsService Test', () => { test('ExtensionTipsService: No Recommendations of globally ignored recommendations', () => { const storageGetterStub = (a, _, c) => { - const storedRecommendations = '["ms-vscode.csharp", "ms-python.python", "eg2.tslint"]'; + const storedRecommendations = '["ms-vscode.csharp", "ms-python.python", "ms-vscode.vscode-typescript-tslint-plugin"]'; const ignoredRecommendations = '["ms-vscode.csharp", "mockpublisher2.mockextension2"]'; // ignore a stored recommendation and a workspace recommendation. if (a === 'extensionsAssistant/recommendations') { return storedRecommendations; } if (a === 'extensionsAssistant/ignored_recommendations') { return ignoredRecommendations; } @@ -508,7 +508,7 @@ suite('ExtensionsTipsService Test', () => { }); test('ExtensionTipsService: Get file based recommendations from storage (old format)', () => { - const storedRecommendations = '["ms-vscode.csharp", "ms-python.python", "eg2.tslint"]'; + const storedRecommendations = '["ms-vscode.csharp", "ms-python.python", "ms-vscode.vscode-typescript-tslint-plugin"]'; instantiationService.stub(IStorageService, { get: (a, b, c) => a === 'extensionsAssistant/recommendations' ? storedRecommendations : c }); return setUpFolderWorkspace('myFolder', []).then(() => { @@ -518,7 +518,7 @@ suite('ExtensionsTipsService Test', () => { assert.equal(recommendations.length, 2); assert.ok(recommendations.some(({ extensionId }) => extensionId === 'ms-vscode.csharp')); // stored recommendation that exists in product.extensionTips assert.ok(recommendations.some(({ extensionId }) => extensionId === 'ms-python.python')); // stored recommendation that exists in product.extensionImportantTips - assert.ok(recommendations.every(({ extensionId }) => extensionId !== 'eg2.tslint')); // stored recommendation that is no longer in neither product.extensionTips nor product.extensionImportantTips + assert.ok(recommendations.every(({ extensionId }) => extensionId !== 'ms-vscode.vscode-typescript-tslint-plugin')); // stored recommendation that is no longer in neither product.extensionTips nor product.extensionImportantTips }); }); }); @@ -527,7 +527,7 @@ suite('ExtensionsTipsService Test', () => { const milliSecondsInADay = 1000 * 60 * 60 * 24; const now = Date.now(); const tenDaysOld = 10 * milliSecondsInADay; - const storedRecommendations = `{"ms-vscode.csharp": ${now}, "ms-python.python": ${now}, "eg2.tslint": ${now}, "lukehoban.Go": ${tenDaysOld}}`; + const storedRecommendations = `{"ms-vscode.csharp": ${now}, "ms-python.python": ${now}, "ms-vscode.vscode-typescript-tslint-plugin": ${now}, "lukehoban.Go": ${tenDaysOld}}`; instantiationService.stub(IStorageService, { get: (a, b, c) => a === 'extensionsAssistant/recommendations' ? storedRecommendations : c }); return setUpFolderWorkspace('myFolder', []).then(() => { @@ -537,7 +537,7 @@ suite('ExtensionsTipsService Test', () => { assert.equal(recommendations.length, 2); assert.ok(recommendations.some(({ extensionId }) => extensionId === 'ms-vscode.csharp')); // stored recommendation that exists in product.extensionTips assert.ok(recommendations.some(({ extensionId }) => extensionId === 'ms-python.python')); // stored recommendation that exists in product.extensionImportantTips - assert.ok(recommendations.every(({ extensionId }) => extensionId !== 'eg2.tslint')); // stored recommendation that is no longer in neither product.extensionTips nor product.extensionImportantTips + assert.ok(recommendations.every(({ extensionId }) => extensionId !== 'ms-vscode.vscode-typescript-tslint-plugin')); // stored recommendation that is no longer in neither product.extensionTips nor product.extensionImportantTips assert.ok(recommendations.every(({ extensionId }) => extensionId !== 'lukehoban.Go')); //stored recommendation that is older than a week }); }); From 9a766eaa38990f47f40a76b7ba2511dbcf74c0c4 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 30 Jan 2019 18:50:41 -0800 Subject: [PATCH 182/429] Make sure we update tag closing registration when the document's language changes Fixes #67613 --- .../src/features/tagClosing.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/extensions/typescript-language-features/src/features/tagClosing.ts b/extensions/typescript-language-features/src/features/tagClosing.ts index e4df1264ccf..34ddd2c0285 100644 --- a/extensions/typescript-language-features/src/features/tagClosing.ts +++ b/extensions/typescript-language-features/src/features/tagClosing.ts @@ -144,6 +144,7 @@ export class ActiveDocumentDependentRegistration extends Disposable { super(); this._registration = this._register(new ConditionalRegistration(register)); vscode.window.onDidChangeActiveTextEditor(this.update, this, this._disposables); + vscode.workspace.onDidOpenTextDocument(this.onDidOpenDocument, this, this._disposables); this.update(); } @@ -152,6 +153,13 @@ export class ActiveDocumentDependentRegistration extends Disposable { const enabled = !!(editor && vscode.languages.match(this.selector, editor.document)); this._registration.update(enabled); } + + private onDidOpenDocument(openedDocument: vscode.TextDocument) { + if (vscode.window.activeTextEditor && vscode.window.activeTextEditor.document === openedDocument) { + // The active document's language may have changed + this.update(); + } + } } export function register( From 9b1f263a88f91170fff51ede1b030b165ce53cd4 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 30 Jan 2019 20:45:02 -0800 Subject: [PATCH 183/429] Fix #67587 --- .../electron-browser/media/settingsEditor2.css | 13 +++++++++++-- .../electron-browser/settingsEditor2.ts | 17 ++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css b/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css index a29751e89bd..0674380596b 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css +++ b/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css @@ -99,7 +99,7 @@ position: relative; } -.settings-editor > .settings-body > .no-results { +.settings-editor > .settings-body > .no-results-message { display: none; max-width: 1000px; margin: auto; @@ -109,7 +109,16 @@ box-sizing: border-box; } -.settings-editor > .settings-body > .no-results a.prominent { +.settings-editor.no-results > .settings-body .settings-toc-container, +.settings-editor.no-results > .settings-body .settings-tree-container { + display: none; +} + +.settings-editor.no-results > .settings-body > .no-results-message { + display: block; +} + +.settings-editor > .settings-body > .no-results-message a.prominent { text-decoration: underline; } diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index 30d99008bc7..b0d31cad7b7 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -455,7 +455,7 @@ export class SettingsEditor2 extends BaseEditor { private createBody(parent: HTMLElement): void { const bodyContainer = DOM.append(parent, $('.settings-body')); - this.noResultsMessage = DOM.append(bodyContainer, $('.no-results')); + this.noResultsMessage = DOM.append(bodyContainer, $('.no-results-message')); this.noResultsMessage.innerText = localize('noResults', "No Settings Found"); @@ -950,6 +950,8 @@ export class SettingsEditor2 extends BaseEditor { } } + this.renderResultCountMessages(); + if (key) { const elements = this.currentSettingsModel.getElementsByName(key); if (elements && elements.length) { @@ -1034,13 +1036,13 @@ export class SettingsEditor2 extends BaseEditor { // Added a filter model this.tocTree.setSelection([]); this.tocTree.expandAll(); - this.refreshTree(); this.renderResultCountMessages(); + this.refreshTree(); } else { // Leaving search mode this.tocTree.collapseAll(); - this.refreshTree(); this.renderResultCountMessages(); + this.refreshTree(); } this.refreshTOCTree(); @@ -1147,9 +1149,7 @@ export class SettingsEditor2 extends BaseEditor { return Promise.all([ this.filterOrSearchPreferences(query, SearchResultIdx.Remote, remoteSearchProvider, token), this.filterOrSearchPreferences(query, SearchResultIdx.NewExtensions, newExtSearchProvider, token) - ]).then(() => { - this.renderResultCountMessages(); - }); + ]).then(() => { }); } private filterOrSearchPreferences(query: string, type: SearchResultIdx, searchProvider: ISearchProvider, token?: CancellationToken): Promise { @@ -1164,7 +1164,6 @@ export class SettingsEditor2 extends BaseEditor { this.searchResultModel.setResult(type, result); this.tocTreeModel.currentSearchModel = this.searchResultModel; this.onSearchModeToggled(); - this.refreshTree(); } else { this.searchResultModel.setResult(type, result); this.tocTreeModel.update(); @@ -1174,7 +1173,7 @@ export class SettingsEditor2 extends BaseEditor { this.viewState.filterToCategory = null; this.tocTree.expandAll(); - return this.renderTree().then(() => result); + return this.renderTree(undefined, true).then(() => result); }); } @@ -1192,7 +1191,7 @@ export class SettingsEditor2 extends BaseEditor { } this.countElement.style.display = 'block'; - this.noResultsMessage.style.display = count === 0 ? 'block' : 'none'; + DOM.toggleClass(this.rootElement, 'no-results', count === 0); this.clearFilterLinkContainer.style.display = this.viewState.tagFilters && this.viewState.tagFilters.size > 0 ? 'initial' : 'none'; From 7f136b44cff0cd3486ac88b43598b8c72b025d16 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 30 Jan 2019 21:14:46 -0800 Subject: [PATCH 184/429] Fix bad highlight in inactive toc tree --- src/vs/workbench/parts/preferences/browser/tocTree.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/tocTree.ts b/src/vs/workbench/parts/preferences/browser/tocTree.ts index b3459279b3c..ac87ea537d6 100644 --- a/src/vs/workbench/parts/preferences/browser/tocTree.ts +++ b/src/vs/workbench/parts/preferences/browser/tocTree.ts @@ -5,6 +5,7 @@ import * as DOM from 'vs/base/browser/dom'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; +import { DefaultStyleController } from 'vs/base/browser/ui/list/listWidget'; import { IObjectTreeOptions, ObjectTree } from 'vs/base/browser/ui/tree/objectTree'; import { ITreeElement, ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; import { Iterator } from 'vs/base/common/iterator'; @@ -157,6 +158,7 @@ export class TOCTree extends ObjectTree { ) { // test open mode + const treeClass = 'settings-toc-tree'; const filter = instantiationService.createInstance(SettingsTreeFilter, viewState); const options: IObjectTreeOptions = { filter, @@ -165,7 +167,8 @@ export class TOCTree extends ObjectTree { getId(e) { return e.id; } - } + }, + styleController: new DefaultStyleController(DOM.createStyleSheet(container), treeClass) }; super(container, @@ -173,7 +176,6 @@ export class TOCTree extends ObjectTree { [new TOCRenderer()], options); - const treeClass = 'settings-toc-tree'; this.getHTMLElement().classList.add(treeClass); this.disposables.push(attachStyler(themeService, { @@ -187,6 +189,8 @@ export class TOCTree extends ObjectTree { listHoverBackground: editorBackground, listInactiveSelectionBackground: editorBackground, listInactiveSelectionForeground: settingsHeaderForeground, + listInactiveFocusBackground: editorBackground, + listInactiveFocusOutline: editorBackground }, colors => { this.style(colors); })); From 07bc7cb9dff13a7742ab69d9b2fd46760f9f1261 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Wed, 30 Jan 2019 22:24:07 -0800 Subject: [PATCH 185/429] Fix terminal reflow problems Fixes #67439 Fixes #67359 Fixes #67364 --- package.json | 2 +- .../electron-browser/terminalInstance.ts | 59 ++++++++++--------- yarn.lock | 8 +-- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index 5653c44fcae..781fc7bde22 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "vscode-ripgrep": "^1.2.5", "vscode-sqlite3": "4.0.7", "vscode-textmate": "^4.0.1", - "vscode-xterm": "3.11.0-beta1", + "vscode-xterm": "3.11.0-beta2", "winreg": "^1.2.4", "yauzl": "^2.9.1", "yazl": "^2.4.3" diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index c0c72063d10..b19e38fcae5 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -3,42 +3,42 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as browser from 'vs/base/browser/browser'; -import * as lifecycle from 'vs/base/common/lifecycle'; -import * as nls from 'vs/nls'; -import * as platform from 'vs/base/common/platform'; -import * as dom from 'vs/base/browser/dom'; -import * as paths from 'vs/base/common/paths'; +import { execFile } from 'child_process'; import * as os from 'os'; import * as path from 'path'; -import { Event, Emitter } from 'vs/base/common/event'; -import { debounce } from 'vs/base/common/decorators'; -import { WindowsShellHelper } from 'vs/workbench/parts/terminal/node/windowsShellHelper'; -import { Terminal as XTermTerminal, ISearchOptions } from 'vscode-xterm'; -import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; -import { ITerminalInstance, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, IShellLaunchConfig, ITerminalProcessManager, ProcessState, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ITerminalDimensions } from 'vs/workbench/parts/terminal/common/terminal'; -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeyCode } from 'vs/base/common/keyCodes'; +import * as browser from 'vs/base/browser/browser'; +import * as dom from 'vs/base/browser/dom'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { debounce } from 'vs/base/common/decorators'; +import { Emitter, Event } from 'vs/base/common/event'; +import { KeyCode } from 'vs/base/common/keyCodes'; +import * as lifecycle from 'vs/base/common/lifecycle'; +import * as paths from 'vs/base/common/paths'; +import * as platform from 'vs/base/common/platform'; import { TabFocus } from 'vs/editor/common/config/commonEditorConfig'; +import * as nls from 'vs/nls'; +import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; +import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; +import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { ILogService } from 'vs/platform/log/common/log'; +import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification'; +import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { activeContrastBorder, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry'; +import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; +import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; +import { IShellLaunchConfig, ITerminalDimensions, ITerminalInstance, ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; +import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; +import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; import { TerminalLinkHandler } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; -import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; -import { registerThemingParticipant, ITheme, ICssStyleCollector, IThemeService } from 'vs/platform/theme/common/themeService'; -import { scrollbarSliderBackground, scrollbarSliderHoverBackground, scrollbarSliderActiveBackground, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; -import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; -import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; -import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { INotificationService, Severity, IPromptChoice } from 'vs/platform/notification/common/notification'; -import { ILogService } from 'vs/platform/log/common/log'; -import { TerminalCommandTracker } from 'vs/workbench/parts/terminal/node/terminalCommandTracker'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { execFile } from 'child_process'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; import { TerminalProcessManager } from 'vs/workbench/parts/terminal/electron-browser/terminalProcessManager'; +import { TerminalCommandTracker } from 'vs/workbench/parts/terminal/node/terminalCommandTracker'; +import { WindowsShellHelper } from 'vs/workbench/parts/terminal/node/windowsShellHelper'; +import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; +import { ISearchOptions, Terminal as XTermTerminal } from 'vscode-xterm'; // How long in milliseconds should an average frame take to render for a notification to appear // which suggests the fallback DOM-based renderer @@ -1185,6 +1185,7 @@ export class TerminalInstance implements ITerminalInstance { this._resize(); } + @debounce(50) private _resize(): void { let cols = this._cols; let rows = this._rows; diff --git a/yarn.lock b/yarn.lock index 82332aa7d79..42352c9383a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9433,10 +9433,10 @@ vscode-uri@^1.0.6: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d" integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww== -vscode-xterm@3.11.0-beta1: - version "3.11.0-beta1" - resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.11.0-beta1.tgz#1c4dac56e8e87839e8cbc4a6481916f578e3ad8e" - integrity sha512-9T1uswvZ4fGGa+rXCT7AFmTbwQsuARoyG75FzTr0MYDXxg0hufnofWZ73LBn92yY/GP9bv2oJZ5Wc4LDlX6OJQ== +vscode-xterm@3.11.0-beta2: + version "3.11.0-beta2" + resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.11.0-beta2.tgz#fe5295c835fcff00fee55cbb1d5a4bf537d105a2" + integrity sha512-QG9ALgfH4+YUblN1G/AAdf40MJPOeb0p2u2k9MwcIvaJGQmk5Pp2KZUiQbO+ycfeuisTTVtqjceG7MutIEVZSQ== vso-node-api@6.1.2-preview: version "6.1.2-preview" From d5e2c72eb08fce7510fd6e23265f0ab22912725b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 09:27:05 +0100 Subject: [PATCH 186/429] fixes #67492 --- src/vs/base/browser/ui/tree/abstractTree.ts | 2 +- .../workbench/browser/actions/listCommands.ts | 22 ++++++++++++++----- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 036b4ddf543..de9e3c1eb1c 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -1115,7 +1115,7 @@ export abstract class AbstractTree implements IDisposable const didChange = this.model.setCollapsed(location, false); if (!didChange) { - if (node.children.length === 0) { + if (!node.children.some(child => child.visible)) { return; } diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index e5ee5abd4e3..9b113ef082b 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -310,6 +310,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ // Tree only if (focused && !(focused instanceof List || focused instanceof PagedList)) { if (focused instanceof ObjectTree || focused instanceof DataTree) { + // TODO@Joao: instead of doing this here, just delegate to a tree method const tree = focused; const focusedElements = tree.getFocus(); @@ -323,12 +324,17 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ const child = tree.getFirstElementChild(focus); if (child) { - const fakeKeyboardEvent = new KeyboardEvent('keydown'); - tree.setFocus([child], fakeKeyboardEvent); - tree.reveal(child); + const node = tree.getNode(child); + + if (node.visible) { + const fakeKeyboardEvent = new KeyboardEvent('keydown'); + tree.setFocus([child], fakeKeyboardEvent); + tree.reveal(child); + } } } } else if (focused instanceof AsyncDataTree) { + // TODO@Joao: instead of doing this here, just delegate to a tree method const tree = focused; const focusedElements = tree.getFocus(); @@ -342,9 +348,13 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ const child = tree.getFirstElementChild(focus); if (child) { - const fakeKeyboardEvent = new KeyboardEvent('keydown'); - tree.setFocus([child], fakeKeyboardEvent); - tree.reveal(child); + const node = tree.getNode(child); + + if (node.visible) { + const fakeKeyboardEvent = new KeyboardEvent('keydown'); + tree.setFocus([child], fakeKeyboardEvent); + tree.reveal(child); + } } } }); From 66b8820e56a23a38c4f4b21ee47c71fc15a8736f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 09:47:29 +0100 Subject: [PATCH 187/429] improve tree trait behaviour fixes #67595 --- src/vs/base/browser/ui/tree/abstractTree.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index de9e3c1eb1c..9521a95a882 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -689,12 +689,17 @@ class Trait { } remove(nodes: ITreeNode[]): void { - const set = this.nodeSet; - - for (const node of nodes) { - set.delete(node); + if (nodes.length === 0) { + return; } + const set = this.nodeSet; + const visit = (node: ITreeNode) => { + set.delete(node); + node.children.forEach(visit); + }; + + nodes.forEach(visit); this.set(values(set)); } } From fcefb67a2a7c2a848eba8f4c9381c6236134825e Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 09:56:37 +0100 Subject: [PATCH 188/429] fixes #67627 --- src/vs/base/browser/ui/tree/abstractTree.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 9521a95a882..d5019da6031 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -493,7 +493,7 @@ class TypeFilterController implements IDisposable { const element = focus[0]; if (this.tree.getRelativeTop(element) === null) { - this.tree.reveal(focus[0], 0.5); + this.tree.reveal(element, 0.5); } } @@ -1043,6 +1043,11 @@ export abstract class AbstractTree implements IDisposable reveal(location: TRef, relativeTop?: number): void { const index = this.model.getListIndex(location); + + if (index === -1) { + return null; + } + this.view.reveal(index, relativeTop); } @@ -1052,6 +1057,11 @@ export abstract class AbstractTree implements IDisposable */ getRelativeTop(location: TRef): number | null { const index = this.model.getListIndex(location); + + if (index === -1) { + return null; + } + return this.view.getRelativeTop(index); } From c8e5503a4c67926160f0b8b418177919f66691d0 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 09:58:29 +0100 Subject: [PATCH 189/429] Fix #67629 --- .../parts/extensions/electron-browser/extensionsActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 675cf034634..c24ff4e6f98 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -569,7 +569,7 @@ export class InstallAnotherVersionAction extends ExtensionAction { } update(): void { - this.enabled = this.extension && !!this.extension.gallery; + this.enabled = this.extension && this.extension.type === ExtensionType.User && !!this.extension.gallery; } run(): Promise { @@ -2483,7 +2483,7 @@ export class InstallSpecificVersionOfExtensionAction extends Action { } private isEnabled(extension: IExtension): boolean { - return !!extension.gallery && (extension.enablementState === EnablementState.Enabled || extension.enablementState === EnablementState.WorkspaceEnabled); + return extension.type === ExtensionType.User && !!extension.gallery && (extension.enablementState === EnablementState.Enabled || extension.enablementState === EnablementState.WorkspaceEnabled); } private async getExtensionEntries(): Promise<(IQuickPickItem & { extension: IExtension, versions: IGalleryExtensionVersion[] })[]> { From 4710cd8c3d34acea67ab167a926f3318aca9aa12 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 10:09:26 +0100 Subject: [PATCH 190/429] Revert "Fix #67629" This reverts commit c8e5503a4c67926160f0b8b418177919f66691d0. --- .../parts/extensions/electron-browser/extensionsActions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index c24ff4e6f98..675cf034634 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -569,7 +569,7 @@ export class InstallAnotherVersionAction extends ExtensionAction { } update(): void { - this.enabled = this.extension && this.extension.type === ExtensionType.User && !!this.extension.gallery; + this.enabled = this.extension && !!this.extension.gallery; } run(): Promise { @@ -2483,7 +2483,7 @@ export class InstallSpecificVersionOfExtensionAction extends Action { } private isEnabled(extension: IExtension): boolean { - return extension.type === ExtensionType.User && !!extension.gallery && (extension.enablementState === EnablementState.Enabled || extension.enablementState === EnablementState.WorkspaceEnabled); + return !!extension.gallery && (extension.enablementState === EnablementState.Enabled || extension.enablementState === EnablementState.WorkspaceEnabled); } private async getExtensionEntries(): Promise<(IQuickPickItem & { extension: IExtension, versions: IGalleryExtensionVersion[] })[]> { From a6d5a74a05e99ea18f73142452fc4c41c240d474 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 10:26:22 +0100 Subject: [PATCH 191/429] Fix #67604 --- .../parts/extensions/electron-browser/extensionsActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 675cf034634..de2c77c9b6a 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -2062,7 +2062,7 @@ export class StatusLabelAction extends Action implements IExtensionContainer { private _extension: IExtension; get extension(): IExtension { return this._extension; } set extension(extension: IExtension) { - if (!(this._extension && areSameExtensions(this._extension.identifier, extension.identifier))) { + if (!(this._extension && extension && areSameExtensions(this._extension.identifier, extension.identifier))) { // Different extension. Reset this.status = null; this.enablementState = null; From a538e27ef1085a9162906f2e84e2803a738911e3 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 09:59:53 +0100 Subject: [PATCH 192/429] fixes #67591 --- src/vs/workbench/browser/actions/listCommands.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 9b113ef082b..5fbd81fae8e 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -643,12 +643,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } const newSelection: any[] = []; - - // If the scope isn't the tree root, it should be part of the new selection - if (scope) { - newSelection.push(scope); - } - const visit = (node: ITreeNode) => { for (const child of node.children) { if (child.visible) { @@ -664,6 +658,11 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ // Add the whole scope subtree to the new selection visit(tree.getNode(scope)); + // If the scope isn't the tree root, it should be part of the new selection + if (scope && selection.length === newSelection.length) { + newSelection.unshift(scope); + } + const fakeKeyboardEvent = new KeyboardEvent('keydown'); tree.setSelection(newSelection, fakeKeyboardEvent); } From f1c66a1cbe52b6947ba88f32233c6a2dfe4fa0f9 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 10:38:17 +0100 Subject: [PATCH 193/429] strict null --- src/vs/base/browser/ui/tree/abstractTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index d5019da6031..56ea99c13f0 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -1045,7 +1045,7 @@ export abstract class AbstractTree implements IDisposable const index = this.model.getListIndex(location); if (index === -1) { - return null; + return; } this.view.reveal(index, relativeTop); From 3b28d9eb1795564a13c23b93dde7e4ee0f1b225e Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 31 Jan 2019 10:45:17 +0100 Subject: [PATCH 194/429] Fixes #67093: Require a reload when encountering 3rd party extension points --- .../extensions/electron-browser/extensionService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index 8d8af492103..36eafb01844 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -265,7 +265,13 @@ export class ExtensionService extends Disposable implements IExtensionService { for (let extPointName in extension.contributes) { if (hasOwnProperty.call(extension.contributes, extPointName)) { const extPoint = extensionPoints[extPointName]; - if (extPoint && !extPoint.isDynamic) { + if (extPoint) { + if (!extPoint.isDynamic) { + return false; + } + } else { + // This extension has a 3rd party (unknown) extension point + // ===> require a reload for now... return false; } } From 6e2852f4eea06750ea0f348ba25a5e3f24ec084c Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 11:01:17 +0100 Subject: [PATCH 195/429] Fix #66685 --- .../parts/markers/electron-browser/markersPanelActions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts index 278570fc877..43090745bbb 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts @@ -354,6 +354,9 @@ export class QuickFixActionItem extends ActionItem { if (!this.element) { return; } + if (!this.isEnabled()) { + return; + } const elementPosition = DOM.getDomNodePagePosition(this.element); this.markerWorkbenchService.getQuickFixActions((this.getAction()).marker).then(actions => { this.contextMenuService.showContextMenu({ From 4e57d8d4612a38da4b54dc783541239728343dee Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 11:07:17 +0100 Subject: [PATCH 196/429] fixes #67633 --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 2485cf1bd9e..a4f7128419d 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -215,11 +215,7 @@ function asObjectTreeOptions(options?: IAsyncDataTreeOpt return options.keyboardNavigationLabelProvider!.getKeyboardNavigationLabel(e.element as T); } }, - sorter: options.sorter && { - compare(a, b) { - return options.sorter!.compare(a.element as T, b.element as T); - } - } + sorter: undefined }; } @@ -263,6 +259,7 @@ export class AsyncDataTree implements IDisposable private readonly tree: ObjectTree, TFilterData>; private readonly root: IAsyncDataTreeNode; private readonly renderedNodes = new Map>(); + private readonly sorter?: ITreeSorter; private readonly subTreeRefreshPromises = new Map, Promise>(); private readonly refreshPromises = new Map, CancelablePromise>(); @@ -298,6 +295,7 @@ export class AsyncDataTree implements IDisposable ) { this.identityProvider = options.identityProvider; this.autoExpandSingleChildren = typeof options.autoExpandSingleChildren === 'undefined' ? false : options.autoExpandSingleChildren; + this.sorter = options.sorter; const objectTreeDelegate = new ComposedTreeDelegate>(delegate); const objectTreeRenderers = renderers.map(r => new DataTreeRenderer(r, this._onDidChangeNodeSlowState.event)); @@ -693,7 +691,15 @@ export class AsyncDataTree implements IDisposable return result; } - result = createCancelablePromise(_ => Promise.resolve(this.dataSource.getChildren(node.element!))); + result = createCancelablePromise(async () => { + const children = await this.dataSource.getChildren(node.element!); + + if (this.sorter) { + children.sort(this.sorter.compare.bind(this.sorter)); + } + + return children; + }); this.refreshPromises.set(node, result); return always(result, () => this.refreshPromises.delete(node)); } From 23e901b7529788f58214d9b5a3cc63c37419cf21 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 31 Jan 2019 11:13:28 +0100 Subject: [PATCH 197/429] fix #67626 --- .../parts/snippets/electron-browser/snippetsService.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts b/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts index 524250d2cf2..7a288503970 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts @@ -301,8 +301,11 @@ class SnippetsService implements ISnippetsService { private _initFolderSnippets(source: SnippetSource, folder: URI, bucket: IDisposable[]): Promise { let disposables: IDisposable[] = []; - let addFolderSnippets = () => { + let addFolderSnippets = (type?: FileChangeType) => { disposables = dispose(disposables); + if (type === FileChangeType.DELETED) { + return Promise.resolve(); + } return this._fileService.resolveFile(folder).then(stat => { for (const entry of stat.children || []) { disposables.push(this._addSnippetFile(entry.resource, source)); From 01aff5ab6c9d76177e8c42a80be7eff711c14355 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 31 Jan 2019 11:33:35 +0100 Subject: [PATCH 198/429] explorer: Ignore first active editor change, since on startup we already reveal the active editor --- .../parts/files/electron-browser/views/explorerView.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 4f3b10f4513..0b558779712 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -63,7 +63,8 @@ export class ExplorerView extends ViewletPanel { private dragHandler: DelayedDragHandler; private decorationProvider: ExplorerDecorationsProvider; private autoReveal = false; - private ignoreActiveEditorChange; + // Ignore first active editor change, since on startup we already reveal the active editor + private ignoreActiveEditorChange = true; constructor( options: IViewletPanelOptions, @@ -196,6 +197,7 @@ export class ExplorerView extends ViewletPanel { if (!this.ignoreActiveEditorChange) { this.selectActiveFile(); } + this.ignoreActiveEditorChange = false; })); // Also handle configuration updates @@ -338,10 +340,7 @@ export class ExplorerView extends ViewletPanel { this.telemetryService.publicLog('workbenchActionExecuted', { id: 'workbench.files.openFile', from: 'explorer' }); this.ignoreActiveEditorChange = true; this.editorService.openEditor({ resource: selection[0].resource, options: { preserveFocus: (e.browserEvent instanceof MouseEvent) && !isDoubleClick, pinned: isDoubleClick || isMiddleClick } }, sideBySide ? SIDE_GROUP : ACTIVE_GROUP) - .then(() => this.ignoreActiveEditorChange = false).catch(e => { - this.ignoreActiveEditorChange = false; - onUnexpectedError(e); - }); + .then(undefined, onUnexpectedError); } })); From c4dc6df3fc313c45fd7603ace6415e4d9e9096fc Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 31 Jan 2019 11:43:38 +0100 Subject: [PATCH 199/429] fixes #67570 --- src/vs/workbench/parts/files/electron-browser/fileActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.ts index 0b22d39d37d..f38833fd7cd 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.ts @@ -484,7 +484,7 @@ class PasteFileAction extends BaseErrorReportingAction { } return undefined; - }); + }, e => this.onError(e)); }, error => { this.onError(new Error(nls.localize('fileDeleted', "File to paste was deleted or moved meanwhile"))); }); From d3ea4a5aa77b06c6d2de82207315449dafb29244 Mon Sep 17 00:00:00 2001 From: Yan Pashkovsky Date: Thu, 31 Jan 2019 13:42:37 +0300 Subject: [PATCH 200/429] rejected promise not handled verbose message --- .../services/extensions/node/extensionHostProcess.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts index 5f2935618c6..40f22930a7e 100644 --- a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts +++ b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts @@ -107,9 +107,14 @@ function connectToRenderer(protocol: IMessagePassingProtocol): Promise { const idx = unhandledPromises.indexOf(promise); if (idx >= 0) { - unhandledPromises.splice(idx, 1); - console.warn('rejected promise not handled within 1 second'); - onUnexpectedError(reason); + promise.catch(e => { + unhandledPromises.splice(idx, 1); + console.warn(`rejected promise not handled within 1 second: ${e}`); + if (e.stack) { + console.warn(`stack trace: ${e.stack}`); + } + onUnexpectedError(reason); + }); } }, 1000); }); From 51765d81b29e78e8619bb9d0ad0a86e4bf03bc74 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 31 Jan 2019 11:52:40 +0100 Subject: [PATCH 201/429] Fixes #67350: Do not allow to add an extension if it is already known at a different version --- .../extensions/electron-browser/extensionService.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index 36eafb01844..b6b74109a3a 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -188,6 +188,12 @@ export class ExtensionService extends Disposable implements IExtensionService { continue; } + const existingExtensionDescription = this._registry.getExtensionDescription(extension.identifier.id); + if (existingExtensionDescription) { + // this extension is already running (most likely at a different version) + continue; + } + const extensionDescription = await this._extensionScanner.scanSingleExtension(extension.location.fsPath, extension.type === ExtensionType.System, this.createLogger()); if (!extensionDescription || !this._usesOnlyDynamicExtensionPoints(extensionDescription)) { // uses non-dynamic extension point From f6e47cf44855571152dd12f9d490530134d820d2 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 13:40:45 +0100 Subject: [PATCH 202/429] hide complete container --- .../electron-browser/media/extensionsViewlet.css | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css index 9089f6ff17d..020d8a4bcfa 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css @@ -108,11 +108,8 @@ bottom: 5px; } -.extensions-viewlet.narrow > .extensions .extension > .icon-container > .icon { - display: none; -} - -.extensions-viewlet > .extensions .extension.loading > .icon-container > .icon { +.extensions-viewlet.narrow > .extensions .extension > .icon-container, +.extensions-viewlet > .extensions .extension.loading > .icon-container { display: none; } From e990eae5993a2ef84fdca6ebe26ecb77441bdb93 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 13:42:42 +0100 Subject: [PATCH 203/429] update title --- .../parts/extensions/electron-browser/extensionsWidgets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts index 6a49044725b..09f35375ec2 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts @@ -240,7 +240,7 @@ export class RemoteBadgeWidget extends ExtensionWidget { this.themeService.onThemeChange(applyBadgeStyle, this, this.disposables); this.workspaceContextService.onDidChangeWorkbenchState(applyBadgeStyle, this, this.disposables); - const updateTitle = () => this.element.title = this.labelService.getHostLabel(); + const updateTitle = () => this.element.title = localize('remote extension title', "Extension in {0}", this.labelService.getHostLabel()); this.labelService.onDidChangeFormatters(() => updateTitle(), this, this.disposables); updateTitle(); } From bd903dde721cfe02c1d07f10e42b6e802d0863f1 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 31 Jan 2019 14:01:09 +0100 Subject: [PATCH 204/429] fix #67390 --- .../editor/contrib/smartSelect/smartSelect.ts | 28 ++++++++++++++++++- .../smartSelect/test/smartSelect.test.ts | 15 ++++------ .../contrib/smartSelect/wordSelections.ts | 14 +++++----- 3 files changed, 40 insertions(+), 17 deletions(-) diff --git a/src/vs/editor/contrib/smartSelect/smartSelect.ts b/src/vs/editor/contrib/smartSelect/smartSelect.ts index 19ed2246954..66d7733573b 100644 --- a/src/vs/editor/contrib/smartSelect/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/smartSelect.ts @@ -241,6 +241,11 @@ export function provideSelectionRanges(model: ITextModel, position: Position, to } return Promise.all(work).then(() => { + + if (ranges.length === 0) { + return []; + } + ranges.sort((a, b) => { if (Position.isBefore(a.range.getStartPosition(), b.range.getStartPosition())) { return 1; @@ -254,6 +259,7 @@ export function provideSelectionRanges(model: ITextModel, position: Position, to return b.rank - a.rank; } }); + let result: Range[] = []; let last: Range | undefined; for (const { range } of ranges) { @@ -262,7 +268,27 @@ export function provideSelectionRanges(model: ITextModel, position: Position, to last = range; } } - return result; + + let result2: Range[] = [result[0]]; + for (let i = 1; i < result.length; i++) { + const prev = result[i - 1]; + const cur = result[i]; + if (cur.startLineNumber !== prev.startLineNumber || cur.endLineNumber !== prev.endLineNumber) { + // add line/block range without leading/failing whitespace + const rangeNoWhitespace = new Range(prev.startLineNumber, model.getLineFirstNonWhitespaceColumn(prev.startLineNumber), prev.endLineNumber, model.getLineLastNonWhitespaceColumn(prev.endLineNumber)); + if (rangeNoWhitespace.containsRange(prev) && !rangeNoWhitespace.equalsRange(prev)) { + result2.push(rangeNoWhitespace); + } + // add line/block range + const rangeFull = new Range(prev.startLineNumber, 1, prev.endLineNumber, model.getLineMaxColumn(prev.endLineNumber)); + if (rangeFull.containsRange(prev) && !rangeFull.equalsRange(rangeNoWhitespace)) { + result2.push(rangeFull); + } + } + result2.push(cur); + } + + return result2; }); } diff --git a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts index efe1e8d2056..e8a5ec3cbdd 100644 --- a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts @@ -83,7 +83,7 @@ suite('SmartSelect', () => { let actualStr = actual!.map(r => new Range(r.startLineNumber, r.startColumn, r.endLineNumber, r.endColumn).toString()); let desiredStr = ranges.reverse().map(r => String(r)); - assert.deepEqual(actualStr, desiredStr); + assert.deepEqual(actualStr, desiredStr, `\nA: ${actualStr} VS \nE: ${desiredStr}`); modelService.destroyModel(uri); } @@ -99,6 +99,7 @@ suite('SmartSelect', () => { new Range(1, 1, 5, 2), // all new Range(1, 21, 5, 2), // {} outside new Range(1, 22, 5, 1), // {} inside + new Range(2, 1, 4, 3), // block new Range(2, 1, 4, 3), new Range(2, 2, 4, 3), new Range(2, 11, 4, 3), @@ -125,10 +126,10 @@ suite('SmartSelect', () => { new Range(1, 21, 5, 2), new Range(1, 22, 5, 1), new Range(2, 1, 4, 3), + new Range(2, 1, 4, 3), new Range(2, 2, 4, 3), new Range(2, 11, 4, 3), new Range(2, 12, 4, 2), - new Range(3, 1, 3, 1), ]); }); @@ -145,10 +146,12 @@ suite('SmartSelect', () => { new Range(1, 21, 5, 2), // {} outside new Range(1, 22, 5, 1), // {} inside new Range(2, 1, 4, 3), + new Range(2, 1, 4, 3), new Range(2, 2, 4, 3), new Range(2, 11, 4, 3), new Range(2, 12, 4, 2), - new Range(3, 1, 3, 2) // line w/ triva + new Range(3, 1, 3, 2), // block + new Range(3, 1, 3, 2) // empty line ]); }); @@ -261,8 +264,6 @@ suite('SmartSelect', () => { await assertRanges(new WordSelectionRangeProvider(), 'fIooBar', new Range(1, 1, 1, 5), // foo new Range(1, 1, 1, 8), // fooBar - new Range(1, 1, 1, 8), // line (triva) - new Range(1, 1, 1, 8), // line new Range(1, 1, 1, 8), // doc ); @@ -270,16 +271,12 @@ suite('SmartSelect', () => { new Range(1, 1, 1, 5), new Range(1, 1, 1, 8), new Range(1, 1, 1, 8), - new Range(1, 1, 1, 8), - new Range(1, 1, 1, 8), ); await assertRanges(new WordSelectionRangeProvider(), 'fIoo-Ba', new Range(1, 1, 1, 5), new Range(1, 1, 1, 8), new Range(1, 1, 1, 8), - new Range(1, 1, 1, 8), - new Range(1, 1, 1, 8), ); }); diff --git a/src/vs/editor/contrib/smartSelect/wordSelections.ts b/src/vs/editor/contrib/smartSelect/wordSelections.ts index 512e0352654..0d5d5fa2ca7 100644 --- a/src/vs/editor/contrib/smartSelect/wordSelections.ts +++ b/src/vs/editor/contrib/smartSelect/wordSelections.ts @@ -16,7 +16,7 @@ export class WordSelectionRangeProvider implements SelectionRangeProvider { let result: SelectionRange[] = []; this._addInWordRanges(result, model, position); this._addWordRanges(result, model, position); - this._addLineRanges(result, model, position); + this._addWhitespaceLine(result, model, position); result.push({ range: model.getFullModelRange(), kind: 'statement.all' }); return result; } @@ -60,12 +60,12 @@ export class WordSelectionRangeProvider implements SelectionRangeProvider { } } - private _addLineRanges(bucket: SelectionRange[], model: ITextModel, pos: Position): void { - - const nonWhitespaceColumn = model.getLineFirstNonWhitespaceColumn(pos.lineNumber); - if (nonWhitespaceColumn > 0) { - bucket.push({ range: new Range(pos.lineNumber, nonWhitespaceColumn, pos.lineNumber, model.getLineLastNonWhitespaceColumn(pos.lineNumber)), kind: 'statement.line' }); + private _addWhitespaceLine(bucket: SelectionRange[], model: ITextModel, pos: Position): void { + if (model.getLineLength(pos.lineNumber) > 0 + && model.getLineFirstNonWhitespaceColumn(pos.lineNumber) === 0 + && model.getLineLastNonWhitespaceColumn(pos.lineNumber) === 0 + ) { + bucket.push({ range: new Range(pos.lineNumber, 1, pos.lineNumber, model.getLineMaxColumn(pos.lineNumber)), kind: 'statement.line' }); } - bucket.push({ range: new Range(pos.lineNumber, model.getLineMinColumn(pos.lineNumber), pos.lineNumber, model.getLineMaxColumn(pos.lineNumber)), kind: 'statement.line.full' }); } } From d220c955d4c00cd13c0a0a952f02d2cba2e253e8 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 14:02:01 +0100 Subject: [PATCH 205/429] #67585 remove border radius --- .../extensions/electron-browser/media/extensionActions.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css b/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css index fbfdba03550..d2bea0aecb4 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css +++ b/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css @@ -49,12 +49,12 @@ .monaco-action-bar .action-item.disabled .action-label.extension-status-label { opacity: 0.9; line-height: initial; - border-radius: 4px; padding: 0 5px; } .monaco-action-bar .action-item .action-label.disable-status, .monaco-action-bar .action-item .action-label.malicious-status { + border-radius: 4px; color: inherit; background-color: transparent; font-style: italic; From 70160d0e580d0588e37c93fe8724014d76b00939 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Thu, 31 Jan 2019 14:51:25 +0100 Subject: [PATCH 206/429] fix #67493 --- .../smartSelect/test/smartSelect.test.ts | 71 ++++++++++++++----- .../contrib/smartSelect/wordSelections.ts | 48 ++++++++----- 2 files changed, 83 insertions(+), 36 deletions(-) diff --git a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts index e8a5ec3cbdd..43b94bd2d05 100644 --- a/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/smartSelect.test.ts @@ -55,7 +55,7 @@ class MockJSMode extends MockMode { ], onEnterRules: javascriptOnEnterRules, - wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g + wordPattern: /(-?\d*\.\d\w*)|([^\`\~\!\@\#\$\%\^\&\*\(\)\=\+\[\{\]\}\\\;\:\'\"\,\.\<\>\/\?\s]+)/g })); } } @@ -202,7 +202,7 @@ suite('SmartSelect', () => { async function assertRanges(provider: SelectionRangeProvider, value: string, ...expected: IRange[]): Promise { let model = modelService.createModel(value, new StaticLanguageSelector(mode.getLanguageIdentifier()), URI.parse('fake:lang')); - let pos = model.getPositionAt(value.indexOf('I')); + let pos = model.getPositionAt(value.indexOf('|')); let ranges = await provider.provideSelectionRanges(model, pos, CancellationToken.None); modelService.destroyModel(model.uri); @@ -214,45 +214,45 @@ suite('SmartSelect', () => { } test('bracket selection', async () => { - await assertRanges(new BracketSelectionRangeProvider(), '(I)', + await assertRanges(new BracketSelectionRangeProvider(), '(|)', new Range(1, 2, 1, 3), new Range(1, 1, 1, 4) ); - await assertRanges(new BracketSelectionRangeProvider(), '[[[](I)]]', + await assertRanges(new BracketSelectionRangeProvider(), '[[[](|)]]', new Range(1, 6, 1, 7), new Range(1, 5, 1, 8), // () new Range(1, 3, 1, 8), new Range(1, 2, 1, 9), // [[]()] new Range(1, 2, 1, 9), new Range(1, 1, 1, 10), // [[[]()]] ); - await assertRanges(new BracketSelectionRangeProvider(), '[a[](I)a]', + await assertRanges(new BracketSelectionRangeProvider(), '[a[](|)a]', new Range(1, 6, 1, 7), new Range(1, 5, 1, 8), new Range(1, 2, 1, 9), new Range(1, 1, 1, 10), ); // no bracket - await assertRanges(new BracketSelectionRangeProvider(), 'fofofIfofo'); + await assertRanges(new BracketSelectionRangeProvider(), 'fofof|fofo'); // empty - await assertRanges(new BracketSelectionRangeProvider(), '[[[]()]]I'); - await assertRanges(new BracketSelectionRangeProvider(), 'I[[[]()]]'); + await assertRanges(new BracketSelectionRangeProvider(), '[[[]()]]|'); + await assertRanges(new BracketSelectionRangeProvider(), '|[[[]()]]'); // edge - await assertRanges(new BracketSelectionRangeProvider(), '[I[[]()]]', new Range(1, 2, 1, 9), new Range(1, 1, 1, 10)); - await assertRanges(new BracketSelectionRangeProvider(), '[[[]()]I]', new Range(1, 2, 1, 9), new Range(1, 1, 1, 10)); + await assertRanges(new BracketSelectionRangeProvider(), '[|[[]()]]', new Range(1, 2, 1, 9), new Range(1, 1, 1, 10)); + await assertRanges(new BracketSelectionRangeProvider(), '[[[]()]|]', new Range(1, 2, 1, 9), new Range(1, 1, 1, 10)); - await assertRanges(new BracketSelectionRangeProvider(), 'aaa(aaa)bbb(bIb)ccc(ccc)', new Range(1, 13, 1, 16), new Range(1, 12, 1, 17)); - await assertRanges(new BracketSelectionRangeProvider(), '(aaa(aaa)bbb(bIb)ccc(ccc))', new Range(1, 14, 1, 17), new Range(1, 13, 1, 18), new Range(1, 2, 1, 26), new Range(1, 1, 1, 27)); + await assertRanges(new BracketSelectionRangeProvider(), 'aaa(aaa)bbb(b|b)ccc(ccc)', new Range(1, 13, 1, 16), new Range(1, 12, 1, 17)); + await assertRanges(new BracketSelectionRangeProvider(), '(aaa(aaa)bbb(b|b)ccc(ccc))', new Range(1, 14, 1, 17), new Range(1, 13, 1, 18), new Range(1, 2, 1, 26), new Range(1, 1, 1, 27)); }); test('bracket with leading/trailing', async () => { - await assertRanges(new BracketSelectionRangeProvider(), 'for(a of b){\n foo(I);\n}', + await assertRanges(new BracketSelectionRangeProvider(), 'for(a of b){\n foo(|);\n}', new Range(2, 7, 2, 8), new Range(2, 6, 2, 9), new Range(1, 13, 3, 1), new Range(1, 12, 3, 2), new Range(1, 1, 3, 2), new Range(1, 1, 3, 2), ); - await assertRanges(new BracketSelectionRangeProvider(), 'for(a of b)\n{\n foo(I);\n}', + await assertRanges(new BracketSelectionRangeProvider(), 'for(a of b)\n{\n foo(|);\n}', new Range(3, 7, 3, 8), new Range(3, 6, 3, 9), new Range(2, 2, 4, 1), new Range(2, 1, 4, 2), new Range(1, 1, 4, 2), new Range(1, 1, 4, 2), @@ -261,26 +261,61 @@ suite('SmartSelect', () => { test('in-word ranges', async () => { - await assertRanges(new WordSelectionRangeProvider(), 'fIooBar', + await assertRanges(new WordSelectionRangeProvider(), 'f|ooBar', new Range(1, 1, 1, 5), // foo new Range(1, 1, 1, 8), // fooBar new Range(1, 1, 1, 8), // doc ); - await assertRanges(new WordSelectionRangeProvider(), 'fIoo_Ba', + await assertRanges(new WordSelectionRangeProvider(), 'f|oo_Ba', new Range(1, 1, 1, 5), new Range(1, 1, 1, 8), new Range(1, 1, 1, 8), ); - await assertRanges(new WordSelectionRangeProvider(), 'fIoo-Ba', + await assertRanges(new WordSelectionRangeProvider(), 'f|oo-Ba', new Range(1, 1, 1, 5), new Range(1, 1, 1, 8), new Range(1, 1, 1, 8), ); }); - test('Default selection should select current word/hump first in camelCase #67493', function () { + test('Default selection should select current word/hump first in camelCase #67493', async function () { + await assertRanges(new WordSelectionRangeProvider(), 'Abs|tractSmartSelect', + new Range(1, 1, 1, 10), + new Range(1, 1, 1, 21), + new Range(1, 1, 1, 21), + ); + + await assertRanges(new WordSelectionRangeProvider(), 'AbstractSma|rtSelect', + new Range(1, 9, 1, 15), + new Range(1, 1, 1, 21), + new Range(1, 1, 1, 21), + ); + + await assertRanges(new WordSelectionRangeProvider(), 'Abstrac-Sma|rt-elect', + new Range(1, 9, 1, 15), + new Range(1, 1, 1, 21), + new Range(1, 1, 1, 21), + ); + + await assertRanges(new WordSelectionRangeProvider(), 'Abstrac_Sma|rt_elect', + new Range(1, 9, 1, 15), + new Range(1, 1, 1, 21), + new Range(1, 1, 1, 21), + ); + + await assertRanges(new WordSelectionRangeProvider(), 'Abstrac_Sma|rt-elect', + new Range(1, 9, 1, 15), + new Range(1, 1, 1, 21), + new Range(1, 1, 1, 21), + ); + + await assertRanges(new WordSelectionRangeProvider(), 'Abstrac_Sma|rtSelect', + new Range(1, 9, 1, 15), + new Range(1, 1, 1, 21), + new Range(1, 1, 1, 21), + ); }); }); diff --git a/src/vs/editor/contrib/smartSelect/wordSelections.ts b/src/vs/editor/contrib/smartSelect/wordSelections.ts index 0d5d5fa2ca7..6c6c1ffd65b 100644 --- a/src/vs/editor/contrib/smartSelect/wordSelections.ts +++ b/src/vs/editor/contrib/smartSelect/wordSelections.ts @@ -26,31 +26,43 @@ export class WordSelectionRangeProvider implements SelectionRangeProvider { if (!obj) { return; } + let { word, startColumn } = obj; let offset = pos.column - startColumn; + let start = offset; + let end = offset; let lastCh: number = 0; - for (; offset < word.length; offset++) { - let ch = word.charCodeAt(offset); - if (isUpperAsciiLetter(ch) && isLowerAsciiLetter(lastCh)) { + + // LEFT anchor (start) + for (; start >= 0; start--) { + let ch = word.charCodeAt(start); + if (ch === CharCode.Underline || ch === CharCode.Dash) { + // foo-bar OR foo_bar + break; + } else if (isLowerAsciiLetter(ch) && isUpperAsciiLetter(lastCh)) { // fooBar - // ^^^ - // ^^^^^^ - bucket.push({ range: new Range(pos.lineNumber, startColumn, pos.lineNumber, startColumn + offset), kind: 'statement.word.part' }); - } else if (ch === CharCode.Underline && lastCh !== CharCode.Underline) { - // foo_bar - // ^^^ - // ^^^^^^^ - bucket.push({ range: new Range(pos.lineNumber, startColumn, pos.lineNumber, startColumn + offset), kind: 'statement.word.part' }); - offset += 1; - } else if (ch === CharCode.Dash && lastCh !== CharCode.Dash) { - // foo-bar - // ^^^ - // ^^^^^^^ - bucket.push({ range: new Range(pos.lineNumber, startColumn, pos.lineNumber, startColumn + offset), kind: 'statement.word.part' }); - offset += 1; + break; } lastCh = ch; } + start += 1; + + // RIGHT anchor (end) + for (; end < word.length; end++) { + let ch = word.charCodeAt(end); + if (isUpperAsciiLetter(ch) && isLowerAsciiLetter(lastCh)) { + // fooBar + break; + } else if (ch === CharCode.Underline || ch === CharCode.Dash) { + // foo-bar OR foo_bar + break; + } + lastCh = ch; + } + + if (start < end) { + bucket.push({ range: new Range(pos.lineNumber, startColumn + start, pos.lineNumber, startColumn + end), kind: 'statement.word.part' }); + } } private _addWordRanges(bucket: SelectionRange[], model: ITextModel, pos: Position): void { From 5f842e20926bbaddc3338bb06294763d4a8e3cbf Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 15:19:18 +0100 Subject: [PATCH 207/429] fixes #66995 --- src/vs/base/browser/ui/tree/abstractTree.ts | 78 +++++++++++++------ src/vs/base/browser/ui/tree/asyncDataTree.ts | 4 + src/vs/platform/list/browser/listService.ts | 47 +++++++++++ .../workbench/browser/actions/listCommands.ts | 23 +++++- 4 files changed, 125 insertions(+), 27 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 56ea99c13f0..67f91e2f92d 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -377,6 +377,9 @@ class TypeFilterController implements IDisposable { private filterOnTypeDomNode: HTMLInputElement; private clearDomNode: HTMLElement; + private automaticKeyboardNavigation: boolean; + private triggered = false; + private enabledDisposables: IDisposable[] = []; private disposables: IDisposable[] = []; @@ -408,12 +411,10 @@ class TypeFilterController implements IDisposable { this.clearDomNode.title = localize('clear', "Clear"); model.onDidSplice(this.onDidSpliceModel, this, this.disposables); - - tree.onDidUpdateOptions(this.onDidUpdateTreeOptions, this, this.disposables); - this.onDidUpdateTreeOptions(tree.options); + this.updateOptions(tree.options); } - private onDidUpdateTreeOptions(options: IAbstractTreeOptions): void { + updateOptions(options: IAbstractTreeOptions): void { if (options.simpleKeyboardNavigation) { this.disable(); } else { @@ -421,10 +422,19 @@ class TypeFilterController implements IDisposable { } this.filterOnTypeDomNode.checked = !!options.filterOnType; + this.automaticKeyboardNavigation = typeof options.automaticKeyboardNavigation === 'undefined' ? true : options.automaticKeyboardNavigation; this.tree.refilter(); this.render(); } + toggle(): void { + this.triggered = !this.triggered; + + if (!this.triggered) { + this.onEventOrInput(''); + } + } + private enable(): void { if (this._enabled) { return; @@ -433,31 +443,22 @@ class TypeFilterController implements IDisposable { const isPrintableCharEvent = this.keyboardNavigationLabelProvider.mightProducePrintableCharacter ? (e: IKeyboardEvent) => this.keyboardNavigationLabelProvider.mightProducePrintableCharacter!(e) : (e: IKeyboardEvent) => mightProducePrintableCharacter(e); const onKeyDown = Event.chain(domEvent(this.view.getHTMLElement(), 'keydown')) .filter(e => !isInputElement(e.target as HTMLElement) || e.target === this.filterOnTypeDomNode) + .filter(() => this.automaticKeyboardNavigation || this.triggered) .map(e => new StandardKeyboardEvent(e)) - .filter(e => isPrintableCharEvent(e) || (this._pattern.length > 0 && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey)))) + .filter(e => isPrintableCharEvent(e) || ((this._pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey)))) .forEach(e => { e.stopPropagation(); e.preventDefault(); }) .event; const onClear = domEvent(this.clearDomNode, 'click'); - const onInput = Event.chain(Event.any(onKeyDown, onClear)) - .reduce((previous: string, e) => { - if (e instanceof MouseEvent || e.keyCode === KeyCode.Escape || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey))) { - return ''; - } - if (e.keyCode === KeyCode.Backspace) { - return previous.length === 0 ? '' : previous.substr(0, previous.length - 1); - } + Event.chain(Event.any(onKeyDown, onClear)) + .event(this.onEventOrInput, this, this.enabledDisposables); - return previous + e.browserEvent.key; - }, '') - .event; - - onInput(this.onInput, this, this.enabledDisposables); this.filter.pattern = ''; this.tree.refilter(); this.render(); this._enabled = true; + this.triggered = false; } private disable(): void { @@ -470,6 +471,19 @@ class TypeFilterController implements IDisposable { this.tree.refilter(); this.render(); this._enabled = false; + this.triggered = false; + } + + private onEventOrInput(e: MouseEvent | StandardKeyboardEvent | string): void { + if (typeof e === 'string') { + this.onInput(e); + } else if (e instanceof MouseEvent || e.keyCode === KeyCode.Escape || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey))) { + this.onInput(''); + } else if (e.keyCode === KeyCode.Backspace) { + this.onInput(this.pattern.length === 0 ? '' : this.pattern.substr(0, this.pattern.length - 1)); + } else { + this.onInput(this.pattern + e.browserEvent.key); + } } private onInput(pattern: string): void { @@ -498,6 +512,10 @@ class TypeFilterController implements IDisposable { } this.render(); + + if (!pattern) { + this.triggered = false; + } } private onDragStart(): void { @@ -631,6 +649,7 @@ function asTreeContextMenuEvent(event: IListContextMenuEvent implements IDisposable private focus = new Trait(); private selection = new Trait(); private eventBufferer = new EventBufferer(); + private typeFilterController?: TypeFilterController; protected disposables: IDisposable[] = []; - private _onDidUpdateOptions = new Emitter>(); - readonly onDidUpdateOptions = this._onDidUpdateOptions.event; - get onDidScroll(): Event { return this.view.onDidScroll; } readonly onDidChangeFocus: Event> = this.eventBufferer.wrapEvent(this.focus.onDidChange); @@ -852,9 +869,9 @@ export abstract class AbstractTree implements IDisposable } if (_options.keyboardNavigationLabelProvider) { - const typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, _options.keyboardNavigationLabelProvider); + this.typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, _options.keyboardNavigationLabelProvider); this.focusNavigationFilter = node => { - if (!typeFilterController.enabled || !typeFilterController.pattern) { + if (!this.typeFilterController!.enabled || !this.typeFilterController!.pattern) { return true; } @@ -864,7 +881,7 @@ export abstract class AbstractTree implements IDisposable return !FuzzyScore.isDefault(node.filterData as any as FuzzyScore); }; - this.disposables.push(typeFilterController); + this.disposables.push(this.typeFilterController!); } } @@ -876,7 +893,10 @@ export abstract class AbstractTree implements IDisposable } this.view.updateOptions({ enableKeyboardNavigation: this._options.simpleKeyboardNavigation }); - this._onDidUpdateOptions.fire(this._options); + + if (this.typeFilterController) { + this.typeFilterController.updateOptions(this._options); + } } get options(): IAbstractTreeOptions { @@ -983,6 +1003,14 @@ export abstract class AbstractTree implements IDisposable return this.model.isCollapsed(location); } + toggleKeyboardNavigation(): void { + if (!this.typeFilterController) { + return; + } + + this.typeFilterController.toggle(); + } + refilter(): void { this._onWillRefilter.fire(undefined); this.model.refilter(); diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index a4f7128419d..3b50d3ff5f8 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -478,6 +478,10 @@ export class AsyncDataTree implements IDisposable return this.tree.isCollapsed(this.getDataNode(element)); } + toggleKeyboardNavigation(): void { + this.tree.toggleKeyboardNavigation(); + } + refilter(): void { this.tree.refilter(); } diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 776395ccbcf..529f63834ed 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -103,6 +103,8 @@ export const WorkbenchListFocusContextKey = ContextKeyExpr.and(RawWorkbenchListF export const WorkbenchListHasSelectionOrFocus = new RawContextKey('listHasSelectionOrFocus', false); export const WorkbenchListDoubleSelection = new RawContextKey('listDoubleSelection', false); export const WorkbenchListMultiSelection = new RawContextKey('listMultiSelection', false); +export const WorkbenchListAutomaticKeyboardNavigationKey = 'listAutomaticKeyboardNavigation'; +export const WorkbenchListAutomaticKeyboardNavigation = new RawContextKey(WorkbenchListAutomaticKeyboardNavigationKey, true); function createScopedContextKeyService(contextKeyService: IContextKeyService, widget: ListWidget): IContextKeyService { const result = contextKeyService.createScoped(widget.getHTMLElement()); @@ -920,6 +922,9 @@ export class WorkbenchObjectTree, TFilterData = void> @IConfigurationService configurationService: IConfigurationService, @IKeybindingService keybindingService: IKeybindingService ) { + WorkbenchListAutomaticKeyboardNavigation.bindTo(contextKeyService); + + const automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); @@ -929,6 +934,7 @@ export class WorkbenchObjectTree, TFilterData = void> ...computeStyles(themeService.getTheme(), defaultListStyles), ...toWorkbenchListOptions(options, configurationService, keybindingService), indent: configurationService.getValue(treeIndentKey), + automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', horizontalScrolling @@ -946,6 +952,9 @@ export class WorkbenchObjectTree, TFilterData = void> this._openOnSingleClick = useSingleClickToOpen(configurationService); this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + const interestingContextKeys = new Set(); + interestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationKey); + this.disposables.push( this.contextKeyService, (listService as ListService).register(this), @@ -982,6 +991,14 @@ export class WorkbenchObjectTree, TFilterData = void> filterOnType: keyboardNavigation === 'filter' }); } + }), + this.contextKeyService.onDidChangeContext(e => { + if (e.affectsSome(interestingContextKeys)) { + const automaticKeyboardNavigation = this.contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); + this.updateOptions({ + automaticKeyboardNavigation + }); + } }) ); } @@ -1023,6 +1040,9 @@ export class WorkbenchDataTree extends DataTree(WorkbenchListAutomaticKeyboardNavigationKey); const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); @@ -1032,6 +1052,7 @@ export class WorkbenchDataTree extends DataTree extends DataTree extends DataTree { + if (e.affectsSome(interestingContextKeys)) { + const automaticKeyboardNavigation = this.contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); + this.updateOptions({ + automaticKeyboardNavigation + }); + } }) ); } @@ -1121,6 +1153,9 @@ export class WorkbenchAsyncDataTree extends Async @IConfigurationService configurationService: IConfigurationService, @IKeybindingService keybindingService: IKeybindingService ) { + WorkbenchListAutomaticKeyboardNavigation.bindTo(contextKeyService); + + const automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); @@ -1130,6 +1165,7 @@ export class WorkbenchAsyncDataTree extends Async ...computeStyles(themeService.getTheme(), defaultListStyles), ...toWorkbenchListOptions(options, configurationService, keybindingService), indent: configurationService.getValue(treeIndentKey), + automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', horizontalScrolling @@ -1147,6 +1183,9 @@ export class WorkbenchAsyncDataTree extends Async this._openOnSingleClick = useSingleClickToOpen(configurationService); this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + const interestingContextKeys = new Set(); + interestingContextKeys.add(WorkbenchListAutomaticKeyboardNavigationKey); + this.disposables.push( this.contextKeyService, (listService as ListService).register(this), @@ -1183,6 +1222,14 @@ export class WorkbenchAsyncDataTree extends Async filterOnType: keyboardNavigation === 'filter' }); } + }), + this.contextKeyService.onDidChangeContext(e => { + if (e.affectsSome(interestingContextKeys)) { + const automaticKeyboardNavigation = this.contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); + this.updateOptions({ + automaticKeyboardNavigation + }); + } }) ); } diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 5fbd81fae8e..123778a5809 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -7,7 +7,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { List } from 'vs/base/browser/ui/list/listWidget'; -import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus } from 'vs/platform/list/browser/listService'; +import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, WorkbenchListAutomaticKeyboardNavigationKey } from 'vs/platform/list/browser/listService'; import { PagedList } from 'vs/base/browser/ui/list/listPaging'; import { range } from 'vs/base/common/arrays'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; @@ -16,6 +16,7 @@ import { ObjectTree } from 'vs/base/browser/ui/tree/objectTree'; import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree'; import { DataTree } from 'vs/base/browser/ui/tree/dataTree'; import { ITreeNode } from 'vs/base/browser/ui/tree/tree'; +import { CommandsRegistry } from 'vs/platform/commands/common/commands'; function ensureDOMFocus(widget: ListWidget): void { // it can happen that one of the commands is executed while @@ -742,4 +743,22 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ } } } -}); \ No newline at end of file +}); + +CommandsRegistry.registerCommand({ + id: 'list.toggleKeyboardNavigation', + handler: (accessor) => { + const focused = accessor.get(IListService).lastFocusedList; + + // List + if (focused instanceof List || focused instanceof PagedList) { + // TODO@joao + } + + // ObjectTree + else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) { + const tree = focused; + tree.toggleKeyboardNavigation(); + } + } +}); From c9695877372a07dd1bfd137c9cf3e02ba2847031 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 31 Jan 2019 15:24:29 +0100 Subject: [PATCH 208/429] fix build --- src/vs/workbench/browser/actions/listCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 123778a5809..087f1f5f2aa 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -7,7 +7,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { List } from 'vs/base/browser/ui/list/listWidget'; -import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, WorkbenchListAutomaticKeyboardNavigationKey } from 'vs/platform/list/browser/listService'; +import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus } from 'vs/platform/list/browser/listService'; import { PagedList } from 'vs/base/browser/ui/list/listPaging'; import { range } from 'vs/base/common/arrays'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; From effdac4b6b9512ab924c37577535583fae12a7c4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 31 Jan 2019 15:31:57 +0100 Subject: [PATCH 209/429] Fix #67585 --- .../parts/extensions/electron-browser/extensionsActions.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index de2c77c9b6a..33ff76a0343 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -2610,17 +2610,13 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const extensionButtonProminentBackgroundColor = theme.getColor(extensionButtonProminentBackground); if (extensionButtonProminentBackground) { collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`); - collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-status-label { background-color: ${extensionButtonProminentBackgroundColor}; }`); collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.prominent { background-color: ${extensionButtonProminentBackgroundColor}; }`); - collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-status-label { background-color: ${extensionButtonProminentBackgroundColor}; }`); } const extensionButtonProminentForegroundColor = theme.getColor(extensionButtonProminentForeground); if (extensionButtonProminentForeground) { collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`); - collector.addRule(`.extension .monaco-action-bar .action-item .action-label.extension-status-label { color: ${extensionButtonProminentForegroundColor}; }`); collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-action.prominent { color: ${extensionButtonProminentForegroundColor}; }`); - collector.addRule(`.extension-editor .monaco-action-bar .action-item .action-label.extension-status-label { color: ${extensionButtonProminentForegroundColor}; }`); } const extensionButtonProminentHoverBackgroundColor = theme.getColor(extensionButtonProminentHoverBackground); From 714824761b36ec8d4526739947af0fa25df83831 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 15:34:59 +0100 Subject: [PATCH 210/429] add list keyboard navigation support context key related to #66995 --- src/vs/base/browser/ui/tree/abstractTree.ts | 4 ++++ src/vs/platform/list/browser/listService.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 67f91e2f92d..95b8617c300 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -425,6 +425,10 @@ class TypeFilterController implements IDisposable { this.automaticKeyboardNavigation = typeof options.automaticKeyboardNavigation === 'undefined' ? true : options.automaticKeyboardNavigation; this.tree.refilter(); this.render(); + + if (!this.automaticKeyboardNavigation) { + this.onEventOrInput(''); + } } toggle(): void { diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 529f63834ed..84f5114a9a9 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -103,6 +103,7 @@ export const WorkbenchListFocusContextKey = ContextKeyExpr.and(RawWorkbenchListF export const WorkbenchListHasSelectionOrFocus = new RawContextKey('listHasSelectionOrFocus', false); export const WorkbenchListDoubleSelection = new RawContextKey('listDoubleSelection', false); export const WorkbenchListMultiSelection = new RawContextKey('listMultiSelection', false); +export const WorkbenchListSupportsKeyboardNavigation = new RawContextKey('listSupportsKeyboardNavigation', true); export const WorkbenchListAutomaticKeyboardNavigationKey = 'listAutomaticKeyboardNavigation'; export const WorkbenchListAutomaticKeyboardNavigation = new RawContextKey(WorkbenchListAutomaticKeyboardNavigationKey, true); @@ -922,6 +923,7 @@ export class WorkbenchObjectTree, TFilterData = void> @IConfigurationService configurationService: IConfigurationService, @IKeybindingService keybindingService: IKeybindingService ) { + WorkbenchListSupportsKeyboardNavigation.bindTo(contextKeyService); WorkbenchListAutomaticKeyboardNavigation.bindTo(contextKeyService); const automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); @@ -1040,6 +1042,7 @@ export class WorkbenchDataTree extends DataTree(WorkbenchListAutomaticKeyboardNavigationKey); @@ -1153,6 +1156,7 @@ export class WorkbenchAsyncDataTree extends Async @IConfigurationService configurationService: IConfigurationService, @IKeybindingService keybindingService: IKeybindingService ) { + WorkbenchListSupportsKeyboardNavigation.bindTo(contextKeyService); WorkbenchListAutomaticKeyboardNavigation.bindTo(contextKeyService); const automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); From f41ddf2bb65d552d7e7e54f66101afe2edbfb963 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 15:42:43 +0100 Subject: [PATCH 211/429] fixes #67449 --- src/vs/base/browser/ui/tree/abstractTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 95b8617c300..b57109987e0 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -879,7 +879,7 @@ export abstract class AbstractTree implements IDisposable return true; } - if (filter!.totalCount > 0 && filter!.matchCount === 0) { + if (filter!.totalCount > 0 && filter!.matchCount <= 1) { return true; } From 5aaf8173b33ecb2df7f2b836fa85813ec6df5b75 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 16:02:32 +0100 Subject: [PATCH 212/429] add filter matches to references widget related to #67280 --- .../contrib/referenceSearch/referencesTree.ts | 17 +++++++++-------- .../contrib/referenceSearch/referencesWidget.ts | 7 ++++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/vs/editor/contrib/referenceSearch/referencesTree.ts b/src/vs/editor/contrib/referenceSearch/referencesTree.ts index 296d55db965..8866c65be81 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesTree.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesTree.ts @@ -24,6 +24,7 @@ import { IListVirtualDelegate, IKeyboardNavigationLabelProvider, IIdentityProvid import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { basename } from 'vs/base/common/paths'; +import { FuzzyScore, createMatches, IMatch } from 'vs/base/common/filters'; //#region data source @@ -115,7 +116,7 @@ class FileReferencesTemplate extends Disposable { super(); const parent = document.createElement('div'); dom.addClass(parent, 'reference-file'); - this.file = this._register(new IconLabel(parent)); + this.file = this._register(new IconLabel(parent, { supportHighlights: true })); this.badge = new CountBadge(dom.append(parent, dom.$('.count'))); this._register(attachBadgeStyler(this.badge, themeService)); @@ -123,9 +124,9 @@ class FileReferencesTemplate extends Disposable { container.appendChild(parent); } - set(element: FileReferences) { + set(element: FileReferences, matches: IMatch[]) { let parent = dirname(element.uri); - this.file.setLabel(getBaseLabel(element.uri), parent ? this._uriLabel.getUriLabel(parent, { relative: true }) : undefined, { title: this._uriLabel.getUriLabel(element.uri) }); + this.file.setLabel(getBaseLabel(element.uri), parent ? this._uriLabel.getUriLabel(parent, { relative: true }) : undefined, { title: this._uriLabel.getUriLabel(element.uri), matches }); const len = element.children.length; this.badge.setCount(len); if (element.failure) { @@ -138,7 +139,7 @@ class FileReferencesTemplate extends Disposable { } } -export class FileReferencesRenderer implements ITreeRenderer { +export class FileReferencesRenderer implements ITreeRenderer { static readonly id = 'FileReferencesRenderer'; @@ -149,8 +150,8 @@ export class FileReferencesRenderer implements ITreeRenderer, index: number, template: FileReferencesTemplate): void { - template.set(node.element); + renderElement(node: ITreeNode, index: number, template: FileReferencesTemplate): void { + template.set(node.element, createMatches(node.filterData)); } disposeTemplate(templateData: FileReferencesTemplate): void { templateData.dispose(); @@ -191,7 +192,7 @@ class OneReferenceTemplate { } } -export class OneReferenceRenderer implements ITreeRenderer { +export class OneReferenceRenderer implements ITreeRenderer { static readonly id = 'OneReferenceRenderer'; @@ -200,7 +201,7 @@ export class OneReferenceRenderer implements ITreeRenderer, index: number, templateData: OneReferenceTemplate): void { + renderElement(element: ITreeNode, index: number, templateData: OneReferenceTemplate): void { templateData.set(element.element); } disposeTemplate(): void { diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index e04ca9e6c5d..60500684060 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -34,6 +34,7 @@ import { FileReferences, OneReference, ReferencesModel } from './referencesModel import { ITreeRenderer, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree'; import { IAsyncDataTreeOptions } from 'vs/base/browser/ui/tree/asyncDataTree'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; +import { FuzzyScore } from 'vs/base/common/filters'; class DecorationsManager implements IDisposable { @@ -245,7 +246,7 @@ export class ReferenceWidget extends PeekViewWidget { private _callOnDispose: IDisposable[] = []; private _onDidSelectReference = new Emitter(); - private _tree: WorkbenchAsyncDataTree; + private _tree: WorkbenchAsyncDataTree; private _treeContainer: HTMLElement; private _sash: VSash; private _preview: ICodeEditor; @@ -360,7 +361,7 @@ export class ReferenceWidget extends PeekViewWidget { this._instantiationService.createInstance(OneReferenceRenderer), ]; - const treeOptions: IAsyncDataTreeOptions = { + const treeOptions: IAsyncDataTreeOptions = { ariaLabel: nls.localize('treeAriaLabel', "References"), keyboardSupport: this._defaultTreeKeyboardSupport, accessibilityProvider: new AriaProvider(), @@ -370,7 +371,7 @@ export class ReferenceWidget extends PeekViewWidget { const treeDataSource = this._instantiationService.createInstance(DataSource); - this._tree = this._instantiationService.createInstance, ITreeRenderer[], IAsyncDataSource, IAsyncDataTreeOptions, WorkbenchAsyncDataTree>( + this._tree = this._instantiationService.createInstance, ITreeRenderer[], IAsyncDataSource, IAsyncDataTreeOptions, WorkbenchAsyncDataTree>( WorkbenchAsyncDataTree, this._treeContainer, new Delegate(), From ea5048a7d5c4dcb749949317648afe34664edf94 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 16:13:37 +0100 Subject: [PATCH 213/429] undefined keyboard navigation label always matches fixes #66979 --- src/vs/base/browser/ui/list/list.ts | 8 +++++++- src/vs/base/browser/ui/list/listWidget.ts | 3 ++- src/vs/base/browser/ui/tree/abstractTree.ts | 10 ++++++++-- src/vs/workbench/parts/files/common/files.ts | 1 + .../parts/files/electron-browser/explorerService.ts | 4 ++++ .../parts/files/electron-browser/views/explorerView.ts | 8 +++++++- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/vs/base/browser/ui/list/list.ts b/src/vs/base/browser/ui/list/list.ts index 49c953f0124..b4a4aa4821f 100644 --- a/src/vs/base/browser/ui/list/list.ts +++ b/src/vs/base/browser/ui/list/list.ts @@ -71,7 +71,13 @@ export enum ListAriaRootRole { } export interface IKeyboardNavigationLabelProvider { - getKeyboardNavigationLabel(element: T): { toString(): string; }; + + /** + * Return a keyboard navigation label which will be used by the + * list for filtering/navigating. Return `undefined` to make an + * element always match. + */ + getKeyboardNavigationLabel(element: T): { toString(): string | undefined; } | undefined; mightProducePrintableCharacter?(event: IKeyboardEvent): boolean; } diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 2cc18d00b3a..ebe2af766dc 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -403,8 +403,9 @@ class TypeLabelController implements IDisposable { for (let i = 0; i < this.list.length; i++) { const index = (start + i + delta) % this.list.length; const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(this.view.element(index)); + const labelStr = label && label.toString(); - if (matchesPrefix(word, label.toString())) { + if (typeof labelStr === 'undefined' || matchesPrefix(word, labelStr)) { this.list.setFocus([index]); this.list.reveal(index); return; diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index b57109987e0..d7362e7e14d 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -334,8 +334,14 @@ class TypeFilter implements ITreeFilter, IDisposable { return { data: FuzzyScore.Default, visibility: true }; } - const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(element).toString(); - const score = fuzzyScore(this._pattern, this._lowercasePattern, 0, label, label.toLowerCase(), 0, true); + const label = this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(element); + const labelStr = label && label.toString(); + + if (typeof labelStr === 'undefined') { + return { data: FuzzyScore.Default, visibility: true }; + } + + const score = fuzzyScore(this._pattern, this._lowercasePattern, 0, labelStr, labelStr.toLowerCase(), 0, true); if (!score) { if (this.tree.options.filterOnType) { diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index 10877a56430..8915bd13b1d 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -49,6 +49,7 @@ export interface IExplorerService { setEditable(stat: ExplorerItem, data: IEditableData): void; getEditableData(stat: ExplorerItem): IEditableData | undefined; + isEditable(stat: ExplorerItem): boolean; findClosest(resource: URI): ExplorerItem | null; refresh(): void; setToCopy(stats: ExplorerItem[], cut: boolean): void; diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/parts/files/electron-browser/explorerService.ts index 234117fd39c..e6edda05b16 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerService.ts @@ -129,6 +129,10 @@ export class ExplorerService implements IExplorerService { return this.editableStats.get(stat); } + isEditable(stat: ExplorerItem): boolean { + return this.editableStats.has(stat); + } + select(resource: URI, reveal?: boolean): Promise { const fileStat = this.findClosest(resource); if (fileStat) { diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 0b558779712..a972a289ee2 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -266,7 +266,13 @@ export class ExplorerView extends ViewletPanel { getId: stat => stat.resource }, keyboardNavigationLabelProvider: { - getKeyboardNavigationLabel: stat => stat.name + getKeyboardNavigationLabel: stat => { + if (this.explorerService.isEditable(stat)) { + return undefined; + } + + return stat.name; + } }, multipleSelectionSupport: true, filter: this.filter, From 7cb0746b71bbd264b0bce6400903bd5ba0532e35 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 31 Jan 2019 16:01:48 +0100 Subject: [PATCH 214/429] highlight theme rule for all new trees --- src/vs/workbench/browser/parts/views/customView.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index d0c1951d8bd..a6568b49c4e 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -615,12 +615,12 @@ registerThemingParticipant((theme, collector) => { const findMatchHighlightColor = theme.getColor(editorFindMatchHighlight); if (findMatchHighlightColor) { collector.addRule(`.file-icon-themable-tree .monaco-tree-row .content .monaco-highlighted-label .highlight { color: unset !important; background-color: ${findMatchHighlightColor}; }`); - collector.addRule(`.file-icon-themable-tree .monaco-tl-contents .monaco-highlighted-label .highlight { color: unset !important; background-color: ${findMatchHighlightColor}; }`); + collector.addRule(`.monaco-tl-contents .monaco-highlighted-label .highlight { color: unset !important; background-color: ${findMatchHighlightColor}; }`); } const findMatchHighlightColorBorder = theme.getColor(editorFindMatchHighlightBorder); if (findMatchHighlightColorBorder) { collector.addRule(`.file-icon-themable-tree .monaco-tree-row .content .monaco-highlighted-label .highlight { color: unset !important; border: 1px dotted ${findMatchHighlightColorBorder}; box-sizing: border-box; }`); - collector.addRule(`.file-icon-themable-tree .monaco-tl-contents .monaco-highlighted-label .highlight { color: unset !important; border: 1px dotted ${findMatchHighlightColorBorder}; box-sizing: border-box; }`); + collector.addRule(`.monaco-tl-contents .monaco-highlighted-label .highlight { color: unset !important; border: 1px dotted ${findMatchHighlightColorBorder}; box-sizing: border-box; }`); } const link = theme.getColor(textLinkForeground); if (link) { @@ -925,4 +925,4 @@ class MarkdownRenderer { dispose: () => dispose(disposeables) }; } -} \ No newline at end of file +} From ccdaf1272f61add807588570425b7dd94986a559 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 31 Jan 2019 16:17:44 +0100 Subject: [PATCH 215/429] debug: dighlights in trees --- .../parts/debug/browser/baseDebugView.ts | 28 +++++++----- .../parts/debug/browser/debugActions.ts | 2 +- .../parts/debug/browser/loadedScriptsView.ts | 16 ++++--- .../debug/electron-browser/callStackView.ts | 43 +++++++++++-------- .../debug/electron-browser/debugHover.ts | 2 +- .../parts/debug/electron-browser/repl.ts | 29 ++++++++----- .../debug/electron-browser/variablesView.ts | 16 ++++--- .../electron-browser/watchExpressionsView.ts | 14 +++--- .../debug/test/browser/baseDebugView.test.ts | 18 ++++---- 9 files changed, 98 insertions(+), 70 deletions(-) diff --git a/src/vs/workbench/parts/debug/browser/baseDebugView.ts b/src/vs/workbench/parts/debug/browser/baseDebugView.ts index 3edeaf4a5cc..c073bb18876 100644 --- a/src/vs/workbench/parts/debug/browser/baseDebugView.ts +++ b/src/vs/workbench/parts/debug/browser/baseDebugView.ts @@ -14,6 +14,8 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { KeyCode } from 'vs/base/common/keyCodes'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; +import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; +import { FuzzyScore, createMatches } from 'vs/base/common/filters'; export const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024; export const twistiePixels = 20; @@ -33,6 +35,7 @@ export interface IVariableTemplateData { expression: HTMLElement; name: HTMLElement; value: HTMLElement; + label: HighlightedLabel; } export function renderViewTree(container: HTMLElement): HTMLElement { @@ -88,11 +91,16 @@ export function renderExpressionValue(expressionOrValue: IExpression | string, c } } -export function renderVariable(variable: Variable, data: IVariableTemplateData, showChanged: boolean): void { +export function renderVariable(variable: Variable, data: IVariableTemplateData, showChanged: boolean, highlights: IHighlight[]): void { if (variable.available) { - data.name.textContent = replaceWhitespace(variable.name); - data.name.title = variable.type ? variable.type : variable.name; + let text = replaceWhitespace(variable.name); + if (variable.value && typeof variable.name === 'string') { + text += ':'; + } + data.label.set(text, highlights, variable.type ? variable.type : variable.name); dom.toggleClass(data.name, 'virtual', !!variable.presentationHint && variable.presentationHint.kind === 'virtual'); + } else if (variable.value && typeof variable.name === 'string') { + data.label.set(':'); } renderExpressionValue(variable, data.value, { @@ -102,9 +110,6 @@ export function renderVariable(variable: Variable, data: IVariableTemplateData, showHover: true, colorize: true }); - if (variable.value && typeof variable.name === 'string') { - data.name.textContent += ':'; - } } export interface IInputBoxOptions { @@ -122,9 +127,10 @@ export interface IExpressionTemplateData { inputBoxContainer: HTMLElement; enableInputBox(expression: IExpression, options: IInputBoxOptions); toDispose: IDisposable[]; + label: HighlightedLabel; } -export abstract class AbstractExpressionsRenderer implements ITreeRenderer { +export abstract class AbstractExpressionsRenderer implements ITreeRenderer { constructor( @IDebugService protected debugService: IDebugService, @@ -139,6 +145,8 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer { @@ -196,16 +204,16 @@ export abstract class AbstractExpressionsRenderer implements ITreeRenderer, index: number, data: IExpressionTemplateData): void { + renderElement(node: ITreeNode, index: number, data: IExpressionTemplateData): void { const { element } = node; if (element === this.debugService.getViewModel().getSelectedExpression()) { data.enableInputBox(element, this.getInputBoxOptions(element)); } else { - this.renderExpression(element, data); + this.renderExpression(element, data, createMatches(node.filterData)); } } - protected abstract renderExpression(expression: IExpression, data: IExpressionTemplateData): void; + protected abstract renderExpression(expression: IExpression, data: IExpressionTemplateData, highlights: IHighlight[]): void; protected abstract getInputBoxOptions(expression: IExpression): IInputBoxOptions; disposeTemplate(templateData: IExpressionTemplateData): void { diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index 2eb0c164f12..c00d6590dc7 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -803,7 +803,7 @@ export class ReverseContinueAction extends AbstractDebugAction { } export class ReplCollapseAllAction extends CollapseAction2 { - constructor(tree: AsyncDataTree, private toFocus: { focus(): void; }) { + constructor(tree: AsyncDataTree, private toFocus: { focus(): void; }) { super(tree, true, undefined); } diff --git a/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts b/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts index c59a90734ca..9379dbf7926 100644 --- a/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts @@ -33,6 +33,7 @@ import { WorkbenchAsyncDataTree, IListService, TreeResourceNavigator2 } from 'vs import { IThemeService } from 'vs/platform/theme/common/themeService'; import { DebugContentProvider } from 'vs/workbench/parts/debug/browser/debugContentProvider'; import { dispose } from 'vs/base/common/lifecycle'; +import { createMatches, FuzzyScore } from 'vs/base/common/filters'; const SMART = true; @@ -363,7 +364,7 @@ export class LoadedScriptsView extends ViewletPanel { private treeContainer: HTMLElement; private loadedScriptsItemType: IContextKey; - private tree: WorkbenchAsyncDataTree; + private tree: WorkbenchAsyncDataTree; private treeLabels: ResourceLabels; private changeScheduler: RunOnceScheduler; private treeNeedsRefreshOnVisible: boolean; @@ -540,7 +541,7 @@ interface ILoadedScriptsItemTemplateData { label: IResourceLabel; } -class LoadedScriptsRenderer implements ITreeRenderer { +class LoadedScriptsRenderer implements ITreeRenderer { static readonly ID = 'lsrenderer'; @@ -555,11 +556,11 @@ class LoadedScriptsRenderer implements ITreeRenderer, index: number, data: ILoadedScriptsItemTemplateData): void { + renderElement(node: ITreeNode, index: number, data: ILoadedScriptsItemTemplateData): void { const element = node.element; @@ -589,6 +590,7 @@ class LoadedScriptsRenderer implements ITreeRenderer { +class LoadedScriptsFilter implements ITreeFilter { private filterText: string; @@ -630,7 +632,7 @@ class LoadedScriptsFilter implements ITreeFilter { this.filterText = filterText; } - filter(element: BaseTreeItem, parentVisibility: TreeVisibility): TreeFilterResult { + filter(element: BaseTreeItem, parentVisibility: TreeVisibility): TreeFilterResult { if (!this.filterText) { return TreeVisibility.Visible; @@ -645,4 +647,4 @@ class LoadedScriptsFilter implements ITreeFilter { } return TreeVisibility.Recurse; } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts index a4dfb9bea3c..91e17036d60 100644 --- a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts @@ -31,6 +31,8 @@ import { ITreeRenderer, ITreeNode, ITreeContextMenuEvent, IAsyncDataSource } fro import { TreeResourceNavigator2, WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { onUnexpectedError } from 'vs/base/common/errors'; +import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; +import { createMatches, FuzzyScore } from 'vs/base/common/filters'; const $ = dom.$; @@ -46,7 +48,7 @@ export class CallStackView extends ViewletPanel { private ignoreFocusStackFrameEvent: boolean; private callStackItemType: IContextKey; private dataSource: CallStackDataSource; - private tree: WorkbenchAsyncDataTree; + private tree: WorkbenchAsyncDataTree; private contributedContextMenu: IMenu; constructor( @@ -328,6 +330,7 @@ interface IThreadTemplateData { name: HTMLElement; state: HTMLElement; stateLabel: HTMLSpanElement; + label: HighlightedLabel; } interface ISessionTemplateData { @@ -335,6 +338,7 @@ interface ISessionTemplateData { name: HTMLElement; state: HTMLElement; stateLabel: HTMLSpanElement; + label: HighlightedLabel; } interface IErrorTemplateData { @@ -347,13 +351,13 @@ interface ILabelTemplateData { interface IStackFrameTemplateData { stackFrame: HTMLElement; - label: HTMLElement; file: HTMLElement; fileName: HTMLElement; lineNumber: HTMLElement; + label: HighlightedLabel; } -class SessionsRenderer implements ITreeRenderer { +class SessionsRenderer implements ITreeRenderer { static readonly ID = 'session'; get templateId(): string { @@ -366,14 +370,15 @@ class SessionsRenderer implements ITreeRenderer, index: number, data: ISessionTemplateData): void { + renderElement(element: ITreeNode, index: number, data: ISessionTemplateData): void { const session = element.element; data.session.title = nls.localize({ key: 'session', comment: ['Session is a noun'] }, "Session"); - data.name.textContent = session.getLabel(); + data.label.set(session.getLabel(), createMatches(element.filterData)); const stoppedThread = session.getAllThreads().filter(t => t.stopped).pop(); data.stateLabel.textContent = stoppedThread ? nls.localize('paused', "Paused") @@ -385,7 +390,7 @@ class SessionsRenderer implements ITreeRenderer { +class ThreadsRenderer implements ITreeRenderer { static readonly ID = 'thread'; get templateId(): string { @@ -402,10 +407,10 @@ class ThreadsRenderer implements ITreeRenderer, index: number, data: IThreadTemplateData): void { + renderElement(element: ITreeNode, index: number, data: IThreadTemplateData): void { const thread = element.element; data.thread.title = nls.localize('thread', "Thread"); - data.name.textContent = thread.name; + data.label.set(thread.name, createMatches(element.filterData)); if (thread.stopped) { data.stateLabel.textContent = thread.stoppedDetails.description || @@ -420,7 +425,7 @@ class ThreadsRenderer implements ITreeRenderer { +class StackFramesRenderer implements ITreeRenderer { static readonly ID = 'stackFrame'; constructor(@ILabelService private readonly labelService: ILabelService) { } @@ -432,16 +437,17 @@ class StackFramesRenderer implements ITreeRenderer, index: number, data: IStackFrameTemplateData): void { + renderElement(element: ITreeNode, index: number, data: IStackFrameTemplateData): void { const stackFrame = element.element; dom.toggleClass(data.stackFrame, 'disabled', !stackFrame.source || !stackFrame.source.available || stackFrame.source.presentationHint === 'deemphasize'); dom.toggleClass(data.stackFrame, 'label', stackFrame.presentationHint === 'label'); @@ -451,8 +457,7 @@ class StackFramesRenderer implements ITreeRenderer { +class ErrorsRenderer implements ITreeRenderer { static readonly ID = 'error'; get templateId(): string { @@ -484,7 +489,7 @@ class ErrorsRenderer implements ITreeRenderer return data; } - renderElement(element: ITreeNode, index: number, data: IErrorTemplateData): void { + renderElement(element: ITreeNode, index: number, data: IErrorTemplateData): void { const error = element.element; data.label.textContent = error; data.label.title = error; @@ -495,7 +500,7 @@ class ErrorsRenderer implements ITreeRenderer } } -class LoadMoreRenderer implements ITreeRenderer { +class LoadMoreRenderer implements ITreeRenderer { static readonly ID = 'loadMore'; static readonly LABEL = nls.localize('loadMoreStackFrames', "Load More Stack Frames"); @@ -510,7 +515,7 @@ class LoadMoreRenderer implements ITreeRenderer, index: number, data: ILabelTemplateData): void { + renderElement(element: ITreeNode, index: number, data: ILabelTemplateData): void { data.label.textContent = LoadMoreRenderer.LABEL; } @@ -519,7 +524,7 @@ class LoadMoreRenderer implements ITreeRenderer { +class ShowMoreRenderer implements ITreeRenderer { static readonly ID = 'showMore'; get templateId(): string { @@ -533,7 +538,7 @@ class ShowMoreRenderer implements ITreeRenderer, index: number, data: ILabelTemplateData): void { + renderElement(element: ITreeNode, index: number, data: ILabelTemplateData): void { const stackFrames = element.element; if (stackFrames.every(sf => sf.source && sf.source.origin && sf.source.origin === stackFrames[0].source.origin)) { data.label.textContent = nls.localize('showMoreAndOrigin', "Show {0} More: {1}", stackFrames.length, stackFrames[0].source.origin); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts index 061d9a72a1b..788457f386f 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugHover.ts @@ -45,7 +45,7 @@ export class DebugHoverWidget implements IContentWidget { private _isVisible: boolean; private domNode: HTMLElement; - private tree: AsyncDataTree; + private tree: AsyncDataTree; private showAtPosition: Position; private highlightDecorations: string[]; private complexValueContainer: HTMLElement; diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index 45f77ae9975..21b493db790 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -66,6 +66,8 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration'; import { RunOnceScheduler } from 'vs/base/common/async'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; +import { FuzzyScore, createMatches } from 'vs/base/common/filters'; +import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; const $ = dom.$; @@ -81,7 +83,7 @@ interface IPrivateReplService { clearRepl(): void; } -function revealLastElement(tree: WorkbenchAsyncDataTree) { +function revealLastElement(tree: WorkbenchAsyncDataTree) { tree.scrollTop = tree.scrollHeight - tree.renderHeight; } @@ -95,7 +97,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati private static readonly REPL_INPUT_MAX_HEIGHT = 170; private history: HistoryNavigator; - private tree: WorkbenchAsyncDataTree; + private tree: WorkbenchAsyncDataTree; private replDelegate: ReplDelegate; private container: HTMLElement; private treeContainer: HTMLElement; @@ -250,7 +252,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati getVisibleContent(): string { let text = ''; const lineDelimiter = this.textResourcePropertiesService.getEOL(this.model.uri); - const traverseAndAppend = (node: ITreeNode) => { + const traverseAndAppend = (node: ITreeNode) => { node.children.forEach(child => { text += child.element.toString() + lineDelimiter; if (!child.collapsed && child.children.length) { @@ -507,6 +509,7 @@ interface IExpressionTemplateData { output: HTMLElement; value: HTMLElement; annotation: HTMLElement; + label: HighlightedLabel; } interface ISimpleReplElementTemplateData { @@ -515,6 +518,7 @@ interface ISimpleReplElementTemplateData { source: HTMLElement; getReplElementSource(): IReplElementSource; toDispose: IDisposable[]; + label: HighlightedLabel; } interface IRawObjectReplTemplateData { @@ -523,9 +527,10 @@ interface IRawObjectReplTemplateData { name: HTMLElement; value: HTMLElement; annotation: HTMLElement; + label: HighlightedLabel; } -class ReplExpressionsRenderer implements ITreeRenderer { +class ReplExpressionsRenderer implements ITreeRenderer { static readonly ID = 'expressionRepl'; get templateId(): string { @@ -536,6 +541,7 @@ class ReplExpressionsRenderer implements ITreeRenderer, index: number, templateData: IExpressionTemplateData): void { + renderElement(element: ITreeNode, index: number, templateData: IExpressionTemplateData): void { const expression = element.element; - templateData.input.textContent = expression.name; + templateData.label.set(expression.name, createMatches(element.filterData)); renderExpressionValue(expression, templateData.value, { preserveWhitespace: !expression.hasChildren, showHover: false, @@ -562,7 +568,7 @@ class ReplExpressionsRenderer implements ITreeRenderer { +class ReplSimpleElementsRenderer implements ITreeRenderer { static readonly ID = 'simpleReplElement'; constructor( @@ -606,7 +612,7 @@ class ReplSimpleElementsRenderer implements ITreeRenderer, index: number, templateData: ISimpleReplElementTemplateData): void { + renderElement({ element }: ITreeNode, index: number, templateData: ISimpleReplElementTemplateData): void { // value dom.clearNode(templateData.value); // Reset classes to clear ansi decorations since templates are reused @@ -625,7 +631,7 @@ class ReplSimpleElementsRenderer implements ITreeRenderer { +class ReplRawObjectsRenderer implements ITreeRenderer { static readonly ID = 'rawObject'; get templateId(): string { @@ -639,14 +645,17 @@ class ReplRawObjectsRenderer implements ITreeRenderer, index: number, templateData: IRawObjectReplTemplateData): void { + renderElement(node: ITreeNode, index: number, templateData: IRawObjectReplTemplateData): void { // key + const element = node.element; + templateData.label.set(element.name ? `${element.name}:` : '', createMatches(node.filterData)); if (element.name) { templateData.name.textContent = `${element.name}:`; } else { diff --git a/src/vs/workbench/parts/debug/electron-browser/variablesView.ts b/src/vs/workbench/parts/debug/electron-browser/variablesView.ts index 9540ae417cd..b6b470d6697 100644 --- a/src/vs/workbench/parts/debug/electron-browser/variablesView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/variablesView.ts @@ -28,6 +28,8 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { onUnexpectedError } from 'vs/base/common/errors'; +import { FuzzyScore, createMatches } from 'vs/base/common/filters'; +import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; const $ = dom.$; @@ -37,7 +39,7 @@ export class VariablesView extends ViewletPanel { private onFocusStackFrameScheduler: RunOnceScheduler; private needsRefresh: boolean; - private tree: WorkbenchAsyncDataTree; + private tree: WorkbenchAsyncDataTree; constructor( options: IViewletViewOptions, @@ -178,6 +180,7 @@ export class VariablesDataSource implements IAsyncDataSource { @@ -198,7 +201,7 @@ class VariablesDelegate implements IListVirtualDelegate { } } -class ScopesRenderer implements ITreeRenderer { +class ScopesRenderer implements ITreeRenderer { static readonly ID = 'scope'; @@ -209,12 +212,13 @@ class ScopesRenderer implements ITreeRenderer renderTemplate(container: HTMLElement): IScopeTemplateData { let data: IScopeTemplateData = Object.create(null); data.name = dom.append(container, $('.scope')); + data.label = new HighlightedLabel(data.name, false); return data; } - renderElement(element: ITreeNode, index: number, templateData: IScopeTemplateData): void { - templateData.name.textContent = element.element.name; + renderElement(element: ITreeNode, index: number, templateData: IScopeTemplateData): void { + templateData.label.set(element.element.name, createMatches(element.filterData)); } disposeTemplate(templateData: IScopeTemplateData): void { @@ -230,8 +234,8 @@ export class VariablesRenderer extends AbstractExpressionsRenderer { return VariablesRenderer.ID; } - protected renderExpression(expression: IExpression, data: IExpressionTemplateData): void { - renderVariable(expression as Variable, data, true); + protected renderExpression(expression: IExpression, data: IExpressionTemplateData, highlights: IHighlight[]): void { + renderVariable(expression as Variable, data, true, highlights); } protected getInputBoxOptions(expression: IExpression): IInputBoxOptions { diff --git a/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts b/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts index 7e461ac86a3..24c330faa89 100644 --- a/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts @@ -30,6 +30,8 @@ import { IAsyncDataSource, ITreeMouseEvent, ITreeContextMenuEvent, ITreeDragAndD import { IDragAndDropData } from 'vs/base/browser/dnd'; import { onUnexpectedError } from 'vs/base/common/errors'; import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; +import { FuzzyScore } from 'vs/base/common/filters'; +import { IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; const MAX_VALUE_RENDER_LENGTH_IN_VIEWLET = 1024; @@ -37,7 +39,7 @@ export class WatchExpressionsView extends ViewletPanel { private onWatchExpressionsUpdatedScheduler: RunOnceScheduler; private needsRefresh: boolean; - private tree: WorkbenchAsyncDataTree; + private tree: WorkbenchAsyncDataTree; constructor( options: IViewletViewOptions, @@ -223,8 +225,9 @@ export class WatchExpressionsRenderer extends AbstractExpressionsRenderer { return WatchExpressionsRenderer.ID; } - protected renderExpression(expression: IExpression, data: IExpressionTemplateData): void { - data.name.textContent = expression.name; + protected renderExpression(expression: IExpression, data: IExpressionTemplateData, highlights: IHighlight[]): void { + const text = typeof expression.value === 'string' ? `${expression.name}:` : expression.name; + data.label.set(text, highlights, expression.type ? expression.type : expression.value); renderExpressionValue(expression, data.value, { showChanged: true, maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_VIEWLET, @@ -232,11 +235,6 @@ export class WatchExpressionsRenderer extends AbstractExpressionsRenderer { showHover: true, colorize: true }); - data.name.title = expression.type ? expression.type : expression.value; - - if (typeof expression.value === 'string') { - data.name.textContent += ':'; - } } protected getInputBoxOptions(expression: IExpression): IInputBoxOptions { diff --git a/src/vs/workbench/parts/debug/test/browser/baseDebugView.test.ts b/src/vs/workbench/parts/debug/test/browser/baseDebugView.test.ts index 837cb46a9b6..e90ea964925 100644 --- a/src/vs/workbench/parts/debug/test/browser/baseDebugView.test.ts +++ b/src/vs/workbench/parts/debug/test/browser/baseDebugView.test.ts @@ -8,6 +8,7 @@ import { replaceWhitespace, renderExpressionValue, renderVariable } from 'vs/wor import * as dom from 'vs/base/browser/dom'; import { Expression, Variable, Scope, StackFrame, Thread } from 'vs/workbench/parts/debug/common/debugModel'; import { MockSession } from 'vs/workbench/parts/debug/test/common/mockDebug'; +import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; const $ = dom.$; suite('Debug - Base Debug View', () => { @@ -61,9 +62,10 @@ suite('Debug - Base Debug View', () => { let expression = $('.'); let name = $('.'); let value = $('.'); - renderVariable(variable, { expression, name, value }, false); + let label = new HighlightedLabel(name, false); + renderVariable(variable, { expression, name, value, label }, false, []); - assert.equal(name.textContent, 'foo'); + assert.equal(label.element.textContent, 'foo'); assert.equal(value.textContent, ''); assert.equal(value.title, ''); @@ -71,19 +73,19 @@ suite('Debug - Base Debug View', () => { expression = $('.'); name = $('.'); value = $('.'); - renderVariable(variable, { expression, name, value }, false); + renderVariable(variable, { expression, name, value, label }, false, []); assert.equal(value.textContent, 'hey'); - assert.equal(name.textContent, 'foo:'); - assert.equal(name.title, 'string'); + assert.equal(label.element.textContent, 'foo:'); + assert.equal(label.element.title, 'string'); variable = new Variable(session, scope, 2, 'console', 'console', '5', 0, 0, { kind: 'virtual' }); expression = $('.'); name = $('.'); value = $('.'); - renderVariable(variable, { expression, name, value }, false); + renderVariable(variable, { expression, name, value, label }, false, []); assert.equal(name.className, 'virtual'); - assert.equal(name.textContent, 'console:'); - assert.equal(name.title, 'console'); + assert.equal(label.element.textContent, 'console:'); + assert.equal(label.element.title, 'console'); assert.equal(value.className, 'value number'); }); }); From 191c11b888d6e644d07192ac95b864e08b304032 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 31 Jan 2019 16:17:53 +0100 Subject: [PATCH 216/429] highglightLabel is not disposable --- .../base/browser/ui/highlightedlabel/highlightedLabel.ts | 8 +------- src/vs/base/browser/ui/iconLabel/iconLabel.ts | 5 ++--- src/vs/base/parts/quickopen/browser/quickOpenModel.ts | 1 - src/vs/base/test/browser/highlightedLabel.test.ts | 4 ---- src/vs/editor/contrib/documentSymbols/outlineTree.ts | 3 +-- .../parts/markers/electron-browser/markersTreeViewer.ts | 8 ++------ 6 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts b/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts index 14d7439bf90..836818294c2 100644 --- a/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts +++ b/src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IDisposable } from 'vs/base/common/lifecycle'; import * as dom from 'vs/base/browser/dom'; import * as objects from 'vs/base/common/objects'; import { renderOcticons } from 'vs/base/browser/ui/octiconLabel/octiconLabel'; @@ -14,7 +13,7 @@ export interface IHighlight { end: number; } -export class HighlightedLabel implements IDisposable { +export class HighlightedLabel { private domNode: HTMLElement; private text: string; @@ -91,11 +90,6 @@ export class HighlightedLabel implements IDisposable { this.didEverRender = true; } - dispose() { - this.text = null!; // StrictNullOverride: nulling out ok in dispose - this.highlights = null!; // StrictNullOverride: nulling out ok in dispose - } - static escapeNewLines(text: string, highlights: IHighlight[]): string { let total = 0; diff --git a/src/vs/base/browser/ui/iconLabel/iconLabel.ts b/src/vs/base/browser/ui/iconLabel/iconLabel.ts index be99067ee1d..a61b1bba525 100644 --- a/src/vs/base/browser/ui/iconLabel/iconLabel.ts +++ b/src/vs/base/browser/ui/iconLabel/iconLabel.ts @@ -100,13 +100,13 @@ export class IconLabel extends Disposable { this.labelDescriptionContainer = this._register(new FastLabelNode(dom.append(this.domNode.element, dom.$('.monaco-icon-label-description-container')))); if (options && options.supportHighlights) { - this.labelNode = this._register(new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name')), !options.donotSupportOcticons)); + this.labelNode = new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name')), !options.donotSupportOcticons); } else { this.labelNode = this._register(new FastLabelNode(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name')))); } if (options && options.supportDescriptionHighlights) { - this.descriptionNodeFactory = () => this._register(new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description')), !options.donotSupportOcticons)); + this.descriptionNodeFactory = () => new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description')), !options.donotSupportOcticons); } else { this.descriptionNodeFactory = () => this._register(new FastLabelNode(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description')))); } @@ -157,4 +157,3 @@ export class IconLabel extends Disposable { } } } - diff --git a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts index 5780dee88ca..4959a71f185 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts @@ -485,7 +485,6 @@ class Renderer implements IRenderer { data.container = null; data.entry = null; data.keybinding = null; - data.detail.dispose(); data.detail = null; data.group = null; data.icon = null; diff --git a/src/vs/base/test/browser/highlightedLabel.test.ts b/src/vs/base/test/browser/highlightedLabel.test.ts index 4fbab5b9614..c658c835c04 100644 --- a/src/vs/base/test/browser/highlightedLabel.test.ts +++ b/src/vs/base/test/browser/highlightedLabel.test.ts @@ -12,10 +12,6 @@ suite('HighlightedLabel', () => { label = new HighlightedLabel(document.createElement('div'), true); }); - teardown(() => { - label.dispose(); - }); - test('empty label', function () { assert.equal(label.element.innerHTML, ''); }); diff --git a/src/vs/editor/contrib/documentSymbols/outlineTree.ts b/src/vs/editor/contrib/documentSymbols/outlineTree.ts index 3daabc1627d..4c529be6e97 100644 --- a/src/vs/editor/contrib/documentSymbols/outlineTree.ts +++ b/src/vs/editor/contrib/documentSymbols/outlineTree.ts @@ -240,9 +240,8 @@ export class OutlineRenderer implements IRenderer { }; disposeTemplate(tree: ITree, templateId: string, template: OutlineTemplate): void { - template.label.dispose(); + // noop } - } export class OutlineTreeState { diff --git a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts index a284d526c5e..e7cb8ee2bbd 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts @@ -305,7 +305,6 @@ class MarkerWidget extends Disposable { lastLineElement = dom.append(messageContainer, dom.$('.marker-message-line')); const highlightedLabel = new HighlightedLabel(lastLineElement, false); highlightedLabel.set(lines[index], lineMatches[index]); - this.disposables.push(highlightedLabel); } this.renderDetails(marker, filterData, multiline ? lastLineElement : this.messageAndDetailsContainer); } @@ -325,8 +324,6 @@ class MarkerWidget extends Disposable { const lnCol = dom.append(parent, dom.$('span.marker-line')); lnCol.textContent = Messages.MARKERS_PANEL_AT_LINE_COL_NUMBER(marker.startLineNumber, marker.startColumn); - - this.disposables.push(...[source, code]); } private static iconClassNameFor(element: IMarker): string { @@ -382,8 +379,7 @@ export class RelatedInformationRenderer implements ITreeRenderer Date: Thu, 31 Jan 2019 17:47:14 +0100 Subject: [PATCH 217/429] fixes #66899 --- src/vs/base/browser/ui/tree/abstractTree.ts | 2 ++ src/vs/base/browser/ui/tree/asyncDataTree.ts | 2 ++ .../workbench/browser/actions/listCommands.ts | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index d7362e7e14d..5ee6f822611 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -831,6 +831,8 @@ export abstract class AbstractTree implements IDisposable private _onWillRefilter = new Emitter(); readonly onWillRefilter: Event = this._onWillRefilter.event; + get filterOnType(): boolean { return !!this._options.filterOnType; } + get onDidDispose(): Event { return this.view.onDidDispose; } constructor( diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 3b50d3ff5f8..c0fe25efda9 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -284,6 +284,8 @@ export class AsyncDataTree implements IDisposable get onDidFocus(): Event { return this.tree.onDidFocus; } get onDidBlur(): Event { return this.tree.onDidBlur; } + get filterOnType(): boolean { return this.tree.filterOnType; } + get onDidDispose(): Event { return this.tree.onDidDispose; } constructor( diff --git a/src/vs/workbench/browser/actions/listCommands.ts b/src/vs/workbench/browser/actions/listCommands.ts index 087f1f5f2aa..2ce44cacbb7 100644 --- a/src/vs/workbench/browser/actions/listCommands.ts +++ b/src/vs/workbench/browser/actions/listCommands.ts @@ -762,3 +762,21 @@ CommandsRegistry.registerCommand({ } } }); + +CommandsRegistry.registerCommand({ + id: 'list.toggleFilterOnType', + handler: (accessor) => { + const focused = accessor.get(IListService).lastFocusedList; + + // List + if (focused instanceof List || focused instanceof PagedList) { + // TODO@joao + } + + // ObjectTree + else if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) { + const tree = focused; + tree.updateOptions({ filterOnType: !tree.filterOnType }); + } + } +}); From b3ebb15a5f156e9f27185d1672b7b7b2d9daf873 Mon Sep 17 00:00:00 2001 From: isidor Date: Thu, 31 Jan 2019 18:12:49 +0100 Subject: [PATCH 218/429] explorer: select parent folder when new file / new folder canceled fixes #67653 fixes #66475 --- src/vs/workbench/parts/files/electron-browser/fileActions.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.ts index f38833fd7cd..420a845ae97 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.ts @@ -145,6 +145,8 @@ export class NewFileAction extends BaseErrorReportingAction { this.explorerService.setEditable(stat, null); if (success) { onSuccess(value); + } else { + this.explorerService.select(folder.resource).then(undefined, onUnexpectedError); } } }); @@ -199,6 +201,8 @@ export class NewFolderAction extends BaseErrorReportingAction { this.explorerService.setEditable(stat, null); if (success) { onSuccess(value); + } else { + this.explorerService.select(folder.resource).then(undefined, onUnexpectedError); } } }); From ef0f902787952638317d709e0c1c5030b47a79ac Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 31 Jan 2019 10:44:46 -0800 Subject: [PATCH 219/429] Fix custom data capitalization --- extensions/css-language-features/server/src/customData.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/css-language-features/server/src/customData.ts b/extensions/css-language-features/server/src/customData.ts index b5cbdc27c7a..f173d884a2b 100644 --- a/extensions/css-language-features/server/src/customData.ts +++ b/extensions/css-language-features/server/src/customData.ts @@ -43,8 +43,8 @@ function parseCSSData(source: string): CSSDataV1 { return { version: 1, properties: rawData.properties || [], - atDirectives: rawData.atdirectives || [], - pseudoClasses: rawData.pseudoclasses || [], - pseudoElements: rawData.pseudoelements || [] + atDirectives: rawData.atDirectives || [], + pseudoClasses: rawData.pseudoClasses || [], + pseudoElements: rawData.pseudoElements || [] }; } From 7debb7ebdc1e4bdb193d9a91753a8e1242ccff8a Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Thu, 31 Jan 2019 11:30:24 -0800 Subject: [PATCH 220/429] listen to onDidVisibleEditors change as well refs #67356 --- src/vs/workbench/electron-browser/workbench.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index f222c743e7d..d82db96296d 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -581,6 +581,10 @@ export class Workbench extends Disposable implements IPartService { this.closeEmptyWindowScheduler.schedule(); } } + + if (this.editorHidden) { + this.setEditorHidden(false); + } } private onAllEditorsClosed(): void { From e795093995c7382d0fb0f2e126f6f91aa81637c2 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Thu, 31 Jan 2019 11:42:34 -0800 Subject: [PATCH 221/429] adjust titlebar size with zoom appropriately --- src/vs/workbench/browser/parts/titlebar/titlebarPart.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index c6bd885de3b..4b3eb7bdb87 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -66,8 +66,8 @@ export class TitlebarPart extends Part implements ITitleService, ISerializableVi minimumWidth: number = 0; maximumWidth: number = Number.POSITIVE_INFINITY; - minimumHeight: number = isMacintosh ? 22 : 30; - maximumHeight: number = isMacintosh ? 22 : 30; + get minimumHeight(): number { return isMacintosh ? 22 / getZoomFactor() : (30 / (this.configurationService.getValue('window.menuBarVisibility') === 'hidden' ? getZoomFactor() : 1)); } + get maximumHeight(): number { return isMacintosh ? 22 / getZoomFactor() : (30 / (this.configurationService.getValue('window.menuBarVisibility') === 'hidden' ? getZoomFactor() : 1)); } private _onDidChange = new Emitter<{ width: number; height: number; }>(); readonly onDidChange = this._onDidChange.event; From 9c887c95738845aca072cbb19702a49e13ff325f Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 21:12:43 +0100 Subject: [PATCH 222/429] proper tree aria-posinset and aria-setsize attributes fixes #67156 --- src/vs/base/browser/ui/tree/abstractTree.ts | 27 ++++--- src/vs/base/browser/ui/tree/asyncDataTree.ts | 2 + src/vs/base/browser/ui/tree/indexTreeModel.ts | 76 +++++++++++++++++-- src/vs/base/browser/ui/tree/tree.ts | 2 + 4 files changed, 91 insertions(+), 16 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 5ee6f822611..6d472170250 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -171,8 +171,9 @@ export class ComposedTreeDelegate implements IListV } interface ITreeListTemplateData { - twistie: HTMLElement; - templateData: T; + readonly container: HTMLElement; + readonly twistie: HTMLElement; + readonly templateData: T; } interface ITreeRendererOptions { @@ -218,7 +219,7 @@ class TreeRenderer implements IListRenderer, index: number, templateData: ITreeListTemplateData): void { @@ -227,7 +228,9 @@ class TreeRenderer implements IListRenderer implements IListRenderer, twistieElement: HTMLElement) { + private update(node: ITreeNode, templateData: ITreeListTemplateData) { if (this.renderer.renderTwistie) { - this.renderer.renderTwistie(node.element, twistieElement); + this.renderer.renderTwistie(node.element, templateData.twistie); } - toggleClass(twistieElement, 'collapsible', node.collapsible); - toggleClass(twistieElement, 'collapsed', node.collapsible && node.collapsed); + toggleClass(templateData.twistie, 'collapsible', node.collapsible); + toggleClass(templateData.twistie, 'collapsed', node.collapsible && node.collapsed); + + if (node.collapsible) { + templateData.container.setAttribute('aria-expanded', String(!node.collapsed)); + } else { + templateData.container.removeAttribute('aria-expanded'); + } } dispose(): void { diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index c0fe25efda9..332fa1d0bcf 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -59,6 +59,8 @@ class AsyncDataTreeNodeWrapper implements ITreeNode | undefined { return this.node.parent && new AsyncDataTreeNodeWrapper(this.node.parent); } get children(): ITreeNode[] { return this.node.children.map(node => new AsyncDataTreeNodeWrapper(node)); } get depth(): number { return this.node.depth; } + get visibleChildrenCount(): number { return this.node.visibleChildrenCount; } + get visibleChildIndex(): number { return this.node.visibleChildIndex; } get collapsible(): boolean { return this.node.collapsible; } get collapsed(): boolean { return this.node.collapsed; } get visible(): boolean { return this.node.visible; } diff --git a/src/vs/base/browser/ui/tree/indexTreeModel.ts b/src/vs/base/browser/ui/tree/indexTreeModel.ts index cc6555950aa..b22af463d96 100644 --- a/src/vs/base/browser/ui/tree/indexTreeModel.ts +++ b/src/vs/base/browser/ui/tree/indexTreeModel.ts @@ -12,6 +12,8 @@ import { ISpliceable } from 'vs/base/common/sequence'; interface IMutableTreeNode extends ITreeNode { readonly parent: IMutableTreeNode | undefined; readonly children: IMutableTreeNode[]; + visibleChildrenCount: number; + visibleChildIndex: number; collapsible: boolean; collapsed: boolean; renderNodeCount: number; @@ -76,6 +78,8 @@ export class IndexTreeModel, TFilterData = voi element: rootElement, children: [], depth: 0, + visibleChildrenCount: 0, + visibleChildIndex: -1, collapsible: false, collapsed: false, renderNodeCount: 0, @@ -99,17 +103,59 @@ export class IndexTreeModel, TFilterData = voi const treeListElementsToInsert: ITreeNode[] = []; const nodesToInsertIterator = Iterator.map(Iterator.from(toInsert), el => this.createTreeNode(el, parentNode, parentNode.visible ? TreeVisibility.Visible : TreeVisibility.Hidden, revealed, treeListElementsToInsert, onDidCreateNode)); + const lastIndex = location[location.length - 1]; + + // figure out what's the visible child start index right before the + // splice point + let visibleChildStartIndex = 0; + + for (let i = lastIndex; i >= 0 && i < parentNode.children.length; i--) { + const child = parentNode.children[i]; + + if (child.visible) { + visibleChildStartIndex = child.visibleChildIndex; + break; + } + } + const nodesToInsert: IMutableTreeNode[] = []; + let insertedVisibleChildrenCount = 0; let renderNodeCount = 0; - Iterator.forEach(nodesToInsertIterator, node => { - nodesToInsert.push(node); - renderNodeCount += node.renderNodeCount; + Iterator.forEach(nodesToInsertIterator, child => { + nodesToInsert.push(child); + renderNodeCount += child.renderNodeCount; + + if (child.visible) { + child.visibleChildIndex = visibleChildStartIndex + insertedVisibleChildrenCount++; + } }); - const lastIndex = location[location.length - 1]; const deletedNodes = parentNode.children.splice(lastIndex, deleteCount, ...nodesToInsert); + // figure out what is the count of deleted visible children + let deletedVisibleChildrenCount = 0; + + for (const child of deletedNodes) { + if (child.visible) { + deletedVisibleChildrenCount++; + } + } + + // and adjust for all visible children after the splice point + if (deletedVisibleChildrenCount !== 0) { + for (let i = lastIndex + nodesToInsert.length; i < parentNode.children.length; i++) { + const child = parentNode.children[i]; + + if (child.visible) { + child.visibleChildIndex -= deletedVisibleChildrenCount; + } + } + } + + // update parent's visible children count + parentNode.visibleChildrenCount += insertedVisibleChildrenCount - deletedVisibleChildrenCount; + if (revealed && visible) { const visibleDeleteCount = deletedNodes.reduce((r, node) => r + node.renderNodeCount, 0); @@ -253,6 +299,8 @@ export class IndexTreeModel, TFilterData = voi element: treeElement.element, children: [], depth: parent.depth + 1, + visibleChildrenCount: 0, + visibleChildIndex: -1, collapsible: typeof treeElement.collapsible === 'boolean' ? treeElement.collapsible : (typeof treeElement.collapsed !== 'undefined'), collapsed: typeof treeElement.collapsed === 'undefined' ? this.collapseByDefault : treeElement.collapsed, renderNodeCount: 1, @@ -270,17 +318,21 @@ export class IndexTreeModel, TFilterData = voi const childRevealed = revealed && visibility !== TreeVisibility.Hidden && !node.collapsed; const childNodes = Iterator.map(childElements, el => this.createTreeNode(el, node, visibility, childRevealed, treeListElements, onDidCreateNode)); - let hasVisibleDescendants = false; + let visibleChildrenCount = 0; let renderNodeCount = 1; Iterator.forEach(childNodes, child => { node.children.push(child); - hasVisibleDescendants = hasVisibleDescendants || child.visible; renderNodeCount += child.renderNodeCount; + + if (child.visible) { + child.visibleChildIndex = visibleChildrenCount++; + } }); node.collapsible = node.collapsible || node.children.length > 0; - node.visible = visibility === TreeVisibility.Recurse ? hasVisibleDescendants : (visibility === TreeVisibility.Visible); + node.visibleChildrenCount = visibleChildrenCount; + node.visible = visibility === TreeVisibility.Recurse ? visibleChildrenCount > 0 : (visibility === TreeVisibility.Visible); if (!node.visible) { node.renderNodeCount = 0; @@ -358,9 +410,19 @@ export class IndexTreeModel, TFilterData = voi let hasVisibleDescendants = false; if (!node.collapsed || visibility! !== TreeVisibility.Hidden) { + let visibleChildIndex = 0; + for (const child of node.children) { hasVisibleDescendants = this._updateNodeAfterFilterChange(child, visibility!, result, revealed && !node.collapsed) || hasVisibleDescendants; + + if (child.visible) { + child.visibleChildIndex = visibleChildIndex++; + } } + + node.visibleChildrenCount = visibleChildIndex; + } else { + node.visibleChildrenCount = 0; } if (node !== this.root) { diff --git a/src/vs/base/browser/ui/tree/tree.ts b/src/vs/base/browser/ui/tree/tree.ts index 4880293c269..adde3a3f6f2 100644 --- a/src/vs/base/browser/ui/tree/tree.ts +++ b/src/vs/base/browser/ui/tree/tree.ts @@ -84,6 +84,8 @@ export interface ITreeNode { readonly parent: ITreeNode | undefined; readonly children: ITreeNode[]; readonly depth: number; + readonly visibleChildrenCount: number; + readonly visibleChildIndex: number; readonly collapsible: boolean; readonly collapsed: boolean; readonly visible: boolean; From d93d2c344091fd5f03552eee007814405d8caf33 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 21:17:17 +0100 Subject: [PATCH 223/429] fixes #67576 --- src/vs/base/browser/ui/tree/abstractTree.ts | 3 ++- src/vs/platform/list/browser/listService.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 6d472170250..5fa35f962d0 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -23,6 +23,7 @@ import { localize } from 'vs/nls'; import { disposableTimeout } from 'vs/base/common/async'; import { isMacintosh } from 'vs/base/common/platform'; import { values } from 'vs/base/common/map'; +import { clamp } from 'vs/base/common/numbers'; function asTreeDragAndDropData(data: IDragAndDropData): IDragAndDropData { if (data instanceof ElementsDragAndDropData) { @@ -206,7 +207,7 @@ class TreeRenderer implements IListRenderer { templateData.twistie.style.marginLeft = `${node.depth * this.indent}px`; diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 84f5114a9a9..e3ac00702cd 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -1288,6 +1288,8 @@ configurationRegistry.registerConfiguration({ [treeIndentKey]: { 'type': 'number', 'default': 8, + minimum: 0, + maximum: 20, 'description': localize('tree indent setting', "Controls tree indentation in pixels.") }, [keyboardNavigationSettingKey]: { From 97688712b3614902b29d08b61f5afba4923e0eec Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 21:39:38 +0100 Subject: [PATCH 224/429] tree: respect multi select key fixes #67648 --- src/vs/base/browser/ui/list/listWidget.ts | 10 ++++++++-- src/vs/base/browser/ui/tree/abstractTree.ts | 5 +++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index ebe2af766dc..4d417ec11d9 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -505,7 +505,7 @@ const DefaultOpenController: IOpenController = { class MouseController implements IDisposable { private multipleSelectionSupport: boolean; - private multipleSelectionController: IMultipleSelectionController; + readonly multipleSelectionController: IMultipleSelectionController; private openController: IOpenController; private disposables: IDisposable[] = []; @@ -1063,6 +1063,11 @@ export class List implements ISpliceable, IDisposable { private spliceable: ISpliceable; private styleElement: HTMLStyleElement; private styleController: IStyleController; + private mouseController: MouseController | undefined; + + get multipleSelectionController(): IMultipleSelectionController { + return this.mouseController ? this.mouseController.multipleSelectionController : DefaultMultipleSelectionContoller; + } private _onDidUpdateOptions = new Emitter>(); readonly onDidUpdateOptions = this._onDidUpdateOptions.event; @@ -1208,7 +1213,8 @@ export class List implements ISpliceable, IDisposable { } if (typeof _options.mouseSupport === 'boolean' ? _options.mouseSupport : true) { - this.disposables.push(new MouseController(this, this.view, _options)); + this.mouseController = new MouseController(this, this.view, _options); + this.disposables.push(this.mouseController); } this.onFocusChange(this._onFocusChange, this, this.disposables); diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 5fa35f962d0..c68823146a3 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/tree'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IListOptions, List, IListStyles, mightProducePrintableCharacter, isSelectionRangeChangeEvent, isSelectionSingleChangeEvent } from 'vs/base/browser/ui/list/listWidget'; +import { IListOptions, List, IListStyles, mightProducePrintableCharacter } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass } from 'vs/base/browser/dom'; import { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event'; @@ -1127,7 +1127,8 @@ export abstract class AbstractTree implements IDisposable if (!node) { return; } - if (isSelectionRangeChangeEvent(e) || isSelectionSingleChangeEvent(e)) { + + if (this.view.multipleSelectionController.isSelectionRangeChangeEvent(e) || this.view.multipleSelectionController.isSelectionSingleChangeEvent(e)) { return; } From ce755eaf650acdcca39ec315f5f37f166967b0df Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 21:43:41 +0100 Subject: [PATCH 225/429] remove specific type filter shadow color fixes #67446 --- src/vs/platform/theme/common/colorRegistry.ts | 1 - src/vs/platform/theme/common/styler.ts | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index b253d48e95e..a60acb6546f 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -238,7 +238,6 @@ export const listWarningForeground = registerColor('list.warningForeground', { d export const listMatchesBackground = registerColor('list.matchesBackground', { light: '#efc1ad', dark: '#653723', hc: Color.black }, nls.localize('listMatchesBackground', 'Background color of the type filter widget in lists and trees.')); export const listMatchesOutline = registerColor('list.matchesOutline', { dark: Color.transparent, light: Color.transparent, hc: '#f38518' }, nls.localize('listMatchesOutline', 'Outline color of the type filter widget in lists and trees.')); export const listNoMatchesOutline = registerColor('list.noMatchesOutline', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, nls.localize('listNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.')); -export const listMatchesShadow = registerColor('list.matchesShadow', { dark: '#000000', light: '#A8A8A8', hc: null }, nls.localize('listMatchesShadow', 'Shadow color of the type filter widget in lists and trees.')); export const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hc: Color.white }, nls.localize('pickerGroupForeground', "Quick picker color for grouping labels.")); export const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hc: Color.white }, nls.localize('pickerGroupBorder', "Quick picker color for grouping borders.")); diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index e96a4270c33..f3f7a613fff 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listMatchesOutline, listNoMatchesOutline, listMatchesShadow, listMatchesBackground } from 'vs/platform/theme/common/colorRegistry'; +import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listMatchesOutline, listNoMatchesOutline, listMatchesBackground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; import { mixin } from 'vs/base/common/objects'; @@ -252,7 +252,7 @@ export const defaultListStyles: IColorMapping = { listMatchesBackground, listMatchesOutline, listNoMatchesOutline, - listMatchesShadow + listMatchesShadow: widgetShadow }; export interface IButtonStyleOverrides extends IStyleOverrides { From 47cbad05abbd782ee1b9d1abd84033357e2a24c7 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 31 Jan 2019 21:58:37 +0100 Subject: [PATCH 226/429] fixes #67446 --- src/vs/base/browser/ui/list/listWidget.ts | 18 +++++++++--------- src/vs/platform/theme/common/colorRegistry.ts | 6 +++--- src/vs/platform/theme/common/styler.ts | 14 +++++++------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 4d417ec11d9..37ccdcbf94f 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -759,16 +759,16 @@ export class DefaultStyleController implements IStyleController { `); } - if (styles.listMatchesBackground) { - content.push(`.monaco-list-type-filter { background-color: ${styles.listMatchesBackground} }`); + if (styles.listFilterWidgetBackground) { + content.push(`.monaco-list-type-filter { background-color: ${styles.listFilterWidgetBackground} }`); } - if (styles.listMatchesOutline) { - content.push(`.monaco-list-type-filter { border: 1px solid ${styles.listMatchesOutline}; }`); + if (styles.listFilterWidgetOutline) { + content.push(`.monaco-list-type-filter { border: 1px solid ${styles.listFilterWidgetOutline}; }`); } - if (styles.listNoMatchesOutline) { - content.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${styles.listNoMatchesOutline}; }`); + if (styles.listFilterWidgetNoMatchesOutline) { + content.push(`.monaco-list-type-filter.no-matches { border: 1px solid ${styles.listFilterWidgetNoMatchesOutline}; }`); } if (styles.listMatchesShadow) { @@ -822,9 +822,9 @@ export interface IListStyles { listInactiveFocusOutline?: Color; listSelectionOutline?: Color; listHoverOutline?: Color; - listMatchesBackground?: Color; - listMatchesOutline?: Color; - listNoMatchesOutline?: Color; + listFilterWidgetBackground?: Color; + listFilterWidgetOutline?: Color; + listFilterWidgetNoMatchesOutline?: Color; listMatchesShadow?: Color; } diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index a60acb6546f..8c94876cb23 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -235,9 +235,9 @@ export const listHighlightForeground = registerColor('list.highlightForeground', export const listInvalidItemForeground = registerColor('list.invalidItemForeground', { dark: '#B89500', light: '#B89500', hc: '#B89500' }, nls.localize('invalidItemForeground', 'List/Tree foreground color for invalid items, for example an unresolved root in explorer.')); export const listErrorForeground = registerColor('list.errorForeground', { dark: '#F88070', light: '#B01011', hc: null }, nls.localize('listErrorForeground', 'Foreground color of list items containing errors.')); export const listWarningForeground = registerColor('list.warningForeground', { dark: '#4d9e4d', light: '#117711', hc: null }, nls.localize('listWarningForeground', 'Foreground color of list items containing warnings.')); -export const listMatchesBackground = registerColor('list.matchesBackground', { light: '#efc1ad', dark: '#653723', hc: Color.black }, nls.localize('listMatchesBackground', 'Background color of the type filter widget in lists and trees.')); -export const listMatchesOutline = registerColor('list.matchesOutline', { dark: Color.transparent, light: Color.transparent, hc: '#f38518' }, nls.localize('listMatchesOutline', 'Outline color of the type filter widget in lists and trees.')); -export const listNoMatchesOutline = registerColor('list.noMatchesOutline', { dark: '#B89500', light: '#B89500', hc: contrastBorder }, nls.localize('listNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.')); +export const listFilterWidgetBackground = registerColor('listFilterWidget.background', { light: '#efc1ad', dark: '#653723', hc: Color.black }, nls.localize('listFilterWidgetBackground', 'Background color of the type filter widget in lists and trees.')); +export const listFilterWidgetOutline = registerColor('listFilterWidget.outline', { dark: Color.transparent, light: Color.transparent, hc: '#f38518' }, nls.localize('listFilterWidgetOutline', 'Outline color of the type filter widget in lists and trees.')); +export const listFilterWidgetNoMatchesOutline = registerColor('listFilterWidget.noMatchesOutline', { dark: '#BE1100', light: '#BE1100', hc: contrastBorder }, nls.localize('listFilterWidgetNoMatchesOutline', 'Outline color of the type filter widget in lists and trees, when there are no matches.')); export const pickerGroupForeground = registerColor('pickerGroup.foreground', { dark: '#3794FF', light: '#0066BF', hc: Color.white }, nls.localize('pickerGroupForeground', "Quick picker color for grouping labels.")); export const pickerGroupBorder = registerColor('pickerGroup.border', { dark: '#3F3F46', light: '#CCCEDB', hc: Color.white }, nls.localize('pickerGroupBorder', "Quick picker color for grouping borders.")); diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index f3f7a613fff..d7725d4d1ca 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listMatchesOutline, listNoMatchesOutline, listMatchesBackground } from 'vs/platform/theme/common/colorRegistry'; +import { focusBorder, inputBackground, inputForeground, ColorIdentifier, selectForeground, selectBackground, selectListBackground, selectBorder, inputBorder, foreground, editorBackground, contrastBorder, inputActiveOptionBorder, listFocusBackground, listFocusForeground, listActiveSelectionBackground, listActiveSelectionForeground, listInactiveSelectionForeground, listInactiveSelectionBackground, listInactiveFocusBackground, listHoverBackground, listHoverForeground, listDropBackground, pickerGroupBorder, pickerGroupForeground, widgetShadow, inputValidationInfoBorder, inputValidationInfoBackground, inputValidationWarningBorder, inputValidationWarningBackground, inputValidationErrorBorder, inputValidationErrorBackground, activeContrastBorder, buttonForeground, buttonBackground, buttonHoverBackground, ColorFunction, badgeBackground, badgeForeground, progressBarBackground, breadcrumbsForeground, breadcrumbsFocusForeground, breadcrumbsActiveSelectionForeground, breadcrumbsBackground, editorWidgetBorder, inputValidationInfoForeground, inputValidationWarningForeground, inputValidationErrorForeground, menuForeground, menuBackground, menuSelectionForeground, menuSelectionBackground, menuSelectionBorder, menuBorder, menuSeparatorBackground, darken, listFilterWidgetOutline, listFilterWidgetNoMatchesOutline, listFilterWidgetBackground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; import { mixin } from 'vs/base/common/objects'; @@ -223,9 +223,9 @@ export interface IListStyleOverrides extends IStyleOverrides { listInactiveFocusOutline?: ColorIdentifier; listSelectionOutline?: ColorIdentifier; listHoverOutline?: ColorIdentifier; - listMatchesBackground?: ColorIdentifier; - listMatchesOutline?: ColorIdentifier; - listNoMatchesOutline?: ColorIdentifier; + listFilterWidgetBackground?: ColorIdentifier; + listFilterWidgetOutline?: ColorIdentifier; + listFilterWidgetNoMatchesOutline?: ColorIdentifier; listMatchesShadow?: ColorIdentifier; } @@ -249,9 +249,9 @@ export const defaultListStyles: IColorMapping = { listFocusOutline: activeContrastBorder, listSelectionOutline: activeContrastBorder, listHoverOutline: activeContrastBorder, - listMatchesBackground, - listMatchesOutline, - listNoMatchesOutline, + listFilterWidgetBackground: listFilterWidgetBackground, + listFilterWidgetOutline: listFilterWidgetOutline, + listFilterWidgetNoMatchesOutline: listFilterWidgetNoMatchesOutline, listMatchesShadow: widgetShadow }; From ee10609110fab0de4cf98453ccd3e75272b9c4ec Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 31 Jan 2019 23:17:38 +0100 Subject: [PATCH 227/429] Fixes #67607: Don't trust tokens/states produced by the viewport tokenization --- src/vs/editor/common/model/textModel.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 44037d1b5b1..7893c700738 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -1819,13 +1819,11 @@ export class TextModel extends Disposable implements model.ITextModel { let r = this._tokens._tokenizeText(this._buffer, text, state); if (r) { this._tokens._setTokens(this._tokens.languageIdentifier.id, i - 1, text.length, r.tokens); - /* - * we think it's valid and give it a state but we don't update `_invalidLineStartIndex` then the top-to-bottom tokenization - * goes through the viewport, it can skip them if they already have correct tokens and state, and the lines after the viewport - * can still be tokenized. - */ - this._tokens._setIsInvalid(i - 1, false); - this._tokens._setState(i - 1, state); + + // We cannot trust these states/tokens to be valid! + // (see https://github.com/Microsoft/vscode/issues/67607) + this._tokens._setIsInvalid(i - 1, true); + this._tokens._setState(i - 1, null); state = r.endState.clone(); eventBuilder.registerChangedTokens(i); } else { From 436e2f8122eae96fb34a6358c960d790ba3e13fe Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 31 Jan 2019 23:20:41 +0100 Subject: [PATCH 228/429] Fix strict null check (#67607) --- src/vs/editor/common/model/textModel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 7893c700738..3a0d722fdea 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -1823,7 +1823,7 @@ export class TextModel extends Disposable implements model.ITextModel { // We cannot trust these states/tokens to be valid! // (see https://github.com/Microsoft/vscode/issues/67607) this._tokens._setIsInvalid(i - 1, true); - this._tokens._setState(i - 1, null); + this._tokens._setState(i - 1, state); state = r.endState.clone(); eventBuilder.registerChangedTokens(i); } else { From 16e58d25d008976c8a36867f4b638c07f750794e Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Thu, 31 Jan 2019 14:41:03 -0800 Subject: [PATCH 229/429] Use default font-size for reply button --- .../comments/electron-browser/commentsEditorContribution.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts b/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts index f6cbca33e7a..e761197389b 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts @@ -708,7 +708,8 @@ registerThemingParticipant((theme, collector) => { ` color: ${monacoEditorForeground}` + `}` + `.monaco-editor .review-widget .body .comment-form .review-thread-reply-button {` + - ` color: ${monacoEditorForeground}` + + ` color: ${monacoEditorForeground};` + + ` font-size: inherit` + `}` ); } From c0dba426a2f4736a818bcaee21e9a34e2efcfb8a Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Thu, 31 Jan 2019 15:23:58 -0800 Subject: [PATCH 230/429] Fix Microsoft/vscode-pull-request-github#895. Comment editor should layout automatically. --- .../parts/comments/electron-browser/simpleCommentEditor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts b/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts index 779d0e58fe7..81a65c067a2 100644 --- a/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts +++ b/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts @@ -63,6 +63,7 @@ export class SimpleCommentEditor extends CodeEditorWidget { verticalHasArrows: false, horizontalHasArrows: false }, + automaticLayout: true, overviewRulerLanes: 2, lineDecorationsWidth: 0, scrollBeyondLastLine: false, From 3d2f7d26a061e4545d43d6185704a24d0750da40 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Thu, 31 Jan 2019 16:01:25 -0800 Subject: [PATCH 231/429] Fix Microsoft/vscode-pull-request-github#893. Avoid margin collapse --- .../parts/comments/electron-browser/commentThreadWidget.ts | 3 ++- .../parts/comments/electron-browser/media/review.css | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts index 2af96523bbe..456f7b9be20 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts @@ -622,8 +622,9 @@ export class ReviewZoneWidget extends ZoneWidget { const lineHeight = this.editor.getConfiguration().lineHeight; const arrowHeight = Math.round(lineHeight / 3); const frameThickness = Math.round(lineHeight / 9) * 2; + console.log(dimensions); - const computedLinesNumber = Math.ceil((headHeight + dimensions.height + arrowHeight + frameThickness) / lineHeight); + const computedLinesNumber = Math.ceil((headHeight + dimensions.height + arrowHeight + frameThickness + 8 /** margin bottom to avoid margin collapse */) / lineHeight); this._relayout(computedLinesNumber); } } diff --git a/src/vs/workbench/parts/comments/electron-browser/media/review.css b/src/vs/workbench/parts/comments/electron-browser/media/review.css index 040faaee75b..1339e933862 100644 --- a/src/vs/workbench/parts/comments/electron-browser/media/review.css +++ b/src/vs/workbench/parts/comments/electron-browser/media/review.css @@ -34,6 +34,10 @@ display: none !important; } +.monaco-editor .review-widget .body { + overflow: hidden; +} + .monaco-editor .review-widget .body .review-comment { padding: 8px 16px 8px 20px; display: flex; @@ -198,8 +202,7 @@ } .monaco-editor .review-widget .body .comment-form { - margin: 0 20px; - padding: 8px 0; + margin: 8px 20px; } .monaco-editor .review-widget .validation-error { From 1bcf2c77ca766f23b9227ce5d18da8b10c53c803 Mon Sep 17 00:00:00 2001 From: Pine Wu Date: Thu, 31 Jan 2019 16:13:14 -0800 Subject: [PATCH 232/429] [CSS] Update Service --- extensions/css-language-features/server/package.json | 2 +- extensions/css-language-features/server/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index aebf551a2e5..6666da57282 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -9,7 +9,7 @@ }, "main": "./out/cssServerMain", "dependencies": { - "vscode-css-languageservice": "^3.0.13-next.10", + "vscode-css-languageservice": "^3.0.13-next.12", "vscode-languageserver": "^5.1.0" }, "devDependencies": { diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index 665dd086b76..3e3e40f4a1d 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -229,10 +229,10 @@ supports-color@5.4.0: dependencies: has-flag "^3.0.0" -vscode-css-languageservice@^3.0.13-next.10: - version "3.0.13-next.10" - resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.13-next.10.tgz#f5822e832b06e1e91ec96c528bab83bb07251c35" - integrity sha512-zKwzo3GVhrAllYDM4afL8q1XCHixsI8tP3SyLrWGzp0Nc9P+bbjKQeC26VcaOb0dtkgfpB/vfBPf+4yOs4s/pw== +vscode-css-languageservice@^3.0.13-next.12: + version "3.0.13-next.12" + resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.13-next.12.tgz#8d20828e41bc7dcf44cdba4b2e476393780a7793" + integrity sha512-5B3NYU2DBFhbUvMuTg7kBlc9COHyr/pbR1cDzXGFwemQG8W6ERsgn+eftPHFbcug1kwBjPVSoMgtw/czKpboHQ== dependencies: vscode-languageserver-types "^3.13.0" vscode-nls "^4.0.0" From e43830645b83067e7c20b1375c538459589f9931 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 31 Jan 2019 16:39:15 -0800 Subject: [PATCH 233/429] Pick up TS 3.3.1 final Fixes #66175 --- extensions/package.json | 2 +- extensions/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/package.json b/extensions/package.json index d746f102903..0f226217b7c 100644 --- a/extensions/package.json +++ b/extensions/package.json @@ -3,7 +3,7 @@ "version": "0.0.1", "description": "Dependencies shared by all extensions", "dependencies": { - "typescript": "3.3.0-rc" + "typescript": "3.3.1" }, "scripts": { "postinstall": "node ./postinstall" diff --git a/extensions/yarn.lock b/extensions/yarn.lock index d9da95bb124..faf73e87903 100644 --- a/extensions/yarn.lock +++ b/extensions/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -typescript@3.3.0-rc: - version "3.3.0-rc" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.0-rc.tgz#700578b55868f99c79870c5611570663b3e21e44" - integrity sha512-C8FMc5pU+gFLm/rXKcwjHIeQnXJXfPNmONhKDSUWeVhyrnSqEI84EzoZylTqN0g6sJwdsn1W1AuG0RQRhfhSEA== +typescript@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b" + integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA== From 509e904316c406a6718aa26c1103c3705b5dcf95 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 31 Jan 2019 16:53:57 -0800 Subject: [PATCH 234/429] Change autofix keybinding to not use windows key Fixes #67411 --- src/vs/editor/contrib/codeAction/codeActionCommands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index 7eb09212d89..7777aded9f6 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -395,7 +395,7 @@ export class AutoFixAction extends EditorAction { contextKeyForSupportedActions(CodeActionKind.QuickFix)), kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, - primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.US_DOT, + primary: KeyMod.Alt | KeyMod.Shift | KeyCode.US_DOT, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.US_DOT }, From 013ce6a2ae9d9f9d8d79dc6e8146d2ce87f63794 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Thu, 31 Jan 2019 17:17:54 -0800 Subject: [PATCH 235/429] don't show toggle editor action when not using grid layout --- src/vs/workbench/browser/actions/layoutActions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 70bafe35ada..4ae06a85506 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -22,6 +22,7 @@ import { isWindows, isLinux } from 'vs/base/common/platform'; import { IsMacContext } from 'vs/platform/workbench/common/contextkeys'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { InEditorZenModeContext } from 'vs/workbench/common/editor'; +import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; const registry = Registry.as(Extensions.WorkbenchActions); const viewCategory = nls.localize('view', "View"); @@ -235,7 +236,7 @@ export class ToggleEditorVisibilityAction extends Action { } -registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleEditorVisibilityAction, ToggleEditorVisibilityAction.ID, ToggleEditorVisibilityAction.LABEL), 'View: Toggle Editor Area Visibility', viewCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleEditorVisibilityAction, ToggleEditorVisibilityAction.ID, ToggleEditorVisibilityAction.LABEL), 'View: Toggle Editor Area Visibility', viewCategory, ContextKeyExpr.equals('config.workbench.useExperimentalGridLayout', true)); export class ToggleSidebarVisibilityAction extends Action { From a6ab525d5b74ea452a66057d8e60d80d24afa2fd Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Thu, 31 Jan 2019 17:27:04 -0800 Subject: [PATCH 236/429] refs #67018 --- src/vs/workbench/browser/parts/panel/panelPart.ts | 2 ++ src/vs/workbench/browser/parts/sidebar/sidebarPart.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/vs/workbench/browser/parts/panel/panelPart.ts b/src/vs/workbench/browser/parts/panel/panelPart.ts index 68bc0f955e6..f7e420b76a7 100644 --- a/src/vs/workbench/browser/parts/panel/panelPart.ts +++ b/src/vs/workbench/browser/parts/panel/panelPart.ts @@ -33,6 +33,7 @@ import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/cont import { isUndefinedOrNull } from 'vs/base/common/types'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { ISerializableView } from 'vs/base/browser/ui/grid/grid'; +import { LayoutPriority } from 'vs/base/browser/ui/grid/gridview'; export const ActivePanelContext = new RawContextKey('activePanel', ''); export const PanelFocusContext = new RawContextKey('panelFocus', false); @@ -66,6 +67,7 @@ export class PanelPart extends CompositePart implements IPanelService, IS minimumHeight: number = 77; maximumHeight: number = Number.POSITIVE_INFINITY; snapSize: number = 50; + priority: LayoutPriority = LayoutPriority.Low; private _onDidChange = new Emitter<{ width: number; height: number; }>(); readonly onDidChange = this._onDidChange.event; diff --git a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts index d95a8d716a4..88b4876943a 100644 --- a/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts +++ b/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts @@ -31,6 +31,7 @@ import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/cont import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { ISerializableView } from 'vs/base/browser/ui/grid/grid'; +import { LayoutPriority } from 'vs/base/browser/ui/grid/gridview'; export const SidebarFocusContext = new RawContextKey('sideBarFocus', false); export const ActiveViewletContext = new RawContextKey('activeViewlet', ''); @@ -52,6 +53,7 @@ export class SidebarPart extends CompositePart implements ISerializable minimumHeight: number = 0; maximumHeight: number = Number.POSITIVE_INFINITY; snapSize: number = 50; + priority: LayoutPriority = LayoutPriority.Low; private _onDidChange = new Emitter<{ width: number; height: number; }>(); readonly onDidChange = this._onDidChange.event; From 371c853fa9c6def40b6fa51071d0ba03c9f62ebb Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Thu, 31 Jan 2019 21:35:17 -0800 Subject: [PATCH 237/429] Fix #67690 - only render setting trees when the settings editor is visible --- .../parts/preferences/electron-browser/settingsEditor2.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index b0d31cad7b7..dec6a197d5a 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -971,11 +971,15 @@ export class SettingsEditor2 extends BaseEditor { } private refreshTree(): void { - this.settingsTree.setChildren(null, createGroupIterator(this.currentSettingsModel.root)); + if (this.isVisible()) { + this.settingsTree.setChildren(null, createGroupIterator(this.currentSettingsModel.root)); + } } private refreshTOCTree(): void { - this.tocTree.setChildren(null, createTOCIterator(this.tocTreeModel, this.tocTree)); + if (this.isVisible()) { + this.tocTree.setChildren(null, createTOCIterator(this.tocTreeModel, this.tocTree)); + } } private updateModifiedLabelForKey(key: string): void { From 60526cb4bebf2c93db30a225a5605cb3715f283e Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 1 Feb 2019 09:29:27 +0100 Subject: [PATCH 238/429] rename closeTabsInMRUOrder to focusRecentEditorAfterClose (for #43459) --- src/vs/workbench/browser/parts/editor/editor.ts | 2 +- src/vs/workbench/browser/workbench.contribution.ts | 4 ++-- src/vs/workbench/common/editor.ts | 2 +- src/vs/workbench/common/editor/editorGroup.ts | 6 +++--- src/vs/workbench/test/common/editor/editorGroups.test.ts | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editor.ts b/src/vs/workbench/browser/parts/editor/editor.ts index 09b13c06a1b..c37f2d0a275 100644 --- a/src/vs/workbench/browser/parts/editor/editor.ts +++ b/src/vs/workbench/browser/parts/editor/editor.ts @@ -30,7 +30,7 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = { highlightModifiedTabs: false, tabCloseButton: 'right', tabSizing: 'fit', - closeTabsInMRUOrder: true, + focusRecentEditorAfterClose: true, showIcons: true, enablePreview: true, openPositioning: 'right', diff --git a/src/vs/workbench/browser/workbench.contribution.ts b/src/vs/workbench/browser/workbench.contribution.ts index 3fcab416418..3798dbde4fd 100644 --- a/src/vs/workbench/browser/workbench.contribution.ts +++ b/src/vs/workbench/browser/workbench.contribution.ts @@ -58,9 +58,9 @@ configurationRegistry.registerConfiguration({ ], 'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'tabSizing' }, "Controls the sizing of editor tabs.") }, - 'workbench.editor.closeTabsInMRUOrder': { + 'workbench.editor.focusRecentEditorAfterClose': { 'type': 'boolean', - 'description': nls.localize('closeTabsInMRUOrder', "Controls whether tabs are closed in most recently used order or from left to right."), + 'description': nls.localize('focusRecentEditorAfterClose', "Controls whether tabs are closed in most recently used order or from left to right."), 'default': true }, 'workbench.editor.showIcons': { diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index ae666377dd3..7b264e5598a 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -941,7 +941,7 @@ export interface IWorkbenchEditorPartConfiguration { highlightModifiedTabs?: boolean; tabCloseButton?: 'left' | 'right' | 'off'; tabSizing?: 'fit' | 'shrink'; - closeTabsInMRUOrder?: boolean; + focusRecentEditorAfterClose?: boolean; showIcons?: boolean; enablePreview?: boolean; enablePreviewFromQuickOpen?: boolean; diff --git a/src/vs/workbench/common/editor/editorGroup.ts b/src/vs/workbench/common/editor/editorGroup.ts index f8d1e48fe61..af7ff8be8bb 100644 --- a/src/vs/workbench/common/editor/editorGroup.ts +++ b/src/vs/workbench/common/editor/editorGroup.ts @@ -98,7 +98,7 @@ export class EditorGroup extends Disposable { private active: EditorInput | null; // editor in active state private editorOpenPositioning: 'left' | 'right' | 'first' | 'last'; - private closeTabsInMRUOrder: boolean; + private focusRecentEditorAfterClose: boolean; constructor( labelOrSerializedGroup: ISerializedEditorGroup, @@ -123,7 +123,7 @@ export class EditorGroup extends Disposable { private onConfigurationUpdated(event?: IConfigurationChangeEvent): void { this.editorOpenPositioning = this.configurationService.getValue('workbench.editor.openPositioning'); - this.closeTabsInMRUOrder = this.configurationService.getValue('workbench.editor.closeTabsInMRUOrder'); + this.focusRecentEditorAfterClose = this.configurationService.getValue('workbench.editor.focusRecentEditorAfterClose'); } get id(): GroupIdentifier { @@ -335,7 +335,7 @@ export class EditorGroup extends Disposable { // More than one editor if (this.mru.length > 1) { let newActive: EditorInput; - if (this.closeTabsInMRUOrder) { + if (this.focusRecentEditorAfterClose) { newActive = this.mru[1]; // active editor is always first in MRU, so pick second editor after as new active } else { if (index === this.editors.length - 1) { diff --git a/src/vs/workbench/test/common/editor/editorGroups.test.ts b/src/vs/workbench/test/common/editor/editorGroups.test.ts index c69335c58be..b29dbd3f74d 100644 --- a/src/vs/workbench/test/common/editor/editorGroups.test.ts +++ b/src/vs/workbench/test/common/editor/editorGroups.test.ts @@ -29,7 +29,7 @@ function inst(): IInstantiationService { inst.stub(ITelemetryService, NullTelemetryService); const config = new TestConfigurationService(); - config.setUserConfiguration('workbench', { editor: { openPositioning: 'right', closeTabsInMRUOrder: true } }); + config.setUserConfiguration('workbench', { editor: { openPositioning: 'right', focusRecentEditorAfterClose: true } }); inst.stub(IConfigurationService, config); return inst; @@ -653,7 +653,7 @@ suite('Workbench editor groups', () => { inst.stub(ITelemetryService, NullTelemetryService); const config = new TestConfigurationService(); - config.setUserConfiguration('workbench', { editor: { closeTabsInMRUOrder: false } }); + config.setUserConfiguration('workbench', { editor: { focusRecentEditorAfterClose: false } }); inst.stub(IConfigurationService, config); const group = inst.createInstance(EditorGroup); From c2f430ea5981877e0c35925e41e2ccbd3f7b7b77 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Fri, 1 Feb 2019 09:33:19 +0100 Subject: [PATCH 239/429] Fix #67687 --- .../extensions/electron-browser/extensionService.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts index b6b74109a3a..801b69f39a2 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionService.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionService.ts @@ -143,8 +143,10 @@ export class ExtensionService extends Disposable implements IExtensionService { this._extensionManagementService.onDidInstallExtension((event) => { if (event.local) { - // an extension has been installed - this._handleDeltaExtensions(new DeltaExtensionsQueueItem([event.local], [])); + if (this._extensionEnablementService.isEnabled(event.local)) { + // an extension has been installed + this._handleDeltaExtensions(new DeltaExtensionsQueueItem([event.local], [])); + } } }); From cf14d2c66a3009c82e79eadf8f4a6fac409e770e Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 1 Feb 2019 11:45:27 +0100 Subject: [PATCH 240/429] fixes #67725 --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 332fa1d0bcf..4467d58769f 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -14,7 +14,7 @@ import { IListStyles } from 'vs/base/browser/ui/list/listWidget'; import { Iterator } from 'vs/base/common/iterator'; import { IDragAndDropData } from 'vs/base/browser/dnd'; import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; -import { isPromiseCanceledError } from 'vs/base/common/errors'; +import { isPromiseCanceledError, onUnexpectedError } from 'vs/base/common/errors'; import { toggleClass } from 'vs/base/browser/dom'; const enum AsyncDataTreeNodeState { @@ -675,14 +675,16 @@ export class AsyncDataTree implements IDisposable const children = await childrenPromise; this.setChildren(node, children, recursive, viewStateContext); } catch (err) { - if (isPromiseCanceledError(err)) { - return; - } + node.needsRefresh = true; if (node !== this.root) { this.tree.collapse(node === this.root ? null : node); } + if (isPromiseCanceledError(err)) { + return; + } + throw err; } finally { if (node.slow) { @@ -713,11 +715,12 @@ export class AsyncDataTree implements IDisposable } private _onDidChangeCollapseState({ node, deep }: ICollapseStateChangeEvent, any>): void { - if (!node.collapsed && node.element.state === AsyncDataTreeNodeState.Uninitialized) { + if (!node.collapsed && (node.element.state === AsyncDataTreeNodeState.Uninitialized || node.element.needsRefresh)) { if (deep) { this.collapse(node.element.element as T); } else { - this.refreshAndRenderNode(node.element, false, ChildrenResolutionReason.Expand); + this.refreshAndRenderNode(node.element, false, ChildrenResolutionReason.Expand) + .catch(onUnexpectedError); } } } From 65cc37aba6794f065debdbc83244532996522811 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 1 Feb 2019 12:27:05 +0100 Subject: [PATCH 241/429] Installing new color theme causes that theme to become the active theme. Fixes #67688 --- .../electron-browser/workbenchThemeService.ts | 34 +++++++++---------- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index a64c0f8be21..cf132772969 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -171,17 +171,16 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration, tokenColorCustomizationConfiguration); if (this.currentColorTheme.isLoaded) { - if (event.added.length > 0 && event.added.length < event.themes.length) { + const themeData = await this.colorThemeStore.findThemeData(this.currentColorTheme.id); + if (!themeData) { + // current theme is no longer available prevColorId = this.currentColorTheme.id; - this.setColorTheme(event.added[0].id, 'auto'); + this.setColorTheme(DEFAULT_THEME_ID, 'auto'); } else { - const themeData = await this.colorThemeStore.findThemeData(this.currentColorTheme.id); - if (!themeData) { - if (prevColorId && await this.colorThemeStore.findThemeData(prevColorId)) { - this.setColorTheme(prevColorId, 'auto'); - } else { - this.setColorTheme(DEFAULT_THEME_ID, 'auto'); - } + if (this.currentColorTheme.id === DEFAULT_THEME_ID && !types.isUndefined(prevColorId) && await this.colorThemeStore.findThemeData(prevColorId)) { + // restore color + this.setColorTheme(prevColorId, 'auto'); + prevColorId = undefined; } } } @@ -194,17 +193,16 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { configurationRegistry.notifyConfigurationSchemaUpdated(themeSettingsConfiguration); if (this.currentIconTheme.isLoaded) { - if (event.added.length > 0 && event.added.length < event.themes.length) { + const theme = await this.iconThemeStore.findThemeData(this.currentIconTheme.id); + if (!theme) { + // current theme is no longer available prevFileIconId = this.currentIconTheme.id; - this.setFileIconTheme(event.added[0].id, 'auto'); + this.setFileIconTheme(DEFAULT_ICON_THEME_SETTING_VALUE, 'auto'); } else { - const theme = await this.iconThemeStore.findThemeData(this.currentIconTheme.id); - if (!theme) { - if (prevFileIconId && await this.iconThemeStore.findThemeData(prevFileIconId)) { - this.setFileIconTheme(prevFileIconId, 'auto'); - } else { - this.setFileIconTheme(DEFAULT_ICON_THEME_SETTING_VALUE, 'auto'); - } + // restore color + if (this.currentIconTheme.id === DEFAULT_ICON_THEME_SETTING_VALUE && !types.isUndefined(prevFileIconId) && await this.iconThemeStore.findThemeData(prevFileIconId)) { + this.setFileIconTheme(prevFileIconId, 'auto'); + prevFileIconId = undefined; } } } From 3c2c17dd90bbb0200f238a4ee3542c280deb2ac5 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 1 Feb 2019 12:28:38 +0100 Subject: [PATCH 242/429] fixes #67708 fixes #67696 --- .../files/electron-browser/views/explorerView.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index a972a289ee2..27befca06c6 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -233,6 +233,20 @@ export class ExplorerView extends ViewletPanel { focus(): void { this.tree.domFocus(); + + const focused = this.tree.getFocus(); + if (focused.length === 1) { + if (this.autoReveal) { + this.tree.reveal(focused[0], 0.5); + } + + const activeFile = this.getActiveFile(); + if (!activeFile && !focused[0].isDirectory) { + // Open the focused element in the editor if there is currently no file opened #67708 + this.editorService.openEditor({ resource: focused[0].resource, options: { preserveFocus: true, revealIfVisible: true } }) + .then(undefined, onUnexpectedError); + } + } } private selectActiveFile(reveal?: boolean): void { From 98e5b5c0a30591571b5a39aa921cc3f27cea27c9 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 1 Feb 2019 12:47:55 +0100 Subject: [PATCH 243/429] fixes #67720 --- src/vs/base/browser/ui/tree/abstractTree.ts | 36 +++++++++++++++---- src/vs/base/browser/ui/tree/indexTreeModel.ts | 2 +- src/vs/base/browser/ui/tree/tree.ts | 1 + 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index c68823146a3..c5640d99420 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -870,12 +870,36 @@ export abstract class AbstractTree implements IDisposable this.model = this.createModel(this.view, _options); onDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState; - this.model.onDidSplice(e => { - this.eventBufferer.bufferEvents(() => { - this.focus.remove(e.deletedNodes); - this.selection.remove(e.deletedNodes); - }); - }, null, this.disposables); + if (this.options.identityProvider) { + const identityProvider = this.options.identityProvider; + + this.model.onDidSplice(e => { + if (e.deletedNodes.length === 0) { + return; + } + + this.eventBufferer.bufferEvents(() => { + const map = new Map>(); + + for (const node of e.deletedNodes) { + map.set(identityProvider.getId(node.element).toString(), node); + } + + for (const node of e.insertedNodes) { + map.delete(identityProvider.getId(node.element).toString()); + } + + if (map.size === 0) { + return; + } + + const deletedNodes = values(map); + + this.focus.remove(deletedNodes); + this.selection.remove(deletedNodes); + }); + }, null, this.disposables); + } this.view.onTap(this.reactOnMouseClick, this, this.disposables); this.view.onMouseClick(this.reactOnMouseClick, this, this.disposables); diff --git a/src/vs/base/browser/ui/tree/indexTreeModel.ts b/src/vs/base/browser/ui/tree/indexTreeModel.ts index b22af463d96..dca017dbfb0 100644 --- a/src/vs/base/browser/ui/tree/indexTreeModel.ts +++ b/src/vs/base/browser/ui/tree/indexTreeModel.ts @@ -173,7 +173,7 @@ export class IndexTreeModel, TFilterData = voi } const result = Iterator.map(Iterator.fromArray(deletedNodes), treeNodeToElement); - this._onDidSplice.fire({ deletedNodes }); + this._onDidSplice.fire({ insertedNodes: nodesToInsert, deletedNodes }); return result; } diff --git a/src/vs/base/browser/ui/tree/tree.ts b/src/vs/base/browser/ui/tree/tree.ts index adde3a3f6f2..1cdd610004a 100644 --- a/src/vs/base/browser/ui/tree/tree.ts +++ b/src/vs/base/browser/ui/tree/tree.ts @@ -98,6 +98,7 @@ export interface ICollapseStateChangeEvent { } export interface ITreeModelSpliceEvent { + insertedNodes: ITreeNode[]; deletedNodes: ITreeNode[]; } From e6c682e841cf7ea813ac70f036e9ad0471640bef Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 1 Feb 2019 13:57:23 +0100 Subject: [PATCH 244/429] refresh the proper item (parent) when item resolved fixes #67733 --- .../parts/files/electron-browser/explorerService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/parts/files/electron-browser/explorerService.ts index e6edda05b16..7bcd9095155 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerService.ts @@ -151,10 +151,11 @@ export class ExplorerService implements IExplorerService { const modelStat = ExplorerItem.create(stat, undefined, options.resolveTo); // Update Input with disk Stat ExplorerItem.mergeLocalWithDisk(modelStat, root); - this._onDidChangeItem.fire(root); + const item = root.find(resource); + this._onDidChangeItem.fire(item ? item.parent : undefined); // Select and Reveal - this._onDidSelectItem.fire({ item: root.find(resource) || undefined, reveal }); + this._onDidSelectItem.fire({ item: item || undefined, reveal }); }, () => { root.isError = true; this._onDidChangeItem.fire(root); From 6b552b4f4dfcb9bf60158d3024f97656a48a24d8 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Fri, 1 Feb 2019 14:12:57 +0100 Subject: [PATCH 245/429] files - let copy/move of same file path be a no-op --- .../files/electron-browser/fileService.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index a08ba498f27..f6419c6094f 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -856,25 +856,28 @@ export class FileService extends Disposable implements IFileService { // 2.) resolve return this.resolve(target).then(result => { - // Events - this._onAfterOperation.fire(new FileOperationEvent(source, keepCopy ? FileOperation.COPY : FileOperation.MOVE, result)); + // Events (unless it was a no-op because paths are identical) + if (sourcePath !== targetPath) { + this._onAfterOperation.fire(new FileOperationEvent(source, keepCopy ? FileOperation.COPY : FileOperation.MOVE, result)); + } return result; }); }); } - private doMoveOrCopyFile(sourcePath: string, targetPath: string, keepCopy: boolean, overwrite: boolean): Promise { + private doMoveOrCopyFile(sourcePath: string, targetPath: string, keepCopy: boolean, overwrite: boolean): Promise { // 1.) validate operation if (isParent(targetPath, sourcePath, !isLinux)) { return Promise.reject(new Error('Unable to move/copy when source path is parent of target path')); + } else if (sourcePath === targetPath) { + return Promise.resolve(); // no-op but not an error } // 2.) check if target exists return pfs.exists(targetPath).then(exists => { const isCaseRename = sourcePath.toLowerCase() === targetPath.toLowerCase(); - const isSameFile = sourcePath === targetPath; // Return early with conflict if target exists and we are not told to overwrite if (exists && !isCaseRename && !overwrite) { @@ -897,14 +900,12 @@ export class FileService extends Disposable implements IFileService { return pfs.mkdirp(paths.dirname(targetPath)).then(() => { // 4.) copy/move - if (isSameFile) { - return null; - } else if (keepCopy) { + if (keepCopy) { return nfcall(extfs.copy, sourcePath, targetPath); } else { return nfcall(extfs.mv, sourcePath, targetPath); } - }).then(() => exists); + }); }); }); } From bece8283521c1099ea7be5013a99418cdb799ef5 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Fri, 1 Feb 2019 14:21:04 +0100 Subject: [PATCH 246/429] Disable a theme does not exclude it from `workbench.colorTheme` completion. Fixes #67465 --- .../themes/electron-browser/workbenchThemeService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index cf132772969..e0d5b16bf91 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -149,16 +149,16 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { // update settings schema setting for theme specific settings this.colorThemeStore.onDidChange(async event => { + // updates enum for the 'workbench.colorTheme` setting + colorThemeSettingSchema.enum = event.themes.map(t => t.settingsId); + colorThemeSettingSchema.enumDescriptions = event.themes.map(t => t.description || ''); + const themeSpecificWorkbenchColors: IJSONSchema = { properties: {} }; const themeSpecificTokenColors: IJSONSchema = { properties: {} }; const workbenchColors = { $ref: workbenchColorsSchemaId, additionalProperties: false }; const tokenColors = { properties: tokenColorSchema.properties, additionalProperties: false }; for (let t of event.themes) { - // add a enum value to the 'workbench.colorTheme` setting - colorThemeSettingSchema.enum!.push(t.settingsId); - colorThemeSettingSchema.enumDescriptions!.push(t.description || ''); - // add theme specific color customization ("[Abyss]":{ ... }) const themeId = `[${t.settingsId}]`; themeSpecificWorkbenchColors.properties![themeId] = workbenchColors; From 1d2b3be2feb1700ba94d46de9c3024015a62de41 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 1 Feb 2019 14:21:48 +0100 Subject: [PATCH 247/429] move openOnSingleClick to tree fixes #65252 --- src/vs/base/browser/ui/tree/abstractTree.ts | 6 ++++ src/vs/base/browser/ui/tree/asyncDataTree.ts | 1 + src/vs/platform/list/browser/listService.ts | 36 +++++++------------- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index c5640d99420..ce8d7dc4e71 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -672,6 +672,7 @@ export interface IAbstractTreeOptionsUpdate extends ITreeRendererOptions { readonly automaticKeyboardNavigation?: boolean; readonly simpleKeyboardNavigation?: boolean; readonly filterOnType?: boolean; + readonly openOnSingleClick?: boolean; } export interface IAbstractTreeOptions extends IAbstractTreeOptionsUpdate, IListOptions { @@ -842,6 +843,7 @@ export abstract class AbstractTree implements IDisposable readonly onWillRefilter: Event = this._onWillRefilter.event; get filterOnType(): boolean { return !!this._options.filterOnType; } + get openOnSingleClick(): boolean { return typeof this._options.openOnSingleClick === 'undefined' ? true : this._options.openOnSingleClick; } get onDidDispose(): Event { return this.view.onDidDispose; } @@ -1156,6 +1158,10 @@ export abstract class AbstractTree implements IDisposable return; } + if (!this.openOnSingleClick && e.browserEvent.detail !== 2) { + return; + } + const location = this.model.getNodeLocation(node); const recursive = e.browserEvent.altKey; diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 4467d58769f..bfe2b0e6161 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -287,6 +287,7 @@ export class AsyncDataTree implements IDisposable get onDidBlur(): Event { return this.tree.onDidBlur; } get filterOnType(): boolean { return this.tree.filterOnType; } + get openOnSingleClick(): boolean { return this.tree.openOnSingleClick; } get onDidDispose(): Event { return this.tree.onDidDispose; } diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index e3ac00702cd..9a6688e2d15 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -909,7 +909,6 @@ export class WorkbenchObjectTree, TFilterData = void> private hasDoubleSelection: IContextKey; private hasMultiSelection: IContextKey; - private _openOnSingleClick: boolean; private _useAltAsMultipleSelectionModifier: boolean; constructor( @@ -929,6 +928,7 @@ export class WorkbenchObjectTree, TFilterData = void> const automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); + const openOnSingleClick = useSingleClickToOpen(configurationService); super(container, delegate, renderers, { keyboardSupport: false, @@ -939,7 +939,8 @@ export class WorkbenchObjectTree, TFilterData = void> automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', - horizontalScrolling + horizontalScrolling, + openOnSingleClick }); this.contextKeyService = createScopedContextKeyService(contextKeyService, this); @@ -951,7 +952,6 @@ export class WorkbenchObjectTree, TFilterData = void> this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); - this._openOnSingleClick = useSingleClickToOpen(configurationService); this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); const interestingContextKeys = new Set(); @@ -977,7 +977,7 @@ export class WorkbenchObjectTree, TFilterData = void> }), configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(openModeSettingKey)) { - this._openOnSingleClick = useSingleClickToOpen(configurationService); + this.updateOptions({ openOnSingleClick: useSingleClickToOpen(configurationService) }); } if (e.affectsConfiguration(multiSelectModifierSettingKey)) { this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); @@ -1005,10 +1005,6 @@ export class WorkbenchObjectTree, TFilterData = void> ); } - get openOnSingleClick(): boolean { - return this._openOnSingleClick; - } - get useAltAsMultipleSelectionModifier(): boolean { return this._useAltAsMultipleSelectionModifier; } @@ -1027,7 +1023,6 @@ export class WorkbenchDataTree extends DataTree; private hasMultiSelection: IContextKey; - private _openOnSingleClick: boolean; private _useAltAsMultipleSelectionModifier: boolean; constructor( @@ -1048,6 +1043,7 @@ export class WorkbenchDataTree extends DataTree(WorkbenchListAutomaticKeyboardNavigationKey); const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); + const openOnSingleClick = useSingleClickToOpen(configurationService); super(container, delegate, renderers, dataSource, { keyboardSupport: false, @@ -1058,7 +1054,8 @@ export class WorkbenchDataTree extends DataTree extends DataTree extends DataTree { if (e.affectsConfiguration(openModeSettingKey)) { - this._openOnSingleClick = useSingleClickToOpen(configurationService); + this.updateOptions({ openOnSingleClick: useSingleClickToOpen(configurationService) }); } if (e.affectsConfiguration(multiSelectModifierSettingKey)) { this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); @@ -1124,10 +1120,6 @@ export class WorkbenchDataTree extends DataTree extends Async private hasDoubleSelection: IContextKey; private hasMultiSelection: IContextKey; - private _openOnSingleClick: boolean; private _useAltAsMultipleSelectionModifier: boolean; constructor( @@ -1162,6 +1153,7 @@ export class WorkbenchAsyncDataTree extends Async const automaticKeyboardNavigation = contextKeyService.getContextKeyValue(WorkbenchListAutomaticKeyboardNavigationKey); const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); + const openOnSingleClick = useSingleClickToOpen(configurationService); super(container, delegate, renderers, dataSource, { keyboardSupport: false, @@ -1172,7 +1164,8 @@ export class WorkbenchAsyncDataTree extends Async automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', - horizontalScrolling + horizontalScrolling, + openOnSingleClick }); this.contextKeyService = createScopedContextKeyService(contextKeyService, this); @@ -1184,7 +1177,6 @@ export class WorkbenchAsyncDataTree extends Async this.hasDoubleSelection = WorkbenchListDoubleSelection.bindTo(this.contextKeyService); this.hasMultiSelection = WorkbenchListMultiSelection.bindTo(this.contextKeyService); - this._openOnSingleClick = useSingleClickToOpen(configurationService); this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); const interestingContextKeys = new Set(); @@ -1210,7 +1202,7 @@ export class WorkbenchAsyncDataTree extends Async }), configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration(openModeSettingKey)) { - this._openOnSingleClick = useSingleClickToOpen(configurationService); + this.updateOptions({ openOnSingleClick: useSingleClickToOpen(configurationService) }); } if (e.affectsConfiguration(multiSelectModifierSettingKey)) { this._useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); @@ -1238,10 +1230,6 @@ export class WorkbenchAsyncDataTree extends Async ); } - get openOnSingleClick(): boolean { - return this._openOnSingleClick; - } - get useAltAsMultipleSelectionModifier(): boolean { return this._useAltAsMultipleSelectionModifier; } From 201d02554cd997c57b1e73821e041dbc700b308b Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 1 Feb 2019 14:38:51 +0100 Subject: [PATCH 248/429] fixes #67716 --- .../parts/files/electron-browser/views/explorerViewer.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index fe5b0957b70..e66f74f034a 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -445,6 +445,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { const isCopy = originalEvent && ((originalEvent.ctrlKey && !isMacintosh) || (originalEvent.altKey && isMacintosh)); const fromDesktop = data instanceof DesktopDragAndDropData; + const effect = (fromDesktop || isCopy) ? ListDragOverEffect.Copy : ListDragOverEffect.Move; // Desktop DND if (fromDesktop) { @@ -474,7 +475,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop { return false; } - return { accept: true, bubble: TreeDragOverBubble.Down, autoExpand: false }; + return { accept: true, bubble: TreeDragOverBubble.Down, effect, autoExpand: false }; } if (!Array.isArray(items)) { @@ -511,13 +512,11 @@ export class FileDragAndDrop implements ITreeDragAndDrop { // All (target = model) if (!target) { - return { accept: true, bubble: TreeDragOverBubble.Down }; + return { accept: true, bubble: TreeDragOverBubble.Down, effect }; } // All (target = file/folder) else { - const effect = fromDesktop || isCopy ? ListDragOverEffect.Copy : ListDragOverEffect.Move; - if (target.isDirectory) { if (target.isReadonly) { return false; From f125fdfa20b217dea34001eac9866322418226ce Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 1 Feb 2019 15:06:15 +0100 Subject: [PATCH 249/429] fixes #67726 --- src/vs/base/browser/ui/tree/abstractTree.ts | 9 ++++++ src/vs/platform/list/browser/listService.ts | 31 +++++++++++++++++++-- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index ce8d7dc4e71..742c6aa0d8e 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -392,6 +392,7 @@ class TypeFilterController implements IDisposable { private labelDomNode: HTMLElement; private filterOnTypeDomNode: HTMLInputElement; private clearDomNode: HTMLElement; + private keyboardNavigationEventFilter?: IKeyboardNavigationEventFilter; private automaticKeyboardNavigation: boolean; private triggered = false; @@ -426,6 +427,8 @@ class TypeFilterController implements IDisposable { this.clearDomNode.tabIndex = -1; this.clearDomNode.title = localize('clear', "Clear"); + this.keyboardNavigationEventFilter = tree.options.keyboardNavigationEventFilter; + model.onDidSplice(this.onDidSpliceModel, this, this.disposables); this.updateOptions(tree.options); } @@ -463,6 +466,7 @@ class TypeFilterController implements IDisposable { const isPrintableCharEvent = this.keyboardNavigationLabelProvider.mightProducePrintableCharacter ? (e: IKeyboardEvent) => this.keyboardNavigationLabelProvider.mightProducePrintableCharacter!(e) : (e: IKeyboardEvent) => mightProducePrintableCharacter(e); const onKeyDown = Event.chain(domEvent(this.view.getHTMLElement(), 'keydown')) .filter(e => !isInputElement(e.target as HTMLElement) || e.target === this.filterOnTypeDomNode) + .filter(this.keyboardNavigationEventFilter || (() => true)) .filter(() => this.automaticKeyboardNavigation || this.triggered) .map(e => new StandardKeyboardEvent(e)) .filter(e => isPrintableCharEvent(e) || ((this._pattern.length > 0 || this.triggered) && ((e.keyCode === KeyCode.Escape || e.keyCode === KeyCode.Backspace) && !e.altKey && !e.ctrlKey && !e.metaKey) || (e.keyCode === KeyCode.Backspace && (isMacintosh ? e.altKey : e.ctrlKey)))) @@ -668,6 +672,10 @@ function asTreeContextMenuEvent(event: IListContextMenuEvent extends IAbstractTr readonly filter?: ITreeFilter; readonly dnd?: ITreeDragAndDrop; readonly autoExpandSingleChildren?: boolean; + readonly keyboardNavigationEventFilter?: IKeyboardNavigationEventFilter; } /** diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 9a6688e2d15..3b7b94de788 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -35,6 +35,7 @@ import { ObjectTree, IObjectTreeOptions } from 'vs/base/browser/ui/tree/objectTr import { ITreeEvent, ITreeRenderer, IAsyncDataSource, IDataSource } from 'vs/base/browser/ui/tree/tree'; import { AsyncDataTree, IAsyncDataTreeOptions } from 'vs/base/browser/ui/tree/asyncDataTree'; import { DataTree, IDataTreeOptions } from 'vs/base/browser/ui/tree/dataTree'; +import { IKeyboardNavigationEventFilter } from 'vs/base/browser/ui/tree/abstractTree'; export type ListWidget = List | PagedList | ITree | ObjectTree | DataTree | AsyncDataTree; @@ -899,6 +900,27 @@ export class HighlightingWorkbenchTree extends WorkbenchTree { } } +function createKeyboardNavigationEventFilter(container: HTMLElement, keybindingService: IKeybindingService): IKeyboardNavigationEventFilter { + let inChord = false; + + return event => { + if (inChord) { + inChord = false; + return false; + } + + const result = keybindingService.softDispatch(event, container); + + if (result && result.enterChord) { + inChord = true; + return false; + } + + inChord = false; + return true; + }; +} + export class WorkbenchObjectTree, TFilterData = void> extends ObjectTree { readonly contextKeyService: IContextKeyService; @@ -940,7 +962,8 @@ export class WorkbenchObjectTree, TFilterData = void> simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', horizontalScrolling, - openOnSingleClick + openOnSingleClick, + keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService) }); this.contextKeyService = createScopedContextKeyService(contextKeyService, this); @@ -1055,7 +1078,8 @@ export class WorkbenchDataTree extends DataTree extends Async simpleKeyboardNavigation: keyboardNavigation === 'simple', filterOnType: keyboardNavigation === 'filter', horizontalScrolling, - openOnSingleClick + openOnSingleClick, + keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService) }); this.contextKeyService = createScopedContextKeyService(contextKeyService, this); From 7a24ac1de4724b8e9d564814f2e654b02eab04b6 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 1 Feb 2019 15:51:13 +0100 Subject: [PATCH 250/429] explorer: do not select and reveal roots which are tree inputs fixes #67749 --- .../parts/files/electron-browser/views/explorerView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 27befca06c6..247910d03e8 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -503,7 +503,7 @@ export class ExplorerView extends ViewletPanel { } private onSelectItem(fileStat: ExplorerItem, reveal = this.autoReveal): Promise { - if (!fileStat || !this.isBodyVisible()) { + if (!fileStat || !this.isBodyVisible() || this.tree.getInput() === fileStat) { return Promise.resolve(undefined); } From 5b966deaf193ab7d443314ac31a93f4557849102 Mon Sep 17 00:00:00 2001 From: isidor Date: Fri, 1 Feb 2019 16:06:25 +0100 Subject: [PATCH 251/429] explorer issues to bpasero --- .github/classifier.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/classifier.yml b/.github/classifier.yml index 3236507a472..a279a7cb8d2 100644 --- a/.github/classifier.yml +++ b/.github/classifier.yml @@ -63,7 +63,7 @@ assignLabel: false }, file-explorer: { - assignees: [ isidorn ], + assignees: [ bpasero ], assignLabel: false }, file-glob: [], From 8020bdcf22a99407f26dfbecf820f7ddb4073784 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Fri, 1 Feb 2019 16:52:33 +0100 Subject: [PATCH 252/429] fixes #67755 --- src/vs/base/browser/ui/list/listWidget.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 37ccdcbf94f..53869580549 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -1066,7 +1066,7 @@ export class List implements ISpliceable, IDisposable { private mouseController: MouseController | undefined; get multipleSelectionController(): IMultipleSelectionController { - return this.mouseController ? this.mouseController.multipleSelectionController : DefaultMultipleSelectionContoller; + return (this.mouseController && this.mouseController.multipleSelectionController) || DefaultMultipleSelectionContoller; } private _onDidUpdateOptions = new Emitter>(); From 7523941bc9decc58504f9dc710961eb020f66fa9 Mon Sep 17 00:00:00 2001 From: Miguel Solorio Date: Fri, 1 Feb 2019 08:43:43 -0800 Subject: [PATCH 253/429] Increase spacing between keybinding keys --- .../browser/ui/keybindingLabel/keybindingLabel.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css index dd24df5df23..e33663d34b1 100644 --- a/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css +++ b/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.css @@ -20,6 +20,15 @@ color: #555; font-size: 11px; padding: 3px 5px; + margin: 0 2px; +} + +.monaco-keybinding > .monaco-keybinding-key:first-child { + margin-left: 0; +} + +.monaco-keybinding > .monaco-keybinding-key:last-child { + margin-right: 0; } .hc-black .monaco-keybinding > .monaco-keybinding-key, @@ -36,5 +45,5 @@ } .monaco-keybinding > .monaco-keybinding-key-chord-separator { - width: 2px; + width: 6px; } \ No newline at end of file From 8f56013e8f66650c1b0b65cc5c502691e307db21 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 1 Feb 2019 10:05:32 -0800 Subject: [PATCH 254/429] Fix #67757 --- .../electron-browser/settingsEditor2.ts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index dec6a197d5a..3d677bad6fd 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -549,24 +549,25 @@ export class SettingsEditor2 extends BaseEditor { this.viewState)); this._register(this.tocTree.onDidChangeFocus(e => { - setTimeout(() => { - const element: SettingsTreeGroupElement = e.elements[0]; - if (this.tocFocusedElement === e.elements[0]) { - return; - } + const element: SettingsTreeGroupElement = e.elements[0]; + if (this.tocFocusedElement === element) { + return; + } - this.tocFocusedElement = element; - this.tocTree.setSelection(e.elements); - if (this.searchResultModel) { - if (this.viewState.filterToCategory !== element) { - this.viewState.filterToCategory = element; + this.tocFocusedElement = element; + this.tocTree.setSelection(element ? [element] : []); + if (this.searchResultModel) { + if (this.viewState.filterToCategory !== element) { + this.viewState.filterToCategory = element; + // see https://github.com/Microsoft/vscode/issues/66796 + setTimeout(() => { this.renderTree(); this.settingsTree.scrollTop = 0; - } - } else if (element && (!e.browserEvent || !(e.browserEvent).fromScroll)) { - this.settingsTree.reveal(element, 0); + }, 0); } - }, 0); + } else if (element && (!e.browserEvent || !(e.browserEvent).fromScroll)) { + this.settingsTree.reveal(element, 0); + } })); this._register(this.tocTree.onDidFocus(() => { From 8eb58eba797971ba4cdd65d19b032212526bcb3e Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Fri, 1 Feb 2019 10:34:57 -0800 Subject: [PATCH 255/429] Bump to 1.32 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 781fc7bde22..75e5b7f1d38 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-oss-dev", - "version": "1.31.0", + "version": "1.32.0", "distro": "cb7599e6323871114d034681abb30ed5e2066d3c", "author": { "name": "Microsoft Corporation" From c3b9299c9d68bb566d946e8f7260177471be8de3 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Fri, 1 Feb 2019 11:53:04 -0800 Subject: [PATCH 256/429] disable save actions for webview fixes #60801 --- .../files/electron-browser/fileActions.contribution.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts index 1002950c754..ca9a038f774 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts @@ -25,6 +25,8 @@ import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listServi import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; +import { WebviewEditor } from 'vs/workbench/parts/webview/electron-browser/webviewEditor'; +import { WalkThroughPart } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart'; // Contribute Global Actions const category = nls.localize('filesCategory', "File"); @@ -559,7 +561,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, { group: '4_save', command: { id: SAVE_FILE_COMMAND_ID, - title: nls.localize({ key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save") + title: nls.localize({ key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save"), + precondition: ContextKeyExpr.and(ContextKeyExpr.notEquals('activeEditor', WebviewEditor.ID), ContextKeyExpr.notEquals('activeEditor', WalkThroughPart.ID)) }, order: 1 }); @@ -568,7 +571,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, { group: '4_save', command: { id: SAVE_FILE_AS_COMMAND_ID, - title: nls.localize({ key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As...") + title: nls.localize({ key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As..."), + precondition: ContextKeyExpr.and(ContextKeyExpr.notEquals('activeEditor', WebviewEditor.ID), ContextKeyExpr.notEquals('activeEditor', WalkThroughPart.ID)) }, order: 2 }); From c79a8bf7eb56804c25e943533640b2a3f76ff0d3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 1 Feb 2019 14:45:26 -0800 Subject: [PATCH 257/429] Remove stray log :) --- extensions/markdown-language-features/src/markdownEngine.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/markdown-language-features/src/markdownEngine.ts b/extensions/markdown-language-features/src/markdownEngine.ts index 90e7284cf2b..25ac8f33b09 100644 --- a/extensions/markdown-language-features/src/markdownEngine.ts +++ b/extensions/markdown-language-features/src/markdownEngine.ts @@ -283,7 +283,6 @@ async function getMarkdownOptions(md: () => MarkdownIt) { return { html: true, highlight: (str: string, lang?: string) => { - console.log(123); // Workaround for highlight not supporting tsx: https://github.com/isagalaev/highlight.js/issues/1155 if (lang && ['tsx', 'typescriptreact'].indexOf(lang.toLocaleLowerCase()) >= 0) { lang = 'jsx'; From ea541de9c470f1f31d5d8b8034587d8b72c4daf9 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 1 Feb 2019 14:46:33 -0800 Subject: [PATCH 258/429] Remove old css vars from webviews These were undocumented and we now had offical css vars that extensions should use instead --- .../parts/webview/electron-browser/webviewElement.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts index 5d9110300fb..d65d118c5bb 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts @@ -475,16 +475,6 @@ export class WebviewElement extends Disposable { const styles = { - // Old vars - 'font-family': fontFamily, - 'font-weight': fontWeight, - 'font-size': fontSize, - 'background-color': theme.getColor(colorRegistry.editorBackground).toString(), - 'color': theme.getColor(colorRegistry.editorForeground).toString(), - 'link-color': theme.getColor(colorRegistry.textLinkForeground).toString(), - 'link-active-color': theme.getColor(colorRegistry.textLinkActiveForeground).toString(), - - // Offical API 'vscode-editor-font-family': fontFamily, 'vscode-editor-font-weight': fontWeight, 'vscode-editor-font-size': fontSize, @@ -495,6 +485,7 @@ export class WebviewElement extends Disposable { this._send('styles', styles, activeTheme); this._webviewFindWidget.updateTheme(theme); + } public layout(): void { From 543282c05b14f9b558ba55b80c393149140ca96a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 1 Feb 2019 15:07:34 -0800 Subject: [PATCH 259/429] Make using the previewHtml command a user facing error #62630 --- src/vs/workbench/api/node/extHost.api.impl.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 02fd3f33913..59ecf348f91 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -177,11 +177,11 @@ export function createApiFactory( // Warn when trying to use the vscode.previewHtml command as it does not work properly in all scenarios and // has security concerns. const checkCommand = (() => { - let done = !extension.isUnderDevelopment; + let done = false; const informOnce = () => { if (!done) { done = true; - console.warn(`Extension '${extension.identifier.value}' uses the 'vscode.previewHtml' command which is deprecated and will be removed. Please update your extension to use the Webview API: https://go.microsoft.com/fwlink/?linkid=2039309`); + window.showWarningMessage(localize('previewHtml.deprecated', "Extension '{0}' uses the 'vscode.previewHtml' command which is deprecated and will be removed soon. Please file an issue against this extension to update to use VS Code's webview API.", extension.identifier.value)); } }; return (commandId: string) => { From 1d90e2f39b83664a208e244ddaf9d8125eea2c15 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 1 Feb 2019 15:12:27 -0800 Subject: [PATCH 260/429] Strict null auto add --- src/tsconfig.strictNullChecks.json | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 530d76501d5..19d2a4737a0 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -18,7 +18,7 @@ "./vs/editor/contrib/smartSelect/**/*.ts", "./vs/editor/contrib/snippet/**/*.ts", "./vs/editor/contrib/suggest/**/*.ts", - "./vs/editor/test/**/*.ts", + "./vs/editor/test/**/*.ts" ], "files": [ "./vs/base/parts/contextmenu/common/contextmenu.ts", @@ -171,9 +171,9 @@ "./vs/editor/contrib/comment/test/lineCommentCommand.test.ts", "./vs/editor/contrib/contextmenu/contextmenu.ts", "./vs/editor/contrib/cursorUndo/cursorUndo.ts", - "./vs/editor/contrib/documentSymbols/outlineModel.ts", "./vs/editor/contrib/dnd/dnd.ts", "./vs/editor/contrib/dnd/dragAndDropCommand.ts", + "./vs/editor/contrib/documentSymbols/outlineModel.ts", "./vs/editor/contrib/find/findController.ts", "./vs/editor/contrib/find/findDecorations.ts", "./vs/editor/contrib/find/findModel.ts", @@ -361,6 +361,7 @@ "./vs/platform/editor/common/editor.ts", "./vs/platform/environment/common/environment.ts", "./vs/platform/environment/node/argv.ts", + "./vs/platform/environment/node/argvHelper.ts", "./vs/platform/environment/node/environmentService.ts", "./vs/platform/environment/test/node/environmentService.test.ts", "./vs/platform/extensionManagement/common/extensionEnablementService.ts", @@ -378,6 +379,7 @@ "./vs/platform/extensions/common/extensionHost.ts", "./vs/platform/extensions/common/extensions.ts", "./vs/platform/extensions/node/extensionValidator.ts", + "./vs/platform/extensions/node/extensionsUtil.ts", "./vs/platform/extensions/test/node/extensionValidator.test.ts", "./vs/platform/files/common/files.ts", "./vs/platform/files/node/files.ts", @@ -508,6 +510,8 @@ "./vs/platform/workspaces/node/workspacesIpc.ts", "./vs/vscode.d.ts", "./vs/vscode.proposed.d.ts", + "./vs/workbench/api/common/configurationExtensionPoint.ts", + "./vs/workbench/api/common/menusExtensionPoint.ts", "./vs/workbench/api/node/extHostExtensionActivator.ts", "./vs/workbench/api/node/extHostSearch.fileIndex.ts", "./vs/workbench/api/node/extHostTypes.ts", @@ -554,6 +558,7 @@ "./vs/workbench/browser/parts/views/views.ts", "./vs/workbench/browser/parts/views/viewsViewlet.ts", "./vs/workbench/browser/viewlet.ts", + "./vs/workbench/browser/workbench.contribution.ts", "./vs/workbench/common/actions.ts", "./vs/workbench/common/activity.ts", "./vs/workbench/common/component.ts", @@ -572,9 +577,12 @@ "./vs/workbench/common/theme.ts", "./vs/workbench/common/viewlet.ts", "./vs/workbench/common/views.ts", - "./vs/workbench/electron-browser/actions/helpActions", "./vs/workbench/electron-browser/actions/developerActions", + "./vs/workbench/electron-browser/actions/developerActions.ts", + "./vs/workbench/electron-browser/actions/helpActions", + "./vs/workbench/electron-browser/actions/helpActions.ts", "./vs/workbench/electron-browser/actions/windowActions", + "./vs/workbench/electron-browser/actions/windowActions.ts", "./vs/workbench/electron-browser/resources.ts", "./vs/workbench/electron-browser/window.ts", "./vs/workbench/parts/backup/common/backupRestorer.ts", @@ -747,8 +755,6 @@ "./vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts", "./vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts", "./vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts", - "./vs/workbench/api/common/menusExtensionPoint.ts", - "./vs/workbench/api/common/configurationExtensionPoint.ts", "./vs/workbench/services/activity/common/activity.ts", "./vs/workbench/services/backup/common/backup.ts", "./vs/workbench/services/backup/node/backupFileService.ts", @@ -869,8 +875,8 @@ "./vs/workbench/services/themes/electron-browser/colorThemeStore.ts", "./vs/workbench/services/themes/electron-browser/fileIconThemeData.ts", "./vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts", - "./vs/workbench/services/themes/electron-browser/workbenchThemeService.ts", "./vs/workbench/services/themes/electron-browser/themeCompatibility.ts", + "./vs/workbench/services/themes/electron-browser/workbenchThemeService.ts", "./vs/workbench/services/timer/electron-browser/timerService.ts", "./vs/workbench/services/title/common/titleService.ts", "./vs/workbench/services/viewlet/browser/viewlet.ts", From 9f6f45bb0917385798e42754c10f825c802aa3c2 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 1 Feb 2019 15:31:19 -0800 Subject: [PATCH 261/429] Build VS Code using TS 3.3 Fixes #67776 --- build/package.json | 4 ++-- build/yarn.lock | 8 ++++---- package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/package.json b/build/package.json index 64c0f9277b0..4ad039a7e21 100644 --- a/build/package.json +++ b/build/package.json @@ -38,7 +38,7 @@ "minimist": "^1.2.0", "request": "^2.85.0", "tslint": "^5.9.1", - "typescript": "3.2.2", + "typescript": "3.3.1", "vsce": "1.48.0", "xml2js": "^0.4.17" }, @@ -48,4 +48,4 @@ "postinstall": "npm run compile", "npmCheckJs": "tsc --noEmit" } -} +} \ No newline at end of file diff --git a/build/yarn.lock b/build/yarn.lock index 4d2a53c8ee7..c9384fe6d54 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -1894,10 +1894,10 @@ typed-rest-client@^0.9.0: tunnel "0.0.4" underscore "1.8.3" -typescript@3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" - integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg== +typescript@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b" + integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA== uc.micro@^1.0.1, uc.micro@^1.0.5: version "1.0.5" diff --git a/package.json b/package.json index 75e5b7f1d38..0d10f5eb1f5 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "source-map": "^0.4.4", "ts-loader": "^4.4.2", "tslint": "^5.11.0", - "typescript": "3.2.2", + "typescript": "3.3.1", "typescript-formatter": "7.1.0", "typescript-tslint-plugin": "^0.0.7", "uglify-es": "^3.0.18", diff --git a/yarn.lock b/yarn.lock index 42352c9383a..bf5199ef494 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8828,10 +8828,10 @@ typescript-tslint-plugin@^0.0.7: minimatch "^3.0.4" vscode-languageserver "^5.1.0" -typescript@3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.2.2.tgz#fe8101c46aa123f8353523ebdcf5730c2ae493e5" - integrity sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg== +typescript@3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b" + integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA== typescript@^2.6.2: version "2.6.2" From b4165f6d32a4ec473a489b97e059b262d1da9dfb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Fri, 1 Feb 2019 15:46:03 -0800 Subject: [PATCH 262/429] Fix potential race while creating a webview and changing a theme Fixes #67628 --- .../webview/electron-browser/webview-pre.js | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js index 29593dc6b66..ebf0555f42f 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js +++ b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js @@ -36,7 +36,7 @@ * @param {() => void} handlers.onFocus * @param {() => void} handlers.onBlur */ - const trackFocus = ({onFocus, onBlur}) => { + const trackFocus = ({ onFocus, onBlur }) => { const interval = 50; let isFocused = document.hasFocus(); setInterval(() => { @@ -67,12 +67,19 @@ /** * @param {HTMLElement} body */ - const styleBody = (body) => { + const applyStyles = (body) => { if (!body) { return; } + body.classList.remove('vscode-light', 'vscode-dark', 'vscode-high-contrast'); body.classList.add(initData.activeTheme); + + if (initData.styles) { + for (const variable of Object.keys(initData.styles)) { + body.style.setProperty(`--${variable}`, initData.styles[variable]); + } + } }; const getActiveFrame = () => { @@ -169,11 +176,7 @@ return; } - styleBody(target.contentDocument.body); - - Object.keys(variables).forEach((variable) => { - target.contentDocument.documentElement.style.setProperty(`--${variable}`, variables[variable]); - }); + applyStyles(target.contentDocument.body); }); // propagate focus @@ -253,7 +256,7 @@ defaultStyles.innerHTML = getDefaultCss(initData.styles); newDocument.head.prepend(defaultStyles); - styleBody(newDocument.body); + applyStyles(newDocument.body); const frame = getActiveFrame(); const wasFirstLoad = firstLoad; @@ -321,6 +324,8 @@ if (oldActiveFrame) { document.body.removeChild(oldActiveFrame); } + // Styles may have changed since we created the element. Make sure we re-style + applyStyles(newFrame.contentDocument.body); newFrame.setAttribute('id', 'active-frame'); newFrame.style.visibility = 'visible'; newFrame.contentWindow.focus(); From 7ed75d992c5999730ce97d03caa482f0b7da596d Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 1 Feb 2019 19:57:12 -0800 Subject: [PATCH 263/429] vscode-xterm@3.12.0-beta1 Fixes #67438 --- package.json | 4 ++-- yarn.lock | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 0d10f5eb1f5..561f2d5c494 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "vscode-ripgrep": "^1.2.5", "vscode-sqlite3": "4.0.7", "vscode-textmate": "^4.0.1", - "vscode-xterm": "3.11.0-beta2", + "vscode-xterm": "3.12.0-beta1", "winreg": "^1.2.4", "yauzl": "^2.9.1", "yazl": "^2.4.3" @@ -150,4 +150,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.3" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index bf5199ef494..bfb1e38ac88 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9433,10 +9433,10 @@ vscode-uri@^1.0.6: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d" integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww== -vscode-xterm@3.11.0-beta2: - version "3.11.0-beta2" - resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.11.0-beta2.tgz#fe5295c835fcff00fee55cbb1d5a4bf537d105a2" - integrity sha512-QG9ALgfH4+YUblN1G/AAdf40MJPOeb0p2u2k9MwcIvaJGQmk5Pp2KZUiQbO+ycfeuisTTVtqjceG7MutIEVZSQ== +vscode-xterm@3.12.0-beta1: + version "3.12.0-beta1" + resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.12.0-beta1.tgz#7dc28214077d1d8fc306fb6f392b4b553c6b0024" + integrity sha512-bv6AbbtzMfNdku97BomTY7PJNo1Bd0sHnNy9GZmMeVm8SoLxxvhmR2PRsbYY0AD1n7wbA7l55msJKye57+mD/w== vso-node-api@6.1.2-preview: version "6.1.2-preview" From 2b0fc3b0fcf78cd3d0bed3619c2b6f58fcf0411c Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Sat, 2 Feb 2019 09:01:49 -0800 Subject: [PATCH 264/429] Fix infinite relayout of comment widget. --- .../parts/comments/electron-browser/commentThreadWidget.ts | 1 - .../parts/comments/electron-browser/simpleCommentEditor.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts index 456f7b9be20..c5eea6a8d01 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts @@ -622,7 +622,6 @@ export class ReviewZoneWidget extends ZoneWidget { const lineHeight = this.editor.getConfiguration().lineHeight; const arrowHeight = Math.round(lineHeight / 3); const frameThickness = Math.round(lineHeight / 9) * 2; - console.log(dimensions); const computedLinesNumber = Math.ceil((headHeight + dimensions.height + arrowHeight + frameThickness + 8 /** margin bottom to avoid margin collapse */) / lineHeight); this._relayout(computedLinesNumber); diff --git a/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts b/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts index 81a65c067a2..779d0e58fe7 100644 --- a/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts +++ b/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts @@ -63,7 +63,6 @@ export class SimpleCommentEditor extends CodeEditorWidget { verticalHasArrows: false, horizontalHasArrows: false }, - automaticLayout: true, overviewRulerLanes: 2, lineDecorationsWidth: 0, scrollBeyondLastLine: false, From d6b0453f41a5ccf1cef25bc901eda07368874696 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 2 Feb 2019 10:38:51 -0800 Subject: [PATCH 265/429] Fix conflict --- .../parts/terminal/electron-browser/terminalActions.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index 7ed5a34cc68..506ff36c559 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -30,13 +30,10 @@ import { Command } from 'vs/editor/browser/editorExtensions'; import { timeout } from 'vs/base/common/async'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; -<<<<<<< HEAD import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { Schemas } from 'vs/base/common/network'; -======= import { URI } from 'vs/base/common/uri'; ->>>>>>> origin/master export const TERMINAL_PICKER_PREFIX = 'term '; From ac416127cafe37c1a4f348c7c832541e5a912971 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sat, 2 Feb 2019 10:44:53 -0800 Subject: [PATCH 266/429] Remove empty lines --- .../parts/terminal/electron-browser/terminalActions.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts index 506ff36c559..4252f8fa3df 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts @@ -288,12 +288,10 @@ export class SendSequenceTerminalCommand extends Command { } const configurationResolverService = accessor.get(IConfigurationResolverService); - const workspaceContextService = accessor.get(IWorkspaceContextService); const historyService = accessor.get(IHistoryService); const activeWorkspaceRootUri = historyService.getLastActiveWorkspaceRoot(Schemas.file); const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; - const resolvedText = configurationResolverService.resolve(lastActiveWorkspaceRoot, args.text); terminalInstance.sendText(resolvedText, false); } From 904004b95f0bdf8db08a407d4f546e4cc26e57df Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Sun, 3 Feb 2019 16:21:53 +0100 Subject: [PATCH 267/429] fixes #67449 --- src/vs/base/browser/ui/tree/abstractTree.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 742c6aa0d8e..134044cfde3 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -386,6 +386,9 @@ class TypeFilterController implements IDisposable { private _pattern = ''; get pattern(): string { return this._pattern; } + private _filterOnType: boolean; + get filterOnType(): boolean { return this._filterOnType; } + private positionClassName = 'ne'; private domNode: HTMLElement; private messageDomNode: HTMLElement; @@ -416,9 +419,10 @@ class TypeFilterController implements IDisposable { this.labelDomNode = append(this.domNode, $('span.label')); const controls = append(this.domNode, $('.controls')); + this._filterOnType = !!tree.options.filterOnType; this.filterOnTypeDomNode = append(controls, $('input.filter')); this.filterOnTypeDomNode.type = 'checkbox'; - this.filterOnTypeDomNode.checked = !!tree.options.filterOnType; + this.filterOnTypeDomNode.checked = this._filterOnType; this.filterOnTypeDomNode.tabIndex = -1; this.updateFilterOnTypeTitle(); domEvent(this.filterOnTypeDomNode, 'input')(this.onDidChangeFilterOnType, this, this.disposables); @@ -440,7 +444,11 @@ class TypeFilterController implements IDisposable { this.enable(); } - this.filterOnTypeDomNode.checked = !!options.filterOnType; + if (typeof options.filterOnType !== 'undefined') { + this._filterOnType = !!options.filterOnType; + this.filterOnTypeDomNode.checked = this._filterOnType; + } + this.automaticKeyboardNavigation = typeof options.automaticKeyboardNavigation === 'undefined' ? true : options.automaticKeyboardNavigation; this.tree.refilter(); this.render(); @@ -619,7 +627,7 @@ class TypeFilterController implements IDisposable { } private updateFilterOnTypeTitle(): void { - if (this.filterOnTypeDomNode.checked) { + if (this.filterOnType) { this.filterOnTypeDomNode.title = localize('disable filter on type', "Disable Filter on Type"); } else { this.filterOnTypeDomNode.title = localize('enable filter on type', "Enable Filter on Type"); @@ -928,7 +936,7 @@ export abstract class AbstractTree implements IDisposable if (_options.keyboardNavigationLabelProvider) { this.typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, _options.keyboardNavigationLabelProvider); this.focusNavigationFilter = node => { - if (!this.typeFilterController!.enabled || !this.typeFilterController!.pattern) { + if (!this.typeFilterController!.enabled || !this.typeFilterController!.pattern || this.typeFilterController!.filterOnType) { return true; } From 842b2ede43066445a0721d410cad004499731cd5 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Sun, 3 Feb 2019 16:38:10 +0100 Subject: [PATCH 268/429] fixes #67733 --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 4 ++++ .../parts/files/electron-browser/views/explorerView.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index bfe2b0e6161..31e5b0af409 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -412,6 +412,10 @@ export class AsyncDataTree implements IDisposable await this.refreshAndRenderNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh, viewStateContext); } + hasNode(element: T): boolean { + return this.renderedNodes.has(element); + } + // View refresh(element: T): void { diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index 247910d03e8..f42a9d00cce 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -430,6 +430,12 @@ export class ExplorerView extends ViewletPanel { this.shouldRefresh = true; return Promise.resolve(undefined); } + + // Tree node doesn't exist yet + if (item && !this.tree.hasNode(item)) { + return Promise.resolve(undefined); + } + const recursive = !item; const toRefresh = item || this.tree.getInput(); From 427927db8c1eb68bed288c7bcfd852b11e7f4af2 Mon Sep 17 00:00:00 2001 From: al Date: Sun, 3 Feb 2019 23:05:35 +0300 Subject: [PATCH 269/429] Fix wrong hover on empty when column --- src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts index 72e4cd23c34..8d358e31f2c 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts @@ -926,6 +926,7 @@ class WhenColumn extends Column { whenLabel.element.title = keybindingItemEntry.keybindingItem.when; } else { this.whenColumn.textContent = '—'; + this.whenColumn.title = ''; } } From d562c85b42646bbf08e661f3ab68970ce87a40a1 Mon Sep 17 00:00:00 2001 From: Hao Hu Date: Sun, 3 Feb 2019 23:22:33 -0800 Subject: [PATCH 270/429] Add git diff terminal link handler Fixes #67238 --- .../electron-browser/terminalLinkHandler.ts | 69 ++++++++++++------- .../terminalLinkHandler.test.ts | 32 +++++++++ 2 files changed, 77 insertions(+), 24 deletions(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts index 31a1d6fc8ed..993b6e548fa 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts @@ -63,6 +63,9 @@ export class TerminalLinkHandler { private _widgetManager: TerminalWidgetManager; private _processCwd: string; private _localLinkPattern: RegExp; + private _gitDiffPreImagePattern: RegExp; + private _gitDiffPostImagePattern: RegExp; + private readonly _tooltipCallback: (event: MouseEvent, uri: string) => boolean | void; constructor( private _xterm: any, @@ -75,8 +78,23 @@ export class TerminalLinkHandler { const baseLocalLinkClause = _platform === platform.Platform.Windows ? winLocalLinkClause : unixLocalLinkClause; // Append line and column number regex this._localLinkPattern = new RegExp(`${baseLocalLinkClause}(${lineAndColumnClause})`); + // Matches '--- a/src/file1', capturing 'src/file1' in group 1 + this._gitDiffPreImagePattern = /^--- a\/(\S*)/; + // Matches '+++ b/src/file1', capturing 'src/file1' in group 1 + this._gitDiffPostImagePattern = /^\+\+\+ b\/(\S*)/; + + this._tooltipCallback = (e: MouseEvent) => { + if (this._terminalService && this._terminalService.configHelper.config.rendererType === 'dom') { + const target = (e.target as HTMLElement); + this._widgetManager.showMessage(target.offsetLeft, target.offsetTop, this._getLinkHoverString()); + } else { + this._widgetManager.showMessage(e.offsetX, e.offsetY, this._getLinkHoverString()); + } + }; + this.registerWebLinkHandler(); this.registerLocalLinkHandler(); + this.registerGitDiffLinkHandlers(); } public setWidgetManager(widgetManager: TerminalWidgetManager): void { @@ -90,14 +108,7 @@ export class TerminalLinkHandler { public registerCustomLinkHandler(regex: RegExp, handler: (uri: string) => void, matchIndex?: number, validationCallback?: XtermLinkMatcherValidationCallback): number { const options: ILinkMatcherOptions = { matchIndex, - tooltipCallback: (e: MouseEvent) => { - if (this._terminalService && this._terminalService.configHelper.config.rendererType === 'dom') { - const target = (e.target as HTMLElement); - this._widgetManager.showMessage(target.offsetLeft, target.offsetTop, this._getLinkHoverString()); - } else { - this._widgetManager.showMessage(e.offsetX, e.offsetY, this._getLinkHoverString()); - } - }, + tooltipCallback: this._tooltipCallback, leaveCallback: () => this._widgetManager.closeMessage(), willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e), priority: CUSTOM_LINK_PRIORITY @@ -114,14 +125,7 @@ export class TerminalLinkHandler { }); this._xterm.webLinksInit(wrappedHandler, { validationCallback: (uri: string, callback: (isValid: boolean) => void) => this._validateWebLink(uri, callback), - tooltipCallback: (e: MouseEvent) => { - if (this._terminalService && this._terminalService.configHelper.config.rendererType === 'dom') { - const target = (e.target as HTMLElement); - this._widgetManager.showMessage(target.offsetLeft, target.offsetTop, this._getLinkHoverString()); - } else { - this._widgetManager.showMessage(e.offsetX, e.offsetY, this._getLinkHoverString()); - } - }, + tooltipCallback: this._tooltipCallback, leaveCallback: () => this._widgetManager.closeMessage(), willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e) }); @@ -133,20 +137,29 @@ export class TerminalLinkHandler { }); this._xterm.registerLinkMatcher(this._localLinkRegex, wrappedHandler, { validationCallback: (uri: string, callback: (isValid: boolean) => void) => this._validateLocalLink(uri, callback), - tooltipCallback: (e: MouseEvent) => { - if (this._terminalService && this._terminalService.configHelper.config.rendererType === 'dom') { - const target = (e.target as HTMLElement); - this._widgetManager.showMessage(target.offsetLeft, target.offsetTop, this._getLinkHoverString()); - } else { - this._widgetManager.showMessage(e.offsetX, e.offsetY, this._getLinkHoverString()); - } - }, + tooltipCallback: this._tooltipCallback, leaveCallback: () => this._widgetManager.closeMessage(), willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e), priority: LOCAL_LINK_PRIORITY }); } + public registerGitDiffLinkHandlers(): void { + const wrappedHandler = this._wrapLinkHandler(url => { + this._handleLocalLink(url); + }); + const options = { + matchIndex: 1, + validationCallback: (uri: string, callback: (isValid: boolean) => void) => this._validateLocalLink(uri, callback), + tooltipCallback: this._tooltipCallback, + leaveCallback: () => this._widgetManager.closeMessage(), + willLinkActivate: (e: MouseEvent) => this._isLinkActivationModifierDown(e), + priority: LOCAL_LINK_PRIORITY + }; + this._xterm.registerLinkMatcher(this._gitDiffPreImagePattern, wrappedHandler, options); + this._xterm.registerLinkMatcher(this._gitDiffPostImagePattern, wrappedHandler, options); + } + public dispose(): void { this._xterm = null; this._hoverDisposables = dispose(this._hoverDisposables); @@ -172,6 +185,14 @@ export class TerminalLinkHandler { return this._localLinkPattern; } + protected get _gitDiffPreImageRegex(): RegExp { + return this._gitDiffPreImagePattern; + } + + protected get _gitDiffPostImageRegex(): RegExp { + return this._gitDiffPostImagePattern; + } + private _handleLocalLink(link: string): PromiseLike { return this._resolvePath(link).then(resolvedLink => { if (!resolvedLink) { diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts index 1cc1487e224..a15fe4cf18d 100644 --- a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -14,6 +14,12 @@ class TestTerminalLinkHandler extends TerminalLinkHandler { public get localLinkRegex(): RegExp { return this._localLinkRegex; } + public get gitDiffLinkPreImageRegex(): RegExp { + return this._gitDiffPreImageRegex; + } + public get gitDiffLinkPostImageRegex(): RegExp { + return this._gitDiffPostImageRegex; + } public preprocessPath(link: string): string | null { return this._preprocessPath(link); } @@ -217,4 +223,30 @@ suite('Workbench - TerminalLinkHandler', () => { assert.equal(linkHandler.preprocessPath('/absolute/path/file3'), '/absolute/path/file3'); }); }); + + test('gitDiffLinkRegex', () => { + // The platform is irrelevant because the links generated by Git are the same format regardless of platform + const linkHandler = new TestTerminalLinkHandler(new TestXterm(), Platform.Linux, null!, null!, null!, null!); + + function assertAreGoodMatches(matches: RegExpMatchArray | null) { + if (matches) { + assert.equal(matches.length, 2); + assert.equal(matches[1], 'src/file1'); + } else { + assert.fail(); + } + } + + // Happy cases + assertAreGoodMatches('--- a/src/file1'.match(linkHandler.gitDiffLinkPreImageRegex)); + assertAreGoodMatches('--- a/src/file1 '.match(linkHandler.gitDiffLinkPreImageRegex)); + assertAreGoodMatches('+++ b/src/file1'.match(linkHandler.gitDiffLinkPostImageRegex)); + assertAreGoodMatches('+++ b/src/file1 '.match(linkHandler.gitDiffLinkPostImageRegex)); + + // Make sure /dev/null isn't a match + assert.equal(linkHandler.gitDiffLinkPreImageRegex.test('--- /dev/null'), false); + assert.equal(linkHandler.gitDiffLinkPreImageRegex.test('--- /dev/null '), false); + assert.equal(linkHandler.gitDiffLinkPostImageRegex.test('+++ /dev/null'), false); + assert.equal(linkHandler.gitDiffLinkPostImageRegex.test('+++ /dev/null '), false); + }); }); From 7492c99a8b8ce5beca47e346531a41b88f9483a3 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 1 Feb 2019 14:34:50 +0100 Subject: [PATCH 271/429] add `strings.removeAccents` #66720 --- src/vs/base/common/strings.ts | 15 +++++++ src/vs/base/test/common/strings.test.ts | 55 +++++++++++++++++++++++++ 2 files changed, 70 insertions(+) diff --git a/src/vs/base/common/strings.ts b/src/vs/base/common/strings.ts index 39da4f5446f..72a0c0785b5 100644 --- a/src/vs/base/common/strings.ts +++ b/src/vs/base/common/strings.ts @@ -627,6 +627,21 @@ export function removeAnsiEscapeCodes(str: string): string { return str; } +export const removeAccents: (str: string) => string = (function () { + if (typeof (String.prototype as any).normalize !== 'function') { + // ☹️ no ES6 features... + return function (str: string) { return str; }; + } else { + // transform into NFD form and remove accents + // see: https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript/37511463#37511463 + const regex = /[\u0300-\u036f]/g; + return function (str: string) { + return (str as any).normalize('NFD').replace(regex, empty); + }; + } +})(); + + // -- UTF-8 BOM export const UTF8_BOM_CHARACTER = String.fromCharCode(CharCode.UTF8_BOM); diff --git a/src/vs/base/test/common/strings.test.ts b/src/vs/base/test/common/strings.test.ts index 758bfb246d1..015075a90a9 100644 --- a/src/vs/base/test/common/strings.test.ts +++ b/src/vs/base/test/common/strings.test.ts @@ -403,4 +403,59 @@ suite('Strings', () => { assert.equal(strings.getNLines('foo\nbar\nsomething', 2), 'foo\nbar'); assert.equal(strings.getNLines('foo', 0), ''); }); + + test('removeAccents', function () { + assert.equal(strings.removeAccents('joào'), 'joao'); + assert.equal(strings.removeAccents('joáo'), 'joao'); + assert.equal(strings.removeAccents('joâo'), 'joao'); + assert.equal(strings.removeAccents('joäo'), 'joao'); + // assert.equal(strings.removeAccents('joæo'), 'joao'); // not an accent + assert.equal(strings.removeAccents('joão'), 'joao'); + assert.equal(strings.removeAccents('joåo'), 'joao'); + assert.equal(strings.removeAccents('joåo'), 'joao'); + assert.equal(strings.removeAccents('joāo'), 'joao'); + + assert.equal(strings.removeAccents('fôo'), 'foo'); + assert.equal(strings.removeAccents('föo'), 'foo'); + assert.equal(strings.removeAccents('fòo'), 'foo'); + assert.equal(strings.removeAccents('fóo'), 'foo'); + // assert.equal(strings.removeAccents('fœo'), 'foo'); + // assert.equal(strings.removeAccents('føo'), 'foo'); + assert.equal(strings.removeAccents('fōo'), 'foo'); + assert.equal(strings.removeAccents('fõo'), 'foo'); + + assert.equal(strings.removeAccents('andrè'), 'andre'); + assert.equal(strings.removeAccents('andré'), 'andre'); + assert.equal(strings.removeAccents('andrê'), 'andre'); + assert.equal(strings.removeAccents('andrë'), 'andre'); + assert.equal(strings.removeAccents('andrē'), 'andre'); + assert.equal(strings.removeAccents('andrė'), 'andre'); + assert.equal(strings.removeAccents('andrę'), 'andre'); + + assert.equal(strings.removeAccents('hvîc'), 'hvic'); + assert.equal(strings.removeAccents('hvïc'), 'hvic'); + assert.equal(strings.removeAccents('hvíc'), 'hvic'); + assert.equal(strings.removeAccents('hvīc'), 'hvic'); + assert.equal(strings.removeAccents('hvįc'), 'hvic'); + assert.equal(strings.removeAccents('hvìc'), 'hvic'); + + assert.equal(strings.removeAccents('ûdo'), 'udo'); + assert.equal(strings.removeAccents('üdo'), 'udo'); + assert.equal(strings.removeAccents('ùdo'), 'udo'); + assert.equal(strings.removeAccents('údo'), 'udo'); + assert.equal(strings.removeAccents('ūdo'), 'udo'); + + assert.equal(strings.removeAccents('heÿ'), 'hey'); + + // assert.equal(strings.removeAccents('gruß'), 'grus'); + assert.equal(strings.removeAccents('gruś'), 'grus'); + assert.equal(strings.removeAccents('gruš'), 'grus'); + + assert.equal(strings.removeAccents('çool'), 'cool'); + assert.equal(strings.removeAccents('ćool'), 'cool'); + assert.equal(strings.removeAccents('čool'), 'cool'); + + assert.equal(strings.removeAccents('ñice'), 'nice'); + assert.equal(strings.removeAccents('ńice'), 'nice'); + }); }); From 3646ede2d17413848b3d7368c7d1b1c87e011fc5 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 1 Feb 2019 16:48:19 +0100 Subject: [PATCH 272/429] add lib.es2018.promise.d.to to yet another place, #65040 --- build/gulpfile.editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index e59be13ea3e..3fc992bd9c4 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -84,6 +84,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () { 'typings/thenable.d.ts', 'typings/es6-promise.d.ts', 'typings/require-monaco.d.ts', + "typings/lib.es2018.promise.d.ts", 'vs/monaco.d.ts' ], libs: [ From 67ffab8dcd1a6752d8b62bcd13d7020101eef568 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Fri, 1 Feb 2019 18:26:53 +0100 Subject: [PATCH 273/429] use SIGUSR1 to enable inspector on extension host --- .../electron-browser/extensionHost.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts index b54507fb37e..b5bce66b0f2 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts @@ -224,9 +224,14 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter { // Print out extension host output onDebouncedOutput(output => { - const inspectorUrlMatch = !this._environmentService.isBuilt && output.data && output.data.match(/ws:\/\/([^\s]+)/); + const inspectorUrlMatch = output.data && output.data.match(/ws:\/\/([^\s]+:(\d+)\/[^\s]+)/); if (inspectorUrlMatch) { - console.log(`%c[Extension Host] %cdebugger inspector at chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=${inspectorUrlMatch[1]}`, 'color: blue', 'color: black'); + if (!this._environmentService.isBuilt) { + console.log(`%c[Extension Host] %cdebugger inspector at chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=${inspectorUrlMatch[1]}`, 'color: blue', 'color: black'); + } + if (!this._inspectPort) { + this._inspectPort = Number(inspectorUrlMatch[2]); + } } else { console.group('Extension Host'); console.log(output.data, ...output.format); @@ -498,6 +503,15 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter { } } + public enableInspector(): Promise { + if (this._inspectPort) { + return Promise.resolve(); + } + // send SIGUSR1 and wait a little + this._extensionHostProcess.kill('SIGUSR1'); + return timeout(1000); + } + public getInspectPort(): number { return this._inspectPort; } From 29357370fbcb5c432ed2b321abf3355120d8f0b9 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 09:49:04 +0100 Subject: [PATCH 274/429] debt - avoid dependencies from files to other parts (part 1) --- src/vs/workbench/parts/files/common/files.ts | 5 ----- .../electron-browser/fileActions.contribution.ts | 11 ----------- .../parts/preferences/browser/preferencesEditor.ts | 3 +-- .../electron-browser/preferences.contribution.ts | 13 ++++++++++++- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index 8915bd13b1d..9b8cbdf5d29 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -91,11 +91,6 @@ export const OpenEditorsVisibleCondition = ContextKeyExpr.has(openEditorsVisible export const FilesExplorerFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(explorerViewletVisibleId), ContextKeyExpr.has(filesExplorerFocusId), ContextKeyExpr.not(InputFocusedContextKey)); export const ExplorerFocusCondition = ContextKeyExpr.and(ContextKeyExpr.has(explorerViewletVisibleId), ContextKeyExpr.has(explorerViewletFocusId), ContextKeyExpr.not(InputFocusedContextKey)); -/** - * Preferences editor id. - */ -export const PREFERENCES_EDITOR_ID = 'workbench.editor.preferencesEditor'; - /** * Text file editor id. */ diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts index ca9a038f774..99ad4630a14 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts @@ -18,7 +18,6 @@ import { isWindows, isMacintosh } from 'vs/base/common/platform'; import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerFolderContext, ExplorerResourceNotReadonlyContext, ExplorerResourceCut, IExplorerService } from 'vs/workbench/parts/files/common/files'; import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL } from 'vs/workbench/browser/actions/workspaceCommands'; import { CLOSE_SAVED_EDITORS_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; -import { OPEN_FOLDER_SETTINGS_COMMAND, OPEN_FOLDER_SETTINGS_LABEL } from 'vs/workbench/parts/preferences/browser/preferencesActions'; import { AutoSaveContext } from 'vs/workbench/services/textfile/common/textfiles'; import { ResourceContextKey } from 'vs/workbench/common/resources'; import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listService'; @@ -484,16 +483,6 @@ MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { when: ContextKeyExpr.and(ExplorerRootContext) }); -MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { - group: '2_workspace', - order: 20, - command: { - id: OPEN_FOLDER_SETTINGS_COMMAND, - title: OPEN_FOLDER_SETTINGS_LABEL - }, - when: ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext) -}); - MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { group: '2_workspace', order: 30, diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts index b104b1b3b94..8e8da3a6699 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts @@ -44,7 +44,6 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; import { EditorInput, EditorOptions, IEditorControl } from 'vs/workbench/common/editor'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; -import { PREFERENCES_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; import { DefaultSettingsRenderer, FolderSettingsRenderer, IPreferencesRenderer, UserSettingsRenderer, WorkspaceSettingsRenderer } from 'vs/workbench/parts/preferences/browser/preferencesRenderers'; import { SearchWidget, SettingsTarget, SettingsTargetsWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, IPreferencesSearchService, ISearchProvider, CONTEXT_SETTINGS_JSON_EDITOR } from 'vs/workbench/parts/preferences/common/preferences'; @@ -58,7 +57,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; export class PreferencesEditor extends BaseEditor { - static readonly ID: string = PREFERENCES_EDITOR_ID; + static readonly ID: string = 'workbench.editor.preferencesEditor'; private defaultSettingsEditorContextKey: IContextKey; private defaultSettingsJSONEditorContextKey: IContextKey; diff --git a/src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts b/src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts index 8b06f6018e1..3e43d22c5e7 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts @@ -27,7 +27,7 @@ import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchCo import { EditorInput, Extensions as EditorInputExtensions, IEditorInputFactory, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; import { ResourceContextKey } from 'vs/workbench/common/resources'; import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybindingsEditor'; -import { ConfigureLanguageBasedSettingsAction, OpenDefaultKeybindingsFileAction, OpenFolderSettingsAction, OpenGlobalKeybindingsAction, OpenGlobalKeybindingsFileAction, OpenGlobalSettingsAction, OpenRawDefaultSettingsAction, OpenSettings2Action, OpenSettingsJsonAction, OpenWorkspaceSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND } from 'vs/workbench/parts/preferences/browser/preferencesActions'; +import { ConfigureLanguageBasedSettingsAction, OpenDefaultKeybindingsFileAction, OpenFolderSettingsAction, OpenGlobalKeybindingsAction, OpenGlobalKeybindingsFileAction, OpenGlobalSettingsAction, OpenRawDefaultSettingsAction, OpenSettings2Action, OpenSettingsJsonAction, OpenWorkspaceSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND, OPEN_FOLDER_SETTINGS_LABEL } from 'vs/workbench/parts/preferences/browser/preferencesActions'; import { PreferencesEditor } from 'vs/workbench/parts/preferences/browser/preferencesEditor'; import { CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, CONTEXT_KEYBINDING_FOCUS, CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_JSON_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IKeybindingsEditor, IPreferencesSearchService, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS, KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_SEARCH, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING, SETTINGS_EDITOR_COMMAND_FILTER_MODIFIED, SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, SETTINGS_EDITOR_COMMAND_FOCUS_FILE, SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST, SETTINGS_EDITOR_COMMAND_SEARCH, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU, SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON, SETTINGS_COMMAND_OPEN_SETTINGS } from 'vs/workbench/parts/preferences/common/preferences'; import { PreferencesContribution } from 'vs/workbench/parts/preferences/common/preferencesContribution'; @@ -36,6 +36,7 @@ import { SettingsEditor2 } from 'vs/workbench/parts/preferences/electron-browser import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { DefaultPreferencesEditorInput, KeybindingsEditorInput, PreferencesEditorInput, SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; +import { ExplorerRootContext, ExplorerFolderContext } from 'vs/workbench/parts/files/common/files'; registerSingleton(IPreferencesSearchService, PreferencesSearchService, true); @@ -773,3 +774,13 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { CONTEXT_SETTINGS_JSON_EDITOR.toNegated() ) }); + +MenuRegistry.appendMenuItem(MenuId.ExplorerContext, { + group: '2_workspace', + order: 20, + command: { + id: OPEN_FOLDER_SETTINGS_COMMAND, + title: OPEN_FOLDER_SETTINGS_LABEL + }, + when: ContextKeyExpr.and(ExplorerRootContext, ExplorerFolderContext) +}); \ No newline at end of file From dcea90230b46a2ef7cd27305ed9e68563ce6edec Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 4 Feb 2019 09:50:05 +0100 Subject: [PATCH 275/429] add comment --- .../services/extensions/electron-browser/extensionHost.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts index b5bce66b0f2..1749a27e1a6 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts @@ -507,7 +507,8 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter { if (this._inspectPort) { return Promise.resolve(); } - // send SIGUSR1 and wait a little + // send SIGUSR1 and wait a little the actual port is read from the process stdout which we + // scan here: https://github.com/Microsoft/vscode/blob/67ffab8dcd1a6752d8b62bcd13d7020101eef568/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts#L225-L240 this._extensionHostProcess.kill('SIGUSR1'); return timeout(1000); } From ed856d85f5916b690490ef8f2c81e4d7bb34da75 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 09:50:26 +0100 Subject: [PATCH 276/429] Revert "disable save actions for webview" This reverts commit c3b9299c9d68bb566d946e8f7260177471be8de3. --- .../files/electron-browser/fileActions.contribution.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts index 99ad4630a14..3a75d49e119 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts @@ -24,8 +24,6 @@ import { WorkbenchListDoubleSelection } from 'vs/platform/list/browser/listServi import { URI } from 'vs/base/common/uri'; import { Schemas } from 'vs/base/common/network'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; -import { WebviewEditor } from 'vs/workbench/parts/webview/electron-browser/webviewEditor'; -import { WalkThroughPart } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart'; // Contribute Global Actions const category = nls.localize('filesCategory', "File"); @@ -550,8 +548,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, { group: '4_save', command: { id: SAVE_FILE_COMMAND_ID, - title: nls.localize({ key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save"), - precondition: ContextKeyExpr.and(ContextKeyExpr.notEquals('activeEditor', WebviewEditor.ID), ContextKeyExpr.notEquals('activeEditor', WalkThroughPart.ID)) + title: nls.localize({ key: 'miSave', comment: ['&& denotes a mnemonic'] }, "&&Save") }, order: 1 }); @@ -560,8 +557,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, { group: '4_save', command: { id: SAVE_FILE_AS_COMMAND_ID, - title: nls.localize({ key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As..."), - precondition: ContextKeyExpr.and(ContextKeyExpr.notEquals('activeEditor', WebviewEditor.ID), ContextKeyExpr.notEquals('activeEditor', WalkThroughPart.ID)) + title: nls.localize({ key: 'miSaveAs', comment: ['&& denotes a mnemonic'] }, "Save &&As...") }, order: 2 }); From a455381dd18af6eb7e35284fa8324728e520accb Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 09:55:28 +0100 Subject: [PATCH 277/429] debt - disallow cross-part dependencies for files part --- .../test/browser/fileEditorInput.test.ts | 1 + tslint.json | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts index 54c12010023..2e5676deab9 100644 --- a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts @@ -2,6 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ + import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { join } from 'vs/base/common/paths'; diff --git a/tslint.json b/tslint.json index 67a640687c9..3d7876e972d 100644 --- a/tslint.json +++ b/tslint.json @@ -457,6 +457,54 @@ "*" // node modules ] }, + { + "target": "**/vs/workbench/parts/files/common/**", + "restrictions": [ + "vs/nls", + "**/vs/base/common/**", + "**/vs/base/parts/*/common/**", + "**/vs/platform/*/common/**", + "**/vs/editor/common/**", + "**/vs/editor/contrib/*/common/**", + "**/vs/workbench/common/**", + "**/vs/workbench/services/*/common/**", + "**/vs/workbench/parts/files/common/**", + "assert" + ] + }, + { + "target": "**/vs/workbench/parts/files/browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser}/**", + "**/vs/base/parts/*/{common,browser}/**", + "**/vs/platform/*/{common,browser}/**", + "**/vs/editor/{common,browser}/**", + "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention + "**/vs/workbench/{common,browser}/**", + "**/vs/workbench/services/*/{common,browser}/**", + "**/vs/workbench/parts/files/{common,browser}/**", + "assert" + ] + }, + { + "target": "**/vs/workbench/parts/files/electron-browser/**", + "restrictions": [ + "vs/nls", + "vs/css!./**/*", + "**/vs/base/{common,browser,node,electron-browser}/**", + "**/vs/base/parts/*/{common,browser,node,electron-browser}/**", + "**/vs/platform/node/**", + "**/vs/platform/*/{common,browser,node,electron-browser}/**", + "**/vs/editor/{common,browser,node,electron-browser}/**", + "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention + "**/vs/workbench/{common,browser,node,electron-browser,api}/**", + "**/vs/workbench/services/*/{common,browser,node,electron-browser}/**", + "**/vs/workbench/parts/files/{common,browser,node,electron-browser}/**", + "*" // node modules + ] + }, { "target": "**/vs/code/node/**", "restrictions": [ From 2b3f9fdcd1600562029cb9c436880cfa171f979d Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 10:14:06 +0100 Subject: [PATCH 278/429] debt - guard replaceEditors() from replacing the same editor --- .../browser/parts/editor/editorGroupView.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index 3a5fdebc6a3..edfd5b9aeb5 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -1308,11 +1308,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Open inactive editor this.doOpenEditor(replacement, options); - // Close replaced inactive edior - this.doCloseInactiveEditor(editor); - - // Forward to title control - this.titleAreaControl.closeEditor(editor); + // Close replaced inactive editor unless they match + if (!editor.matches(replacement)) { + this.doCloseInactiveEditor(editor); + this.titleAreaControl.closeEditor(editor); + } }); // Handle active last @@ -1321,11 +1321,11 @@ export class EditorGroupView extends Themable implements IEditorGroupView { // Open replacement as active editor const openEditorResult = this.doOpenEditor(activeReplacement.replacement, activeReplacement.options); - // Close previous active editor - this.doCloseInactiveEditor(activeReplacement.editor); - - // Forward to title control - this.titleAreaControl.closeEditor(activeReplacement.editor); + // Close replaced active editor unless they match + if (!activeReplacement.editor.matches(activeReplacement.replacement)) { + this.doCloseInactiveEditor(activeReplacement.editor); + this.titleAreaControl.closeEditor(activeReplacement.editor); + } return openEditorResult.then(() => undefined); } From 1ad028dfa956522dbd4ddabf5551092ca40fac19 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 10:15:08 +0100 Subject: [PATCH 279/429] part of #67695 --- src/vs/workbench/browser/actions/layoutActions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index 4ae06a85506..b6e13835191 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -337,7 +337,11 @@ class ToggleTabsVisibilityAction extends Action { } } -registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleTabsVisibilityAction, ToggleTabsVisibilityAction.ID, ToggleTabsVisibilityAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_W }), 'View: Toggle Tab Visibility', viewCategory); +registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleTabsVisibilityAction, ToggleTabsVisibilityAction.ID, ToggleTabsVisibilityAction.LABEL, { + primary: undefined, + mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_W, }, + linux: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_W, } +}), 'View: Toggle Tab Visibility', viewCategory); // --- Toggle Zen Mode From 125c07d1481156ce5584c4a6b0d0dc8627dfe4fc Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 10:32:09 +0100 Subject: [PATCH 280/429] debt - cleanup storage leftovers (#67837) --- src/vs/base/node/storage.ts | 21 --- .../storage/node/storageMainService.ts | 34 +---- .../platform/storage/node/storageService.ts | 53 +------- src/vs/workbench/electron-browser/shell.ts | 125 +----------------- .../electron-browser/perfviewEditor.ts | 2 - .../timer/electron-browser/timerService.ts | 20 --- 6 files changed, 10 insertions(+), 245 deletions(-) diff --git a/src/vs/base/node/storage.ts b/src/vs/base/node/storage.ts index 5cb7369ef99..fa14cb70e4e 100644 --- a/src/vs/base/node/storage.ts +++ b/src/vs/base/node/storage.ts @@ -10,7 +10,6 @@ import { ThrottledDelayer, timeout } from 'vs/base/common/async'; import { isUndefinedOrNull } from 'vs/base/common/types'; import { mapToString, setToString } from 'vs/base/common/map'; import { basename } from 'path'; -import { mark } from 'vs/base/common/performance'; import { copy, renameIgnoreError, unlink } from 'vs/base/node/pfs'; import { fill } from 'vs/base/common/arrays'; @@ -326,8 +325,6 @@ export class SQLiteStorageDatabase implements IStorageDatabase { get onDidChangeItemsExternal(): Event { return Event.None; } // since we are the only client, there can be no external changes - private static measuredRequireDuration: boolean; // TODO@Ben remove me after a while - private static BUSY_OPEN_TIMEOUT = 2000; // timeout in ms to retry when opening DB fails with SQLITE_BUSY private static MAX_HOST_PARAMETERS = 256; // maximum number of parameters within a statement @@ -598,21 +595,8 @@ export class SQLiteStorageDatabase implements IStorageDatabase { } private doConnect(path: string): Promise { - - // TODO@Ben clean up performance markers return new Promise((resolve, reject) => { - let measureRequireDuration = false; - if (!SQLiteStorageDatabase.measuredRequireDuration) { - SQLiteStorageDatabase.measuredRequireDuration = true; - measureRequireDuration = true; - - mark('willRequireSQLite'); - } import('vscode-sqlite3').then(sqlite3 => { - if (measureRequireDuration) { - mark('didRequireSQLite'); - } - const connection: IDatabaseConnection = { db: new (this.logger.isTracing ? sqlite3.verbose().Database : sqlite3.Database)(path, error => { if (error) { @@ -622,17 +606,12 @@ export class SQLiteStorageDatabase implements IStorageDatabase { // The following exec() statement serves two purposes: // - create the DB if it does not exist yet // - validate that the DB is not corrupt (the open() call does not throw otherwise) - mark('willSetupSQLiteSchema'); return this.exec(connection, [ 'PRAGMA user_version = 1;', 'CREATE TABLE IF NOT EXISTS ItemTable (key TEXT UNIQUE ON CONFLICT REPLACE, value BLOB)' ].join('')).then(() => { - mark('didSetupSQLiteSchema'); - return resolve(connection); }, error => { - mark('didSetupSQLiteSchema'); - return connection.db.close(() => reject(error)); }); }), diff --git a/src/vs/platform/storage/node/storageMainService.ts b/src/vs/platform/storage/node/storageMainService.ts index 71f7299951f..72ae2f3222b 100644 --- a/src/vs/platform/storage/node/storageMainService.ts +++ b/src/vs/platform/storage/node/storageMainService.ts @@ -10,8 +10,7 @@ import { ILogService, LogLevel } from 'vs/platform/log/common/log'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IStorage, Storage, SQLiteStorageDatabase, ISQLiteStorageDatabaseLoggingOptions, InMemoryStorageDatabase } from 'vs/base/node/storage'; import { join } from 'path'; -import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { mark, getDuration } from 'vs/base/common/performance'; +import { mark } from 'vs/base/common/performance'; import { exists, readdir } from 'vs/base/node/pfs'; import { Database } from 'vscode-sqlite3'; import { endsWith, startsWith } from 'vs/base/common/strings'; @@ -91,8 +90,7 @@ export class StorageMainService extends Disposable implements IStorageMainServic constructor( @ILogService private readonly logService: ILogService, - @IEnvironmentService private readonly environmentService: IEnvironmentService, - @ITelemetryService private readonly telemetryService: ITelemetryService + @IEnvironmentService private readonly environmentService: IEnvironmentService ) { super(); @@ -109,27 +107,9 @@ export class StorageMainService extends Disposable implements IStorageMainServic } private createLogginOptions(): ISQLiteStorageDatabaseLoggingOptions { - const loggedStorageErrors = new Set(); - return { logTrace: (this.logService.getLevel() === LogLevel.Trace) ? msg => this.logService.trace(msg) : undefined, - logError: error => { - this.logService.error(error); - - const errorStr = `${error}`; - if (!loggedStorageErrors.has(errorStr)) { - loggedStorageErrors.add(errorStr); - - /* __GDPR__ - "sqliteMainStorageError" : { - "storageError": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('sqliteMainStorageError', { - 'storageError': errorStr - }); - } - } + logError: error => this.logService.error(error) } as ISQLiteStorageDatabaseLoggingOptions; } @@ -375,18 +355,12 @@ export class StorageMainService extends Disposable implements IStorageMainServic } close(): Promise { - this.logService.trace('StorageMainService#close() - begin'); // Signal as event so that clients can still store data this._onWillSaveState.fire(); // Do it - mark('main:willCloseGlobalStorage'); - return this.storage.close().then(() => { - mark('main:didCloseGlobalStorage'); - - this.logService.trace(`StorageMainService#close() - finished in ${getDuration('main:willCloseGlobalStorage', 'main:didCloseGlobalStorage')}ms`); - }); + return this.storage.close(); } checkIntegrity(full: boolean): Promise { diff --git a/src/vs/platform/storage/node/storageService.ts b/src/vs/platform/storage/node/storageService.ts index feacaec0b54..536a6fcb0a3 100644 --- a/src/vs/platform/storage/node/storageService.ts +++ b/src/vs/platform/storage/node/storageService.ts @@ -30,27 +30,6 @@ export class StorageService extends Disposable implements IStorageService { private _onWillSaveState: Emitter = this._register(new Emitter()); get onWillSaveState(): Event { return this._onWillSaveState.event; } - private _hasErrors = false; - get hasErrors(): boolean { return this._hasErrors; } - - private bufferedWorkspaceStorageErrors?: Array = []; - private _onWorkspaceStorageError: Emitter = this._register(new Emitter()); - get onWorkspaceStorageError(): Event { - if (Array.isArray(this.bufferedWorkspaceStorageErrors)) { - // todo@ben cleanup after a while - if (this.bufferedWorkspaceStorageErrors.length > 0) { - const bufferedStorageErrors = this.bufferedWorkspaceStorageErrors; - setTimeout(() => { - this._onWorkspaceStorageError.fire(`[startup errors] ${bufferedStorageErrors.join('\n')}`); - }, 0); - } - - this.bufferedWorkspaceStorageErrors = undefined; - } - - return this._onWorkspaceStorageError.event; - } - private globalStorage: IStorage; private workspaceStoragePath: string; @@ -81,15 +60,7 @@ export class StorageService extends Disposable implements IStorageService { } private initializeGlobalStorage(): Promise { - mark('willInitGlobalStorage'); - - return this.globalStorage.init().then(() => { - mark('didInitGlobalStorage'); - }, error => { - mark('didInitGlobalStorage'); - - return Promise.reject(error); - }); + return this.globalStorage.init(); } private initializeWorkspaceStorage(payload: IWorkspaceInitializationPayload): Promise { @@ -120,17 +91,7 @@ export class StorageService extends Disposable implements IStorageService { // Logger for workspace storage const workspaceLoggingOptions: ISQLiteStorageDatabaseLoggingOptions = { logTrace: (this.logService.getLevel() === LogLevel.Trace) ? msg => this.logService.trace(msg) : undefined, - logError: error => { - this.logService.error(error); - - this._hasErrors = true; - - if (Array.isArray(this.bufferedWorkspaceStorageErrors)) { - this.bufferedWorkspaceStorageErrors.push(error); - } else { - this._onWorkspaceStorageError.fire(error); - } - } + logError: error => this.logService.error(error) }; // Dispose old (if any) @@ -219,14 +180,10 @@ export class StorageService extends Disposable implements IStorageService { this._onWillSaveState.fire({ reason: WillSaveStateReason.SHUTDOWN }); // Do it - mark('willCloseGlobalStorage'); - mark('willCloseWorkspaceStorage'); return Promise.all([ - this.globalStorage.close().then(() => mark('didCloseGlobalStorage')), - this.workspaceStorage.close().then(() => mark('didCloseWorkspaceStorage')) - ]).then(() => { - this.logService.trace(`[storage] closing took ${getDuration('willCloseGlobalStorage', 'didCloseGlobalStorage')}ms global / ${getDuration('willCloseWorkspaceStorage', 'didCloseWorkspaceStorage')}ms workspace`); - }); + this.globalStorage.close(), + this.workspaceStorage.close() + ]).then(() => undefined); } private getStorage(scope: StorageScope): IStorage { diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index fd959395067..ddd6d5862c7 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -74,7 +74,7 @@ import { IBroadcastService, BroadcastService } from 'vs/platform/broadcast/elect import { HashService } from 'vs/workbench/services/hash/node/hashService'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; import { ILogService } from 'vs/platform/log/common/log'; -import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { IStorageService } from 'vs/platform/storage/common/storage'; import { StorageService } from 'vs/platform/storage/node/storageService'; import { Event, Emitter } from 'vs/base/common/event'; import { WORKBENCH_BACKGROUND } from 'vs/workbench/common/theme'; @@ -215,11 +215,6 @@ export class Shell extends Disposable { // Startup Telemetry this.logStartupTelemetry(startupInfos); - - // Storage Telemetry (TODO@Ben remove me later, including storage errors) - if (!this.environmentService.extensionTestsPath) { - this.logStorageTelemetry(); - } }, error => handleStartupError(this.logService, error)); return workbench; @@ -273,124 +268,6 @@ export class Shell extends Disposable { perf.mark('didStartWorkbench'); } - private logStorageTelemetry(): void { - const initialStartup = !!this.configuration.isInitialStartup; - - const appReadyDuration = initialStartup ? perf.getDuration('main:started', 'main:appReady') : 0; - const workbenchReadyDuration = perf.getDuration(initialStartup ? 'main:started' : 'main:loadWindow', 'didStartWorkbench'); - const workspaceStorageRequireDuration = perf.getDuration('willRequireSQLite', 'didRequireSQLite'); - const workspaceStorageSchemaDuration = perf.getDuration('willSetupSQLiteSchema', 'didSetupSQLiteSchema'); - const globalStorageInitDurationMain = perf.getDuration('main:willInitGlobalStorage', 'main:didInitGlobalStorage'); - const globalStorageInitDuratioRenderer = perf.getDuration('willInitGlobalStorage', 'didInitGlobalStorage'); - const workspaceStorageInitDuration = perf.getDuration('willInitWorkspaceStorage', 'didInitWorkspaceStorage'); - const workbenchLoadDuration = perf.getDuration('willLoadWorkbenchMain', 'didLoadWorkbenchMain'); - - // Handle errors (avoid duplicates to reduce spam) - const loggedStorageErrors = new Set(); - this._register(this.storageService.onWorkspaceStorageError(error => { - const errorStr = `${error}`; - - if (!loggedStorageErrors.has(errorStr)) { - loggedStorageErrors.add(errorStr); - - /* __GDPR__ - "sqliteStorageError5" : { - "appReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceSchemaTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeMain" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeRenderer" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceKeys" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "storageError": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - - /* __GDPR__ - "sqliteStorageError" : { - "appReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceSchemaTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeMain" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeRenderer" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceKeys" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "storageError": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } - } - */ - this.telemetryService.publicLog('sqliteStorageError5', { - 'appReadyTime': appReadyDuration, - 'workbenchReadyTime': workbenchReadyDuration, - 'workspaceRequireTime': workspaceStorageRequireDuration, - 'workspaceSchemaTime': workspaceStorageSchemaDuration, - 'globalReadTimeMain': globalStorageInitDurationMain, - 'globalReadTimeRenderer': globalStorageInitDuratioRenderer, - 'workspaceReadTime': workspaceStorageInitDuration, - 'workbenchRequireTime': workbenchLoadDuration, - 'workspaceKeys': this.storageService.getSize(StorageScope.WORKSPACE), - 'startupKind': this.lifecycleService.startupKind, - 'storageError': errorStr - }); - } - })); - - - if (this.storageService.hasErrors) { - return; // do not log performance numbers when errors occured - } - - if (this.environmentService.verbose) { - return; // do not log when running in verbose mode - } - - /* __GDPR__ - "sqliteStorageTimers5" : { - "appReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceSchemaTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeMain" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeRenderer" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceKeys" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - - /* __GDPR__ - "sqliteStorageTimers" : { - "appReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchReadyTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceSchemaTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeMain" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "globalReadTimeRenderer" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workbenchRequireTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "workspaceKeys" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, - "startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } - } - */ - this.telemetryService.publicLog('sqliteStorageTimers5', { - 'appReadyTime': appReadyDuration, - 'workbenchReadyTime': workbenchReadyDuration, - 'workspaceRequireTime': workspaceStorageRequireDuration, - 'workspaceSchemaTime': workspaceStorageSchemaDuration, - 'globalReadTimeMain': globalStorageInitDurationMain, - 'globalReadTimeRenderer': globalStorageInitDuratioRenderer, - 'workspaceReadTime': workspaceStorageInitDuration, - 'workbenchRequireTime': workbenchLoadDuration, - 'workspaceKeys': this.storageService.getSize(StorageScope.WORKSPACE), - 'startupKind': this.lifecycleService.startupKind - }); - } private initServiceCollection(container: HTMLElement): [IInstantiationService, ServiceCollection] { const serviceCollection = new ServiceCollection(); diff --git a/src/vs/workbench/parts/performance/electron-browser/perfviewEditor.ts b/src/vs/workbench/parts/performance/electron-browser/perfviewEditor.ts index 052ad299f86..016531777e8 100644 --- a/src/vs/workbench/parts/performance/electron-browser/perfviewEditor.ts +++ b/src/vs/workbench/parts/performance/electron-browser/perfviewEditor.ts @@ -146,8 +146,6 @@ class PerfModelContentProvider implements ITextModelContentProvider { table.push(['require & init global storage', metrics.timers.ellapsedGlobalStorageInitMain, '[main]', `initial startup: ${metrics.initialStartup}`]); table.push(['window.loadUrl() => begin to require(workbench.main.js)', metrics.timers.ellapsedWindowLoadToRequire, '[main->renderer]', StartupKindToString(metrics.windowKind)]); table.push(['require(workbench.main.js)', metrics.timers.ellapsedRequire, '[renderer]', `cached data: ${(metrics.didUseCachedData ? 'YES' : 'NO')}${stats ? `, node_modules took ${stats.nodeRequireTotal}ms` : ''}`]); - table.push(['init global storage', metrics.timers.ellapsedGlobalStorageInitRenderer, '[renderer]', undefined]); - table.push(['require workspace storage', metrics.timers.ellapsedWorkspaceStorageRequire, '[renderer]', undefined]); table.push(['require & init workspace storage', metrics.timers.ellapsedWorkspaceStorageInit, '[renderer]', undefined]); table.push(['init workspace service', metrics.timers.ellapsedWorkspaceServiceInit, '[renderer]', undefined]); table.push(['register extensions & spawn extension host', metrics.timers.ellapsedExtensions, '[renderer]', undefined]); diff --git a/src/vs/workbench/services/timer/electron-browser/timerService.ts b/src/vs/workbench/services/timer/electron-browser/timerService.ts index c4a524d3706..1a4c78ecfa8 100644 --- a/src/vs/workbench/services/timer/electron-browser/timerService.ts +++ b/src/vs/workbench/services/timer/electron-browser/timerService.ts @@ -54,8 +54,6 @@ export interface IMemoryInfo { "timers.ellapsedExtensionsReady" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedGlobalStorageInitMain" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, - "timers.ellapsedGlobalStorageInitRenderer" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, - "timers.ellapsedWorkspaceStorageRequire" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedWorkspaceStorageInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedWorkspaceServiceInit" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, "timers.ellapsedViewletRestore" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth", "isMeasurement": true }, @@ -206,22 +204,6 @@ export interface IStartupMetrics { */ readonly ellapsedGlobalStorageInitMain: number; - /** - * The time it took to load the initial set of values from the global storage. - * - * * Happens in the renderer-process - * * Measured with the `willInitGlobalStorage` and `didInitGlobalStorage` performance marks. - */ - readonly ellapsedGlobalStorageInitRenderer: number; - - /** - * The time it took to require the workspace storage DB. - * - * * Happens in the renderer-process - * * Measured with the `willRequireSQLite` and `didRequireSQLite` performance marks. - */ - readonly ellapsedWorkspaceStorageRequire: number; - /** * The time it took to require the workspace storage DB, connect to it * and load the initial set of values. @@ -416,8 +398,6 @@ class TimerService implements ITimerService { ellapsedWindowLoadToRequire: perf.getDuration('main:loadWindow', 'willLoadWorkbenchMain'), ellapsedRequire: perf.getDuration('willLoadWorkbenchMain', 'didLoadWorkbenchMain'), ellapsedGlobalStorageInitMain: perf.getDuration('main:willInitGlobalStorage', 'main:didInitGlobalStorage'), - ellapsedGlobalStorageInitRenderer: perf.getDuration('willInitGlobalStorage', 'didInitGlobalStorage'), - ellapsedWorkspaceStorageRequire: perf.getDuration('willRequireSQLite', 'didRequireSQLite'), ellapsedWorkspaceStorageInit: perf.getDuration('willInitWorkspaceStorage', 'didInitWorkspaceStorage'), ellapsedWorkspaceServiceInit: perf.getDuration('willInitWorkspaceService', 'didInitWorkspaceService'), ellapsedExtensions: perf.getDuration('willLoadExtensions', 'didLoadExtensions'), From d7d55ee749c7ff15e538dc354130e078e8dc18b7 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 10:35:32 +0100 Subject: [PATCH 281/429] fix build --- src/vs/workbench/browser/actions/layoutActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index b6e13835191..95e2db05534 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -338,7 +338,7 @@ class ToggleTabsVisibilityAction extends Action { } registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleTabsVisibilityAction, ToggleTabsVisibilityAction.ID, ToggleTabsVisibilityAction.LABEL, { - primary: undefined, + primary: undefined!, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_W, }, linux: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_W, } }), 'View: Toggle Tab Visibility', viewCategory); From c86667e5c067c37e30ad7aa8c192ecb5f40b3b65 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 10:40:14 +0100 Subject: [PATCH 282/429] debt - avoid constant settings lookup in lists --- src/vs/platform/list/browser/listService.ts | 75 +++++++++++++++++---- 1 file changed, 61 insertions(+), 14 deletions(-) diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 3b7b94de788..d49a2602d96 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -128,12 +128,27 @@ function useSingleClickToOpen(configurationService: IConfigurationService): bool return configurationService.getValue(openModeSettingKey) !== 'doubleClick'; } -class MultipleSelectionController implements IMultipleSelectionController { +class MultipleSelectionController extends Disposable implements IMultipleSelectionController { + private useAltAsMultipleSelectionModifier: boolean; - constructor(private configurationService: IConfigurationService) { } + constructor(private configurationService: IConfigurationService) { + super(); + + this.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(configurationService); + + this.registerListeners(); + } + + private registerListeners(): void { + this._register(this.configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(multiSelectModifierSettingKey)) { + this.useAltAsMultipleSelectionModifier = useAltAsMultipleSelectionModifier(this.configurationService); + } + })); + } isSelectionSingleChangeEvent(event: IListMouseEvent | IListTouchEvent): boolean { - if (useAltAsMultipleSelectionModifier(this.configurationService)) { + if (this.useAltAsMultipleSelectionModifier) { return event.browserEvent.altKey; } @@ -145,14 +160,29 @@ class MultipleSelectionController implements IMultipleSelectionController } } -class WorkbenchOpenController implements IOpenController { +class WorkbenchOpenController extends Disposable implements IOpenController { + private openOnSingleClick: boolean; - constructor(private configurationService: IConfigurationService, private existingOpenController?: IOpenController) { } + constructor(private configurationService: IConfigurationService, private existingOpenController?: IOpenController) { + super(); + + this.openOnSingleClick = useSingleClickToOpen(configurationService); + + this.registerListeners(); + } + + private registerListeners(): void { + this._register(this.configurationService.onDidChangeConfiguration(e => { + if (e.affectsConfiguration(openModeSettingKey)) { + this.openOnSingleClick = useSingleClickToOpen(this.configurationService); + } + })); + } shouldOpen(event: UIEvent): boolean { if (event instanceof MouseEvent) { const isDoubleClick = event.detail === 2; - if (!useSingleClickToOpen(this.configurationService) && !isDoubleClick) { + if (!this.openOnSingleClick && !isDoubleClick) { return false; } @@ -167,14 +197,19 @@ class WorkbenchOpenController implements IOpenController { } } -function toWorkbenchListOptions(options: IListOptions, configurationService: IConfigurationService, keybindingService: IKeybindingService): IListOptions { +function toWorkbenchListOptions(options: IListOptions, configurationService: IConfigurationService, keybindingService: IKeybindingService): [IListOptions, IDisposable] { + const disposables: IDisposable[] = []; const result = { ...options }; if (options.multipleSelectionSupport !== false && !options.multipleSelectionController) { - result.multipleSelectionController = new MultipleSelectionController(configurationService); + const multipleSelectionController = new MultipleSelectionController(configurationService); + result.multipleSelectionController = multipleSelectionController; + disposables.push(multipleSelectionController); } - result.openController = new WorkbenchOpenController(configurationService, options.openController); + const openController = new WorkbenchOpenController(configurationService, options.openController); + result.openController = openController; + disposables.push(openController); if (options.keyboardNavigationLabelProvider) { const tlp = options.keyboardNavigationLabelProvider; @@ -185,7 +220,7 @@ function toWorkbenchListOptions(options: IListOptions, configurationServic }; } - return result; + return [result, combinedDisposable(disposables)]; } let sharedListStyleSheet: HTMLStyleElement; @@ -241,17 +276,20 @@ export class WorkbenchList extends List { @IKeybindingService keybindingService: IKeybindingService ) { const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); + const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); super(container, delegate, renderers, { keyboardSupport: false, styleController: new DefaultStyleController(getSharedListStyleSheet()), ...computeStyles(themeService.getTheme(), defaultListStyles), - ...toWorkbenchListOptions(options, configurationService, keybindingService), + ...workbenchListOptions, horizontalScrolling } as IListOptions ); + this.disposables.push(workbenchListOptionsDisposable); + this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.configurationService = configurationService; @@ -951,12 +989,13 @@ export class WorkbenchObjectTree, TFilterData = void> const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); const openOnSingleClick = useSingleClickToOpen(configurationService); + const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); super(container, delegate, renderers, { keyboardSupport: false, styleController: new DefaultStyleController(getSharedListStyleSheet()), ...computeStyles(themeService.getTheme(), defaultListStyles), - ...toWorkbenchListOptions(options, configurationService, keybindingService), + ...workbenchListOptions, indent: configurationService.getValue(treeIndentKey), automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', @@ -966,6 +1005,8 @@ export class WorkbenchObjectTree, TFilterData = void> keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService) }); + this.disposables.push(workbenchListOptionsDisposable); + this.contextKeyService = createScopedContextKeyService(contextKeyService, this); const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); @@ -1067,12 +1108,13 @@ export class WorkbenchDataTree extends DataTree(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); const openOnSingleClick = useSingleClickToOpen(configurationService); + const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); super(container, delegate, renderers, dataSource, { keyboardSupport: false, styleController: new DefaultStyleController(getSharedListStyleSheet()), ...computeStyles(themeService.getTheme(), defaultListStyles), - ...toWorkbenchListOptions(options, configurationService, keybindingService), + ...workbenchListOptions, indent: configurationService.getValue(treeIndentKey), automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', @@ -1082,6 +1124,8 @@ export class WorkbenchDataTree extends DataTree extends Async const keyboardNavigation = configurationService.getValue(keyboardNavigationSettingKey); const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); const openOnSingleClick = useSingleClickToOpen(configurationService); + const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); super(container, delegate, renderers, dataSource, { keyboardSupport: false, styleController: new DefaultStyleController(getSharedListStyleSheet()), ...computeStyles(themeService.getTheme(), defaultListStyles), - ...toWorkbenchListOptions(options, configurationService, keybindingService), + ...workbenchListOptions, indent: configurationService.getValue(treeIndentKey), automaticKeyboardNavigation, simpleKeyboardNavigation: keyboardNavigation === 'simple', @@ -1193,6 +1238,8 @@ export class WorkbenchAsyncDataTree extends Async keyboardNavigationEventFilter: createKeyboardNavigationEventFilter(container, keybindingService) }); + this.disposables.push(workbenchListOptionsDisposable); + this.contextKeyService = createScopedContextKeyService(contextKeyService, this); const listSupportsMultiSelect = WorkbenchListSupportsMultiSelectContextKey.bindTo(this.contextKeyService); From b306c55a05062b8fe6ab1a80f19fc18870d87bbd Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Mon, 4 Feb 2019 09:33:54 +0100 Subject: [PATCH 283/429] Remove "Experimental setting" from proxy support setting (fixes #67832) --- src/vs/platform/request/node/request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/request/node/request.ts b/src/vs/platform/request/node/request.ts index 057969a072b..8602bb0357c 100644 --- a/src/vs/platform/request/node/request.ts +++ b/src/vs/platform/request/node/request.ts @@ -57,7 +57,7 @@ Registry.as(Extensions.Configuration) localize('proxySupportOverride', "Enable proxy support for extensions, override request options."), ], default: 'override', - description: localize('proxySupport', "Experimental setting: Use the proxy support for extensions.") + description: localize('proxySupport', "Use the proxy support for extensions.") } } }); From b940d15ed984b38f652c7eae86ce15f70cd8371d Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Mon, 4 Feb 2019 10:57:36 +0100 Subject: [PATCH 284/429] Update distro commit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 561f2d5c494..5f78d0e4027 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.32.0", - "distro": "cb7599e6323871114d034681abb30ed5e2066d3c", + "distro": "d274a23e463c080a0a3ba6278d43431d187e05f5", "author": { "name": "Microsoft Corporation" }, From f3552ec84d58edf2a3f69552e6df617936ebcb99 Mon Sep 17 00:00:00 2001 From: Alexandr Fadeev <5967447+fadeevab@users.noreply.github.com> Date: Mon, 4 Feb 2019 12:11:03 +0200 Subject: [PATCH 285/429] Makefile grammar updating: tests are updated about the handling of @, - and +. (#65629) 1. @, - and + in the beginning of recipes are colored. 2. Shell in recipes is not colored by shellscript extension anymore: improper colorizing of Makefile variables, low suitability. --- .../make/test/colorize-fixtures/makefile | 10 +- .../make/test/colorize-results/makefile.json | 261 +++++++++++++++++- 2 files changed, 264 insertions(+), 7 deletions(-) diff --git a/extensions/make/test/colorize-fixtures/makefile b/extensions/make/test/colorize-fixtures/makefile index 9eab44f6848..65fa3497669 100644 --- a/extensions/make/test/colorize-fixtures/makefile +++ b/extensions/make/test/colorize-fixtures/makefile @@ -1,5 +1,5 @@ .PHONY: all -all: hello +all: echo hello .PHONY: hello hello: main.o factorial.o \ @@ -25,8 +25,8 @@ hello.o: hello.cpp \ clean: rm *o hello -.PHONY: all -all: +.PHONY: var +var: # "$$" in a shell means to escape makefile's variable substitution. some_shell_var=$$(sed -nre 's/some regex with (group)/\1/p') @@ -34,6 +34,10 @@ all: echo: echo "#" and '#' in quotes are not comments \ and '\' will be continued + @echo Shell is not printed out, just a message. + @-+-+echo Error will be ignored here; invalidcommand + # And we can see variables are highlited as supposed to be: + @echo '$(CC) $(shell echo "123") -o $@' define defined $(info Checking existance of $(1) $(flavor $(1))) diff --git a/extensions/make/test/colorize-results/makefile.json b/extensions/make/test/colorize-results/makefile.json index b5d915ffca2..ec834fa59a5 100644 --- a/extensions/make/test/colorize-results/makefile.json +++ b/extensions/make/test/colorize-results/makefile.json @@ -55,7 +55,7 @@ } }, { - "c": " hello", + "c": " echo hello", "t": "source.makefile meta.scope.target.makefile meta.scope.prerequisites.makefile", "r": { "dark_plus": "default: #D4D4D4", @@ -715,7 +715,7 @@ } }, { - "c": " all", + "c": " var", "t": "source.makefile meta.scope.target.makefile meta.scope.prerequisites.makefile", "r": { "dark_plus": "default: #D4D4D4", @@ -726,7 +726,7 @@ } }, { - "c": "all", + "c": "var", "t": "source.makefile meta.scope.target.makefile entity.name.function.target.makefile", "r": { "dark_plus": "entity.name.function: #DCDCAA", @@ -901,6 +901,259 @@ "hc_black": "default: #FFFFFF" } }, + { + "c": "\t", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "@", + "t": "source.makefile meta.scope.recipe.makefile keyword.control.@.makefile", + "r": { + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" + } + }, + { + "c": "echo Shell is not printed out, just a message.", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "\t", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "@-+-+", + "t": "source.makefile meta.scope.recipe.makefile keyword.control.@-+-+.makefile", + "r": { + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" + } + }, + { + "c": "echo Error will be ignored here; invalidcommand", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "\t", + "t": "source.makefile punctuation.whitespace.comment.leading.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "#", + "t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": " And we can see variables are highlited as supposed to be:", + "t": "source.makefile comment.line.number-sign.makefile", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": "\t", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "@", + "t": "source.makefile meta.scope.recipe.makefile keyword.control.@.makefile", + "r": { + "dark_plus": "keyword.control: #C586C0", + "light_plus": "keyword.control: #AF00DB", + "dark_vs": "keyword.control: #569CD6", + "light_vs": "keyword.control: #0000FF", + "hc_black": "keyword.control: #C586C0" + } + }, + { + "c": "echo '", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "$(", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "CC", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile variable.other.makefile", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": ")", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": " ", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "$(", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "shell", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile meta.scope.function-call.makefile support.function.shell.makefile", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "support.function: #DCDCAA" + } + }, + { + "c": " echo \"123\"", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile meta.scope.function-call.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": ")", + "t": "source.makefile meta.scope.recipe.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": " -o ", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "$@", + "t": "source.makefile meta.scope.recipe.makefile variable.language.makefile", + "r": { + "dark_plus": "variable.language: #569CD6", + "light_plus": "variable.language: #0000FF", + "dark_vs": "variable.language: #569CD6", + "light_vs": "variable.language: #0000FF", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": "'", + "t": "source.makefile meta.scope.recipe.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, { "c": "define", "t": "source.makefile meta.scope.conditional.makefile keyword.control.define.makefile", @@ -2760,4 +3013,4 @@ "hc_black": "default: #FFFFFF" } } -] \ No newline at end of file +] From 8704b574da6c72848f74b3a88c47b2ede77e7a89 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 4 Feb 2019 11:15:22 +0100 Subject: [PATCH 286/429] build: decouple upload-vscode-sourcemaps task --- build/azure-pipelines/darwin/product-build-darwin.yml | 3 ++- build/gulpfile.vscode.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index ff9d32b35ca..cdd8dfb9c89 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -23,7 +23,8 @@ steps: set -e VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \ AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \ - yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps + yarn gulp -- vscode-darwin-min + yarn gulp -- upload-vscode-sourcemaps displayName: Build - script: | diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 2a39f8196bf..0bf3c4a38d9 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -517,7 +517,7 @@ gulp.task('vscode-translations-import', function () { // Sourcemaps -gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], () => { +gulp.task('upload-vscode-sourcemaps', () => { const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' }) .pipe(es.mapSync(f => { f.path = `${f.base}/core/${f.relative}`; From 6db6919846fc04ced7769f29e2e816df03ffd341 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 4 Feb 2019 11:21:12 +0100 Subject: [PATCH 287/429] rename --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 31e5b0af409..3890deafa57 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -260,7 +260,7 @@ export class AsyncDataTree implements IDisposable private readonly tree: ObjectTree, TFilterData>; private readonly root: IAsyncDataTreeNode; - private readonly renderedNodes = new Map>(); + private readonly nodes = new Map>(); private readonly sorter?: ITreeSorter; private readonly subTreeRefreshPromises = new Map, Promise>(); @@ -326,7 +326,7 @@ export class AsyncDataTree implements IDisposable }; } - this.renderedNodes.set(null, this.root); + this.nodes.set(null, this.root); this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState, this, this.disposables); } @@ -413,7 +413,7 @@ export class AsyncDataTree implements IDisposable } hasNode(element: T): boolean { - return this.renderedNodes.has(element); + return this.nodes.has(element); } // View @@ -574,7 +574,7 @@ export class AsyncDataTree implements IDisposable // Implementation private getDataNode(element: TInput | T): IAsyncDataTreeNode { - const node: IAsyncDataTreeNode | undefined = this.renderedNodes.get((element === this.root.element ? null : element) as T); + const node: IAsyncDataTreeNode | undefined = this.nodes.get((element === this.root.element ? null : element) as T); if (!node) { throw new Error(`Data tree node not found: ${element}`); @@ -809,7 +809,7 @@ export class AsyncDataTree implements IDisposable const onDidCreateNode = (treeNode: ITreeNode, TFilterData>) => { if (treeNode.element.element) { insertedElements.add(treeNode.element.element as T); - this.renderedNodes.set(treeNode.element.element as T, treeNode.element); + this.nodes.set(treeNode.element.element as T, treeNode.element); } }; @@ -817,7 +817,7 @@ export class AsyncDataTree implements IDisposable if (treeNode.element.element) { if (!insertedElements.has(treeNode.element.element as T)) { treeNode.element.disposed = true; - this.renderedNodes.delete(treeNode.element.element as T); + this.nodes.delete(treeNode.element.element as T); } } }; From f859153fd933ac5348913292b699729fc9a18876 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 13:49:30 +0100 Subject: [PATCH 288/429] Glob: * does not match empty string (#67835) --- src/vs/base/common/glob.ts | 14 +++++++------- src/vs/base/test/node/glob.test.ts | 3 +++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/vs/base/common/glob.ts b/src/vs/base/common/glob.ts index f9c74b9ed46..a26f954ef31 100644 --- a/src/vs/base/common/glob.ts +++ b/src/vs/base/common/glob.ts @@ -302,7 +302,7 @@ function parsePattern(arg1: string | IRelativePattern, options: IGlobOptions): P if (T1.test(pattern)) { // common pattern: **/*.txt just need endsWith check const base = pattern.substr(4); // '**/*'.length === 4 parsedPattern = function (path, basename) { - return path && strings.endsWith(path, base) ? pattern : null; + return typeof path === 'string' && strings.endsWith(path, base) ? pattern : null; }; } else if (match = T2.exec(trimForExclusions(pattern, options))) { // common pattern: **/some.txt just need basename check parsedPattern = trivia2(match[1], pattern); @@ -348,7 +348,7 @@ function trivia2(base: string, originalPattern: string): ParsedStringPattern { const slashBase = `/${base}`; const backslashBase = `\\${base}`; const parsedPattern: ParsedStringPattern = function (path, basename) { - if (!path) { + if (typeof path !== 'string') { return null; } if (basename) { @@ -399,9 +399,9 @@ function trivia4and5(path: string, pattern: string, matchPathEnds: boolean): Par const nativePath = paths.nativeSep !== paths.sep ? path.replace(ALL_FORWARD_SLASHES, paths.nativeSep) : path; const nativePathEnd = paths.nativeSep + nativePath; const parsedPattern: ParsedStringPattern = matchPathEnds ? function (path, basename) { - return path && (path === nativePath || strings.endsWith(path, nativePathEnd)) ? pattern : null; + return typeof path === 'string' && (path === nativePath || strings.endsWith(path, nativePathEnd)) ? pattern : null; } : function (path, basename) { - return path && path === nativePath ? pattern : null; + return typeof path === 'string' && path === nativePath ? pattern : null; }; parsedPattern.allPaths = [(matchPathEnds ? '*/' : './') + path]; return parsedPattern; @@ -412,7 +412,7 @@ function toRegExp(pattern: string): ParsedStringPattern { const regExp = new RegExp(`^${parseRegExp(pattern)}$`); return function (path: string, basename: string) { regExp.lastIndex = 0; // reset RegExp to its initial state to reuse it! - return path && regExp.test(path) ? pattern : null; + return typeof path === 'string' && regExp.test(path) ? pattern : null; }; } catch (error) { return NULL; @@ -430,7 +430,7 @@ function toRegExp(pattern: string): ParsedStringPattern { export function match(pattern: string | IRelativePattern, path: string): boolean; export function match(expression: IExpression, path: string, hasSibling?: (name: string) => boolean): string /* the matching pattern */; export function match(arg1: string | IExpression | IRelativePattern, path: string, hasSibling?: (name: string) => boolean): any { - if (!arg1 || !path) { + if (!arg1 || typeof path !== 'string') { return false; } @@ -675,7 +675,7 @@ function aggregateBasenameMatches(parsedPatterns: Array[]); } const aggregate: ParsedStringPattern = function (path, basename) { - if (!path) { + if (typeof path !== 'string') { return null; } if (!basename) { diff --git a/src/vs/base/test/node/glob.test.ts b/src/vs/base/test/node/glob.test.ts index 7b003cc002b..ee10d64b839 100644 --- a/src/vs/base/test/node/glob.test.ts +++ b/src/vs/base/test/node/glob.test.ts @@ -102,6 +102,9 @@ suite('Glob', () => { p = 'C:/DNXConsoleApp/**/*.cs'; assertGlobMatch(p, 'C:\\DNXConsoleApp\\Program.cs'); assertGlobMatch(p, 'C:\\DNXConsoleApp\\foo\\Program.cs'); + + p = '*'; + assertGlobMatch(p, ''); }); test('dot hidden', function () { From d2ec27494b0abc0bf1123183e3a72a11d4d93982 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 4 Feb 2019 14:34:14 +0100 Subject: [PATCH 289/429] update references view --- build/builtInExtensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/builtInExtensions.json b/build/builtInExtensions.json index 1ce94db95eb..d0d0107677b 100644 --- a/build/builtInExtensions.json +++ b/build/builtInExtensions.json @@ -31,7 +31,7 @@ }, { "name": "ms-vscode.references-view", - "version": "0.0.24", + "version": "0.0.25", "repo": "https://github.com/Microsoft/vscode-reference-view", "metadata": { "id": "dc489f46-520d-4556-ae85-1f9eab3c412d", From a592b43925bed0dbf5ad1c522498b50ac41c89f3 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 12:15:38 +0100 Subject: [PATCH 290/429] Debt: Remove unused gulp tasks --- build/gulpfile.extensions.js | 2 -- gulpfile.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 1488f96ec44..c7591abc6c6 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -163,10 +163,8 @@ const tasks = compilations.map(function (tsconfigFile) { }; }); -gulp.task('clean-extensions', tasks.map(t => t.clean)); gulp.task('compile-extensions', tasks.map(t => t.compile)); gulp.task('watch-extensions', tasks.map(t => t.watch)); -gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild)); gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild)); gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild)); diff --git a/gulpfile.js b/gulpfile.js index fe899377d79..133717f6c3a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,12 +27,10 @@ gulp.task('watch-client-build', ['clean-client-build'], compilation.watchTask('o gulp.task('default', ['compile']); // All -gulp.task('clean', ['clean-client', 'clean-extensions']); gulp.task('compile', ['monaco-typecheck', 'compile-client', 'compile-extensions']); gulp.task('watch', [/* 'monaco-typecheck-watch', */ 'watch-client', 'watch-extensions']); // All Build -gulp.task('clean-build', ['clean-client-build', 'clean-extensions-build']); gulp.task('compile-build', ['compile-client-build', 'compile-extensions-build']); gulp.task('watch-build', ['watch-client-build', 'watch-extensions-build']); From 77b61a1e552aa6dd00ec9d9bf6f6e980665fa117 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 14:41:29 +0100 Subject: [PATCH 291/429] Simplify gulp tasks for extensions --- build/gulpfile.extensions.js | 44 ++++++++++++------------------------ build/lib/util.js | 33 +++++++++++++++++++++++++++ build/lib/util.ts | 34 ++++++++++++++++++++++++++++ gulpfile.js | 2 -- 4 files changed, 81 insertions(+), 32 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index c7591abc6c6..1d0ac3da216 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -47,11 +47,7 @@ const tasks = compilations.map(function (tsconfigFile) { const clean = 'clean-extension:' + name; const compile = 'compile-extension:' + name; const watch = 'watch-extension:' + name; - - // Build Tasks - const cleanBuild = 'clean-extension-build:' + name; const compileBuild = 'compile-extension-build:' + name; - const watchBuild = 'watch-extension-build:' + name; const root = path.join('extensions', relativeDirname); const srcBase = path.join(root, 'src'); @@ -112,15 +108,18 @@ const tasks = compilations.map(function (tsconfigFile) { const srcOpts = { cwd: path.dirname(__dirname), base: srcBase }; gulp.task(clean, cb => rimraf(out, cb)); + const cleanTask = () => util.primraf(out); - gulp.task(compile, [clean], () => { + gulp.task(compile, util.taskSeries(cleanTask, () => { const pipeline = createPipeline(false, true); const input = gulp.src(src, srcOpts); - return input + return util.streamToPromise( + input .pipe(pipeline()) - .pipe(gulp.dest(out)); - }); + .pipe(gulp.dest(out)) + ); + })); gulp.task(watch, [clean], () => { const pipeline = createPipeline(false); @@ -132,39 +131,24 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(gulp.dest(out)); }); - gulp.task(cleanBuild, cb => rimraf(out, cb)); - - gulp.task(compileBuild, [clean], () => { + gulp.task(compileBuild, util.taskSeries(cleanTask, () => { const pipeline = createPipeline(true, true); const input = gulp.src(src, srcOpts); - return input + return util.streamToPromise( + input .pipe(pipeline()) - .pipe(gulp.dest(out)); - }); - - gulp.task(watchBuild, [clean], () => { - const pipeline = createPipeline(true); - const input = gulp.src(src, srcOpts); - const watchInput = watcher(src, srcOpts); - - return watchInput - .pipe(util.incremental(() => pipeline(), input)) - .pipe(gulp.dest(out)); - }); + .pipe(gulp.dest(out)) + ); + })); return { - clean: clean, compile: compile, watch: watch, - cleanBuild: cleanBuild, - compileBuild: compileBuild, - watchBuild: watchBuild + compileBuild: compileBuild }; }); gulp.task('compile-extensions', tasks.map(t => t.compile)); gulp.task('watch-extensions', tasks.map(t => t.watch)); - gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild)); -gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild)); diff --git a/build/lib/util.js b/build/lib/util.js index e6f041f3d60..a03adac0f37 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -183,6 +183,39 @@ function rimraf(dir) { return cb => retry(cb); } exports.rimraf = rimraf; +/** + * Like rimraf (with 5 retries), but with a promise instead of a callback. + */ +function primraf(dir) { + const fn = rimraf(dir); + return new Promise((resolve, reject) => { + fn((err) => { + if (err) { + return reject(err); + } + resolve(); + }); + }); +} +exports.primraf = primraf; +/** + * Convert a stream to a promise. + */ +function streamToPromise(stream) { + return new Promise((resolve, reject) => { + stream.on('end', _ => resolve()); + stream.on('error', err => reject(err)); + }); +} +exports.streamToPromise = streamToPromise; +function taskSeries(...tasks) { + return async () => { + for (let i = 0; i < tasks.length; i++) { + await tasks[i](); + } + }; +} +exports.taskSeries = taskSeries; function getVersion(root) { let version = process.env['BUILD_SOURCEVERSION']; if (!version || !/^[0-9a-f]{40}$/i.test(version)) { diff --git a/build/lib/util.ts b/build/lib/util.ts index 4617cc83f2f..918c2295b3b 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -237,6 +237,40 @@ export function rimraf(dir: string): (cb: any) => void { return cb => retry(cb); } +/** + * Like rimraf (with 5 retries), but with a promise instead of a callback. + */ +export function primraf(dir: string): Promise { + const fn = rimraf(dir); + return new Promise((resolve, reject) => { + fn((err: any) => { + if (err) { + return reject(err); + } + resolve(); + }); + }); +} + +/** + * Convert a stream to a promise. + */ +export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise { + return new Promise((resolve, reject) => { + stream.on('end', _ => resolve()); + stream.on('error', err => reject(err)); + }); +} + +export type PromiseTask = () => Promise; +export function taskSeries(...tasks: PromiseTask[]): () => Promise { + return async () => { + for (let i = 0; i < tasks.length; i++) { + await tasks[i](); + } + }; +} + export function getVersion(root: string): string | undefined { let version = process.env['BUILD_SOURCEVERSION']; diff --git a/gulpfile.js b/gulpfile.js index 133717f6c3a..882d7f84147 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,7 +21,6 @@ gulp.task('watch-client', ['clean-client'], compilation.watchTask('out', false)) // Full compile, including nls and inline sources in sourcemaps, for build gulp.task('clean-client-build', util.rimraf('out-build')); gulp.task('compile-client-build', ['clean-client-build'], compilation.compileTask('src', 'out-build', true)); -gulp.task('watch-client-build', ['clean-client-build'], compilation.watchTask('out-build', true)); // Default gulp.task('default', ['compile']); @@ -32,7 +31,6 @@ gulp.task('watch', [/* 'monaco-typecheck-watch', */ 'watch-client', 'watch-exten // All Build gulp.task('compile-build', ['compile-client-build', 'compile-extensions-build']); -gulp.task('watch-build', ['watch-client-build', 'watch-extensions-build']); process.on('unhandledRejection', (reason, p) => { console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); From 11f724465324425150120373bafed33590cf7a52 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 4 Feb 2019 15:14:48 +0100 Subject: [PATCH 292/429] strict null streams, #67775 --- src/tsconfig.strictNullChecks.json | 3 ++- .../files/electron-browser/streams.ts | 24 +++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 19d2a4737a0..5d4073c2391 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -791,6 +791,7 @@ "./vs/workbench/services/extensions/node/rpcProtocol.ts", "./vs/workbench/services/extensions/test/node/rpcProtocol.test.ts", "./vs/workbench/services/files/electron-browser/encoding.ts", + "./vs/workbench/services/files/electron-browser/streams.ts", "./vs/workbench/services/files/node/watcher/common.ts", "./vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts", "./vs/workbench/services/files/node/watcher/nsfw/test/nsfwWatcherService.test.ts", @@ -891,4 +892,4 @@ "exclude": [ "./typings/require-monaco.d.ts" ] -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/files/electron-browser/streams.ts b/src/vs/workbench/services/files/electron-browser/streams.ts index d4af4580a88..f3a5a3fe034 100644 --- a/src/vs/workbench/services/files/electron-browser/streams.ts +++ b/src/vs/workbench/services/files/electron-browser/streams.ts @@ -31,7 +31,7 @@ function createSimpleWritable(provider: IFileSystemProvider, resource: URI, opts } end() { // todo@joh - end might have another chunk... - provider.writeFile(resource, Buffer.concat(this._chunks), opts).then(_ => { + provider.writeFile!(resource, Buffer.concat(this._chunks), opts).then(_ => { super.end(); }, err => { this.emit('error', err); @@ -50,9 +50,9 @@ function createWritable(provider: IFileSystemProvider, resource: URI, opts: File async _write(chunk: Buffer, encoding, callback: Function) { try { if (typeof this._fd !== 'number') { - this._fd = await provider.open(resource, { create: true }); + this._fd = await provider.open!(resource, { create: true }); } - let bytesWritten = await provider.write(this._fd, this._pos, chunk, 0, chunk.length); + let bytesWritten = await provider.write!(this._fd, this._pos, chunk, 0, chunk.length); this._pos += bytesWritten; callback(); } catch (err) { @@ -61,9 +61,9 @@ function createWritable(provider: IFileSystemProvider, resource: URI, opts: File } _final(callback: (err?: any) => any) { if (typeof this._fd !== 'number') { - provider.open(resource, { create: true }).then(fd => provider.close(fd)).finally(callback); + provider.open!(resource, { create: true }).then(fd => provider.close!(fd)).finally(callback); } else { - provider.close(this._fd).finally(callback); + provider.close!(this._fd).finally(callback); } } }; @@ -85,20 +85,20 @@ function createReadable(provider: IFileSystemProvider, resource: URI, position: _pos: number = position; _reading: boolean = false; - async _read(size?: number) { + async _read(size: number = 2 ** 10) { if (this._reading) { return; } this._reading = true; try { if (typeof this._fd !== 'number') { - this._fd = await provider.open(resource, { create: false }); + this._fd = await provider.open!(resource, { create: false }); } while (this._reading) { let buffer = Buffer.allocUnsafe(size); - let bytesRead = await provider.read(this._fd, this._pos, buffer, 0, buffer.length); + let bytesRead = await provider.read!(this._fd, this._pos, buffer, 0, buffer.length); if (bytesRead === 0) { - await provider.close(this._fd); + await provider.close!(this._fd); this._reading = false; this.push(null); } else { @@ -113,7 +113,7 @@ function createReadable(provider: IFileSystemProvider, resource: URI, position: } _destroy(_err: any, callback: (err?: any) => any) { if (typeof this._fd === 'number') { - provider.close(this._fd).then(callback, callback); + provider.close!(this._fd).then(callback, callback); } } }; @@ -126,7 +126,7 @@ function createSimpleReadable(provider: IFileSystemProvider, resource: URI, posi if (this._readOperation) { return; } - this._readOperation = provider.readFile(resource).then(data => { + this._readOperation = provider.readFile!(resource).then(data => { this.push(data.slice(position)); this.push(null); }, err => { @@ -141,7 +141,7 @@ export function createReadableOfSnapshot(snapshot: ITextSnapshot): Readable { return new Readable({ read: function () { try { - let chunk: string; + let chunk: string | null = null; let canPush = true; // Push all chunks as long as we can push and as long as From 5c7748690dc7d789a0992c219560b45f5fcf3f5a Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 4 Feb 2019 15:17:10 +0100 Subject: [PATCH 293/429] always wait when starting with `prof-append-timers` --- .../parts/performance/electron-browser/startupTimings.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts b/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts index 949e0d28051..c1a0b9a2a42 100644 --- a/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts +++ b/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts @@ -65,18 +65,11 @@ export class StartupTimings implements IWorkbenchContribution { return; } - const waitWhenNoCachedData: () => Promise = () => { - // wait 15s for cached data to be produced - return !didUseCachedData() - ? timeout(15000) - : Promise.resolve(); - }; - const { sessionId } = await this._telemetryService.getTelemetryInfo(); Promise.all([ this._timerService.startupMetrics, - waitWhenNoCachedData(), + timeout(15000), // wait: cached data creation, telemetry sending ]).then(([startupMetrics]) => { return nfcall(appendFile, appendTo, `${startupMetrics.ellapsed}\t${product.nameShort}\t${(product.commit || '').slice(0, 10) || '0000000000'}\t${sessionId}\t${isStandardStartup ? 'standard_start' : 'NO_standard_start'}\n`); }).then(() => { From 8299260c6270a7b2325e20e50e8ee0de9a890277 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Mon, 4 Feb 2019 15:18:47 +0100 Subject: [PATCH 294/429] Strict null check 'quickOpenWidget.ts' (fixes #67774) --- src/tsconfig.strictNullChecks.json | 1 + .../quickopen/browser/quickOpenViewer.ts | 6 ++-- .../quickopen/browser/quickOpenWidget.ts | 31 +++++++++++-------- .../base/parts/quickopen/common/quickOpen.ts | 2 +- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 5d4073c2391..ef2000cae7e 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -38,6 +38,7 @@ "./vs/base/parts/quickopen/common/quickOpen.ts", "./vs/base/parts/quickopen/common/quickOpenScorer.ts", "./vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts", + "./vs/base/parts/quickopen/browser/quickOpenWidget.ts", "./vs/base/parts/tree/browser/tree.ts", "./vs/base/parts/tree/browser/treeDefaults.ts", "./vs/base/parts/tree/browser/treeDnd.ts", diff --git a/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts b/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts index 042d649f924..a6c8e390574 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenViewer.ts @@ -24,7 +24,7 @@ export class DataSource implements IDataSource { getId(tree: ITree, element: any): string { if (!element) { - return null; + return null!; } const model = this.modelProvider.getModel(); @@ -49,10 +49,10 @@ export class DataSource implements IDataSource { export class AccessibilityProvider implements IAccessibilityProvider { constructor(private modelProvider: IModelProvider) { } - getAriaLabel(tree: ITree, element: any): string { + getAriaLabel(tree: ITree, element: any): string | null { const model = this.modelProvider.getModel(); - return model.accessibilityProvider && model.accessibilityProvider.getAriaLabel(element); + return model.accessibilityProvider ? model.accessibilityProvider.getAriaLabel(element) : null; } getPosInSet(tree: ITree, element: any): string { diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index 65cdc14af54..c121e1d3b58 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -110,12 +110,12 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { private visible: boolean; private isLoosingFocus: boolean; private callbacks: IQuickOpenCallbacks; - private quickNavigateConfiguration: IQuickNavigateConfiguration; + private quickNavigateConfiguration: IQuickNavigateConfiguration | undefined; private container: HTMLElement; private treeElement: HTMLElement; private inputElement: HTMLElement; private layoutDimensions: DOM.Dimension; - private model: IModel; + private model: IModel | null; private inputChangingTimeoutHandle: any; private styles: IQuickOpenStyles; private renderer: Renderer; @@ -137,7 +137,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { } getModel(): IModel { - return this.model; + return this.model!; } setCallbacks(callbacks: IQuickOpenCallbacks): void { @@ -181,7 +181,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { DOM.addClass(this.inputContainer, 'quick-open-input'); this.element.appendChild(this.inputContainer); - this.inputBox = this._register(new InputBox(this.inputContainer, null, { + this.inputBox = this._register(new InputBox(this.inputContainer, undefined, { placeholder: this.options.inputPlaceHolder || '', ariaLabel: DEFAULT_INPUT_ARIA_LABEL, inputBackground: this.styles.inputBackground, @@ -538,10 +538,15 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { } // ARIA - this.inputElement.setAttribute('aria-activedescendant', this.treeElement.getAttribute('aria-activedescendant')); + const arivaActiveDescendant = this.treeElement.getAttribute('aria-activedescendant'); + if (arivaActiveDescendant) { + this.inputElement.setAttribute('aria-activedescendant', arivaActiveDescendant); + } else { + this.inputElement.removeAttribute('aria-activedescendant'); + } const context: IEntryRunContext = { event: event, keymods: this.extractKeyMods(event), quickNavigateConfiguration: this.quickNavigateConfiguration }; - this.model.runner.run(value, Mode.PREVIEW, context); + this.model!.runner.run(value, Mode.PREVIEW, context); } private elementSelected(value: any, event?: any, preferredMode?: Mode): void { @@ -553,7 +558,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { const context: IEntryRunContext = { event, keymods: this.extractKeyMods(event), quickNavigateConfiguration: this.quickNavigateConfiguration }; - hide = this.model.runner.run(value, mode, context); + hide = this.model!.runner.run(value, mode, context); } // Hide if command was run successfully @@ -603,7 +608,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { if (types.isString(param)) { this.doShowWithPrefix(param); } else { - if (options.value) { + if (options && options.value) { this.restoreLastInput(options.value); } this.doShowWithInput(param, options && options.autoFocus ? options.autoFocus : {}); @@ -747,13 +752,13 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { // Indicate entries to tree this.tree.layout(); - const entries = input ? input.entries.filter(e => this.isElementVisible(input, e)) : []; + const entries = input ? input.entries!.filter(e => this.isElementVisible(input!, e)) : []; this.updateResultCount(entries.length); // Handle auto focus if (autoFocus) { if (entries.length) { - this.autoFocus(input, entries, autoFocus); + this.autoFocus(input!, entries, autoFocus); } } }); @@ -770,7 +775,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { let height = 0; - let preferredItemsHeight: number; + let preferredItemsHeight: number | undefined; if (this.layoutDimensions && this.layoutDimensions.height) { preferredItemsHeight = (this.layoutDimensions.height - 50 /* subtract height of input field (30px) and some spacing (drop shadow) to fit */) * 0.4 /* max 40% of screen */; } @@ -834,12 +839,12 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { } if (this.callbacks.onHide) { - this.callbacks.onHide(reason); + this.callbacks.onHide(reason!); } } getQuickNavigateConfiguration(): IQuickNavigateConfiguration { - return this.quickNavigateConfiguration; + return this.quickNavigateConfiguration!; } setPlaceHolder(placeHolder: string): void { diff --git a/src/vs/base/parts/quickopen/common/quickOpen.ts b/src/vs/base/parts/quickopen/common/quickOpen.ts index e6d87a0b0e7..a7b46b23c46 100644 --- a/src/vs/base/parts/quickopen/common/quickOpen.ts +++ b/src/vs/base/parts/quickopen/common/quickOpen.ts @@ -49,7 +49,7 @@ export const enum Mode { export interface IEntryRunContext { event: any; keymods: IKeyMods; - quickNavigateConfiguration: IQuickNavigateConfiguration; + quickNavigateConfiguration: IQuickNavigateConfiguration | undefined; } export interface IKeyMods { From bd8486b1c5fe83509bb8bf7fc4ceeb1981193748 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Mon, 4 Feb 2019 15:38:34 +0100 Subject: [PATCH 295/429] properly initialise rendering data for multi-thread case; fixes #67791 --- .../parts/debug/electron-browser/callStackView.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts index 91e17036d60..4be39474958 100644 --- a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts +++ b/src/vs/workbench/parts/debug/electron-browser/callStackView.ts @@ -398,13 +398,13 @@ class ThreadsRenderer implements ITreeRenderer, index: number, data: IThreadTemplateData): void { @@ -483,7 +483,7 @@ class ErrorsRenderer implements ITreeRenderer Date: Mon, 4 Feb 2019 15:43:57 +0100 Subject: [PATCH 296/429] Extensions view broken (fixes #67843) --- src/vs/platform/list/browser/listService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index d49a2602d96..0966123e57d 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -359,17 +359,18 @@ export class WorkbenchPagedList extends PagedList { @IKeybindingService keybindingService: IKeybindingService ) { const horizontalScrolling = typeof options.horizontalScrolling !== 'undefined' ? options.horizontalScrolling : configurationService.getValue(horizontalScrollingKey); + const [workbenchListOptions, workbenchListOptionsDisposable] = toWorkbenchListOptions(options, configurationService, keybindingService); super(container, delegate, renderers, { keyboardSupport: false, styleController: new DefaultStyleController(getSharedListStyleSheet()), ...computeStyles(themeService.getTheme(), defaultListStyles), - ...toWorkbenchListOptions(options, configurationService, keybindingService), + ...workbenchListOptions, horizontalScrolling } as IListOptions ); - this.disposables = []; + this.disposables = [workbenchListOptionsDisposable]; this.contextKeyService = createScopedContextKeyService(contextKeyService, this); this.configurationService = configurationService; From b46c77b7ad2048edf14db1d4e83678c2119af67a Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Mon, 4 Feb 2019 15:45:08 +0100 Subject: [PATCH 297/429] Treat Composer lock files as JSON by default. Fixes #67859. --- extensions/json/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/json/package.json b/extensions/json/package.json index 517346cd347..0ee9501609f 100644 --- a/extensions/json/package.json +++ b/extensions/json/package.json @@ -29,6 +29,7 @@ ".css.map" ], "filenames": [ + "composer.lock", ".watchmanconfig", ".ember-cli" ], From 9af78e6fd8472a8006552ccd83551692f1b6ed1c Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Mon, 4 Feb 2019 15:58:17 +0100 Subject: [PATCH 298/429] fixes #67860 --- src/vs/base/browser/ui/tree/asyncDataTree.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/base/browser/ui/tree/asyncDataTree.ts b/src/vs/base/browser/ui/tree/asyncDataTree.ts index 3890deafa57..98c194d5e6d 100644 --- a/src/vs/base/browser/ui/tree/asyncDataTree.ts +++ b/src/vs/base/browser/ui/tree/asyncDataTree.ts @@ -412,8 +412,8 @@ export class AsyncDataTree implements IDisposable await this.refreshAndRenderNode(this.getDataNode(element), recursive, ChildrenResolutionReason.Refresh, viewStateContext); } - hasNode(element: T): boolean { - return this.nodes.has(element); + hasNode(element: TInput | T): boolean { + return element === this.root.element || this.nodes.has(element as T); } // View From 5830f6857c9215dd82739bcae377aecf7cac6d05 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 4 Feb 2019 16:05:18 +0100 Subject: [PATCH 299/429] auto select theme under development (fixes #62582) --- .../themes/electron-browser/colorThemeStore.ts | 14 ++++++++++++-- .../electron-browser/fileIconThemeStore.ts | 9 +++++++++ .../electron-browser/workbenchThemeService.ts | 16 ++++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts index 0b724501115..20732b19d53 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts @@ -8,7 +8,7 @@ import * as nls from 'vs/nls'; import * as types from 'vs/base/common/types'; import * as resources from 'vs/base/common/resources'; import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -import { IColorTheme, ExtensionData, IThemeExtensionPoint, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService'; +import { ExtensionData, IThemeExtensionPoint, VS_LIGHT_THEME, VS_DARK_THEME, VS_HC_THEME } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { ColorThemeData } from 'vs/workbench/services/themes/electron-browser/colorThemeData'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { Event, Emitter } from 'vs/base/common/event'; @@ -155,7 +155,17 @@ export class ColorThemeStore { }); } - public getColorThemes(): Promise { + public findThemeDataByParentLocation(parentLocation: URI): Promise { + if (parentLocation) { + return this.getColorThemes().then(allThemes => { + return allThemes.filter(t => t.location && resources.isEqualOrParent(t.location, parentLocation)); + }); + } + return Promise.resolve([]); + + } + + public getColorThemes(): Promise { return this.extensionService.whenInstalledExtensionsRegistered().then(_ => { return this.extensionsColorThemes; }); diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts index 437387c81f4..147c0361aad 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts @@ -154,6 +154,15 @@ export class FileIconThemeStore { }); } + public findThemeDataByParentLocation(parentLocation: URI): any { + if (parentLocation) { + return this.getFileIconThemes().then(allThemes => { + return allThemes.filter(t => t.location && resources.isEqualOrParent(t.location, parentLocation)); + }); + } + return Promise.resolve([]); + } + public getFileIconThemes(): Promise { return this.extensionService.whenInstalledExtensionsRegistered().then(isReady => { return this.knownIconThemes; diff --git a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts index e0d5b16bf91..8413a65817a 100644 --- a/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/workbenchThemeService.ts @@ -257,10 +257,22 @@ export class WorkbenchThemeService implements IWorkbenchThemeService { return Promise.all([ this.colorThemeStore.findThemeDataBySettingsId(colorThemeSetting, DEFAULT_THEME_ID).then(theme => { - return this.setColorTheme(theme && theme.id, undefined); + return this.colorThemeStore.findThemeDataByParentLocation(this.environmentService.extensionDevelopmentLocationURI).then(devThemes => { + if (devThemes.length) { + return this.setColorTheme(devThemes[0].id, ConfigurationTarget.MEMORY); + } else { + return this.setColorTheme(theme && theme.id, undefined); + } + }); }), this.iconThemeStore.findThemeBySettingsId(iconThemeSetting).then(theme => { - return this.setFileIconTheme(theme && theme.id, undefined); + return this.iconThemeStore.findThemeDataByParentLocation(this.environmentService.extensionDevelopmentLocationURI).then(devThemes => { + if (devThemes.length) { + return this.setFileIconTheme(devThemes[0].id, ConfigurationTarget.MEMORY); + } else { + return this.setFileIconTheme(theme && theme.id, undefined); + } + }); }), ]); } From 0280160bd2176ca40e26878e30c48bf0a4695830 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 16:04:15 +0100 Subject: [PATCH 300/429] More simplifications to extensions gulp tasks (#67863) --- build/gulpfile.extensions.js | 41 ++++++++++++++++++------------------ build/lib/util.js | 25 +++++++++++++++------- build/lib/util.ts | 21 ++++++++++++------ 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 1d0ac3da216..d4b8ed03796 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -11,7 +11,6 @@ const path = require('path'); const tsb = require('gulp-tsb'); const es = require('event-stream'); const filter = require('gulp-filter'); -const rimraf = require('rimraf'); const util = require('./lib/util'); const watcher = require('./lib/watch'); const createReporter = require('./lib/reporter').createReporter; @@ -43,12 +42,6 @@ const tasks = compilations.map(function (tsconfigFile) { const name = relativeDirname.replace(/\//g, '-'); - // Tasks - const clean = 'clean-extension:' + name; - const compile = 'compile-extension:' + name; - const watch = 'watch-extension:' + name; - const compileBuild = 'compile-extension-build:' + name; - const root = path.join('extensions', relativeDirname); const srcBase = path.join(root, 'src'); const src = path.join(srcBase, '**'); @@ -107,10 +100,9 @@ const tasks = compilations.map(function (tsconfigFile) { const srcOpts = { cwd: path.dirname(__dirname), base: srcBase }; - gulp.task(clean, cb => rimraf(out, cb)); const cleanTask = () => util.primraf(out); - gulp.task(compile, util.taskSeries(cleanTask, () => { + const compileTask = util.task.series(cleanTask, () => { const pipeline = createPipeline(false, true); const input = gulp.src(src, srcOpts); @@ -119,19 +111,21 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(pipeline()) .pipe(gulp.dest(out)) ); - })); + }); - gulp.task(watch, [clean], () => { + const watchTask = util.task.series(cleanTask, () => { const pipeline = createPipeline(false); const input = gulp.src(src, srcOpts); const watchInput = watcher(src, srcOpts); - return watchInput + return util.streamToPromise( + watchInput .pipe(util.incremental(pipeline, input)) - .pipe(gulp.dest(out)); + .pipe(gulp.dest(out)) + ); }); - gulp.task(compileBuild, util.taskSeries(cleanTask, () => { + const compileBuildTask = util.task.series(cleanTask, () => { const pipeline = createPipeline(true, true); const input = gulp.src(src, srcOpts); @@ -140,15 +134,20 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(pipeline()) .pipe(gulp.dest(out)) ); - })); + }); + + // Tasks + gulp.task('compile-extension:' + name, compileTask); + gulp.task('watch-extension:' + name, watchTask); + gulp.task('compile-extension-build:' + name, compileBuildTask); return { - compile: compile, - watch: watch, - compileBuild: compileBuild + compileTask: compileTask, + watchTask: watchTask, + compileBuildTask: compileBuildTask }; }); -gulp.task('compile-extensions', tasks.map(t => t.compile)); -gulp.task('watch-extensions', tasks.map(t => t.watch)); -gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild)); +gulp.task('compile-extensions', util.task.parallel(...tasks.map(t => t.compileTask))); +gulp.task('watch-extensions', util.task.parallel(...tasks.map(t => t.watchTask))); +gulp.task('compile-extensions-build', util.task.parallel(...tasks.map(t => t.compileBuildTask))); diff --git a/build/lib/util.js b/build/lib/util.js index a03adac0f37..fdb0f815e75 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -208,14 +208,23 @@ function streamToPromise(stream) { }); } exports.streamToPromise = streamToPromise; -function taskSeries(...tasks) { - return async () => { - for (let i = 0; i < tasks.length; i++) { - await tasks[i](); - } - }; -} -exports.taskSeries = taskSeries; +var task; +(function (task) { + function series(...tasks) { + return async () => { + for (let i = 0; i < tasks.length; i++) { + await tasks[i](); + } + }; + } + task.series = series; + function parallel(...tasks) { + return async () => { + await Promise.all(tasks.map(t => t())); + }; + } + task.parallel = parallel; +})(task = exports.task || (exports.task = {})); function getVersion(root) { let version = process.env['BUILD_SOURCEVERSION']; if (!version || !/^[0-9a-f]{40}$/i.test(version)) { diff --git a/build/lib/util.ts b/build/lib/util.ts index 918c2295b3b..b831c3e8ed2 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -263,12 +263,21 @@ export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise { } export type PromiseTask = () => Promise; -export function taskSeries(...tasks: PromiseTask[]): () => Promise { - return async () => { - for (let i = 0; i < tasks.length; i++) { - await tasks[i](); - } - }; + +export namespace task { + export function series(...tasks: PromiseTask[]): () => Promise { + return async () => { + for (let i = 0; i < tasks.length; i++) { + await tasks[i](); + } + }; + } + + export function parallel(...tasks: PromiseTask[]): () => Promise { + return async () => { + await Promise.all(tasks.map(t => t())); + }; + } } export function getVersion(root: string): string | undefined { From 8f95df52e132f47b20789d25d07dd3beffaef833 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 16:07:29 +0100 Subject: [PATCH 301/429] More simplifications (#67863) --- build/gulpfile.extensions.js | 1 - 1 file changed, 1 deletion(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index d4b8ed03796..150fe7723c0 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -139,7 +139,6 @@ const tasks = compilations.map(function (tsconfigFile) { // Tasks gulp.task('compile-extension:' + name, compileTask); gulp.task('watch-extension:' + name, watchTask); - gulp.task('compile-extension-build:' + name, compileBuildTask); return { compileTask: compileTask, From 6e968190dfa181ce897b853410e1490bb5b03919 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Mon, 4 Feb 2019 16:35:48 +0100 Subject: [PATCH 302/429] Update grammars --- extensions/bat/cgmanifest.json | 4 +- .../bat/syntaxes/batchfile.tmLanguage.json | 4 +- extensions/cpp/cgmanifest.json | 4 +- extensions/docker/cgmanifest.json | 2 +- extensions/fsharp/cgmanifest.json | 4 +- extensions/git/cgmanifest.json | 2 +- extensions/groovy/cgmanifest.json | 2 +- extensions/hlsl/cgmanifest.json | 2 +- extensions/html/cgmanifest.json | 2 +- extensions/html/syntaxes/html.tmLanguage.json | 56 ++++++++++++++++++- extensions/ini/cgmanifest.json | 2 +- extensions/java/cgmanifest.json | 2 +- extensions/java/syntaxes/java.tmLanguage.json | 41 +++++++++++++- .../syntaxes/JavaScript.tmLanguage.json | 23 +++++++- .../syntaxes/JavaScriptReact.tmLanguage.json | 23 +++++++- extensions/json/cgmanifest.json | 2 +- extensions/lua/cgmanifest.json | 2 +- extensions/perl/cgmanifest.json | 2 +- extensions/php/cgmanifest.json | 4 +- extensions/php/syntaxes/php.tmLanguage.json | 4 +- extensions/pug/cgmanifest.json | 2 +- extensions/ruby/cgmanifest.json | 2 +- extensions/shaderlab/cgmanifest.json | 2 +- extensions/typescript-basics/cgmanifest.json | 2 +- .../syntaxes/TypeScript.tmLanguage.json | 23 +++++++- .../syntaxes/TypeScriptReact.tmLanguage.json | 23 +++++++- extensions/vb/cgmanifest.json | 2 +- extensions/yaml/cgmanifest.json | 2 +- 28 files changed, 205 insertions(+), 40 deletions(-) diff --git a/extensions/bat/cgmanifest.json b/extensions/bat/cgmanifest.json index 1e21679d7b2..5bc3e285f0c 100644 --- a/extensions/bat/cgmanifest.json +++ b/extensions/bat/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "mmims/language-batchfile", "repositoryUrl": "https://github.com/mmims/language-batchfile", - "commitHash": "4b67596631b4ecd2c89c2ec1b2e08a6623438903" + "commitHash": "95ea8c699f7a8296b15767069868532d52631c46" } }, "license": "MIT", - "version": "0.7.4" + "version": "0.7.5" } ], "version": 1 diff --git a/extensions/bat/syntaxes/batchfile.tmLanguage.json b/extensions/bat/syntaxes/batchfile.tmLanguage.json index 26ae88f43c5..9eff3c9de2b 100644 --- a/extensions/bat/syntaxes/batchfile.tmLanguage.json +++ b/extensions/bat/syntaxes/batchfile.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/mmims/language-batchfile/commit/4b67596631b4ecd2c89c2ec1b2e08a6623438903", + "version": "https://github.com/mmims/language-batchfile/commit/95ea8c699f7a8296b15767069868532d52631c46", "name": "Batch File", "scopeName": "source.batchfile", "patterns": [ @@ -46,7 +46,7 @@ "commands": { "patterns": [ { - "match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)", + "match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|scp|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|ssh|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)", "name": "keyword.command.batchfile" }, { diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index e6666933f61..7bab26bfa11 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "atom/language-c", "repositoryUrl": "https://github.com/atom/language-c", - "commitHash": "9c0c5f202741a5647025db8d5df5fefba47b036c" + "commitHash": "3a269f88b12e512fb9495dc006a1dabf325d3d7f" } }, "license": "MIT", - "version": "0.58.1", + "version": "0.58.0", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { diff --git a/extensions/docker/cgmanifest.json b/extensions/docker/cgmanifest.json index 844d3120d3c..dbbf43607ee 100644 --- a/extensions/docker/cgmanifest.json +++ b/extensions/docker/cgmanifest.json @@ -15,4 +15,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/fsharp/cgmanifest.json b/extensions/fsharp/cgmanifest.json index df594e070bb..851e97ca639 100644 --- a/extensions/fsharp/cgmanifest.json +++ b/extensions/fsharp/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "ionide/ionide-fsgrammar", "repositoryUrl": "https://github.com/ionide/ionide-fsgrammar", - "commitHash": "24c1588529af144d205f66fbcec6889500f9aaa9" + "commitHash": "be0bdfd1e272b6633f5edf1429052fe9fa4df7c1" } }, "license": "MIT", @@ -15,4 +15,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/git/cgmanifest.json b/extensions/git/cgmanifest.json index a7e0b63aac3..8b62f6fbb0c 100644 --- a/extensions/git/cgmanifest.json +++ b/extensions/git/cgmanifest.json @@ -63,4 +63,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/groovy/cgmanifest.json b/extensions/groovy/cgmanifest.json index 07dec53a640..fc5a3ca9c12 100644 --- a/extensions/groovy/cgmanifest.json +++ b/extensions/groovy/cgmanifest.json @@ -29,4 +29,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/hlsl/cgmanifest.json b/extensions/hlsl/cgmanifest.json index 92137372cc0..44b3a016ee0 100644 --- a/extensions/hlsl/cgmanifest.json +++ b/extensions/hlsl/cgmanifest.json @@ -14,4 +14,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/html/cgmanifest.json b/extensions/html/cgmanifest.json index 7f3cc9396df..fb7007ddb31 100644 --- a/extensions/html/cgmanifest.json +++ b/extensions/html/cgmanifest.json @@ -29,4 +29,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/html/syntaxes/html.tmLanguage.json b/extensions/html/syntaxes/html.tmLanguage.json index a5ccfed6f36..a071d90a9e3 100644 --- a/extensions/html/syntaxes/html.tmLanguage.json +++ b/extensions/html/syntaxes/html.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/textmate/html.tmbundle/commit/390c8870273a2ae80244dae6db6ba064a802f407", + "version": "https://github.com/textmate/html.tmbundle/commit/0c3d5ee54de3a993f747f54186b73a4d2d3c44a2", "name": "HTML", "scopeName": "text.html.basic", "injections": { @@ -222,7 +222,32 @@ ] } }, - "match": "[^\\n\"]+" + "match": "([^\\n\"/]|/(?![/*]))+" + }, + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.js" + } + }, + "end": "(?=\")|\\n", + "name": "comment.line.double-slash.js" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.js" + } + }, + "end": "(?=\")|\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.js" + } + }, + "name": "comment.block.js" } ] }, @@ -255,7 +280,32 @@ ] } }, - "match": "[^\\n']+" + "match": "([^\\n'/]|/(?![/*]))+" + }, + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.js" + } + }, + "end": "(?=')|\\n", + "name": "comment.line.double-slash.js" + }, + { + "begin": "/\\*", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.begin.js" + } + }, + "end": "(?=')|\\*/", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.end.js" + } + }, + "name": "comment.block.js" } ] } diff --git a/extensions/ini/cgmanifest.json b/extensions/ini/cgmanifest.json index ef9fa28b58a..772dc25a3ac 100644 --- a/extensions/ini/cgmanifest.json +++ b/extensions/ini/cgmanifest.json @@ -29,4 +29,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/java/cgmanifest.json b/extensions/java/cgmanifest.json index ba162b137ab..c32ed3e218f 100644 --- a/extensions/java/cgmanifest.json +++ b/extensions/java/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "atom/language-java", "repositoryUrl": "https://github.com/atom/language-java", - "commitHash": "7c3d0d3e37920790cd3afb4e68830bdb215851a3" + "commitHash": "f6d349a5ca698be25d3f48511888fe62d158e42c" } }, "license": "MIT", diff --git a/extensions/java/syntaxes/java.tmLanguage.json b/extensions/java/syntaxes/java.tmLanguage.json index 650a82c63be..777330ec4ae 100644 --- a/extensions/java/syntaxes/java.tmLanguage.json +++ b/extensions/java/syntaxes/java.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/atom/language-java/commit/7c3d0d3e37920790cd3afb4e68830bdb215851a3", + "version": "https://github.com/atom/language-java/commit/f6d349a5ca698be25d3f48511888fe62d158e42c", "name": "Java", "scopeName": "source.java", "patterns": [ @@ -640,6 +640,42 @@ }, "name": "meta.enum.java", "patterns": [ + { + "begin": "\\b(extends)\\b", + "beginCaptures": { + "1": { + "name": "storage.modifier.extends.java" + } + }, + "end": "(?={|\\bimplements\\b)", + "name": "meta.definition.class.inherited.classes.java", + "patterns": [ + { + "include": "#object-types-inherited" + }, + { + "include": "#comments" + } + ] + }, + { + "begin": "\\b(implements)\\b", + "beginCaptures": { + "1": { + "name": "storage.modifier.implements.java" + } + }, + "end": "(?={|\\bextends\\b)", + "name": "meta.definition.class.implemented.interfaces.java", + "patterns": [ + { + "include": "#object-types-inherited" + }, + { + "include": "#comments" + } + ] + }, { "begin": "{", "beginCaptures": { @@ -1468,6 +1504,9 @@ { "include": "#comments" }, + { + "include": "#storage-modifiers" + }, { "match": "\\|", "name": "punctuation.catch.separator.java" diff --git a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json index 5d6df3a855e..fd84aa1a024 100644 --- a/extensions/javascript/syntaxes/JavaScript.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScript.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/444971648e9e1e41c54c62f41d1310f2816965c4", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/a42e5cbe14945ccc0493f62b1e2d63eddcdaa6f6", "name": "JavaScript (with React support)", "scopeName": "source.js", "patterns": [ @@ -1581,7 +1581,7 @@ "include": "#parameter-name" }, { - "include": "#type-annotation" + "include": "#parameter-type-annotation" }, { "include": "#variable-initializer" @@ -3579,6 +3579,25 @@ } ] }, + "parameter-type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.js", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js" + } + }, + "end": "(?=[,)])|(?==[^>])", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, "return-type": { "patterns": [ { diff --git a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json b/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json index aaa5d8ceaba..3810070af9c 100644 --- a/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json +++ b/extensions/javascript/syntaxes/JavaScriptReact.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/444971648e9e1e41c54c62f41d1310f2816965c4", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/a42e5cbe14945ccc0493f62b1e2d63eddcdaa6f6", "name": "JavaScript (with React support)", "scopeName": "source.js.jsx", "patterns": [ @@ -1581,7 +1581,7 @@ "include": "#parameter-name" }, { - "include": "#type-annotation" + "include": "#parameter-type-annotation" }, { "include": "#variable-initializer" @@ -3579,6 +3579,25 @@ } ] }, + "parameter-type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.js.jsx", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.js.jsx" + } + }, + "end": "(?=[,)])|(?==[^>])", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, "return-type": { "patterns": [ { diff --git a/extensions/json/cgmanifest.json b/extensions/json/cgmanifest.json index d0b23b7e064..fabb7a93aba 100644 --- a/extensions/json/cgmanifest.json +++ b/extensions/json/cgmanifest.json @@ -14,4 +14,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/lua/cgmanifest.json b/extensions/lua/cgmanifest.json index 78d8538bf08..6cefc1ca59e 100644 --- a/extensions/lua/cgmanifest.json +++ b/extensions/lua/cgmanifest.json @@ -29,4 +29,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/perl/cgmanifest.json b/extensions/perl/cgmanifest.json index 6338921e75f..83d91107671 100644 --- a/extensions/perl/cgmanifest.json +++ b/extensions/perl/cgmanifest.json @@ -30,4 +30,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/php/cgmanifest.json b/extensions/php/cgmanifest.json index 3bbbd67fcaf..01cdb6b1761 100644 --- a/extensions/php/cgmanifest.json +++ b/extensions/php/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "language-php", "repositoryUrl": "https://github.com/atom/language-php", - "commitHash": "13842b6dfb4568f76e8fa0c08dbff74347ee13c6" + "commitHash": "b6c5e83016b52311cdc622c2579462861ee91587" } }, "license": "MIT", - "version": "0.43.2" + "version": "0.44.0" } ], "version": 1 diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index 62153a2b04b..bb4c134fbfc 100644 --- a/extensions/php/syntaxes/php.tmLanguage.json +++ b/extensions/php/syntaxes/php.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/atom/language-php/commit/13842b6dfb4568f76e8fa0c08dbff74347ee13c6", + "version": "https://github.com/atom/language-php/commit/b896ebfb6f669b8714f419527f047466420efe5c", "scopeName": "source.php", "patterns": [ { @@ -2696,7 +2696,7 @@ "name": "support.function.com.php" }, { - "begin": "(?i)\\b(isset|unset|eval|empty|list)\\b", + "match": "(?i)\\b(isset|unset|eval|empty|list)\\b", "name": "support.function.construct.php" }, { diff --git a/extensions/pug/cgmanifest.json b/extensions/pug/cgmanifest.json index cdfc2ded989..e7bd7bccc09 100644 --- a/extensions/pug/cgmanifest.json +++ b/extensions/pug/cgmanifest.json @@ -15,4 +15,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/ruby/cgmanifest.json b/extensions/ruby/cgmanifest.json index dd4b29e5184..ffbbb7b71c6 100644 --- a/extensions/ruby/cgmanifest.json +++ b/extensions/ruby/cgmanifest.json @@ -29,4 +29,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/shaderlab/cgmanifest.json b/extensions/shaderlab/cgmanifest.json index 3558286bc04..2dd540dc872 100644 --- a/extensions/shaderlab/cgmanifest.json +++ b/extensions/shaderlab/cgmanifest.json @@ -14,4 +14,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/typescript-basics/cgmanifest.json b/extensions/typescript-basics/cgmanifest.json index e604d6ec27b..2fbc739c7b5 100644 --- a/extensions/typescript-basics/cgmanifest.json +++ b/extensions/typescript-basics/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "TypeScript-TmLanguage", "repositoryUrl": "https://github.com/Microsoft/TypeScript-TmLanguage", - "commitHash": "444971648e9e1e41c54c62f41d1310f2816965c4" + "commitHash": "a42e5cbe14945ccc0493f62b1e2d63eddcdaa6f6" } }, "license": "MIT", diff --git a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json index 455f0756a72..b9dda5a5191 100644 --- a/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScript.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/444971648e9e1e41c54c62f41d1310f2816965c4", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/a42e5cbe14945ccc0493f62b1e2d63eddcdaa6f6", "name": "TypeScript", "scopeName": "source.ts", "patterns": [ @@ -1578,7 +1578,7 @@ "include": "#parameter-name" }, { - "include": "#type-annotation" + "include": "#parameter-type-annotation" }, { "include": "#variable-initializer" @@ -3628,6 +3628,25 @@ } ] }, + "parameter-type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.ts", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.ts" + } + }, + "end": "(?=[,)])|(?==[^>])", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, "return-type": { "patterns": [ { diff --git a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json b/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json index ded8400a283..76c725eccc8 100644 --- a/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json +++ b/extensions/typescript-basics/syntaxes/TypeScriptReact.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/444971648e9e1e41c54c62f41d1310f2816965c4", + "version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/a42e5cbe14945ccc0493f62b1e2d63eddcdaa6f6", "name": "TypeScriptReact", "scopeName": "source.tsx", "patterns": [ @@ -1581,7 +1581,7 @@ "include": "#parameter-name" }, { - "include": "#type-annotation" + "include": "#parameter-type-annotation" }, { "include": "#variable-initializer" @@ -3579,6 +3579,25 @@ } ] }, + "parameter-type-annotation": { + "patterns": [ + { + "name": "meta.type.annotation.tsx", + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "keyword.operator.type.annotation.tsx" + } + }, + "end": "(?=[,)])|(?==[^>])", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, "return-type": { "patterns": [ { diff --git a/extensions/vb/cgmanifest.json b/extensions/vb/cgmanifest.json index 4cb7d33e04b..23523f36abb 100644 --- a/extensions/vb/cgmanifest.json +++ b/extensions/vb/cgmanifest.json @@ -29,4 +29,4 @@ } ], "version": 1 -} +} \ No newline at end of file diff --git a/extensions/yaml/cgmanifest.json b/extensions/yaml/cgmanifest.json index 80ba8ae522c..e6c3ca158b5 100644 --- a/extensions/yaml/cgmanifest.json +++ b/extensions/yaml/cgmanifest.json @@ -34,4 +34,4 @@ } ], "version": 1 -} +} \ No newline at end of file From e6d41395d9296eb68c985028ea4f7dff35e01574 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Mon, 4 Feb 2019 16:37:40 +0100 Subject: [PATCH 303/429] fix null checks --- .../services/themes/electron-browser/colorThemeStore.ts | 2 +- .../services/themes/electron-browser/fileIconThemeStore.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts index 20732b19d53..7955ba6b932 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeStore.ts @@ -155,7 +155,7 @@ export class ColorThemeStore { }); } - public findThemeDataByParentLocation(parentLocation: URI): Promise { + public findThemeDataByParentLocation(parentLocation: URI | undefined): Promise { if (parentLocation) { return this.getColorThemes().then(allThemes => { return allThemes.filter(t => t.location && resources.isEqualOrParent(t.location, parentLocation)); diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts index 147c0361aad..aed1e0de01d 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts +++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts @@ -154,7 +154,7 @@ export class FileIconThemeStore { }); } - public findThemeDataByParentLocation(parentLocation: URI): any { + public findThemeDataByParentLocation(parentLocation: URI | undefined): any { if (parentLocation) { return this.getFileIconThemes().then(allThemes => { return allThemes.filter(t => t.location && resources.isEqualOrParent(t.location, parentLocation)); From 4676da4595f6fdeb5e388231dc8d726aad7556f5 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 16:57:39 +0100 Subject: [PATCH 304/429] More gulp clean task simiplifications (#67863) --- build/gulpfile.extensions.js | 18 ++++------- build/gulpfile.vscode.linux.js | 37 ++++++++--------------- build/gulpfile.vscode.win32.js | 4 +-- build/lib/util.js | 48 +++++++++++++++++++---------- build/lib/util.ts | 55 +++++++++++++++++++++++++--------- 5 files changed, 94 insertions(+), 68 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 150fe7723c0..64d5c213cc6 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -106,11 +106,9 @@ const tasks = compilations.map(function (tsconfigFile) { const pipeline = createPipeline(false, true); const input = gulp.src(src, srcOpts); - return util.streamToPromise( - input + return input .pipe(pipeline()) - .pipe(gulp.dest(out)) - ); + .pipe(gulp.dest(out)); }); const watchTask = util.task.series(cleanTask, () => { @@ -118,22 +116,18 @@ const tasks = compilations.map(function (tsconfigFile) { const input = gulp.src(src, srcOpts); const watchInput = watcher(src, srcOpts); - return util.streamToPromise( - watchInput + return watchInput .pipe(util.incremental(pipeline, input)) - .pipe(gulp.dest(out)) - ); + .pipe(gulp.dest(out)); }); const compileBuildTask = util.task.series(cleanTask, () => { const pipeline = createPipeline(true, true); const input = gulp.src(src, srcOpts); - return util.streamToPromise( - input + return input .pipe(pipeline()) - .pipe(gulp.dest(out)) - ); + .pipe(gulp.dest(out)); }); // Tasks diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index bddba8fe524..6728a0ce640 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -229,41 +229,28 @@ function buildSnapPackage(arch) { return shell.task(`cd ${snapBuildPath} && snapcraft build`); } -gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386')); -gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64')); -gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf')); -gulp.task('clean-vscode-linux-arm64-deb', util.rimraf('.build/linux/deb/arm64')); -gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386')); -gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64')); -gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf')); -gulp.task('clean-vscode-linux-arm64-rpm', util.rimraf('.build/linux/rpm/arm64')); -gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64')); -gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64')); -gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64')); -gulp.task('clean-vscode-linux-arm64-snap', util.rimraf('.build/linux/snap/x64')); - -gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32')); -gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64')); -gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm')); -gulp.task('vscode-linux-arm64-prepare-deb', ['clean-vscode-linux-arm64-deb'], prepareDebPackage('arm64')); +gulp.task('vscode-linux-ia32-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/i386'), prepareDebPackage('ia32'))); +gulp.task('vscode-linux-x64-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/amd64'), prepareDebPackage('x64'))); +gulp.task('vscode-linux-arm-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/armhf'), prepareDebPackage('arm'))); +gulp.task('vscode-linux-arm64-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/arm64'), prepareDebPackage('arm64'))); gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32')); gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64')); gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm')); gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64')); -gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32')); -gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64')); -gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm')); -gulp.task('vscode-linux-arm64-prepare-rpm', ['clean-vscode-linux-arm64-rpm'], prepareRpmPackage('arm64')); +gulp.task('vscode-linux-ia32-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/i386'), prepareRpmPackage('ia32'))); +gulp.task('vscode-linux-x64-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/x86_64'), prepareRpmPackage('x64'))); +gulp.task('vscode-linux-arm-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/armhf'), prepareRpmPackage('arm'))); +gulp.task('vscode-linux-arm64-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/arm64'), prepareRpmPackage('arm64'))); gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32')); gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64')); gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm')); gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64')); -gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32')); -gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64')); -gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm')); -gulp.task('vscode-linux-arm64-prepare-snap', ['clean-vscode-linux-arm64-snap'], prepareSnapPackage('arm64')); +gulp.task('vscode-linux-ia32-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('ia32'))); +gulp.task('vscode-linux-x64-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('x64'))); +gulp.task('vscode-linux-arm-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('arm'))); +gulp.task('vscode-linux-arm64-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('arm64'))); gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32')); gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64')); gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm')); diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index 1cfc5b4c4f7..7973743d77d 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -105,8 +105,8 @@ function buildWin32Setup(arch, target) { } function defineWin32SetupTasks(arch, target) { - gulp.task(`clean-vscode-win32-${arch}-${target}-setup`, util.rimraf(setupDir(arch, target))); - gulp.task(`vscode-win32-${arch}-${target}-setup`, [`clean-vscode-win32-${arch}-${target}-setup`], buildWin32Setup(arch, target)); + const cleanTask = () => util.primraf(setupDir(arch, target)); + gulp.task(`vscode-win32-${arch}-${target}-setup`, util.task.series(cleanTask, buildWin32Setup(arch, target))); } defineWin32SetupTasks('ia32', 'system'); diff --git a/build/lib/util.js b/build/lib/util.js index fdb0f815e75..90b1e622cb1 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -198,32 +198,50 @@ function primraf(dir) { }); } exports.primraf = primraf; -/** - * Convert a stream to a promise. - */ -function streamToPromise(stream) { - return new Promise((resolve, reject) => { - stream.on('end', _ => resolve()); - stream.on('error', err => reject(err)); - }); -} -exports.streamToPromise = streamToPromise; var task; -(function (task) { +(function (task_1) { + function _isPromise(p) { + if (typeof p.then === 'function') { + return true; + } + return false; + } + async function _execute(task) { + // Always invoke as if it were a callback task + return new Promise((resolve, reject) => { + const taskResult = task((err) => { + if (err) { + return reject(err); + } + resolve(); + }); + if (typeof taskResult === 'undefined') { + // this was a callback task + return; + } + if (_isPromise(taskResult)) { + // this was a promise returning task + taskResult.then(resolve, reject); + return; + } + taskResult.on('end', _ => resolve()); + taskResult.on('error', err => reject(err)); + }); + } function series(...tasks) { return async () => { for (let i = 0; i < tasks.length; i++) { - await tasks[i](); + await _execute(tasks[i]); } }; } - task.series = series; + task_1.series = series; function parallel(...tasks) { return async () => { - await Promise.all(tasks.map(t => t())); + await Promise.all(tasks.map(t => _execute(t))); }; } - task.parallel = parallel; + task_1.parallel = parallel; })(task = exports.task || (exports.task = {})); function getVersion(root) { let version = process.env['BUILD_SOURCEVERSION']; diff --git a/build/lib/util.ts b/build/lib/util.ts index b831c3e8ed2..e0d56b59e77 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -252,30 +252,57 @@ export function primraf(dir: string): Promise { }); } -/** - * Convert a stream to a promise. - */ -export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise { - return new Promise((resolve, reject) => { - stream.on('end', _ => resolve()); - stream.on('error', err => reject(err)); - }); -} - export type PromiseTask = () => Promise; +export type StreamTask = () => NodeJS.ReadWriteStream; +export type CallbackTask = (cb: (err?: any) => void) => void; +export type Task = PromiseTask | StreamTask | CallbackTask; export namespace task { - export function series(...tasks: PromiseTask[]): () => Promise { + + function _isPromise(p: Promise | NodeJS.ReadWriteStream): p is Promise { + if (typeof (p).then === 'function') { + return true; + } + return false; + } + + async function _execute(task: Task): Promise { + // Always invoke as if it were a callback task + return new Promise((resolve, reject) => { + const taskResult = task((err) => { + if (err) { + return reject(err); + } + resolve(); + }); + + if (typeof taskResult === 'undefined') { + // this was a callback task + return; + } + + if (_isPromise(taskResult)) { + // this was a promise returning task + taskResult.then(resolve, reject); + return; + } + + taskResult.on('end', _ => resolve()); + taskResult.on('error', err => reject(err)); + }); + } + + export function series(...tasks: Task[]): () => Promise { return async () => { for (let i = 0; i < tasks.length; i++) { - await tasks[i](); + await _execute(tasks[i]); } }; } - export function parallel(...tasks: PromiseTask[]): () => Promise { + export function parallel(...tasks: Task[]): () => Promise { return async () => { - await Promise.all(tasks.map(t => t())); + await Promise.all(tasks.map(t => _execute(t))); }; } } From cf19bcf86258da66130a028f4c8d987c6d8a143c Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 17:34:12 +0100 Subject: [PATCH 305/429] More task simplifications (#67863) --- build/gulpfile.editor.js | 5 ++--- build/gulpfile.vscode.js | 11 +++++------ build/gulpfile.vscode.win32.js | 7 ++----- gulpfile.js | 8 +++----- 4 files changed, 12 insertions(+), 19 deletions(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 3fc992bd9c4..e9bb8cddf52 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -63,8 +63,7 @@ var BUNDLED_FILE_HEADER = [ const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []); -gulp.task('clean-editor-src', util.rimraf('out-editor-src')); -gulp.task('extract-editor-src', ['clean-editor-src'], function () { +gulp.task('extract-editor-src', util.task.series(util.rimraf('out-editor-src'), function () { console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`); const apiusages = monacoapi.execute().usageContent; const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString(); @@ -99,7 +98,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () { importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/, destRoot: path.join(root, 'out-editor-src') }); -}); +})); // Full compile, including nls and inline sources in sourcemaps, for build gulp.task('clean-editor-build', util.rimraf('out-editor-build')); diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 0bf3c4a38d9..e81b0925f64 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -197,12 +197,11 @@ function getElectron(arch) { }; } -gulp.task('clean-electron', util.rimraf('.build/electron')); -gulp.task('electron', ['clean-electron'], getElectron(process.arch)); -gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32')); -gulp.task('electron-x64', ['clean-electron'], getElectron('x64')); -gulp.task('electron-arm', ['clean-electron'], getElectron('arm')); -gulp.task('electron-arm64', ['clean-electron'], getElectron('arm64')); +gulp.task('electron', util.task.series(util.rimraf('.build/electron'), getElectron(process.arch))); +gulp.task('electron-ia32', util.task.series(util.rimraf('.build/electron'), getElectron('ia32'))); +gulp.task('electron-x64', util.task.series(util.rimraf('.build/electron'), getElectron('x64'))); +gulp.task('electron-arm', util.task.series(util.rimraf('.build/electron'), getElectron('arm'))); +gulp.task('electron-arm64', util.task.series(util.rimraf('.build/electron'), getElectron('arm64'))); /** diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index 7973743d77d..3b3a21c1b69 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -124,11 +124,8 @@ function archiveWin32Setup(arch) { }; } -gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32'))); -gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32')); - -gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64'))); -gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64')); +gulp.task('vscode-win32-ia32-archive', util.task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))); +gulp.task('vscode-win32-x64-archive', util.task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('x64'))); function copyInnoUpdater(arch) { return () => { diff --git a/gulpfile.js b/gulpfile.js index 882d7f84147..71e1618ae43 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,13 +14,11 @@ const path = require('path'); const compilation = require('./build/lib/compilation'); // Fast compile for development time -gulp.task('clean-client', util.rimraf('out')); -gulp.task('compile-client', ['clean-client'], compilation.compileTask('src', 'out', false)); -gulp.task('watch-client', ['clean-client'], compilation.watchTask('out', false)); +gulp.task('compile-client', util.task.series(util.rimraf('out'), compilation.compileTask('src', 'out', false))); +gulp.task('watch-client', util.task.series(util.rimraf('out'), compilation.watchTask('out', false))); // Full compile, including nls and inline sources in sourcemaps, for build -gulp.task('clean-client-build', util.rimraf('out-build')); -gulp.task('compile-client-build', ['clean-client-build'], compilation.compileTask('src', 'out-build', true)); +gulp.task('compile-client-build', util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true))); // Default gulp.task('default', ['compile']); From c0c719c6511d15160dd5d20b175f954f34bcc76e Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 18:06:23 +0100 Subject: [PATCH 306/429] More gulp task work (#67863) --- build/gulpfile.extensions.js | 2 +- build/gulpfile.vscode.js | 32 +++++++++++++++++++++----------- build/lib/util.ts | 4 ++-- gulpfile.js | 6 ------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 64d5c213cc6..46fc1940bd5 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -143,4 +143,4 @@ const tasks = compilations.map(function (tsconfigFile) { gulp.task('compile-extensions', util.task.parallel(...tasks.map(t => t.compileTask))); gulp.task('watch-extensions', util.task.parallel(...tasks.map(t => t.watchTask))); -gulp.task('compile-extensions-build', util.task.parallel(...tasks.map(t => t.compileBuildTask))); +exports.compileExtensionsBuildTask = util.task.parallel(...tasks.map(t => t.compileBuildTask)); diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index e81b0925f64..dde330fb9ea 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -33,6 +33,8 @@ const deps = require('./dependencies'); const getElectronVersion = require('./lib/electron').getElectronVersion; const createAsar = require('./lib/asar').createAsar; const minimist = require('minimist'); +const compilation = require('./lib/compilation'); +const { compileExtensionsBuildTask } = require('./gulpfile.extensions'); const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname)); // @ts-ignore @@ -86,17 +88,25 @@ const BUNDLED_FILE_HEADER = [ ' *--------------------------------------------------------*/' ].join('\n'); -gulp.task('clean-optimized-vscode', util.rimraf('out-vscode')); -gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({ - src: 'out-build', - entryPoints: vscodeEntryPoints, - otherSources: [], - resources: vscodeResources, - loaderConfig: common.loaderConfig(nodeModules), - header: BUNDLED_FILE_HEADER, - out: 'out-vscode', - bundleInfo: undefined -})); +// Full compile, including nls and inline sources in sourcemaps, for build +const compileClientBuildTask = util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)); + +// All Build +const compileBuildTask = util.task.parallel(compileClientBuildTask, compileExtensionsBuildTask); + +gulp.task('optimize-vscode', util.task.series( + util.task.parallel(util.rimraf('out-vscode'), compileBuildTask), + common.optimizeTask({ + src: 'out-build', + entryPoints: vscodeEntryPoints, + otherSources: [], + resources: vscodeResources, + loaderConfig: common.loaderConfig(nodeModules), + header: BUNDLED_FILE_HEADER, + out: 'out-vscode', + bundleInfo: undefined + })) +); gulp.task('optimize-index-js', ['optimize-vscode'], () => { diff --git a/build/lib/util.ts b/build/lib/util.ts index e0d56b59e77..4ff07196612 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -292,7 +292,7 @@ export namespace task { }); } - export function series(...tasks: Task[]): () => Promise { + export function series(...tasks: Task[]): PromiseTask { return async () => { for (let i = 0; i < tasks.length; i++) { await _execute(tasks[i]); @@ -300,7 +300,7 @@ export namespace task { }; } - export function parallel(...tasks: Task[]): () => Promise { + export function parallel(...tasks: Task[]): PromiseTask { return async () => { await Promise.all(tasks.map(t => _execute(t))); }; diff --git a/gulpfile.js b/gulpfile.js index 71e1618ae43..0f3fc9cc72c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,9 +17,6 @@ const compilation = require('./build/lib/compilation'); gulp.task('compile-client', util.task.series(util.rimraf('out'), compilation.compileTask('src', 'out', false))); gulp.task('watch-client', util.task.series(util.rimraf('out'), compilation.watchTask('out', false))); -// Full compile, including nls and inline sources in sourcemaps, for build -gulp.task('compile-client-build', util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true))); - // Default gulp.task('default', ['compile']); @@ -27,9 +24,6 @@ gulp.task('default', ['compile']); gulp.task('compile', ['monaco-typecheck', 'compile-client', 'compile-extensions']); gulp.task('watch', [/* 'monaco-typecheck-watch', */ 'watch-client', 'watch-extensions']); -// All Build -gulp.task('compile-build', ['compile-client-build', 'compile-extensions-build']); - process.on('unhandledRejection', (reason, p) => { console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); process.exit(1); From ca550379b9083aecfba3dbfb481e29cb98a00266 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Mon, 4 Feb 2019 09:24:11 -0800 Subject: [PATCH 307/429] Add dimensions APIs to terminal renderer --- src/vs/vscode.proposed.d.ts | 28 ++++++++++++++++++- src/vs/workbench/api/node/extHost.api.impl.ts | 4 +-- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index e8d0f99c563..315b263c9f5 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -888,13 +888,39 @@ declare module 'vscode' { //#region Terminal + /** + * An [event](#Event) which fires when a [Terminal](#Terminal)'s dimensions change. + */ + export interface TerminalDimensionsChangeEvent { + /** + * The [terminal](#Terminal) for which the dimensions have changed. + */ + readonly terminal: Terminal; + /** + * The new value for the [terminal's dimensions](#Terminal.dimensions). + */ + readonly dimensions: TerminalDimensions; + } + + namespace window { + /** + * An event which fires when the [dimensions](#Terminal.dimensions) of the terminal change. + */ + export const onDidChangeTerminalDimensions: Event; + } + export interface Terminal { + /** + * The current dimensions of the terminal. + */ + readonly dimensions: TerminalDimensions; + /** * Fires when the terminal's pty slave pseudo-device is written to. In other words, this * provides access to the raw data stream from the process running within the terminal, * including VT sequences. */ - onDidWriteData: Event; + readonly onDidWriteData: Event; } /** diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 59ecf348f91..f6d2526d4b4 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -479,9 +479,9 @@ export function createApiFactory( } return extHostTerminalService.createTerminal(nameOrOptions, shellPath, shellArgs); }, - createTerminalRenderer: proposedApiFunction(extension, (name: string) => { + createTerminalRenderer(name: string): vscode.TerminalRenderer { return extHostTerminalService.createTerminalRenderer(name); - }), + }, registerTreeDataProvider(viewId: string, treeDataProvider: vscode.TreeDataProvider): vscode.Disposable { return extHostTreeViews.registerTreeDataProvider(viewId, treeDataProvider, extension); }, From 70f3ce5de193d6bf1c6ed15b1f28eb7a3f076eac Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 4 Feb 2019 18:59:33 +0000 Subject: [PATCH 308/429] Fix #67605 - add new drag/drop to search tree --- .../parts/search/browser/searchResultsView.ts | 50 ++++++++++++++++++- .../parts/search/browser/searchView.ts | 5 +- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index 18a8d159b78..de850b8c323 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -8,7 +8,7 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { ITreeNode, ITreeRenderer } from 'vs/base/browser/ui/tree/tree'; +import { ITreeNode, ITreeRenderer, ITreeDragAndDrop, ITreeDragOverReaction } from 'vs/base/browser/ui/tree/tree'; import { IAction } from 'vs/base/common/actions'; import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import * as paths from 'vs/base/common/paths'; @@ -26,6 +26,10 @@ import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels'; import { RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction } from 'vs/workbench/parts/search/browser/searchActions'; import { SearchView } from 'vs/workbench/parts/search/browser/searchView'; import { FileMatch, FolderMatch, Match, RenderableMatch, SearchModel, BaseFolderMatch } from 'vs/workbench/parts/search/common/searchModel'; +import { IDragAndDropData } from 'vs/base/browser/dnd'; +import { fillResourceDataTransfers } from 'vs/workbench/browser/dnd'; +import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; +import { URI } from 'vs/base/common/uri'; interface IFolderMatchTemplate { label: IResourceLabel; @@ -333,3 +337,47 @@ export class SearchAccessibilityProvider implements IAccessibilityProvider { + constructor( + @IInstantiationService private instantiationService: IInstantiationService + ) { } + + onDragOver(data: IDragAndDropData, targetElement: RenderableMatch, targetIndex: number, originalEvent: DragEvent): boolean | ITreeDragOverReaction { + return false; + } + + getDragURI(element: RenderableMatch): string | null { + if (element instanceof FileMatch) { + return element.remove.toString(); + } + + return null; + } + + getDragLabel?(elements: RenderableMatch[]): string | undefined { + if (elements.length > 1) { + return String(elements.length); + } + + const element = elements[0]; + return element instanceof FileMatch ? + resources.basename(element.resource()) : + undefined; + } + + onDragStart(data: IDragAndDropData, originalEvent: DragEvent): void { + const elements = (data as ElementsDragAndDropData).elements; + const resources: URI[] = elements + .filter(e => e instanceof FileMatch) + .map((fm: FileMatch) => fm.resource()); + + if (resources.length) { + // Apply some datatransfer types to allow for dragging the element outside of the application + this.instantiationService.invokeFunction(fillResourceDataTransfers, resources, originalEvent); + } + } + + drop(data: IDragAndDropData, targetElement: RenderableMatch, targetIndex: number, originalEvent: DragEvent): void { + } +} diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index 25a2ec1b093..c55ba8be416 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -50,7 +50,7 @@ import { IPanel } from 'vs/workbench/common/panel'; import { IViewlet } from 'vs/workbench/common/viewlet'; import { ExcludePatternInputWidget, PatternInputWidget } from 'vs/workbench/parts/search/browser/patternInputWidget'; import { CancelSearchAction, ClearSearchResultsAction, CollapseDeepestExpandedLevelAction, getKeyboardEventForEditorOpen, RefreshAction } from 'vs/workbench/parts/search/browser/searchActions'; -import { FileMatchRenderer, FolderMatchRenderer, MatchRenderer, SearchAccessibilityProvider, SearchDelegate } from 'vs/workbench/parts/search/browser/searchResultsView'; +import { FileMatchRenderer, FolderMatchRenderer, MatchRenderer, SearchAccessibilityProvider, SearchDelegate, SearchDND } from 'vs/workbench/parts/search/browser/searchResultsView'; import { ISearchWidgetOptions, SearchWidget } from 'vs/workbench/parts/search/browser/searchWidget'; import * as Constants from 'vs/workbench/parts/search/common/constants'; import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder'; @@ -633,7 +633,8 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { ], { identityProvider, - accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider, this.viewModel) + accessibilityProvider: this.instantiationService.createInstance(SearchAccessibilityProvider, this.viewModel), + dnd: this.instantiationService.createInstance(SearchDND) })); this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); From 8816e58ca746adc3879716e722e3c8a5e30b09d3 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Mon, 4 Feb 2019 19:43:23 +0000 Subject: [PATCH 309/429] Fix #66467 - don't restrict .* regex in search --- .../workbench/parts/search/browser/searchView.ts | 14 -------------- .../workbench/parts/search/browser/searchWidget.ts | 7 ++----- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index c55ba8be416..b492c49c74f 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -1143,20 +1143,6 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { return; } - // Validate regex is OK - if (isRegex) { - let regExp: RegExp; - try { - regExp = new RegExp(contentPattern); - } catch (e) { - return; // malformed regex - } - - if (strings.regExpLeadsToEndlessLoop(regExp)) { - return; // endless regex - } - } - const content: IPatternInfo = { pattern: contentPattern, isRegExp: isRegex, diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/parts/search/browser/searchWidget.ts index 580a4a0044b..76ff4706fb6 100644 --- a/src/vs/workbench/parts/search/browser/searchWidget.ts +++ b/src/vs/workbench/parts/search/browser/searchWidget.ts @@ -397,15 +397,12 @@ export class SearchWidget extends Widget { if (!this.searchInput.getRegex()) { return null; } - let regExp: RegExp; try { - regExp = new RegExp(value); + // tslint:disable-next-line: no-unused-expression + new RegExp(value); } catch (e) { return { content: e.message }; } - if (strings.regExpLeadsToEndlessLoop(regExp)) { - return { content: nls.localize('regexp.validationFailure', "Expression matches everything") }; - } if (strings.regExpContainsBackreference(value)) { if (!this.searchConfiguration.usePCRE2) { From 737b6e45195215aa3e7e96bb624d87dbe53396fb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 4 Feb 2019 11:53:16 -0800 Subject: [PATCH 310/429] Strict null check all base Part of #60565. Make your time Doing more null supressions rather than code changes in quickOpen since we will be migrating off this old code --- src/tsconfig.strictNullChecks.json | 110 +--------------- .../parts/quickopen/browser/quickOpenModel.ts | 122 +++++++++--------- .../quickopen/browser/quickOpenWidget.ts | 2 +- .../base/parts/quickopen/common/quickOpen.ts | 2 +- .../parts/quickopen/common/quickOpenScorer.ts | 22 ++-- src/vs/base/parts/tree/browser/tree.ts | 6 +- 6 files changed, 82 insertions(+), 182 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index ef2000cae7e..3adcf237aed 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -6,9 +6,7 @@ }, "include": [ "./typings", - "./vs/base/browser/**/*.ts", - "./vs/base/common/**/*.ts", - "./vs/base/node/**/*.ts", + "./vs/base/**/*.ts", "./vs/editor/browser/**/*.ts", "./vs/editor/common/**/*.ts", "./vs/editor/contrib/codeAction/**/*.ts", @@ -21,110 +19,6 @@ "./vs/editor/test/**/*.ts" ], "files": [ - "./vs/base/parts/contextmenu/common/contextmenu.ts", - "./vs/base/parts/contextmenu/electron-browser/contextmenu.ts", - "./vs/base/parts/contextmenu/electron-main/contextmenu.ts", - "./vs/base/parts/ipc/electron-browser/ipc.electron-browser.ts", - "./vs/base/parts/ipc/electron-main/ipc.electron-main.ts", - "./vs/base/parts/ipc/node/ipc.cp.ts", - "./vs/base/parts/ipc/node/ipc.electron.ts", - "./vs/base/parts/ipc/node/ipc.net.ts", - "./vs/base/parts/ipc/node/ipc.ts", - "./vs/base/parts/ipc/test/node/ipc.cp.test.ts", - "./vs/base/parts/ipc/test/node/ipc.net.test.ts", - "./vs/base/parts/ipc/test/node/ipc.test.ts", - "./vs/base/parts/ipc/test/node/testApp.ts", - "./vs/base/parts/ipc/test/node/testService.ts", - "./vs/base/parts/quickopen/common/quickOpen.ts", - "./vs/base/parts/quickopen/common/quickOpenScorer.ts", - "./vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts", - "./vs/base/parts/quickopen/browser/quickOpenWidget.ts", - "./vs/base/parts/tree/browser/tree.ts", - "./vs/base/parts/tree/browser/treeDefaults.ts", - "./vs/base/parts/tree/browser/treeDnd.ts", - "./vs/base/parts/tree/browser/treeImpl.ts", - "./vs/base/parts/tree/browser/treeModel.ts", - "./vs/base/parts/tree/browser/treeUtils.ts", - "./vs/base/parts/tree/browser/treeView.ts", - "./vs/base/parts/tree/browser/treeViewModel.ts", - "./vs/base/parts/tree/test/browser/treeModel.test.ts", - "./vs/base/parts/tree/test/browser/treeViewModel.test.ts", - "./vs/base/test/browser/browser.test.ts", - "./vs/base/test/browser/comparers.test.ts", - "./vs/base/test/browser/dom.test.ts", - "./vs/base/test/browser/highlightedLabel.test.ts", - "./vs/base/test/browser/htmlContent.test.ts", - "./vs/base/test/browser/progressBar.test.ts", - "./vs/base/test/browser/ui/contextview/contextview.test.ts", - "./vs/base/test/browser/ui/grid/grid.test.ts", - "./vs/base/test/browser/ui/grid/gridview.test.ts", - "./vs/base/test/browser/ui/grid/util.ts", - "./vs/base/test/browser/ui/list/listView.test.ts", - "./vs/base/test/browser/ui/list/rangeMap.test.ts", - "./vs/base/test/browser/ui/scrollbar/scrollableElement.test.ts", - "./vs/base/test/browser/ui/scrollbar/scrollbarState.test.ts", - "./vs/base/test/browser/ui/splitview/splitview.test.ts", - "./vs/base/test/browser/ui/tree/asyncDataTree.test.ts", - "./vs/base/test/browser/ui/tree/dataTree.test.ts", - "./vs/base/test/browser/ui/tree/indexTreeModel.test.ts", - "./vs/base/test/browser/ui/tree/objectTree.test.ts", - "./vs/base/test/browser/ui/tree/objectTreeModel.test.ts", - "./vs/base/test/common/arrays.test.ts", - "./vs/base/test/common/assert.test.ts", - "./vs/base/test/common/async.test.ts", - "./vs/base/test/common/cache.test.ts", - "./vs/base/test/common/cancellation.test.ts", - "./vs/base/test/common/charCode.test.ts", - "./vs/base/test/common/collections.test.ts", - "./vs/base/test/common/color.test.ts", - "./vs/base/test/common/decorators.test.ts", - "./vs/base/test/common/diff/diff.test.ts", - "./vs/base/test/common/errors.test.ts", - "./vs/base/test/common/event.test.ts", - "./vs/base/test/common/filters.perf.test.ts", - "./vs/base/test/common/filters.test.ts", - "./vs/base/test/common/hash.test.ts", - "./vs/base/test/common/history.test.ts", - "./vs/base/test/common/json.test.ts", - "./vs/base/test/common/jsonEdit.test.ts", - "./vs/base/test/common/jsonFormatter.test.ts", - "./vs/base/test/common/keyCodes.test.ts", - "./vs/base/test/common/labels.test.ts", - "./vs/base/test/common/lifecycle.test.ts", - "./vs/base/test/common/linkedList.test.ts", - "./vs/base/test/common/map.test.ts", - "./vs/base/test/common/marshalling.test.ts", - "./vs/base/test/common/mime.test.ts", - "./vs/base/test/common/objects.test.ts", - "./vs/base/test/common/octicon.test.ts", - "./vs/base/test/common/paging.test.ts", - "./vs/base/test/common/paths.test.ts", - "./vs/base/test/common/resources.test.ts", - "./vs/base/test/common/scrollable.test.ts", - "./vs/base/test/common/strings.test.ts", - "./vs/base/test/common/types.test.ts", - "./vs/base/test/common/uri.test.ts", - "./vs/base/test/common/utils.ts", - "./vs/base/test/common/uuid.test.ts", - "./vs/base/test/node/config.test.ts", - "./vs/base/test/node/console.test.ts", - "./vs/base/test/node/decoder.test.ts", - "./vs/base/test/node/encoding/encoding.test.ts", - "./vs/base/test/node/extfs/extfs.test.ts", - "./vs/base/test/node/flow.test.ts", - "./vs/base/test/node/glob.test.ts", - "./vs/base/test/node/id.test.ts", - "./vs/base/test/node/pfs.test.ts", - "./vs/base/test/node/port.test.ts", - "./vs/base/test/node/processes/fixtures/fork.ts", - "./vs/base/test/node/processes/fixtures/fork_large.ts", - "./vs/base/test/node/processes/processes.test.ts", - "./vs/base/test/node/storage/storage.test.ts", - "./vs/base/test/node/stream/stream.test.ts", - "./vs/base/test/node/uri.test.perf.ts", - "./vs/base/test/node/utils.ts", - "./vs/base/worker/defaultWorkerFactory.ts", - "./vs/base/worker/workerMain.ts", "./vs/code/code.main.ts", "./vs/code/electron-browser/issue/issueReporterMain.ts", "./vs/code/electron-browser/issue/issueReporterModel.ts", @@ -893,4 +787,4 @@ "exclude": [ "./typings/require-monaco.d.ts" ] -} +} \ No newline at end of file diff --git a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts index 4959a71f185..7acd2cbbb9b 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts @@ -8,7 +8,7 @@ import * as types from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { ITree, IActionProvider } from 'vs/base/parts/tree/browser/tree'; import { IconLabel, IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; -import { IQuickNavigateConfiguration, IModel, IDataSource, IFilter, IAccessiblityProvider, IRenderer, IRunner, Mode } from 'vs/base/parts/quickopen/common/quickOpen'; +import { IQuickNavigateConfiguration, IModel, IDataSource, IFilter, IAccessiblityProvider, IRenderer, IRunner, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen'; import { Action, IAction, IActionRunner } from 'vs/base/common/actions'; import { compareAnything } from 'vs/base/common/comparers'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; @@ -35,15 +35,15 @@ let IDS = 0; export class QuickOpenItemAccessorClass implements IItemAccessor { - getItemLabel(entry: QuickOpenEntry): string { + getItemLabel(entry: QuickOpenEntry): string | null { return entry.getLabel(); } - getItemDescription(entry: QuickOpenEntry): string { + getItemDescription(entry: QuickOpenEntry): string | null { return entry.getDescription(); } - getItemPath(entry: QuickOpenEntry): string { + getItemPath(entry: QuickOpenEntry): string | undefined { const resource = entry.getResource(); return resource ? resource.fsPath : undefined; @@ -55,8 +55,8 @@ export const QuickOpenItemAccessor = new QuickOpenItemAccessorClass(); export class QuickOpenEntry { private id: string; private labelHighlights: IHighlight[]; - private descriptionHighlights: IHighlight[]; - private detailHighlights: IHighlight[]; + private descriptionHighlights?: IHighlight[]; + private detailHighlights?: IHighlight[]; private hidden: boolean; constructor(highlights: IHighlight[] = []) { @@ -75,14 +75,14 @@ export class QuickOpenEntry { /** * The label of the entry to identify it from others in the list */ - getLabel(): string { + getLabel(): string | null { return null; } /** * The options for the label to use for this entry */ - getLabelOptions(): IIconLabelValueOptions { + getLabelOptions(): IIconLabelValueOptions | null { return null; } @@ -97,42 +97,42 @@ export class QuickOpenEntry { /** * Detail information about the entry that is optional and can be shown below the label */ - getDetail(): string { + getDetail(): string | null { return null; } /** * The icon of the entry to identify it from others in the list */ - getIcon(): string { + getIcon(): string | null { return null; } /** * A secondary description that is optional and can be shown right to the label */ - getDescription(): string { + getDescription(): string | null { return null; } /** * A tooltip to show when hovering over the entry. */ - getTooltip(): string { + getTooltip(): string | null { return null; } /** * A tooltip to show when hovering over the description portion of the entry. */ - getDescriptionTooltip(): string { + getDescriptionTooltip(): string | null { return null; } /** * An optional keybinding to show for an entry. */ - getKeybinding(): ResolvedKeybinding { + getKeybinding(): ResolvedKeybinding | null { return null; } @@ -140,7 +140,7 @@ export class QuickOpenEntry { * A resource for this entry. Resource URIs can be used to compare different kinds of entries and group * them together. */ - getResource(): URI { + getResource(): URI | null { return null; } @@ -170,7 +170,7 @@ export class QuickOpenEntry { /** * Allows to return highlight ranges that should show up for the entry label and description. */ - getHighlights(): [IHighlight[] /* Label */, IHighlight[] /* Description */, IHighlight[] /* Detail */] { + getHighlights(): [IHighlight[] /* Label */, IHighlight[] | undefined /* Description */, IHighlight[] | undefined /* Detail */] { return [this.labelHighlights, this.descriptionHighlights, this.detailHighlights]; } @@ -180,7 +180,7 @@ export class QuickOpenEntry { * * The context parameter provides additional context information how the run was triggered. */ - run(mode: Mode, context: IContext): boolean { + run(mode: Mode, context: IEntryRunContext): boolean { return false; } @@ -195,9 +195,9 @@ export class QuickOpenEntry { } export class QuickOpenEntryGroup extends QuickOpenEntry { - private entry: QuickOpenEntry; - private groupLabel: string; - private withBorder: boolean; + private entry?: QuickOpenEntry; + private groupLabel?: string; + private withBorder?: boolean; constructor(entry?: QuickOpenEntry, groupLabel?: string, withBorder?: boolean) { super(); @@ -210,7 +210,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { /** * The label of the group or null if none. */ - getGroupLabel(): string { + getGroupLabel(): string | undefined { return this.groupLabel; } @@ -222,18 +222,18 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { * Whether to show a border on top of the group entry or not. */ showBorder(): boolean { - return this.withBorder; + return !!this.withBorder; } setShowBorder(showBorder: boolean): void { this.withBorder = showBorder; } - getLabel(): string { + getLabel(): string | null { return this.entry ? this.entry.getLabel() : super.getLabel(); } - getLabelOptions(): IIconLabelValueOptions { + getLabelOptions(): IIconLabelValueOptions | null { return this.entry ? this.entry.getLabelOptions() : super.getLabelOptions(); } @@ -241,27 +241,27 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { return this.entry ? this.entry.getAriaLabel() : super.getAriaLabel(); } - getDetail(): string { + getDetail(): string | null { return this.entry ? this.entry.getDetail() : super.getDetail(); } - getResource(): URI { + getResource(): URI | null { return this.entry ? this.entry.getResource() : super.getResource(); } - getIcon(): string { + getIcon(): string | null { return this.entry ? this.entry.getIcon() : super.getIcon(); } - getDescription(): string { + getDescription(): string | null { return this.entry ? this.entry.getDescription() : super.getDescription(); } - getEntry(): QuickOpenEntry { + getEntry(): QuickOpenEntry | undefined { return this.entry; } - getHighlights(): [IHighlight[], IHighlight[], IHighlight[]] { + getHighlights(): [IHighlight[], IHighlight[] | undefined, IHighlight[] | undefined] { return this.entry ? this.entry.getHighlights() : super.getHighlights(); } @@ -277,7 +277,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { this.entry ? this.entry.setHidden(hidden) : super.setHidden(hidden); } - run(mode: Mode, context: IContext): boolean { + run(mode: Mode, context: IEntryRunContext): boolean { return this.entry ? this.entry.run(mode, context) : super.run(mode, context); } } @@ -288,7 +288,7 @@ class NoActionProvider implements IActionProvider { return false; } - getActions(tree: ITree, element: any): IAction[] { + getActions(tree: ITree, element: any): IAction[] | null { return null; } @@ -296,7 +296,7 @@ class NoActionProvider implements IActionProvider { return false; } - getSecondaryActions(tree: ITree, element: any): IAction[] { + getSecondaryActions(tree: ITree, element: any): IAction[] | null { return null; } @@ -316,7 +316,7 @@ export interface IQuickOpenEntryTemplateData { } export interface IQuickOpenEntryGroupTemplateData extends IQuickOpenEntryTemplateData { - group: HTMLDivElement; + group?: HTMLDivElement; } const templateEntry = 'quickOpenEntry'; @@ -325,9 +325,9 @@ const templateEntryGroup = 'quickOpenEntryGroup'; class Renderer implements IRenderer { private actionProvider: IActionProvider; - private actionRunner: IActionRunner; + private actionRunner?: IActionRunner; - constructor(actionProvider: IActionProvider = new NoActionProvider(), actionRunner: IActionRunner | null = null) { + constructor(actionProvider: IActionProvider = new NoActionProvider(), actionRunner?: IActionRunner) { this.actionProvider = actionProvider; this.actionRunner = actionRunner; } @@ -356,7 +356,7 @@ class Renderer implements IRenderer { // Entry const row1 = DOM.$('.quick-open-row'); const row2 = DOM.$('.quick-open-row'); - const entry = DOM.$('.quick-open-entry', null, row1, row2); + const entry = DOM.$('.quick-open-entry', undefined, row1, row2); entryContainer.appendChild(entry); // Icon @@ -379,7 +379,7 @@ class Renderer implements IRenderer { const detail = new HighlightedLabel(detailContainer, true); // Entry Group - let group: HTMLDivElement; + let group: HTMLDivElement | undefined; if (templateId === templateEntryGroup) { group = document.createElement('div'); DOM.addClass(group, 'results-group'); @@ -442,7 +442,9 @@ class Renderer implements IRenderer { // Border if (group.showBorder()) { DOM.addClass(groupData.container, 'results-group-separator'); - groupData.container.style.borderTopColor = styles.pickerGroupBorder.toString(); + if (styles.pickerGroupBorder) { + groupData.container.style.borderTopColor = styles.pickerGroupBorder.toString(); + } } else { DOM.removeClass(groupData.container, 'results-group-separator'); groupData.container.style.borderTopColor = null; @@ -450,8 +452,12 @@ class Renderer implements IRenderer { // Group Label const groupLabel = group.getGroupLabel() || ''; - groupData.group.textContent = groupLabel; - groupData.group.style.color = styles.pickerGroupForeground.toString(); + if (groupData.group) { + groupData.group.textContent = groupLabel; + if (styles.pickerGroupForeground) { + groupData.group.style.color = styles.pickerGroupForeground.toString(); + } + } } // Normal Entry @@ -465,31 +471,31 @@ class Renderer implements IRenderer { // Label const options: IIconLabelValueOptions = entry.getLabelOptions() || Object.create(null); options.matches = labelHighlights || []; - options.title = entry.getTooltip(); - options.descriptionTitle = entry.getDescriptionTooltip() || entry.getDescription(); // tooltip over description because it could overflow + options.title = entry.getTooltip() || undefined; + options.descriptionTitle = entry.getDescriptionTooltip() || entry.getDescription() || undefined; // tooltip over description because it could overflow options.descriptionMatches = descriptionHighlights || []; - data.label.setLabel(entry.getLabel(), entry.getDescription(), options); + data.label.setLabel(entry.getLabel() || undefined, entry.getDescription() || undefined, options); // Meta - data.detail.set(entry.getDetail(), detailHighlights); + data.detail.set(entry.getDetail() || undefined, detailHighlights); // Keybinding - data.keybinding.set(entry.getKeybinding()); + data.keybinding.set(entry.getKeybinding()!); } } disposeTemplate(templateId: string, templateData: IQuickOpenEntryGroupTemplateData): void { const data = templateData as IQuickOpenEntryGroupTemplateData; data.actionBar.dispose(); - data.actionBar = null; - data.container = null; - data.entry = null; - data.keybinding = null; - data.detail = null; - data.group = null; - data.icon = null; + data.actionBar = null!; + data.container = null!; + data.entry = null!; + data.keybinding = null!; + data.detail = null!; + data.group = null!; + data.icon = null!; data.label.dispose(); - data.label = null; + data.label = null!; } } @@ -562,7 +568,7 @@ export class QuickOpenModel implements return entry.getId(); } - getLabel(entry: QuickOpenEntry): string { + getLabel(entry: QuickOpenEntry): string | null { return entry.getLabel(); } @@ -579,7 +585,7 @@ export class QuickOpenModel implements return !entry.isHidden(); } - run(entry: QuickOpenEntry, mode: Mode, context: IContext): boolean { + run(entry: QuickOpenEntry, mode: Mode, context: IEntryRunContext): boolean { return entry.run(mode, context); } } @@ -603,8 +609,8 @@ export function compareEntries(elementA: QuickOpenEntry, elementB: QuickOpenEntr } // Fallback to the full path if labels are identical and we have associated resources - let nameA = elementA.getLabel(); - let nameB = elementB.getLabel(); + let nameA = elementA.getLabel()!; + let nameB = elementB.getLabel()!; if (nameA === nameB) { const resourceA = elementA.getResource(); const resourceB = elementB.getResource(); diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index c121e1d3b58..a023136828e 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -681,7 +681,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider { const prefix = autoFocus.autoFocusPrefixMatch; const lowerCasePrefix = prefix.toLowerCase(); for (const entry of entries) { - const label = input.dataSource.getLabel(entry); + const label = input.dataSource.getLabel(entry) || ''; if (!caseSensitiveMatch && label.indexOf(prefix) === 0) { caseSensitiveMatch = entry; diff --git a/src/vs/base/parts/quickopen/common/quickOpen.ts b/src/vs/base/parts/quickopen/common/quickOpen.ts index a7b46b23c46..dd39a215ef1 100644 --- a/src/vs/base/parts/quickopen/common/quickOpen.ts +++ b/src/vs/base/parts/quickopen/common/quickOpen.ts @@ -59,7 +59,7 @@ export interface IKeyMods { export interface IDataSource { getId(entry: T): string; - getLabel(entry: T): string; + getLabel(entry: T): string | null; } /** diff --git a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts index 9abbda5ac13..c1c1a82673e 100644 --- a/src/vs/base/parts/quickopen/common/quickOpenScorer.ts +++ b/src/vs/base/parts/quickopen/common/quickOpenScorer.ts @@ -285,17 +285,17 @@ export interface IItemAccessor { /** * Just the label of the item to score on. */ - getItemLabel(item: T): string; + getItemLabel(item: T): string | null; /** * The optional description of the item to score on. Can be null. */ - getItemDescription(item: T): string; + getItemDescription(item: T): string | null; /** * If the item is a file, the path of the file to score on. Can be null. */ - getItemPath(file: T): string; + getItemPath(file: T): string | undefined; } const PATH_IDENTITY_SCORE = 1 << 18; @@ -376,10 +376,10 @@ function createMatches(offsets: undefined | number[]): IMatch[] { return ret; } -function doScoreItem(label: string, description: string, path: string, query: IPreparedQuery, fuzzy: boolean): IItemScore { +function doScoreItem(label: string, description: string | null, path: string | undefined, query: IPreparedQuery, fuzzy: boolean): IItemScore { // 1.) treat identity matches on full path highest - if (path && isLinux ? query.original === path : equalsIgnoreCase(query.original, path)) { + if (path && (isLinux ? query.original === path : equalsIgnoreCase(query.original, path))) { return { score: PATH_IDENTITY_SCORE, labelMatch: [{ start: 0, end: label.length }], descriptionMatch: description ? [{ start: 0, end: description.length }] : undefined }; } @@ -469,8 +469,8 @@ export function compareItemsByScore(itemA: T, itemB: T, query: IPreparedQuery return scoreA === LABEL_PREFIX_SCORE ? -1 : 1; } - const labelA = accessor.getItemLabel(itemA); - const labelB = accessor.getItemLabel(itemB); + const labelA = accessor.getItemLabel(itemA) || ''; + const labelB = accessor.getItemLabel(itemB) || ''; // prefer shorter names when both match on label prefix if (labelA.length !== labelB.length) { @@ -484,8 +484,8 @@ export function compareItemsByScore(itemA: T, itemB: T, query: IPreparedQuery return scoreA === LABEL_CAMELCASE_SCORE ? -1 : 1; } - const labelA = accessor.getItemLabel(itemA); - const labelB = accessor.getItemLabel(itemB); + const labelA = accessor.getItemLabel(itemA) || ''; + const labelB = accessor.getItemLabel(itemB) || ''; // prefer more compact camel case matches over longer const comparedByMatchLength = compareByMatchLength(itemScoreA.labelMatch, itemScoreB.labelMatch); @@ -592,8 +592,8 @@ function compareByMatchLength(matchesA?: IMatch[], matchesB?: IMatch[]): number export function fallbackCompare(itemA: T, itemB: T, query: IPreparedQuery, accessor: IItemAccessor): number { // check for label + description length and prefer shorter - const labelA = accessor.getItemLabel(itemA); - const labelB = accessor.getItemLabel(itemB); + const labelA = accessor.getItemLabel(itemA) || ''; + const labelB = accessor.getItemLabel(itemB) || ''; const descriptionA = accessor.getItemDescription(itemA); const descriptionB = accessor.getItemDescription(itemB); diff --git a/src/vs/base/parts/tree/browser/tree.ts b/src/vs/base/parts/tree/browser/tree.ts index a74f5cad56e..9966687e74b 100644 --- a/src/vs/base/parts/tree/browser/tree.ts +++ b/src/vs/base/parts/tree/browser/tree.ts @@ -716,12 +716,12 @@ export interface IActionProvider { /** * Returns whether or not the element has actions. These show up in place right to the element in the tree. */ - hasActions(tree: ITree, element: any): boolean; + hasActions(tree: ITree | null, element: any): boolean; /** * Returns a promise of an array with the actions of the element that should show up in place right to the element in the tree. */ - getActions(tree: ITree, element: any): IAction[]; + getActions(tree: ITree | null, element: any): IAction[] | null; /** * Returns whether or not the element has secondary actions. These show up once the user has expanded the element's action bar. @@ -731,7 +731,7 @@ export interface IActionProvider { /** * Returns a promise of an array with the secondary actions of the element that should show up once the user has expanded the element's action bar. */ - getSecondaryActions(tree: ITree, element: any): IAction[]; + getSecondaryActions(tree: ITree, element: any): IAction[] | null; /** * Returns an action item to render an action. From 5e03d02484d715a406d21016b684ef5ecc66a230 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 4 Feb 2019 12:52:57 -0800 Subject: [PATCH 311/429] Working on strict null checks in vs/code --- src/tsconfig.strictNullChecks.json | 1 + src/vs/code/electron-main/app.ts | 32 +++++++++---------- src/vs/code/electron-main/main.ts | 6 ++-- src/vs/code/electron-main/window.ts | 28 +++++++++------- src/vs/code/electron-main/windows.ts | 20 ++++++------ src/vs/platform/windows/common/windows.ts | 2 +- .../platform/windows/electron-main/windows.ts | 8 ++--- 7 files changed, 50 insertions(+), 47 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 3adcf237aed..fc15521231c 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -37,6 +37,7 @@ "./vs/code/electron-main/logUploader.ts", "./vs/code/electron-main/sharedProcess.ts", "./vs/code/electron-main/theme.ts", + "./vs/code/electron-main/window.ts", "./vs/code/node/cli.ts", "./vs/code/node/cliProcessMain.ts", "./vs/code/node/paths.ts", diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index ce0240ad7d2..8a2f82f82ab 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -16,7 +16,6 @@ import { UpdateChannel } from 'vs/platform/update/node/updateIpc'; import { Server as ElectronIPCServer } from 'vs/base/parts/ipc/electron-main/ipc.electron-main'; import { Server, connect, Client } from 'vs/base/parts/ipc/node/ipc.net'; import { SharedProcess } from 'vs/code/electron-main/sharedProcess'; -import { Mutex } from 'windows-mutex'; import { LaunchService, LaunchChannel, ILaunchService } from 'vs/platform/launch/electron-main/launchService'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; @@ -484,22 +483,22 @@ export class CodeApplication extends Disposable { // written from the main process once. const telemetryInstanceId = 'telemetry.instanceId'; - const instanceId = storageMainService.get(telemetryInstanceId, null); - if (instanceId === null) { + const instanceId = storageMainService.get(telemetryInstanceId, undefined); + if (instanceId === undefined) { storageMainService.store(telemetryInstanceId, generateUuid()); } const telemetryFirstSessionDate = 'telemetry.firstSessionDate'; - const firstSessionDate = storageMainService.get(telemetryFirstSessionDate, null); - if (firstSessionDate === null) { + const firstSessionDate = storageMainService.get(telemetryFirstSessionDate, undefined); + if (firstSessionDate === undefined) { storageMainService.store(telemetryFirstSessionDate, new Date().toUTCString()); } const telemetryCurrentSessionDate = 'telemetry.currentSessionDate'; const telemetryLastSessionDate = 'telemetry.lastSessionDate'; - const lastSessionDate = storageMainService.get(telemetryCurrentSessionDate, null); // previous session date was the "current" one at that time + const lastSessionDate = storageMainService.get(telemetryCurrentSessionDate, undefined); // previous session date was the "current" one at that time const currentSessionDate = new Date().toUTCString(); // current session date is "now" - storageMainService.store(telemetryLastSessionDate, lastSessionDate); + storageMainService.store(telemetryLastSessionDate, typeof lastSessionDate === 'undefined' ? null : lastSessionDate); storageMainService.store(telemetryCurrentSessionDate, currentSessionDate); }); } @@ -590,7 +589,7 @@ export class CodeApplication extends Disposable { // Watch Electron URLs and forward them to the UrlService const args = this.environmentService.args; const urls = args['open-url'] ? args._urls : []; - const urlListener = new ElectronURLListener(urls, urlService, this.windowsMainService); + const urlListener = new ElectronURLListener(urls || [], urlService, this.windowsMainService); this._register(urlListener); this.windowsMainService.ready(this.userEnv); @@ -617,13 +616,12 @@ export class CodeApplication extends Disposable { const windowsMainService = accessor.get(IWindowsMainService); const historyMainService = accessor.get(IHistoryMainService); - let windowsMutex: Mutex | null = null; if (isWindows) { // Setup Windows mutex try { const Mutex = (require.__$__nodeRequire('windows-mutex') as any).Mutex; - windowsMutex = new Mutex(product.win32MutexName); + const windowsMutex = new Mutex(product.win32MutexName); this._register(toDisposable(() => windowsMutex.release())); } catch (e) { if (!this.environmentService.isBuilt) { @@ -709,7 +707,7 @@ export class CodeApplication extends Disposable { const resolveAuthority = (authority: string): ResolvedAuthority | null => { if (authority.indexOf('+') >= 0) { if (resolvedAuthorities.has(authority)) { - return resolvedAuthorities.get(authority); + return resolvedAuthorities.get(authority) || null; } return null; } else { @@ -721,24 +719,24 @@ export class CodeApplication extends Disposable { protocol.registerBufferProtocol(REMOTE_HOST_SCHEME, async (request, callback) => { if (request.method !== 'GET') { - return callback(null); + return callback(undefined); } const uri = URI.parse(request.url); - let activeConnection: ActiveConnection = null; + let activeConnection: ActiveConnection | undefined; if (connectionPool.has(uri.authority)) { activeConnection = connectionPool.get(uri.authority); } else { let resolvedAuthority = resolveAuthority(uri.authority); if (!resolvedAuthority) { - callback(null); + callback(undefined); return; } activeConnection = new ActiveConnection(uri.authority, resolvedAuthority.host, resolvedAuthority.port); connectionPool.set(uri.authority, activeConnection); } try { - const rawClient = await activeConnection.getClient(); + const rawClient = await activeConnection!.getClient(); if (connectionPool.has(uri.authority)) { // not disposed in the meantime const channel = rawClient.getChannel(REMOTE_FILE_SYSTEM_CHANNEL_NAME); @@ -746,11 +744,11 @@ export class CodeApplication extends Disposable { const fileContents = await channel.call('readFile', [uri]); callback(Buffer.from(fileContents)); } else { - callback(null); + callback(undefined); } } catch (err) { errors.onUnexpectedError(err); - callback(null); + callback(undefined); } }); } diff --git a/src/vs/code/electron-main/main.ts b/src/vs/code/electron-main/main.ts index 39f624e5de8..4874979725f 100644 --- a/src/vs/code/electron-main/main.ts +++ b/src/vs/code/electron-main/main.ts @@ -158,7 +158,7 @@ function setupIPC(accessor: ServicesAccessor): Promise { logService.trace('Sending env to running instance...'); return allowSetForegroundWindow(service) - .then(() => service.start(environmentService.args, process.env)) + .then(() => service.start(environmentService.args, process.env as platform.IProcessEnvironment)) .then(() => client.dispose()) .then(() => { @@ -316,14 +316,14 @@ function createServices(args: ParsedArgs, bufferLogService: BufferLogService): I function initServices(environmentService: IEnvironmentService, stateService: StateService): Promise { // Ensure paths for environment service exist - const environmentServiceInitialization = Promise.all([ + const environmentServiceInitialization = Promise.all([ environmentService.extensionsPath, environmentService.nodeCachedDataDir, environmentService.logsPath, environmentService.globalStorageHome, environmentService.workspaceStorageHome, environmentService.backupHome - ].map(path => path && mkdirp(path))); + ].map((path): undefined | Promise => path ? mkdirp(path) : undefined)); // State service const stateServiceInitialization = stateService.init(); diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index dbe19cc5743..af7b8265a45 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -73,7 +73,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { private whenReadyCallbacks: { (window: ICodeWindow): void }[]; private currentConfig: IWindowConfiguration; - private pendingLoadConfig: IWindowConfiguration; + private pendingLoadConfig?: IWindowConfiguration; private marketplaceHeadersPromise: Promise; @@ -205,7 +205,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { return !!this.config.extensionTestsPath; } - get extensionDevelopmentPath(): string { + get extensionDevelopmentPath(): string | undefined { return this.config.extensionDevelopmentPath; } @@ -253,19 +253,19 @@ export class CodeWindow extends Disposable implements ICodeWindow { return this._lastFocusTime; } - get backupPath(): string { + get backupPath(): string | undefined { return this.currentConfig ? this.currentConfig.backupPath : undefined; } - get openedWorkspace(): IWorkspaceIdentifier { + get openedWorkspace(): IWorkspaceIdentifier | undefined { return this.currentConfig ? this.currentConfig.workspace : undefined; } - get openedFolderUri(): URI { + get openedFolderUri(): URI | undefined { return this.currentConfig ? this.currentConfig.folderUri : undefined; } - get remoteAuthority(): string { + get remoteAuthority(): string | undefined { return this.currentConfig ? this.currentConfig.remoteAuthority : undefined; } @@ -310,7 +310,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { private registerListeners(): void { // Prevent loading of svgs - this._win.webContents.session.webRequest.onBeforeRequest(null, (details, callback) => { + this._win.webContents.session.webRequest.onBeforeRequest(null!, (details, callback) => { if (details.url.indexOf('.svg') > 0) { const uri = URI.parse(details.url); if (uri && !uri.scheme.match(/file/i) && (uri.path as any).endsWith('.svg')) { @@ -321,7 +321,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { return callback({}); }); - this._win.webContents.session.webRequest.onHeadersReceived(null, (details: any, callback: any) => { + this._win.webContents.session.webRequest.onHeadersReceived(null!, (details: any, callback: any) => { const contentType: string[] = (details.responseHeaders['content-type'] || details.responseHeaders['Content-Type']) as any; if (contentType && Array.isArray(contentType) && contentType.some(x => x.toLowerCase().indexOf('image/svg') >= 0)) { return callback({ cancel: true }); @@ -338,7 +338,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { if (this.pendingLoadConfig) { this.currentConfig = this.pendingLoadConfig; - this.pendingLoadConfig = null; + this.pendingLoadConfig = undefined; } // To prevent flashing, we set the window visible after the page has finished to load but before Code is loaded @@ -685,7 +685,7 @@ export class CodeWindow extends Disposable implements ICodeWindow { private restoreWindowState(state?: IWindowState): IWindowState { if (state) { try { - state = this.validateWindowState(state); + state = this.validateWindowState(state) || undefined; } catch (err) { this.logService.warn(`Unexpected error validating window state: ${err}\n${err.stack}`); // somehow display API can be picky about the state to validate } @@ -703,7 +703,11 @@ export class CodeWindow extends Disposable implements ICodeWindow { return null; } - if ([state.x, state.y, state.width, state.height].some(n => typeof n !== 'number')) { + if (typeof state.x !== 'number' + || typeof state.y !== 'number' + || typeof state.width !== 'number' + || typeof state.height !== 'number' + ) { return null; } @@ -1042,6 +1046,6 @@ export class CodeWindow extends Disposable implements ICodeWindow { clearTimeout(this.showTimeoutHandle); } - this._win = null; // Important to dereference the window object to allow for GC + this._win = null!; // Important to dereference the window object to allow for GC } } diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 9c2ff750b69..6b4a7ae736e 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -368,12 +368,12 @@ export class WindowsManager implements IWindowsMainService { // folders that should be added to the currently active window. let foldersToAdd: URI[] = []; if (openConfig.addMode) { - foldersToAdd = pathsToOpen.filter(path => !!path.folderUri).map(path => path.folderUri); + foldersToAdd = pathsToOpen.filter(path => !!path.folderUri).map(path => path.folderUri!); pathsToOpen = pathsToOpen.filter(path => !path.folderUri); } // collect all file inputs - let fileInputs: IFileInputs = undefined; + let fileInputs: IFileInputs | undefined; for (const path of pathsToOpen) { if (path.fileUri) { if (!fileInputs) { @@ -973,7 +973,7 @@ export class WindowsManager implements IWindowsMainService { return restoreWindows; } - private argToUri(arg: string): URI { + private argToUri(arg: string): URI | null { try { let uri = URI.parse(arg); if (!uri.scheme) { @@ -987,7 +987,7 @@ export class WindowsManager implements IWindowsMainService { return null; } - private parseUri(uri: URI, isFile: boolean, options?: IPathParseOptions): IPathToOpen { + private parseUri(uri: URI, isFile: boolean, options?: IPathParseOptions): IPathToOpen | null { if (!uri || !uri.scheme) { return null; } @@ -1025,7 +1025,7 @@ export class WindowsManager implements IWindowsMainService { }; } - private parsePath(anyPath: string, options?: IPathParseOptions): IPathToOpen { + private parsePath(anyPath: string, options?: IPathParseOptions): IPathToOpen | null { if (!anyPath) { return null; } @@ -1212,7 +1212,7 @@ export class WindowsManager implements IWindowsMainService { configuration.backupPath = join(this.environmentService.backupHome, options.emptyWindowBackupInfo.backupFolder); } - let window: ICodeWindow; + let window: ICodeWindow | undefined; if (!options.forceNewWindow && !options.forceNewTabbedWindow) { window = options.windowToUse || this.getLastActiveWindow(); if (window) { @@ -1372,7 +1372,7 @@ export class WindowsManager implements IWindowsMainService { // // We want the new window to open on the same display that the last active one is in - let displayToUse: Electron.Display; + let displayToUse: Electron.Display | undefined; const displays = screen.getAllDisplays(); // Single Display @@ -1566,7 +1566,7 @@ export class WindowsManager implements IWindowsMainService { closeListener.dispose(); loadListener.dispose(); - resolve(null); + resolve(); } } @@ -2005,7 +2005,7 @@ class WorkspacesManager { window.focus(); // Register window for backups and migrate current backups over - let backupPath: string; + let backupPath: string | undefined; if (!window.config.extensionDevelopmentPath) { backupPath = this.backupMainService.registerWorkspaceBackupSync(workspace, window.config.backupPath); } @@ -2110,7 +2110,7 @@ class WorkspacesManager { }); } - private getUntitledWorkspaceSaveDialogDefaultPath(workspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string { + private getUntitledWorkspaceSaveDialogDefaultPath(workspace?: IWorkspaceIdentifier | ISingleFolderWorkspaceIdentifier): string | undefined { if (workspace) { if (isSingleFolderWorkspaceIdentifier(workspace)) { return workspace.scheme === Schemas.file ? dirname(workspace.fsPath) : undefined; diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 56eaeef6f49..8e643286d88 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -31,7 +31,7 @@ export interface INativeOpenDialogOptions { export interface IEnterWorkspaceResult { workspace: IWorkspaceIdentifier; - backupPath: string; + backupPath?: string; } export interface CrashReporterStartOptions { diff --git a/src/vs/platform/windows/electron-main/windows.ts b/src/vs/platform/windows/electron-main/windows.ts index e067b62e96d..19219a64149 100644 --- a/src/vs/platform/windows/electron-main/windows.ts +++ b/src/vs/platform/windows/electron-main/windows.ts @@ -33,11 +33,11 @@ export interface ICodeWindow { readonly win: Electron.BrowserWindow; readonly config: IWindowConfiguration; - readonly openedFolderUri: URI; - readonly openedWorkspace: IWorkspaceIdentifier; - readonly backupPath: string; + readonly openedFolderUri?: URI; + readonly openedWorkspace?: IWorkspaceIdentifier; + readonly backupPath?: string; - readonly remoteAuthority: string; + readonly remoteAuthority?: string; readonly isExtensionDevelopmentHost: boolean; readonly isExtensionTestHost: boolean; From 68ac1ab84302dd627426a15404fce3fa959c315d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 4 Feb 2019 13:35:10 -0800 Subject: [PATCH 312/429] Strict null checking more quick open related files --- src/tsconfig.strictNullChecks.json | 4 +++ .../quickopen/browser/quickOpenWidget.ts | 2 +- .../browser/quickOpen/editorQuickOpen.ts | 8 ++--- .../browser/quickOpen/quickCommand.ts | 12 ++++---- .../quickOpen/quickOpenEditorWidget.ts | 4 +-- .../browser/quickOpen/quickOutline.ts | 29 ++++++++++--------- 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index fc15521231c..edc118aff8d 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -154,6 +154,10 @@ "./vs/editor/standalone/browser/colorizer.ts", "./vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts", "./vs/editor/standalone/browser/inspectTokens/inspectTokens.ts", + "./vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts", + "./vs/editor/standalone/browser/quickOpen/quickCommand.ts", + "./vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts", + "./vs/editor/standalone/browser/quickOpen/quickOutline.ts", "./vs/editor/standalone/browser/simpleServices.ts", "./vs/editor/standalone/browser/standaloneCodeEditor.ts", "./vs/editor/standalone/browser/standaloneCodeServiceImpl.ts", diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index a023136828e..ed4b43d2680 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -36,7 +36,7 @@ export interface IQuickOpenCallbacks { export interface IQuickOpenOptions extends IQuickOpenStyles { minItemsToShow?: number; maxItemsToShow?: number; - inputPlaceHolder: string; + inputPlaceHolder?: string; inputAriaLabel?: string; actionProvider?: IActionProvider; keyboardSupport?: boolean; diff --git a/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts b/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts index 75de1e65c8d..0a77b555d7d 100644 --- a/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts +++ b/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts @@ -31,9 +31,9 @@ export class QuickOpenController implements editorCommon.IEditorContribution, ID } private editor: ICodeEditor; - private widget: QuickOpenEditorWidget; - private rangeHighlightDecorationId: string; - private lastKnownEditorSelection: Selection; + private widget: QuickOpenEditorWidget | null; + private rangeHighlightDecorationId: string | null; + private lastKnownEditorSelection: Selection | null; constructor(editor: ICodeEditor, @IThemeService private readonly themeService: IThemeService) { this.editor = editor; @@ -83,7 +83,7 @@ export class QuickOpenController implements editorCommon.IEditorContribution, ID () => onClose(false), () => onClose(true), (value: string) => { - this.widget.setInput(opts.getModel(value), opts.getAutoFocus(value)); + this.widget!.setInput(opts.getModel(value), opts.getAutoFocus(value)); }, { inputAriaLabel: opts.inputAriaLabel diff --git a/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts b/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts index 892d458a277..fdbf17a7685 100644 --- a/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts +++ b/src/vs/editor/standalone/browser/quickOpen/quickCommand.ts @@ -8,8 +8,8 @@ import * as browser from 'vs/base/browser/browser'; import { onUnexpectedError } from 'vs/base/common/errors'; import { matchesFuzzy } from 'vs/base/common/filters'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IContext, IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; -import { IAutoFocus, Mode } from 'vs/base/parts/quickopen/common/quickOpen'; +import { IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions'; import { IEditor, IEditorAction } from 'vs/editor/common/editorCommon'; @@ -50,7 +50,7 @@ export class EditorActionCommandEntry extends QuickOpenEntryGroup { return this.key; } - public run(mode: Mode, context: IContext): boolean { + public run(mode: Mode, context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { // Use a timeout to give the quick open widget a chance to close itself first @@ -112,8 +112,8 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction { } private _sort(elementA: QuickOpenEntryGroup, elementB: QuickOpenEntryGroup): number { - let elementAName = elementA.getLabel().toLowerCase(); - let elementBName = elementB.getLabel().toLowerCase(); + let elementAName = (elementA.getLabel() || '').toLowerCase(); + let elementBName = (elementB.getLabel() || '').toLowerCase(); return elementAName.localeCompare(elementBName); } @@ -129,7 +129,7 @@ export class QuickCommandAction extends BaseEditorQuickOpenAction { if (action.label) { let highlights = matchesFuzzy(searchValue, action.label); if (highlights) { - entries.push(new EditorActionCommandEntry(keybinding ? keybinding.getLabel() : '', keybinding ? keybinding.getAriaLabel() : '', highlights, action, editor)); + entries.push(new EditorActionCommandEntry(keybinding ? keybinding.getLabel() || '' : '', keybinding ? keybinding.getAriaLabel() || '' : '', highlights, action, editor)); } } } diff --git a/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts b/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts index 34df6555f29..859e8cca21b 100644 --- a/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts +++ b/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts @@ -45,7 +45,7 @@ export class QuickOpenEditorWidget implements IOverlayWidget { onCancel: onCancel, onType: onType }, { - inputPlaceHolder: null, + inputPlaceHolder: undefined, inputAriaLabel: configuration.inputAriaLabel, keyboardSupport: true } @@ -98,7 +98,7 @@ export class QuickOpenEditorWidget implements IOverlayWidget { this.codeEditor.layoutOverlayWidget(this); } - public getPosition(): IOverlayWidgetPosition { + public getPosition(): IOverlayWidgetPosition | null { if (this.visible) { return { preference: OverlayWidgetPositionPreference.TOP_CENTER diff --git a/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts b/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts index 7a75c155e2d..7a303f61636 100644 --- a/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts +++ b/src/vs/editor/standalone/browser/quickOpen/quickOutline.ts @@ -9,8 +9,8 @@ import { CancellationToken } from 'vs/base/common/cancellation'; import { matchesFuzzy } from 'vs/base/common/filters'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import * as strings from 'vs/base/common/strings'; -import { IContext, IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; -import { IAutoFocus, Mode } from 'vs/base/parts/quickopen/common/quickOpen'; +import { IHighlight, QuickOpenEntryGroup, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions'; import { IRange, Range } from 'vs/editor/common/core/range'; @@ -26,12 +26,12 @@ let SCOPE_PREFIX = ':'; export class SymbolEntry extends QuickOpenEntryGroup { private name: string; private type: string; - private description: string; + private description: string | null; private range: Range; private editor: ICodeEditor; private decorator: IDecorator; - constructor(name: string, type: string, description: string, range: Range, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator) { + constructor(name: string, type: string, description: string | null, range: Range, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator) { super(); this.name = name; @@ -55,7 +55,7 @@ export class SymbolEntry extends QuickOpenEntryGroup { return this.type; } - public getDescription(): string { + public getDescription(): string | null { return this.description; } @@ -67,7 +67,7 @@ export class SymbolEntry extends QuickOpenEntryGroup { return this.range; } - public run(mode: Mode, context: IContext): boolean { + public run(mode: Mode, context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { return this.runOpen(context); } @@ -75,7 +75,7 @@ export class SymbolEntry extends QuickOpenEntryGroup { return this.runPreview(); } - private runOpen(context: IContext): boolean { + private runOpen(_context: IEntryRunContext): boolean { // Apply selection and focus let range = this.toSelection(); @@ -128,12 +128,15 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction { }); } - public run(accessor: ServicesAccessor, editor: ICodeEditor): Promise { + public run(accessor: ServicesAccessor, editor: ICodeEditor) { + if (!editor.hasModel()) { + return undefined; + } - let model = editor.getModel(); + const model = editor.getModel(); if (!DocumentSymbolProviderRegistry.has(model)) { - return null; + return undefined; } // Resolve outline @@ -166,7 +169,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction { }); } - private symbolEntry(name: string, type: string, description: string, range: IRange, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator): SymbolEntry { + private symbolEntry(name: string, type: string, description: string | null, range: IRange, highlights: IHighlight[], editor: ICodeEditor, decorator: IDecorator): SymbolEntry { return new SymbolEntry(name, type, description, Range.lift(range), highlights, editor, decorator); } @@ -222,7 +225,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction { // Update previous result with count if (currentResult) { - currentResult.setGroupLabel(this.typeToLabel(currentType, typeCounter)); + currentResult.setGroupLabel(this.typeToLabel(currentType || '', typeCounter)); } currentType = result.getType(); @@ -240,7 +243,7 @@ export class QuickOutlineAction extends BaseEditorQuickOpenAction { // Update previous result with count if (currentResult) { - currentResult.setGroupLabel(this.typeToLabel(currentType, typeCounter)); + currentResult.setGroupLabel(this.typeToLabel(currentType || '', typeCounter)); } } From 996b5c345b6254f253d783667c009c26841ca799 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 5 Feb 2019 00:58:26 +0000 Subject: [PATCH 313/429] Remove SearchService#extendQuery, all search clients now use the QueryBuilder --- src/vs/platform/search/common/search.ts | 1 - .../electron-browser/mainThreadWorkspace.ts | 61 +++++-------------- .../services/search/node/searchService.ts | 21 +------ 3 files changed, 16 insertions(+), 67 deletions(-) diff --git a/src/vs/platform/search/common/search.ts b/src/vs/platform/search/common/search.ts index 877b69da34a..fa46ccc8958 100644 --- a/src/vs/platform/search/common/search.ts +++ b/src/vs/platform/search/common/search.ts @@ -27,7 +27,6 @@ export interface ISearchService { _serviceBrand: any; textSearch(query: ITextQuery, token?: CancellationToken, onProgress?: (result: ISearchProgressItem) => void): Promise; fileSearch(query: IFileQuery, token?: CancellationToken): Promise; - extendQuery(query: ITextQuery | IFileQuery): void; clearCache(cacheKey: string): Promise; registerSearchResultProvider(scheme: string, type: SearchProviderType, provider: ISearchResultProvider): IDisposable; } diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index 6a435ed4660..2b8311a2e3e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -3,27 +3,26 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation'; import { isPromiseCanceledError } from 'vs/base/common/errors'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { URI, UriComponents } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; +import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ILabelService } from 'vs/platform/label/common/label'; -import { IFolderQuery, IPatternInfo, ISearchConfiguration, ISearchProgressItem, ISearchService, QueryType, IFileQuery, IFileMatch } from 'vs/platform/search/common/search'; +import { IFileMatch, IPatternInfo, ISearchProgressItem, ISearchService } from 'vs/platform/search/common/search'; import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; -import { QueryBuilder, ITextQueryBuilderOptions } from 'vs/workbench/parts/search/common/queryBuilder'; +import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; -import { ExtHostContext, ExtHostWorkspaceShape, IExtHostContext, MainContext, MainThreadWorkspaceShape } from '../node/extHost.protocol'; -import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation'; import { TextSearchComplete } from 'vscode'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; +import { ExtHostContext, ExtHostWorkspaceShape, IExtHostContext, MainContext, MainThreadWorkspaceShape } from '../node/extHost.protocol'; @extHostNamedCustomer(MainContext.MainThreadWorkspace) export class MainThreadWorkspace implements MainThreadWorkspaceShape { @@ -31,13 +30,13 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { private readonly _toDispose: IDisposable[] = []; private readonly _activeCancelTokens: { [id: number]: CancellationTokenSource } = Object.create(null); private readonly _proxy: ExtHostWorkspaceShape; + private readonly _queryBuilder = this._instantiationService.createInstance(QueryBuilder); constructor( extHostContext: IExtHostContext, @ISearchService private readonly _searchService: ISearchService, @IWorkspaceContextService private readonly _contextService: IWorkspaceContextService, @ITextFileService private readonly _textFileService: ITextFileService, - @IConfigurationService private readonly _configurationService: IConfigurationService, @IWorkspaceEditingService private readonly _workspaceEditingService: IWorkspaceEditingService, @IStatusbarService private readonly _statusbarService: IStatusbarService, @IWindowService private readonly _windowService: IWindowService, @@ -120,43 +119,14 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { return undefined; } - let folderQueries: IFolderQuery[]; - if (includeFolder) { - folderQueries = [{ folder: includeFolder }]; // if base provided, only search in that folder - } else { - folderQueries = workspace.folders.map(folder => ({ folder: folder.uri })); // absolute pattern: search across all folders - } - - if (!folderQueries) { - return undefined; // invalid query parameters - } - - const ignoreSymlinks = folderQueries.every(folderQuery => { - const folderConfig = this._configurationService.getValue({ resource: folderQuery.folder }); - return !folderConfig.search.followSymlinks; - }); - - // TODO replace wth QueryBuilder - folderQueries.forEach(fq => { - fq.ignoreSymlinks = ignoreSymlinks; - }); - - const query: IFileQuery = { - folderQueries, - type: QueryType.File, - maxResults, - disregardExcludeSettings: excludePatternOrDisregardExcludes === false, - _reason: 'startFileSearch' - }; - if (typeof includePattern === 'string') { - query.includePattern = { [includePattern]: true }; - } - - if (typeof excludePatternOrDisregardExcludes === 'string') { - query.excludePattern = { [excludePatternOrDisregardExcludes]: true }; - } - - this._searchService.extendQuery(query); + const query = this._queryBuilder.file( + includeFolder ? [includeFolder] : workspace.folders.map(f => f.uri), + { + maxResults, + disregardExcludeSettings: (excludePatternOrDisregardExcludes === false) || undefined, + includePattern, + _reason: 'startFileSearch' + }); return this._searchService.fileSearch(query, token).then(result => { return result.results.map(m => m.resource); @@ -172,8 +142,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { const workspace = this._contextService.getWorkspace(); const folders = workspace.folders.map(folder => folder.uri); - const queryBuilder = this._instantiationService.createInstance(QueryBuilder); - const query = queryBuilder.text(pattern, folders, options); + const query = this._queryBuilder.text(pattern, folders, options); query._reason = 'startTextSearch'; const onProgress = (p: ISearchProgressItem) => { diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index 8d45afec201..394c74fdc2c 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -11,18 +11,16 @@ import { Event } from 'vs/base/common/event'; import { Disposable, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; import { keys, ResourceMap, values } from 'vs/base/common/map'; import { Schemas } from 'vs/base/common/network'; -import * as objects from 'vs/base/common/objects'; import { StopWatch } from 'vs/base/common/stopwatch'; import { URI as uri } from 'vs/base/common/uri'; import * as pfs from 'vs/base/node/pfs'; import { getNextTickChannel } from 'vs/base/parts/ipc/node/ipc'; import { Client, IIPCOptions } from 'vs/base/parts/ipc/node/ipc.cp'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IDebugParams, IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log'; -import { deserializeSearchError, FileMatch, ICachedSearchStats, IFileMatch, IFileQuery, IFileSearchStats, IFolderQuery, IProgress, ISearchComplete, ISearchConfiguration, ISearchEngineStats, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, ITextQuery, pathIncludedInQuery, QueryType, SearchError, SearchErrorCode, SearchProviderType } from 'vs/platform/search/common/search'; +import { deserializeSearchError, FileMatch, ICachedSearchStats, IFileMatch, IFileQuery, IFileSearchStats, IFolderQuery, IProgress, ISearchComplete, ISearchEngineStats, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, ITextQuery, pathIncludedInQuery, QueryType, SearchError, SearchErrorCode, SearchProviderType } from 'vs/platform/search/common/search'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; @@ -46,7 +44,6 @@ export class SearchService extends Disposable implements ISearchService { @IEditorService private readonly editorService: IEditorService, @IEnvironmentService environmentService: IEnvironmentService, @ITelemetryService private readonly telemetryService: ITelemetryService, - @IConfigurationService private readonly configurationService: IConfigurationService, @ILogService private readonly logService: ILogService, @IExtensionService private readonly extensionService: IExtensionService ) { @@ -71,22 +68,6 @@ export class SearchService extends Disposable implements ISearchService { }); } - extendQuery(query: IFileQuery): void { - const configuration = this.configurationService.getValue(); - - // Configuration: File Excludes - if (!query.disregardExcludeSettings) { - const fileExcludes = objects.deepClone(configuration && configuration.files && configuration.files.exclude); - if (fileExcludes) { - if (!query.excludePattern) { - query.excludePattern = fileExcludes; - } else { - objects.mixin(query.excludePattern, fileExcludes, false /* no overwrite */); - } - } - } - } - textSearch(query: ITextQuery, token?: CancellationToken, onProgress?: (item: ISearchProgressItem) => void): Promise { // Get local results from dirty/untitled const localResults = this.getLocalResults(query); From 9deb608cc6c152d091484aebd9efcbbb35206f73 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 5 Feb 2019 04:55:31 +0000 Subject: [PATCH 314/429] Fix #67661 --- src/vs/workbench/parts/search/browser/searchWidget.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/parts/search/browser/searchWidget.ts index 76ff4706fb6..c40fdd82fb6 100644 --- a/src/vs/workbench/parts/search/browser/searchWidget.ts +++ b/src/vs/workbench/parts/search/browser/searchWidget.ts @@ -440,14 +440,16 @@ export class SearchWidget extends Widget { else if (keyboardEvent.equals(KeyCode.UpArrow)) { const ta = this.searchInput.domNode.querySelector('textarea'); - if (ta && ta.selectionStart > 0) { + const isMultiline = !!this.searchInput.getValue().match(/\n/); + if (ta && isMultiline && ta.selectionStart > 0) { keyboardEvent.stopPropagation(); } } else if (keyboardEvent.equals(KeyCode.DownArrow)) { const ta = this.searchInput.domNode.querySelector('textarea'); - if (ta && ta.selectionEnd < ta.value.length) { + const isMultiline = !!this.searchInput.getValue().match(/\n/); + if (ta && isMultiline && ta.selectionEnd < ta.value.length) { keyboardEvent.stopPropagation(); } } From d50594c1c69e82c671b88fd45314e2acead4fca2 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Mon, 4 Feb 2019 19:46:00 +0100 Subject: [PATCH 315/429] Fix build on macOS --- build/azure-pipelines/darwin/product-build-darwin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index cdd8dfb9c89..2427beb711e 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -21,9 +21,9 @@ steps: - script: | set -e + yarn gulp -- vscode-darwin-min VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \ AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \ - yarn gulp -- vscode-darwin-min yarn gulp -- upload-vscode-sourcemaps displayName: Build From c91613496bd4f665a03ad2c475244bf9dc92a352 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 5 Feb 2019 09:42:35 +0100 Subject: [PATCH 316/429] fixes #67883 --- .../files/electron-browser/views/openEditorsView.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index 398894eee0a..dedd674663a 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -39,7 +39,7 @@ import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/v import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IDragAndDropData } from 'vs/base/browser/dnd'; import { memoize } from 'vs/base/common/decorators'; -import { DesktopDragAndDropData, ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; +import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; import { URI } from 'vs/base/common/uri'; const $ = dom.$; @@ -652,15 +652,14 @@ class OpenEditorsDragAndDrop implements IListDragAndDrop group, () => group.focus(), index); - } else { - const elementsData = (data as ElementsDragAndDropData).elements; + if (data instanceof ElementsDragAndDropData) { + const elementsData = data.elements; elementsData.forEach((oe, offset) => { oe.group.moveEditor(oe.editor, group, { index: index + offset, preserveFocus: true }); }); this.editorGroupService.activateGroup(group); + } else { + this.dropHandler.handleDrop(originalEvent, () => group, () => group.focus(), index); } - } } From d1546d83f6aca8b604bf44f5c9086dfd79fd34ff Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 5 Feb 2019 11:09:56 +0100 Subject: [PATCH 317/429] :lipstick: --- src/vs/platform/list/browser/listService.ts | 60 +++++++++++++-------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 0966123e57d..0a26a9aebf4 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -232,27 +232,6 @@ function getSharedListStyleSheet(): HTMLStyleElement { return sharedListStyleSheet; } -let sharedTreeStyleSheet: HTMLStyleElement; -function getSharedTreeStyleSheet(): HTMLStyleElement { - if (!sharedTreeStyleSheet) { - sharedTreeStyleSheet = createStyleSheet(); - } - - return sharedTreeStyleSheet; -} - -function handleTreeController(configuration: ITreeConfiguration, instantiationService: IInstantiationService): ITreeConfiguration { - if (!configuration.controller) { - configuration.controller = instantiationService.createInstance(WorkbenchTreeController, {}); - } - - if (!configuration.styler) { - configuration.styler = new DefaultTreestyler(getSharedTreeStyleSheet()); - } - - return configuration; -} - export class WorkbenchList extends List { readonly contextKeyService: IContextKeyService; @@ -408,6 +387,36 @@ export class WorkbenchPagedList extends PagedList { } } +/** + * @deprecated + */ +let sharedTreeStyleSheet: HTMLStyleElement; +function getSharedTreeStyleSheet(): HTMLStyleElement { + if (!sharedTreeStyleSheet) { + sharedTreeStyleSheet = createStyleSheet(); + } + + return sharedTreeStyleSheet; +} + +/** + * @deprecated + */ +function handleTreeController(configuration: ITreeConfiguration, instantiationService: IInstantiationService): ITreeConfiguration { + if (!configuration.controller) { + configuration.controller = instantiationService.createInstance(WorkbenchTreeController, {}); + } + + if (!configuration.styler) { + configuration.styler = new DefaultTreestyler(getSharedTreeStyleSheet()); + } + + return configuration; +} + +/** + * @deprecated + */ export class WorkbenchTree extends Tree { readonly contextKeyService: IContextKeyService; @@ -502,6 +511,9 @@ export class WorkbenchTree extends Tree { } } +/** + * @deprecated + */ function massageControllerOptions(options: IControllerOptions): IControllerOptions { if (typeof options.keyboardSupport !== 'boolean') { options.keyboardSupport = false; @@ -514,6 +526,9 @@ function massageControllerOptions(options: IControllerOptions): IControllerOptio return options; } +/** + * @deprecated + */ export class WorkbenchTreeController extends DefaultController { protected disposables: IDisposable[] = []; @@ -559,6 +574,9 @@ export interface IResourceResultsNavigationOptions { openOnFocus: boolean; } +/** + * @deprecated + */ export class TreeResourceNavigator extends Disposable { private readonly _openResource = new Emitter(); From 4aa198c4eeab64c1747530c9e3793f0078c69fe5 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 5 Feb 2019 11:10:04 +0100 Subject: [PATCH 318/429] add logging for resolving authority on main side --- src/vs/code/electron-main/app.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 8a2f82f82ab..8c39f0d1e50 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -701,14 +701,17 @@ export class CodeApplication extends Disposable { const resolvedAuthorities = new Map(); ipc.on('vscode:remoteAuthorityResolved', (event: any, data: ResolvedAuthority) => { + this.logService.info('Receieved resolved authority', data.authority); resolvedAuthorities.set(data.authority, data); }); const resolveAuthority = (authority: string): ResolvedAuthority | null => { + this.logService.info('Resolving authority', authority); if (authority.indexOf('+') >= 0) { if (resolvedAuthorities.has(authority)) { return resolvedAuthorities.get(authority) || null; } + this.logService.info('Didnot find resolved authority for', authority); return null; } else { const [host, strPort] = authority.split(':'); From cf0fa0861ce5994dbf72af8cd49e830c8510be3a Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 5 Feb 2019 12:36:34 +0100 Subject: [PATCH 319/429] fix #67813 --- .../parts/preferences/browser/keybindingsEditor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts index 8d358e31f2c..71f261fc2f6 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts @@ -35,7 +35,7 @@ import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode, ResolvedKeybinding } from 'vs/base/common/keyCodes'; -import { listHighlightForeground, badgeBackground, contrastBorder, badgeForeground } from 'vs/platform/theme/common/colorRegistry'; +import { listHighlightForeground, badgeBackground, contrastBorder, badgeForeground, listActiveSelectionForeground } from 'vs/platform/theme/common/colorRegistry'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { EditorExtensionsRegistry } from 'vs/editor/browser/editorExtensions'; import { WorkbenchList } from 'vs/platform/list/browser/listService'; @@ -940,4 +940,8 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { if (listHighlightForegroundColor) { collector.addRule(`.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list-row > .column .highlight { color: ${listHighlightForegroundColor}; }`); } + const listFocusAndSelectionForegroundColor = theme.getColor(listActiveSelectionForeground); + if (listFocusAndSelectionForegroundColor) { + collector.addRule(`.keybindings-editor > .keybindings-body > .keybindings-list-container .monaco-list:focus .monaco-list-row.selected.focused > .column .monaco-keybinding-key { color: ${listFocusAndSelectionForegroundColor}; }`); + } }); From beabfb15c801546c0e0f3079b8358edf2e237dad Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 5 Feb 2019 12:40:28 +0100 Subject: [PATCH 320/429] bring back `Promise.finally` change --- .../node/extensionManagementService.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/platform/extensionManagement/node/extensionManagementService.ts b/src/vs/platform/extensionManagement/node/extensionManagementService.ts index eec60635669..ab6982abed3 100644 --- a/src/vs/platform/extensionManagement/node/extensionManagementService.ts +++ b/src/vs/platform/extensionManagement/node/extensionManagementService.ts @@ -24,7 +24,7 @@ import { import { areSameExtensions, getGalleryExtensionId, groupByExtension, getMaliciousExtensionsSet, getGalleryExtensionTelemetryData, getLocalExtensionTelemetryData } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { localizeManifest } from '../common/extensionNls'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { Limiter, always, createCancelablePromise, CancelablePromise, Queue } from 'vs/base/common/async'; +import { Limiter, createCancelablePromise, CancelablePromise, Queue } from 'vs/base/common/async'; import { Event, Emitter } from 'vs/base/common/event'; import * as semver from 'semver'; import { URI } from 'vs/base/common/uri'; @@ -306,7 +306,7 @@ export class ExtensionManagementService extends Disposable implements IExtension this.downloadInstallableExtension(extension, operation) .then(installableExtension => this.installExtension(installableExtension, ExtensionType.User, cancellationToken) - .then(local => always(pfs.rimraf(installableExtension.zipPath), () => null).then(() => local))) + .then(local => pfs.rimraf(installableExtension.zipPath).finally(() => null).then(() => local))) .then(local => this.installDependenciesAndPackExtensions(local, existingExtension) .then(() => local, error => this.uninstall(local, true).then(() => Promise.reject(error), () => Promise.reject(error)))) .then( @@ -464,7 +464,7 @@ export class ExtensionManagementService extends Disposable implements IExtension () => this.logService.info('Renamed to', renamePath), e => { this.logService.info('Rename failed. Deleting from extracted location', extractPath); - return always(pfs.rimraf(extractPath), () => null).then(() => Promise.reject(e)); + return pfs.rimraf(extractPath).finally(() => null).then(() => Promise.reject(e)); })); } @@ -475,7 +475,7 @@ export class ExtensionManagementService extends Disposable implements IExtension () => extract(zipPath, extractPath, { sourcePath: 'extension', overwrite: true }, this.logService, token) .then( () => this.logService.info(`Extracted extension to ${extractPath}:`, identifier.id), - e => always(pfs.rimraf(extractPath), () => null) + e => pfs.rimraf(extractPath).finally(() => null) .then(() => Promise.reject(new ExtensionManagementError(e.message, e instanceof ExtractError && e.type ? e.type : INSTALL_ERROR_EXTRACTING)))), e => Promise.reject(new ExtensionManagementError(this.joinErrors(e).message, INSTALL_ERROR_DELETING))); } From 30afe8898a678b6ddfe2b9766f1f6ba617ffbda8 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Tue, 5 Feb 2019 12:52:01 +0100 Subject: [PATCH 321/429] debt - smarter initial commands picker --- .../quickopen/browser/commandsHandler.ts | 171 ++++++++++-------- 1 file changed, 91 insertions(+), 80 deletions(-) diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index c1c6e03e2c3..d86c5ac4cfd 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -31,6 +31,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { CancellationToken } from 'vs/base/common/cancellation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { Disposable } from 'vs/base/common/lifecycle'; +import { timeout } from 'vs/base/common/async'; export const ALL_COMMANDS_PREFIX = '>'; @@ -376,6 +377,7 @@ export class CommandsHandler extends QuickOpenHandler { private commandHistoryEnabled: boolean; private commandsHistory: CommandsHistory; + private extensionsRegistered: boolean; constructor( @IEditorService private readonly editorService: IEditorService, @@ -389,6 +391,8 @@ export class CommandsHandler extends QuickOpenHandler { this.commandsHistory = this.instantiationService.createInstance(CommandsHistory); + this.extensionService.whenInstalledExtensionsRegistered().then(() => this.extensionsRegistered = true); + this.configurationService.onDidChangeConfiguration(e => this.updateConfiguration()); this.updateConfiguration(); } @@ -398,89 +402,96 @@ export class CommandsHandler extends QuickOpenHandler { } getResults(searchValue: string, token: CancellationToken): Promise { + if (this.extensionsRegistered) { + return this.doGetResults(searchValue, token); + } - // wait for extensions being registered to cover all commands - // also from extensions - return this.extensionService.whenInstalledExtensionsRegistered().then(() => { - if (token.isCancellationRequested) { - return new QuickOpenModel([]); + // If extensions are not yet registered, we wait for a little moment to give them + // a chance to register so that the complete set of commands shows up as result + // We do not want to delay functionality beyond that time though to keep the commands + // functional. + return Promise.race([timeout(800), this.extensionService.whenInstalledExtensionsRegistered().then(() => undefined)]).then(() => this.doGetResults(searchValue, token)); + } + + private doGetResults(searchValue: string, token: CancellationToken): Promise { + if (token.isCancellationRequested) { + return Promise.resolve(new QuickOpenModel([])); + } + + searchValue = searchValue.trim(); + + // Remember as last command palette input + lastCommandPaletteInput = searchValue; + + // Editor Actions + const activeTextEditorWidget = this.editorService.activeTextEditorWidget; + let editorActions: IEditorAction[] = []; + if (activeTextEditorWidget && types.isFunction(activeTextEditorWidget.getSupportedActions)) { + editorActions = activeTextEditorWidget.getSupportedActions(); + } + + const editorEntries = this.editorActionsToEntries(editorActions, searchValue); + + // Other Actions + const menu = this.editorService.invokeWithinEditorContext(accessor => this.menuService.createMenu(MenuId.CommandPalette, accessor.get(IContextKeyService))); + const menuActions = menu.getActions().reduce((r, [, actions]) => [...r, ...actions], []).filter(action => action instanceof MenuItemAction) as MenuItemAction[]; + const commandEntries = this.menuItemActionsToEntries(menuActions, searchValue); + menu.dispose(); + + // Concat + let entries = [...editorEntries, ...commandEntries]; + + // Remove duplicates + entries = arrays.distinct(entries, entry => `${entry.getLabel()}${entry.getGroupLabel()}${entry.getCommandId()}`); + + // Handle label clashes + const commandLabels = new Set(); + entries.forEach(entry => { + const commandLabel = `${entry.getLabel()}${entry.getGroupLabel()}`; + if (commandLabels.has(commandLabel)) { + entry.setDescription(entry.getCommandId()); + } else { + commandLabels.add(commandLabel); } - - searchValue = searchValue.trim(); - - // Remember as last command palette input - lastCommandPaletteInput = searchValue; - - // Editor Actions - const activeTextEditorWidget = this.editorService.activeTextEditorWidget; - let editorActions: IEditorAction[] = []; - if (activeTextEditorWidget && types.isFunction(activeTextEditorWidget.getSupportedActions)) { - editorActions = activeTextEditorWidget.getSupportedActions(); - } - - const editorEntries = this.editorActionsToEntries(editorActions, searchValue); - - // Other Actions - const menu = this.editorService.invokeWithinEditorContext(accessor => this.menuService.createMenu(MenuId.CommandPalette, accessor.get(IContextKeyService))); - const menuActions = menu.getActions().reduce((r, [, actions]) => [...r, ...actions], []).filter(action => action instanceof MenuItemAction) as MenuItemAction[]; - const commandEntries = this.menuItemActionsToEntries(menuActions, searchValue); - menu.dispose(); - - // Concat - let entries = [...editorEntries, ...commandEntries]; - - // Remove duplicates - entries = arrays.distinct(entries, entry => `${entry.getLabel()}${entry.getGroupLabel()}${entry.getCommandId()}`); - - // Handle label clashes - const commandLabels = new Set(); - entries.forEach(entry => { - const commandLabel = `${entry.getLabel()}${entry.getGroupLabel()}`; - if (commandLabels.has(commandLabel)) { - entry.setDescription(entry.getCommandId()); - } else { - commandLabels.add(commandLabel); - } - }); - - // Sort by MRU order and fallback to name otherwie - entries = entries.sort((elementA, elementB) => { - const counterA = this.commandsHistory.peek(elementA.getCommandId()); - const counterB = this.commandsHistory.peek(elementB.getCommandId()); - - if (counterA && counterB) { - return counterA > counterB ? -1 : 1; // use more recently used command before older - } - - if (counterA) { - return -1; // first command was used, so it wins over the non used one - } - - if (counterB) { - return 1; // other command was used so it wins over the command - } - - // both commands were never used, so we sort by name - return elementA.getSortLabel().localeCompare(elementB.getSortLabel()); - }); - - // Introduce group marker border between recently used and others - // only if we have recently used commands in the result set - const firstEntry = entries[0]; - if (firstEntry && this.commandsHistory.peek(firstEntry.getCommandId())) { - firstEntry.setGroupLabel(nls.localize('recentlyUsed', "recently used")); - for (let i = 1; i < entries.length; i++) { - const entry = entries[i]; - if (!this.commandsHistory.peek(entry.getCommandId())) { - entry.setShowBorder(true); - entry.setGroupLabel(nls.localize('morecCommands', "other commands")); - break; - } - } - } - - return new QuickOpenModel(entries); }); + + // Sort by MRU order and fallback to name otherwie + entries = entries.sort((elementA, elementB) => { + const counterA = this.commandsHistory.peek(elementA.getCommandId()); + const counterB = this.commandsHistory.peek(elementB.getCommandId()); + + if (counterA && counterB) { + return counterA > counterB ? -1 : 1; // use more recently used command before older + } + + if (counterA) { + return -1; // first command was used, so it wins over the non used one + } + + if (counterB) { + return 1; // other command was used so it wins over the command + } + + // both commands were never used, so we sort by name + return elementA.getSortLabel().localeCompare(elementB.getSortLabel()); + }); + + // Introduce group marker border between recently used and others + // only if we have recently used commands in the result set + const firstEntry = entries[0]; + if (firstEntry && this.commandsHistory.peek(firstEntry.getCommandId())) { + firstEntry.setGroupLabel(nls.localize('recentlyUsed', "recently used")); + for (let i = 1; i < entries.length; i++) { + const entry = entries[i]; + if (!this.commandsHistory.peek(entry.getCommandId())) { + entry.setShowBorder(true); + entry.setGroupLabel(nls.localize('morecCommands', "other commands")); + break; + } + } + } + + return Promise.resolve(new QuickOpenModel(entries)); } private editorActionsToEntries(actions: IEditorAction[], searchValue: string): EditorActionCommandEntry[] { From 98eb895141768bfa4e9198832b2453a294ba4ecf Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 5 Feb 2019 04:44:13 -0800 Subject: [PATCH 322/429] Implement onDidChangeTerminalDimensions Fixes #55718 --- .../src/singlefolder-tests/window.test.ts | 41 ++++++++++++++++++- src/vs/vscode.proposed.d.ts | 6 ++- .../mainThreadTerminalService.ts | 11 +++-- src/vs/workbench/api/node/extHost.api.impl.ts | 3 ++ src/vs/workbench/api/node/extHost.protocol.ts | 2 +- .../api/node/extHostTerminalService.ts | 36 +++++++++++++++- .../electron-browser/terminalInstance.ts | 23 +++++++---- 7 files changed, 103 insertions(+), 19 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 707508b723c..a08d5d049d5 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/window.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind, Terminal } from 'vscode'; +import { workspace, window, commands, ViewColumn, TextEditorViewColumnChangeEvent, Uri, Selection, Position, CancellationTokenSource, TextEditorSelectionChangeKind, Terminal, TerminalDimensionsChangeEvent } from 'vscode'; import { join } from 'path'; import { closeAllEditors, pathEquals, createRandomFile } from '../utils'; @@ -695,6 +695,45 @@ suite('window namespace tests', () => { const terminal = window.createTerminal(); terminal.show(); }); + + test('onDidChangeTerminalDimensions should fire when new terminals are created', (done) => { + const reg1 = window.onDidChangeTerminalDimensions((event: TerminalDimensionsChangeEvent) => { + assert.equal(event.terminal, terminal1); + assert.equal(typeof event.dimensions.columns, 'number'); + assert.equal(typeof event.dimensions.rows, 'number'); + assert.ok(event.dimensions.columns > 0); + assert.ok(event.dimensions.rows > 0); + reg1.dispose(); + let terminal2: Terminal; + const reg2 = window.onDidOpenTerminal((newTerminal) => { + // THis is guarentees to fire before dimensions change event + if (newTerminal !== terminal1) { + terminal2 = newTerminal; + reg2.dispose(); + } + }); + let firstCalled = false; + let secondCalled = false; + const reg3 = window.onDidChangeTerminalDimensions((event: TerminalDimensionsChangeEvent) => { + if (event.terminal === terminal1) { + // The original terminal should fire dimension change after a split + firstCalled = true; + } else if (event.terminal !== terminal1) { + // The new split terminal should fire dimension change + secondCalled = true; + } + if (firstCalled && secondCalled) { + terminal1.dispose(); + terminal2.dispose(); + reg3.dispose(); + done(); + } + }); + commands.executeCommand('workbench.action.terminal.split'); + }); + const terminal1 = window.createTerminal({ name: 'test' }); + terminal1.show(); + }); }); }); diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 315b263c9f5..6192f6b1bbc 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -911,9 +911,11 @@ declare module 'vscode' { export interface Terminal { /** - * The current dimensions of the terminal. + * The current dimensions of the terminal. This will be `undefined` immediately after the + * terminal is created as the dimensions are not known until shortly after the terminal is + * created. */ - readonly dimensions: TerminalDimensions; + readonly dimensions: TerminalDimensions | undefined; /** * Fires when the terminal's pty slave pseudo-device is written to. In other words, this diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index 4a846cf2952..bdc0b212563 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -28,7 +28,10 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape // Delay this message so the TerminalInstance constructor has a chance to finish and // return the ID normally to the extension host. The ID that is passed here will be used // to register non-extension API terminals in the extension host. - setTimeout(() => this._onTerminalOpened(instance), EXT_HOST_CREATION_DELAY); + setTimeout(() => { + this._onTerminalOpened(instance); + this._onInstanceDimensionsChanged(instance); + }, EXT_HOST_CREATION_DELAY); })); this._toDispose.push(terminalService.onInstanceDisposed(instance => this._onTerminalDisposed(instance))); this._toDispose.push(terminalService.onInstanceProcessIdReady(instance => this._onTerminalProcessIdReady(instance))); @@ -196,11 +199,7 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape } private _onInstanceDimensionsChanged(instance: ITerminalInstance): void { - // Only send the dimensions if the terminal is a renderer only as there is no API to access - // dimensions on a plain Terminal. - if (instance.shellLaunchConfig.isRendererOnly) { - this._proxy.$acceptTerminalRendererDimensions(instance.id, instance.cols, instance.rows); - } + this._proxy.$acceptTerminalDimensions(instance.id, instance.cols, instance.rows); } private _onTerminalRequestExtHostProcess(request: ITerminalProcessExtHostRequest): void { diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index f6d2526d4b4..7373f1f92d4 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -424,6 +424,9 @@ export function createApiFactory( onDidChangeActiveTerminal(listener, thisArg?, disposables?) { return extHostTerminalService.onDidChangeActiveTerminal(listener, thisArg, disposables); }, + onDidChangeTerminalDimensions(listener, thisArg?, disposables?) { + return extHostTerminalService.onDidChangeTerminalDimensions(listener, thisArg, disposables); + }, get state() { return extHostWindow.state; }, diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 85e68f5080d..93bf62e21a9 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -935,7 +935,7 @@ export interface ExtHostTerminalServiceShape { $acceptTerminalProcessData(id: number, data: string): void; $acceptTerminalRendererInput(id: number, data: string): void; $acceptTerminalTitleChange(id: number, name: string): void; - $acceptTerminalRendererDimensions(id: number, cols: number, rows: number): void; + $acceptTerminalDimensions(id: number, cols: number, rows: number): void; $createProcess(id: number, shellLaunchConfig: ShellLaunchConfigDto, activeWorkspaceRootUri: URI, cols: number, rows: number): void; $acceptProcessInput(id: number, data: string): void; $acceptProcessResize(id: number, cols: number, rows: number): void; diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 1136debe9a1..005f6b766a8 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -78,6 +78,8 @@ export class BaseExtHostTerminal { export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Terminal { private _pidPromise: Promise; private _pidPromiseComplete: (value: number) => any; + private _cols: number | undefined; + private _rows: number | undefined; private readonly _onData = new Emitter(); public get onDidWriteData(): Event { @@ -126,6 +128,26 @@ export class ExtHostTerminal extends BaseExtHostTerminal implements vscode.Termi this._name = name; } + public get dimensions(): vscode.TerminalDimensions | undefined { + if (this._cols === undefined && this._rows === undefined) { + return undefined; + } + return { + columns: this._cols, + rows: this._rows + }; + } + + public setDimensions(cols: number, rows: number): boolean { + if (cols === this._cols && rows === this._rows) { + // Nothing changed + return false; + } + this._cols = cols; + this._rows = rows; + return true; + } + public get processId(): Promise { return this._pidPromise; } @@ -258,6 +280,8 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { public get onDidOpenTerminal(): Event { return this._onDidOpenTerminal && this._onDidOpenTerminal.event; } private readonly _onDidChangeActiveTerminal: Emitter = new Emitter(); public get onDidChangeActiveTerminal(): Event { return this._onDidChangeActiveTerminal && this._onDidChangeActiveTerminal.event; } + private readonly _onDidChangeTerminalDimensions: Emitter = new Emitter(); + public get onDidChangeTerminalDimensions(): Event { return this._onDidChangeTerminalDimensions && this._onDidChangeTerminalDimensions.event; } constructor( mainContext: IMainContext, @@ -319,7 +343,17 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape { }); } - public $acceptTerminalRendererDimensions(id: number, cols: number, rows: number): void { + public async $acceptTerminalDimensions(id: number, cols: number, rows: number): Promise { + const terminal = this._getTerminalById(id); + if (terminal) { + if (terminal.setDimensions(cols, rows)) { + this._onDidChangeTerminalDimensions.fire({ + terminal: terminal, + dimensions: terminal.dimensions + }); + } + } + // When a terminal's dimensions change, a renderer's _maximum_ dimensions change const renderer = this._getTerminalRendererById(id); if (renderer) { renderer._setMaximumDimensions(cols, rows); diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts index b19e38fcae5..15cc76a4fc3 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts @@ -190,8 +190,18 @@ export class TerminalInstance implements ITerminalInstance { public disableLayout: boolean; public get id(): number { return this._id; } - public get cols(): number { return this._cols; } - public get rows(): number { return this._rows; } + public get cols(): number { + if (this._dimensionsOverride && this._dimensionsOverride.cols) { + return Math.min(Math.max(this._dimensionsOverride.cols, 2), this._cols); + } + return this._cols; + } + public get rows(): number { + if (this._dimensionsOverride && this._dimensionsOverride.rows) { + return Math.min(Math.max(this._dimensionsOverride.rows, 2), this._rows); + } + return this._rows; + } // TODO: Ideally processId would be merged into processReady public get processId(): number | undefined { return this._processManager ? this._processManager.shellProcessId : undefined; } // TODO: How does this work with detached processes? @@ -1173,6 +1183,7 @@ export class TerminalInstance implements ITerminalInstance { return; } + const terminalWidth = this._evaluateColsAndRows(dimension.width, dimension.height); if (!terminalWidth) { return; @@ -1187,12 +1198,8 @@ export class TerminalInstance implements ITerminalInstance { @debounce(50) private _resize(): void { - let cols = this._cols; - let rows = this._rows; - if (this._dimensionsOverride && this._dimensionsOverride.cols && this._dimensionsOverride.rows) { - cols = Math.min(Math.max(this._dimensionsOverride.cols, 2), cols); - rows = Math.min(Math.max(this._dimensionsOverride.rows, 2), rows); - } + let cols = this.cols; + let rows = this.rows; if (this._xterm) { // Only apply these settings when the terminal is visible so that From 7c8e79b5767ef29776d569b09dc530ec8b5e4630 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 10:03:46 +0100 Subject: [PATCH 323/429] Introduce gulpfile.compile --- build/gulpfile.compile.js | 20 ++++++++++++++++++++ build/gulpfile.extensions.js | 6 +++++- build/gulpfile.vscode.js | 9 +-------- 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 build/gulpfile.compile.js diff --git a/build/gulpfile.compile.js b/build/gulpfile.compile.js new file mode 100644 index 00000000000..521a13a440d --- /dev/null +++ b/build/gulpfile.compile.js @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +'use strict'; + +const util = require('./lib/util'); +const compilation = require('./lib/compilation'); +const { compileExtensionsBuildTask } = require('./gulpfile.extensions'); + +// Full compile, including nls and inline sources in sourcemaps, for build +const compileClientBuildTask = util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)); +compileClientBuildTask.displayName = 'compile-client-build'; + +// All Build +const compileBuildTask = util.task.parallel(compileClientBuildTask, compileExtensionsBuildTask); +compileBuildTask.displayName = 'compile-build'; + +exports.compileBuildTask = compileBuildTask; \ No newline at end of file diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 46fc1940bd5..af3278cde5e 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -143,4 +143,8 @@ const tasks = compilations.map(function (tsconfigFile) { gulp.task('compile-extensions', util.task.parallel(...tasks.map(t => t.compileTask))); gulp.task('watch-extensions', util.task.parallel(...tasks.map(t => t.watchTask))); -exports.compileExtensionsBuildTask = util.task.parallel(...tasks.map(t => t.compileBuildTask)); + +const compileExtensionsBuildTask = util.task.parallel(...tasks.map(t => t.compileBuildTask)); +compileExtensionsBuildTask.displayName = 'compile-extensions-build'; + +exports.compileExtensionsBuildTask = compileExtensionsBuildTask; diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index dde330fb9ea..48df754d201 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -33,8 +33,7 @@ const deps = require('./dependencies'); const getElectronVersion = require('./lib/electron').getElectronVersion; const createAsar = require('./lib/asar').createAsar; const minimist = require('minimist'); -const compilation = require('./lib/compilation'); -const { compileExtensionsBuildTask } = require('./gulpfile.extensions'); +const { compileBuildTask } = require('./gulpfile.compile'); const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname)); // @ts-ignore @@ -88,12 +87,6 @@ const BUNDLED_FILE_HEADER = [ ' *--------------------------------------------------------*/' ].join('\n'); -// Full compile, including nls and inline sources in sourcemaps, for build -const compileClientBuildTask = util.task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)); - -// All Build -const compileBuildTask = util.task.parallel(compileClientBuildTask, compileExtensionsBuildTask); - gulp.task('optimize-vscode', util.task.series( util.task.parallel(util.rimraf('out-vscode'), compileBuildTask), common.optimizeTask({ From 87e19ff7ae47d697f9bc2fd1dd7ce3521f0b8d1e Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 10:08:08 +0100 Subject: [PATCH 324/429] Formatting --- build/gulpfile.vscode.js | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 48df754d201..9629e6dec1a 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -87,18 +87,23 @@ const BUNDLED_FILE_HEADER = [ ' *--------------------------------------------------------*/' ].join('\n'); -gulp.task('optimize-vscode', util.task.series( - util.task.parallel(util.rimraf('out-vscode'), compileBuildTask), - common.optimizeTask({ - src: 'out-build', - entryPoints: vscodeEntryPoints, - otherSources: [], - resources: vscodeResources, - loaderConfig: common.loaderConfig(nodeModules), - header: BUNDLED_FILE_HEADER, - out: 'out-vscode', - bundleInfo: undefined - })) +gulp.task('optimize-vscode', + util.task.series( + util.task.parallel( + util.rimraf('out-vscode'), + compileBuildTask + ), + common.optimizeTask({ + src: 'out-build', + entryPoints: vscodeEntryPoints, + otherSources: [], + resources: vscodeResources, + loaderConfig: common.loaderConfig(nodeModules), + header: BUNDLED_FILE_HEADER, + out: 'out-vscode', + bundleInfo: undefined + }) + ) ); From e911796b8ac3d382b651012796d42d6ef041f088 Mon Sep 17 00:00:00 2001 From: Alexandr Fadeev Date: Tue, 5 Feb 2019 11:11:15 +0200 Subject: [PATCH 325/429] Makefile colorizing tests - handling variable expansion in a variable name in assignment: var-$(another-var) := value --- .../make/test/colorize-fixtures/makefile | 7 + .../make/test/colorize-results/makefile.json | 255 +++++++++++++++++- 2 files changed, 261 insertions(+), 1 deletion(-) diff --git a/extensions/make/test/colorize-fixtures/makefile b/extensions/make/test/colorize-fixtures/makefile index 65fa3497669..6fbe91275ff 100644 --- a/extensions/make/test/colorize-fixtures/makefile +++ b/extensions/make/test/colorize-fixtures/makefile @@ -75,3 +75,10 @@ var:=123 var!=echo val var:=val \ notvar=butval + +var-$(nested-var)=val + +# Spaces in a nested shell will hurt a colorizing of variable, +# but not so much. +var-$(shell printf 2) := val2 +$(info Should be 'val2' here: $(var-2)) diff --git a/extensions/make/test/colorize-results/makefile.json b/extensions/make/test/colorize-results/makefile.json index ec834fa59a5..cd9a6c46e53 100644 --- a/extensions/make/test/colorize-results/makefile.json +++ b/extensions/make/test/colorize-results/makefile.json @@ -3012,5 +3012,258 @@ "light_vs": "default: #000000", "hc_black": "default: #FFFFFF" } + }, + { + "c": "var-", + "t": "source.makefile variable.other.makefile", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": "$(", + "t": "source.makefile variable.other.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "nested-var", + "t": "source.makefile variable.other.makefile string.interpolated.makefile variable.other.makefile", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": ")", + "t": "source.makefile variable.other.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "=", + "t": "source.makefile punctuation.separator.key-value.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "val", + "t": "source.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "#", + "t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": " Spaces in a nested shell will hurt a colorizing of variable,", + "t": "source.makefile comment.line.number-sign.makefile", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": "#", + "t": "source.makefile comment.line.number-sign.makefile punctuation.definition.comment.makefile", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": " but not so much.", + "t": "source.makefile comment.line.number-sign.makefile", + "r": { + "dark_plus": "comment: #6A9955", + "light_plus": "comment: #008000", + "dark_vs": "comment: #6A9955", + "light_vs": "comment: #008000", + "hc_black": "comment: #7CA668" + } + }, + { + "c": "var-", + "t": "source.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "$(", + "t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "shell", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile support.function.shell.makefile", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "support.function: #DCDCAA" + } + }, + { + "c": " printf 2", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": ")", + "t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": " := val2", + "t": "source.makefile", + "r": { + "dark_plus": "default: #D4D4D4", + "light_plus": "default: #000000", + "dark_vs": "default: #D4D4D4", + "light_vs": "default: #000000", + "hc_black": "default: #FFFFFF" + } + }, + { + "c": "$(", + "t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "info", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile support.function.info.makefile", + "r": { + "dark_plus": "support.function: #DCDCAA", + "light_plus": "support.function: #795E26", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "support.function: #DCDCAA" + } + }, + { + "c": " Should be 'val2' here: ", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "$(", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": "var-2", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile variable.other.makefile", + "r": { + "dark_plus": "variable: #9CDCFE", + "light_plus": "variable: #001080", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "variable: #9CDCFE" + } + }, + { + "c": ")", + "t": "source.makefile string.interpolated.makefile meta.scope.function-call.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } + }, + { + "c": ")", + "t": "source.makefile string.interpolated.makefile punctuation.definition.variable.makefile", + "r": { + "dark_plus": "string: #CE9178", + "light_plus": "string: #A31515", + "dark_vs": "string: #CE9178", + "light_vs": "string: #A31515", + "hc_black": "string: #CE9178" + } } -] +] \ No newline at end of file From db91adfdf4cce70eb672a500c930fdeb68d9be89 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 13:58:43 +0100 Subject: [PATCH 326/429] Fix once again the macOS build --- build/azure-pipelines/darwin/product-build-darwin.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/azure-pipelines/darwin/product-build-darwin.yml b/build/azure-pipelines/darwin/product-build-darwin.yml index 2427beb711e..f28b5799dc3 100644 --- a/build/azure-pipelines/darwin/product-build-darwin.yml +++ b/build/azure-pipelines/darwin/product-build-darwin.yml @@ -21,6 +21,8 @@ steps: - script: | set -e + VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \ + AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \ yarn gulp -- vscode-darwin-min VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \ AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \ From 15179bead4e473303bd1654c5d12c959c3549b60 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 5 Feb 2019 15:46:10 +0100 Subject: [PATCH 327/429] align datatree with asyncdatatree --- src/vs/base/browser/ui/tree/dataTree.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/tree/dataTree.ts b/src/vs/base/browser/ui/tree/dataTree.ts index 4cc1d74e6b7..99fcac4edb5 100644 --- a/src/vs/base/browser/ui/tree/dataTree.ts +++ b/src/vs/base/browser/ui/tree/dataTree.ts @@ -17,7 +17,7 @@ export interface IDataTreeOptions extends IAbstractTreeOp export interface IDataTreeViewState { readonly focus: string[]; readonly selection: string[]; - readonly collapsed: string[]; + readonly expanded: string[]; } export class DataTree extends AbstractTree { @@ -70,7 +70,7 @@ export class DataTree extends AbstractTree extends AbstractTree 0) { const node = queue.shift()!; - if (node !== root && node.collapsed) { - collapsed.push(getId(node.element!)); + if (node !== root && node.collapsible && !node.collapsed) { + expanded.push(getId(node.element!)); } queue.push(...node.children); } - return { focus, selection, collapsed }; + return { focus, selection, expanded }; } } \ No newline at end of file From cf72cc410441b5a7fd398e7c0735ccbedba58727 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 5 Feb 2019 15:46:53 +0100 Subject: [PATCH 328/429] Fix #67821 --- .../markers/electron-browser/markersPanel.ts | 5 +- .../electron-browser/markersTreeViewer.ts | 47 ++++++++++++++++++- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts index c86ac4dca7c..0ab6213601a 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts @@ -33,7 +33,7 @@ import { IExpression, getEmptyExpression } from 'vs/base/common/glob'; import { mixin, deepClone } from 'vs/base/common/objects'; import { IWorkspaceFolder, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { isAbsolute, join } from 'vs/base/common/paths'; -import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, TreeElement, MarkersTreeAccessibilityProvider, MarkersViewModel } from 'vs/workbench/parts/markers/electron-browser/markersTreeViewer'; +import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, TreeElement, MarkersTreeAccessibilityProvider, MarkersViewModel, ResourceDragAndDrop } from 'vs/workbench/parts/markers/electron-browser/markersTreeViewer'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { Separator, ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; @@ -335,7 +335,8 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { { filter: this.filter, accessibilityProvider, - identityProvider + identityProvider, + dnd: new ResourceDragAndDrop(this.instantiationService) } ) as any as WorkbenchObjectTree; diff --git a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts index e7cb8ee2bbd..60902ef381b 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts @@ -19,9 +19,9 @@ import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/l import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { QuickFixAction, QuickFixActionItem } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; import { ILabelService } from 'vs/platform/label/common/label'; -import { dirname } from 'vs/base/common/resources'; +import { dirname, basename } from 'vs/base/common/resources'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { ITreeFilter, TreeVisibility, TreeFilterResult, ITreeRenderer, ITreeNode } from 'vs/base/browser/ui/tree/tree'; +import { ITreeFilter, TreeVisibility, TreeFilterResult, ITreeRenderer, ITreeNode, ITreeDragAndDrop, ITreeDragOverReaction } from 'vs/base/browser/ui/tree/tree'; import { FilterOptions } from 'vs/workbench/parts/markers/electron-browser/markersFilterOptions'; import { IMatch } from 'vs/base/common/filters'; import { Event, Emitter } from 'vs/base/common/event'; @@ -30,6 +30,9 @@ import { isUndefinedOrNull } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; import { Action } from 'vs/base/common/actions'; import { localize } from 'vs/nls'; +import { IDragAndDropData } from 'vs/base/browser/dnd'; +import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; +import { fillResourceDataTransfers } from 'vs/workbench/browser/dnd'; export type TreeElement = ResourceMarkers | Marker | RelatedInformation; @@ -584,3 +587,43 @@ export class MarkersViewModel extends Disposable { } } + +export class ResourceDragAndDrop implements ITreeDragAndDrop { + constructor( + private instantiationService: IInstantiationService + ) { } + + onDragOver(data: IDragAndDropData, targetElement: TreeElement, targetIndex: number, originalEvent: DragEvent): boolean | ITreeDragOverReaction { + return false; + } + + getDragURI(element: TreeElement): string | null { + if (element instanceof ResourceMarkers) { + return element.resource.toString(); + } + return null; + } + + getDragLabel?(elements: TreeElement[]): string | undefined { + if (elements.length > 1) { + return String(elements.length); + } + const element = elements[0]; + return element instanceof ResourceMarkers ? basename(element.resource) : undefined; + } + + onDragStart(data: IDragAndDropData, originalEvent: DragEvent): void { + const elements = (data as ElementsDragAndDropData).elements; + const resources: URI[] = elements + .filter(e => e instanceof ResourceMarkers) + .map((resourceMarker: ResourceMarkers) => resourceMarker.resource); + + if (resources.length) { + // Apply some datatransfer types to allow for dragging the element outside of the application + this.instantiationService.invokeFunction(fillResourceDataTransfers, resources, originalEvent); + } + } + + drop(data: IDragAndDropData, targetElement: TreeElement, targetIndex: number, originalEvent: DragEvent): void { + } +} From e50ef11ff189afa60ced0bfab7156d843f3881ba Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 5 Feb 2019 16:43:39 +0100 Subject: [PATCH 329/429] tree: refactor click handling for expansion --- src/vs/base/browser/ui/list/listWidget.ts | 40 +++++------ src/vs/base/browser/ui/tree/abstractTree.ts | 74 +++++++++++++-------- 2 files changed, 65 insertions(+), 49 deletions(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 53869580549..4724ca6224d 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -502,33 +502,29 @@ const DefaultOpenController: IOpenController = { } }; -class MouseController implements IDisposable { +export class MouseController implements IDisposable { private multipleSelectionSupport: boolean; readonly multipleSelectionController: IMultipleSelectionController; private openController: IOpenController; private disposables: IDisposable[] = []; - constructor( - private list: List, - private view: ListView, - options: IListOptions = {} - ) { - this.multipleSelectionSupport = !(options.multipleSelectionSupport === false); + constructor(protected list: List) { + this.multipleSelectionSupport = !(list.options.multipleSelectionSupport === false); if (this.multipleSelectionSupport) { - this.multipleSelectionController = options.multipleSelectionController || DefaultMultipleSelectionContoller; + this.multipleSelectionController = list.options.multipleSelectionController || DefaultMultipleSelectionContoller; } - this.openController = options.openController || DefaultOpenController; + this.openController = list.options.openController || DefaultOpenController; - view.onMouseDown(this.onMouseDown, this, this.disposables); - view.onContextMenu(this.onContextMenu, this, this.disposables); - view.onMouseClick(this.onPointer, this, this.disposables); - view.onMouseDblClick(this.onDoubleClick, this, this.disposables); - view.onTouchStart(this.onMouseDown, this, this.disposables); - view.onTap(this.onPointer, this, this.disposables); - Gesture.addTarget(view.domNode); + list.onMouseDown(this.onMouseDown, this, this.disposables); + list.onContextMenu(this.onContextMenu, this, this.disposables); + list.onMouseClick(this.onPointer, this, this.disposables); + list.onMouseDblClick(this.onDoubleClick, this, this.disposables); + list.onTouchStart(this.onMouseDown, this, this.disposables); + list.onTap(this.onPointer, this, this.disposables); + Gesture.addTarget(list.getHTMLElement()); } private isSelectionSingleChangeEvent(event: IListMouseEvent | IListTouchEvent): boolean { @@ -553,16 +549,16 @@ class MouseController implements IDisposable { private onMouseDown(e: IListMouseEvent | IListTouchEvent): void { if (document.activeElement !== e.browserEvent.target) { - this.view.domNode.focus(); + this.list.domFocus(); } } - private onContextMenu(e: IListMouseEvent | IListTouchEvent): void { + private onContextMenu(e: IListContextMenuEvent): void { const focus = typeof e.index === 'undefined' ? [] : [e.index]; this.list.setFocus(focus, e.browserEvent); } - private onPointer(e: IListMouseEvent): void { + protected onPointer(e: IListMouseEvent): void { let reference = this.list.getFocus()[0]; const selection = this.list.getSelection(); reference = reference === undefined ? selection[0] : reference; @@ -1213,7 +1209,7 @@ export class List implements ISpliceable, IDisposable { } if (typeof _options.mouseSupport === 'boolean' ? _options.mouseSupport : true) { - this.mouseController = new MouseController(this, this.view, _options); + this.mouseController = this.createMouseController(_options); this.disposables.push(this.mouseController); } @@ -1227,6 +1223,10 @@ export class List implements ISpliceable, IDisposable { this.style(_options); } + protected createMouseController(options: IListOptions): MouseController { + return new MouseController(this); + } + updateOptions(optionsUpdate: IListOptionsUpdate = {}): void { this._options = { ...this._options, ...optionsUpdate }; this._onDidUpdateOptions.fire(this._options); diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 134044cfde3..3262608778c 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -5,7 +5,7 @@ import 'vs/css!./media/tree'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; -import { IListOptions, List, IListStyles, mightProducePrintableCharacter } from 'vs/base/browser/ui/list/listWidget'; +import { IListOptions, List, IListStyles, mightProducePrintableCharacter, MouseController } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass } from 'vs/base/browser/dom'; import { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event'; @@ -761,11 +761,47 @@ class Trait { } } +export class TreeNodeListMouseController extends MouseController> { + + constructor(list: TreeNodeList, private tree: AbstractTree) { + super(list); + } + + protected onPointer(e: IListMouseEvent>): void { + const node = e.element; + + if (!node) { + super.onPointer(e); + return; + } + + if (this.multipleSelectionController.isSelectionRangeChangeEvent(e) || this.multipleSelectionController.isSelectionSingleChangeEvent(e)) { + super.onPointer(e); + return; + } + + if (!this.tree.options.openOnSingleClick && e.browserEvent.detail !== 2) { + super.onPointer(e); + return; + } + + const model = ((this.tree as any).model as ITreeModel); // internal + const location = model.getNodeLocation(node); + const recursive = e.browserEvent.altKey; + model.setCollapsed(location, undefined, recursive); + super.onPointer(e); + } +} + +interface ITreeNodeListOptions extends IListOptions> { + readonly tree: AbstractTree; +} + /** * We use this List subclass to restore selection and focus as nodes * get rendered in the list, possibly due to a node expand() call. */ -class TreeNodeList extends List> { +class TreeNodeList extends List> { constructor( container: HTMLElement, @@ -773,11 +809,15 @@ class TreeNodeList extends List> { renderers: IListRenderer[], private focusTrait: Trait, private selectionTrait: Trait, - options?: IListOptions> + options: ITreeNodeListOptions ) { super(container, virtualDelegate, renderers, options); } + protected createMouseController(options: ITreeNodeListOptions): MouseController> { + return new TreeNodeListMouseController(this, options.tree); + } + splice(start: number, deleteCount: number, elements: ITreeNode[] = []): void { super.splice(start, deleteCount, elements); @@ -826,7 +866,7 @@ class TreeNodeList extends List> { export abstract class AbstractTree implements IDisposable { - private view: TreeNodeList; + private view: TreeNodeList; private renderers: TreeRenderer[]; private focusNavigationFilter: ((node: ITreeNode) => boolean) | undefined; protected model: ITreeModel; @@ -884,7 +924,7 @@ export abstract class AbstractTree implements IDisposable this.disposables.push(filter); } - this.view = new TreeNodeList(container, treeDelegate, this.renderers, this.focus, this.selection, asListOptions(() => this.model, _options)); + this.view = new TreeNodeList(container, treeDelegate, this.renderers, this.focus, this.selection, { ...asListOptions(() => this.model, _options), tree: this }); this.model = this.createModel(this.view, _options); onDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState; @@ -920,9 +960,6 @@ export abstract class AbstractTree implements IDisposable }, null, this.disposables); } - this.view.onTap(this.reactOnMouseClick, this, this.disposables); - this.view.onMouseClick(this.reactOnMouseClick, this, this.disposables); - if (_options.keyboardSupport !== false) { const onKeyDown = Event.chain(this.view.onKeyDown) .filter(e => !isInputElement(e.target as HTMLElement)) @@ -1164,27 +1201,6 @@ export abstract class AbstractTree implements IDisposable return this.view.length; } - private reactOnMouseClick(e: IListMouseEvent>): void { - const node = e.element; - - if (!node) { - return; - } - - if (this.view.multipleSelectionController.isSelectionRangeChangeEvent(e) || this.view.multipleSelectionController.isSelectionSingleChangeEvent(e)) { - return; - } - - if (!this.openOnSingleClick && e.browserEvent.detail !== 2) { - return; - } - - const location = this.model.getNodeLocation(node); - const recursive = e.browserEvent.altKey; - - this.model.setCollapsed(location, undefined, recursive); - } - private onLeftArrow(e: StandardKeyboardEvent): void { e.preventDefault(); e.stopPropagation(); From 1dd559cddcfca9b81b3046981dd3743a78353e59 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Tue, 5 Feb 2019 17:13:23 +0100 Subject: [PATCH 330/429] tree.expandOnlyOnTwistieClick fixes #67909 --- src/vs/base/browser/ui/tree/abstractTree.ts | 30 ++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 3262608778c..64e526e262b 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -7,7 +7,7 @@ import 'vs/css!./media/tree'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { IListOptions, List, IListStyles, mightProducePrintableCharacter, MouseController } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; -import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass } from 'vs/base/browser/dom'; +import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass, hasClass, createStyleSheet } from 'vs/base/browser/dom'; import { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event'; import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; @@ -697,6 +697,7 @@ export interface IAbstractTreeOptions extends IAbstractTr readonly dnd?: ITreeDragAndDrop; readonly autoExpandSingleChildren?: boolean; readonly keyboardNavigationEventFilter?: IKeyboardNavigationEventFilter; + readonly expandOnlyOnTwistieClick?: boolean; } /** @@ -761,7 +762,7 @@ class Trait { } } -export class TreeNodeListMouseController extends MouseController> { +class TreeNodeListMouseController extends MouseController> { constructor(list: TreeNodeList, private tree: AbstractTree) { super(list); @@ -771,24 +772,32 @@ export class TreeNodeListMouseController extends MouseCont const node = e.element; if (!node) { - super.onPointer(e); - return; + return super.onPointer(e); } if (this.multipleSelectionController.isSelectionRangeChangeEvent(e) || this.multipleSelectionController.isSelectionSingleChangeEvent(e)) { - super.onPointer(e); - return; + return super.onPointer(e); } - if (!this.tree.options.openOnSingleClick && e.browserEvent.detail !== 2) { - super.onPointer(e); - return; + if (!this.tree.openOnSingleClick && e.browserEvent.detail !== 2) { + return super.onPointer(e); + } + + const onTwistie = hasClass(e.browserEvent.target as HTMLElement, 'monaco-tl-twistie'); + + if (this.tree.expandOnlyOnTwistieClick && !onTwistie) { + return super.onPointer(e); } const model = ((this.tree as any).model as ITreeModel); // internal const location = model.getNodeLocation(node); const recursive = e.browserEvent.altKey; model.setCollapsed(location, undefined, recursive); + + if (this.tree.expandOnlyOnTwistieClick && onTwistie) { + return; + } + super.onPointer(e); } } @@ -900,7 +909,10 @@ export abstract class AbstractTree implements IDisposable readonly onWillRefilter: Event = this._onWillRefilter.event; get filterOnType(): boolean { return !!this._options.filterOnType; } + + // Options TODO@joao expose options only, not Optional<> get openOnSingleClick(): boolean { return typeof this._options.openOnSingleClick === 'undefined' ? true : this._options.openOnSingleClick; } + get expandOnlyOnTwistieClick(): boolean { return typeof this._options.expandOnlyOnTwistieClick === 'undefined' ? false : this._options.expandOnlyOnTwistieClick; } get onDidDispose(): Event { return this.view.onDidDispose; } From 3d3844b8448bff9946825e661796306511be939d Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 18:08:41 +0100 Subject: [PATCH 331/429] Adopt new gulp tasks (#67863) --- build/gulpfile.vscode.js | 115 ++++++++++++++++++++++----------------- 1 file changed, 66 insertions(+), 49 deletions(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 9629e6dec1a..c5887cde3f7 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -87,36 +87,46 @@ const BUNDLED_FILE_HEADER = [ ' *--------------------------------------------------------*/' ].join('\n'); -gulp.task('optimize-vscode', - util.task.series( - util.task.parallel( - util.rimraf('out-vscode'), - compileBuildTask - ), - common.optimizeTask({ - src: 'out-build', - entryPoints: vscodeEntryPoints, - otherSources: [], - resources: vscodeResources, - loaderConfig: common.loaderConfig(nodeModules), - header: BUNDLED_FILE_HEADER, - out: 'out-vscode', - bundleInfo: undefined - }) - ) +const optimizeVSCodeTask = util.task.series( + util.task.parallel( + util.rimraf('out-vscode'), + compileBuildTask + ), + common.optimizeTask({ + src: 'out-build', + entryPoints: vscodeEntryPoints, + otherSources: [], + resources: vscodeResources, + loaderConfig: common.loaderConfig(nodeModules), + header: BUNDLED_FILE_HEADER, + out: 'out-vscode', + bundleInfo: undefined + }) ); +optimizeVSCodeTask.displayName = 'optimize-vscode'; +gulp.task(optimizeVSCodeTask.displayName, optimizeVSCodeTask); -gulp.task('optimize-index-js', ['optimize-vscode'], () => { - const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js'); - const contents = fs.readFileSync(fullpath).toString(); - const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules)); - fs.writeFileSync(fullpath, newContents); -}); +const optimizeIndexJSTask = util.task.series( + optimizeVSCodeTask, + () => { + const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js'); + const contents = fs.readFileSync(fullpath).toString(); + const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules)); + fs.writeFileSync(fullpath, newContents); + } +); +optimizeIndexJSTask.displayName = 'optimize-index-js'; const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`; -gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min')); -gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)); +const minifyVSCodeTask = util.task.series( + util.task.parallel( + util.rimraf('out-vscode-min'), + optimizeIndexJSTask + ), + common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`) +); +minifyVSCodeTask.displayName = 'minify-vscode'; // Package @@ -246,14 +256,14 @@ function computeChecksum(filename) { return hash; } -function packageTask(platform, arch, opts) { +function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) { opts = opts || {}; - const destination = path.join(path.dirname(root), 'VSCode') + (platform ? '-' + platform : '') + (arch ? '-' + arch : ''); + const destination = path.join(path.dirname(root), destinationFolderName); platform = platform || process.platform; return () => { - const out = opts.minified ? 'out-vscode-min' : 'out-vscode'; + const out = sourceFolderName; const checksums = computeChecksums(out, [ 'vs/workbench/workbench.main.js', @@ -430,29 +440,36 @@ function packageTask(platform, arch, opts) { const buildRoot = path.dirname(root); -gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'VSCode-win32-ia32'))); -gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'VSCode-win32-x64'))); -gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'VSCode-darwin'))); -gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'VSCode-linux-ia32'))); -gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'VSCode-linux-x64'))); -gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'VSCode-linux-arm'))); -gulp.task('clean-vscode-linux-arm64', util.rimraf(path.join(buildRoot, 'VSCode-linux-arm64'))); +const BUILD_TARGETS = [ + { platform: 'win32', arch: 'ia32' }, + { platform: 'win32', arch: 'x64' }, + { platform: 'darwin', arch: null, opts: { stats: true } }, + { platform: 'linux', arch: 'ia32' }, + { platform: 'linux', arch: 'x64' }, + { platform: 'linux', arch: 'arm' }, + { platform: 'linux', arch: 'arm64' }, +]; +BUILD_TARGETS.forEach(buildTarget => { + const dashed = (str) => (str ? `-${str}` : ``); + const platform = buildTarget.platform; + const arch = buildTarget.arch; + const opts = buildTarget.opts; -gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32')); -gulp.task('vscode-win32-x64', ['optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64')); -gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { stats: true })); -gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32')); -gulp.task('vscode-linux-x64', ['optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64')); -gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm')); -gulp.task('vscode-linux-arm64', ['optimize-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64')); + ['', 'min'].forEach(minified => { + const sourceFolderName = `out-vscode${dashed(minified)}`; + const destinationFolderName = `VSCode${dashed(platform)}${dashed(arch)}`; -gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true })); -gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true })); -gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true, stats: true })); -gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true })); -gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true })); -gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true })); -gulp.task('vscode-linux-arm64-min', ['minify-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64', { minified: true })); + const vscodeTask = util.task.series( + util.task.parallel( + minified ? minifyVSCodeTask : optimizeVSCodeTask, + util.rimraf(path.join(buildRoot, destinationFolderName)) + ), + packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) + ); + vscodeTask.displayName = `vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`; + gulp.task(vscodeTask.displayName, vscodeTask); + }); +}); // Transifex Localizations From add9437982c04313d76a035a5064c0b034c6c97c Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 18:18:18 +0100 Subject: [PATCH 332/429] WorkbenchAsyncDataTree implements IThemable --- build/monaco/monaco.usage.recipe | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/monaco/monaco.usage.recipe b/build/monaco/monaco.usage.recipe index e75b8585a2d..fad1e8ee724 100644 --- a/build/monaco/monaco.usage.recipe +++ b/build/monaco/monaco.usage.recipe @@ -10,6 +10,7 @@ import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge'; import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker'; import { create as create2 } from './vs/editor/common/services/editorSimpleWorker'; import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget'; +import { WorkbenchAsyncDataTree } from './vs/platform/list/browser/listService'; import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors'; import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator'; import * as editorAPI from './vs/editor/editor.api'; @@ -22,6 +23,7 @@ import * as editorAPI from './vs/editor/editor.api'; a = (b).getWorkspace; // IWorkspaceFolderProvider a = (b).style; // IThemable a = (b).style; // IThemable + a = (>b).style; // IThemable a = (b).userHome; // IUserHomeProvider a = (b).previous; // IDiffNavigator a = (>b).type; From c9352c4ca97ac480caec922a1c970f5c91e1884f Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 19:23:51 +0100 Subject: [PATCH 333/429] Adopt new style gulp tasks for the editor (#67863) --- build/gulpfile.editor.js | 125 +++++++++++++++++---------------------- build/lib/util.js | 23 ++++--- build/lib/util.ts | 26 +++++--- 3 files changed, 86 insertions(+), 88 deletions(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index e9bb8cddf52..eb59eb533e1 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -63,7 +63,7 @@ var BUNDLED_FILE_HEADER = [ const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []); -gulp.task('extract-editor-src', util.task.series(util.rimraf('out-editor-src'), function () { +const extractEditorSrcTask = function () { console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`); const apiusages = monacoapi.execute().usageContent; const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString(); @@ -98,14 +98,13 @@ gulp.task('extract-editor-src', util.task.series(util.rimraf('out-editor-src'), importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/, destRoot: path.join(root, 'out-editor-src') }); -})); +}; +extractEditorSrcTask.displayName = 'extract-editor-src'; -// Full compile, including nls and inline sources in sourcemaps, for build -gulp.task('clean-editor-build', util.rimraf('out-editor-build')); -gulp.task('compile-editor-build', ['clean-editor-build', 'extract-editor-src'], compilation.compileTask('out-editor-src', 'out-editor-build', true)); +const compileEditorAMDTask = compilation.compileTask('out-editor-src', 'out-editor-build', true); +compileEditorAMDTask.displayName = 'compile-editor-amd'; -gulp.task('clean-optimized-editor', util.rimraf('out-editor')); -gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], common.optimizeTask({ +const optimizeEditorAMDTask = common.optimizeTask({ src: 'out-editor-build', entryPoints: editorEntryPoints, otherSources: editorOtherSources, @@ -123,13 +122,13 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], bundleInfo: true, out: 'out-editor', languages: languages -})); +}); +optimizeEditorAMDTask.displayName = 'optimize-editor-amd'; -gulp.task('clean-minified-editor', util.rimraf('out-editor-min')); -gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor')); +const minifyEditorAMDTask = common.minifyTask('out-editor'); +minifyEditorAMDTask.displayName = 'minify-editor-amd'; -gulp.task('clean-editor-esm', util.rimraf('out-editor-esm')); -gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'extract-editor-src'], function () { +const createESMSourcesAndResourcesTask = function () { standalone.createESMSourcesAndResources2({ srcFolder: './out-editor-src', outFolder: './out-editor-esm', @@ -150,8 +149,10 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext 'vs/nls.mock.ts': 'vs/nls.ts' } }); -}); -gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () { +}; +createESMSourcesAndResourcesTask.displayName = 'extract-editor-esm'; + +const compileEditorESMTask = function () { if (process.platform === 'win32') { const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, { cwd: path.join(__dirname, '../out-editor-esm') @@ -165,7 +166,8 @@ gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], f console.log(result.stdout.toString()); console.log(result.stderr.toString()); } -}); +}; +compileEditorESMTask.displayName = 'compile-editor-esm'; function toExternalDTS(contents) { let lines = contents.split('\n'); @@ -202,8 +204,16 @@ function toExternalDTS(contents) { return lines.join('\n'); } -gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core')); -gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () { +function filterStream(testFunc) { + return es.through(function (data) { + if (!testFunc(data.relative)) { + return; + } + this.emit('data', data); + }); +} + +const finalEditorResourcesTask = function () { return es.merge( // other assets es.merge( @@ -280,61 +290,34 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify return /\.js\.map$/.test(path); })).pipe(gulp.dest('out-monaco-editor-core/min-maps')) ); -}); - -gulp.task('analyze-editor-distro', function () { - // @ts-ignore - var bundleInfo = require('../out-editor/bundleInfo.json'); - var graph = bundleInfo.graph; - var bundles = bundleInfo.bundles; - - var inverseGraph = {}; - Object.keys(graph).forEach(function (module) { - var dependencies = graph[module]; - dependencies.forEach(function (dep) { - inverseGraph[dep] = inverseGraph[dep] || []; - inverseGraph[dep].push(module); - }); - }); - - var detailed = {}; - Object.keys(bundles).forEach(function (entryPoint) { - var included = bundles[entryPoint]; - var includedMap = {}; - included.forEach(function (included) { - includedMap[included] = true; - }); - - var explanation = []; - included.map(function (included) { - if (included.indexOf('!') >= 0) { - return; - } - - var reason = (inverseGraph[included] || []).filter(function (mod) { - return !!includedMap[mod]; - }); - explanation.push({ - module: included, - reason: reason - }); - }); - - detailed[entryPoint] = explanation; - }); - - console.log(JSON.stringify(detailed, null, '\t')); -}); - -function filterStream(testFunc) { - return es.through(function (data) { - if (!testFunc(data.relative)) { - return; - } - this.emit('data', data); - }); -} +}; +finalEditorResourcesTask.displayName = 'final-editor-resources'; +gulp.task('editor-distro', + util.task.series( + util.task.parallel( + util.rimraf('out-editor-src'), + util.rimraf('out-editor-build'), + util.rimraf('out-editor-esm'), + util.rimraf('out-monaco-editor-core'), + util.rimraf('out-editor'), + util.rimraf('out-editor-min') + ), + extractEditorSrcTask, + util.task.parallel( + util.task.series( + compileEditorAMDTask, + optimizeEditorAMDTask, + minifyEditorAMDTask + ), + util.task.series( + createESMSourcesAndResourcesTask, + compileEditorESMTask + ) + ), + finalEditorResourcesTask + ) +); //#region monaco type checking diff --git a/build/lib/util.js b/build/lib/util.js index 90b1e622cb1..b6228ad4cf9 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -209,21 +209,28 @@ var task; async function _execute(task) { // Always invoke as if it were a callback task return new Promise((resolve, reject) => { - const taskResult = task((err) => { - if (err) { - return reject(err); - } - resolve(); - }); + if (task.length === 1) { + // this is a calback task + task((err) => { + if (err) { + return reject(err); + } + resolve(); + }); + return; + } + const taskResult = task(); if (typeof taskResult === 'undefined') { - // this was a callback task + // this is a sync task + resolve(); return; } if (_isPromise(taskResult)) { - // this was a promise returning task + // this is a promise returning task taskResult.then(resolve, reject); return; } + // this is a stream returning task taskResult.on('end', _ => resolve()); taskResult.on('error', err => reject(err)); }); diff --git a/build/lib/util.ts b/build/lib/util.ts index 4ff07196612..42d3aba2fee 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -254,7 +254,7 @@ export function primraf(dir: string): Promise { export type PromiseTask = () => Promise; export type StreamTask = () => NodeJS.ReadWriteStream; -export type CallbackTask = (cb: (err?: any) => void) => void; +export type CallbackTask = (cb?: (err?: any) => void) => void; export type Task = PromiseTask | StreamTask | CallbackTask; export namespace task { @@ -269,24 +269,32 @@ export namespace task { async function _execute(task: Task): Promise { // Always invoke as if it were a callback task return new Promise((resolve, reject) => { - const taskResult = task((err) => { - if (err) { - return reject(err); - } - resolve(); - }); + if (task.length === 1) { + // this is a calback task + task((err) => { + if (err) { + return reject(err); + } + resolve(); + }); + return; + } + + const taskResult = task(); if (typeof taskResult === 'undefined') { - // this was a callback task + // this is a sync task + resolve(); return; } if (_isPromise(taskResult)) { - // this was a promise returning task + // this is a promise returning task taskResult.then(resolve, reject); return; } + // this is a stream returning task taskResult.on('end', _ => resolve()); taskResult.on('error', err => reject(err)); }); From 209ad59b91df43b4d46ec3f1a0592a82572e795a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 19:24:51 +0100 Subject: [PATCH 334/429] Remove unused import --- src/vs/base/browser/ui/tree/abstractTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 64e526e262b..5e947eb2052 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -7,7 +7,7 @@ import 'vs/css!./media/tree'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { IListOptions, List, IListStyles, mightProducePrintableCharacter, MouseController } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; -import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass, hasClass, createStyleSheet } from 'vs/base/browser/dom'; +import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass, hasClass } from 'vs/base/browser/dom'; import { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event'; import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; From 6063e04fee84bbd61763d92b39d6cf86cec3e22a Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Tue, 5 Feb 2019 10:43:52 -0800 Subject: [PATCH 335/429] fix light menu fg theming fixes #67918 --- src/vs/platform/theme/common/colorRegistry.ts | 2 +- src/vs/platform/theme/common/styler.ts | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 8c94876cb23..3fb34ab3b6c 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -257,7 +257,7 @@ export const scrollbarSliderActiveBackground = registerColor('scrollbarSlider.ac export const progressBarBackground = registerColor('progressBar.background', { dark: Color.fromHex('#0E70C0'), light: Color.fromHex('#0E70C0'), hc: contrastBorder }, nls.localize('progressBarBackground', "Background color of the progress bar that can show for long running operations.")); export const menuBorder = registerColor('menu.border', { dark: null, light: null, hc: contrastBorder }, nls.localize('menuBorder', "Border color of menus.")); -export const menuForeground = registerColor('menu.foreground', { dark: selectForeground, light: selectForeground, hc: selectForeground }, nls.localize('menuForeground', "Foreground color of menu items.")); +export const menuForeground = registerColor('menu.foreground', { dark: selectForeground, light: foreground, hc: selectForeground }, nls.localize('menuForeground', "Foreground color of menu items.")); export const menuBackground = registerColor('menu.background', { dark: selectBackground, light: selectBackground, hc: selectBackground }, nls.localize('menuBackground', "Background color of menu items.")); export const menuSelectionForeground = registerColor('menu.selectionForeground', { dark: listActiveSelectionForeground, light: listActiveSelectionForeground, hc: listActiveSelectionForeground }, nls.localize('menuSelectionForeground', "Foreground color of the selected menu item in menus.")); export const menuSelectionBackground = registerColor('menu.selectionBackground', { dark: listActiveSelectionBackground, light: listActiveSelectionBackground, hc: listActiveSelectionBackground }, nls.localize('menuSelectionBackground', "Background color of the selected menu item in menus.")); diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index d7725d4d1ca..eac33a668a9 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -327,10 +327,5 @@ export const defaultMenuStyles = { }; export function attachMenuStyler(widget: IThemable, themeService, style?: IMenuStyleOverrides): IDisposable { - const styles = { ...defaultMenuStyles, ...style }; - const fallback: IMenuStyleOverrides = { - foregroundColor: !!styles.foregroundColor && !!themeService && !!themeService.getTheme().getColor(styles.foregroundColor) ? styles.foregroundColor : foreground - }; - - return attachStyler(themeService, { ...styles, ...fallback }, widget); + return attachStyler(themeService, { ...defaultMenuStyles, ...style }, widget); } From a9a726aa0dede7b0dbbaef25aea7cc7b23b74ac5 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 5 Feb 2019 11:37:08 -0800 Subject: [PATCH 336/429] vscode-xterm@3.12.0-beta2 Fixes #67933 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 5f78d0e4027..d1ccfcda47d 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "vscode-ripgrep": "^1.2.5", "vscode-sqlite3": "4.0.7", "vscode-textmate": "^4.0.1", - "vscode-xterm": "3.12.0-beta1", + "vscode-xterm": "3.12.0-beta2", "winreg": "^1.2.4", "yauzl": "^2.9.1", "yazl": "^2.4.3" diff --git a/yarn.lock b/yarn.lock index bfb1e38ac88..37c70a4517c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9433,10 +9433,10 @@ vscode-uri@^1.0.6: resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-1.0.6.tgz#6b8f141b0bbc44ad7b07e94f82f168ac7608ad4d" integrity sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww== -vscode-xterm@3.12.0-beta1: - version "3.12.0-beta1" - resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.12.0-beta1.tgz#7dc28214077d1d8fc306fb6f392b4b553c6b0024" - integrity sha512-bv6AbbtzMfNdku97BomTY7PJNo1Bd0sHnNy9GZmMeVm8SoLxxvhmR2PRsbYY0AD1n7wbA7l55msJKye57+mD/w== +vscode-xterm@3.12.0-beta2: + version "3.12.0-beta2" + resolved "https://registry.yarnpkg.com/vscode-xterm/-/vscode-xterm-3.12.0-beta2.tgz#fbbf6d1926e0628d4e0b85b1bfdefa2b0bf40df6" + integrity sha512-NhLYyJXjwLXXzn+NYEOkAtTxbdbAGkjztabE2Vy8j4fXXOwHHHg6KurMCbL7bd8BOEMIPrTIw6zLhzfexs5Vhw== vso-node-api@6.1.2-preview: version "6.1.2-preview" From c064781f92ddac447a24cbd4df88f0a61c9a2006 Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 5 Feb 2019 12:05:46 -0800 Subject: [PATCH 337/429] Fix #66151 - refactor settings editor layout --- .../parts/preferences/browser/settingsTree.ts | 44 ++++--- .../preferences/browser/settingsWidgets.ts | 10 +- .../media/settingsEditor2.css | 123 ++++++++---------- .../electron-browser/settingsEditor2.ts | 2 +- 4 files changed, 84 insertions(+), 95 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/settingsTree.ts b/src/vs/workbench/parts/preferences/browser/settingsTree.ts index 9f13b1ae66e..67bc7db7bbe 100644 --- a/src/vs/workbench/parts/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/parts/preferences/browser/settingsTree.ts @@ -256,6 +256,8 @@ export abstract class AbstractSettingRenderer implements ITreeRenderer { templateId = SETTINGS_TEXT_TEMPLATE_ID; - renderTemplate(container: HTMLElement): ISettingTextItemTemplate { - const common = this.renderCommonTemplate(null, container, 'text'); - const validationErrorMessageElement = DOM.append(container, $('.setting-item-validation-message')); + renderTemplate(_container: HTMLElement): ISettingTextItemTemplate { + const common = this.renderCommonTemplate(null, _container, 'text'); + const validationErrorMessageElement = DOM.append(common.containerElement, $('.setting-item-validation-message')); const inputBox = new InputBox(common.controlElement, this._contextViewService); common.toDispose.push(inputBox); @@ -851,9 +855,9 @@ export class SettingEnumRenderer extends AbstractSettingRenderer implements ITre export class SettingNumberRenderer extends AbstractSettingRenderer implements ITreeRenderer { templateId = SETTINGS_NUMBER_TEMPLATE_ID; - renderTemplate(container: HTMLElement): ISettingNumberItemTemplate { - const common = super.renderCommonTemplate(null, container, 'number'); - const validationErrorMessageElement = DOM.append(container, $('.setting-item-validation-message')); + renderTemplate(_container: HTMLElement): ISettingNumberItemTemplate { + const common = super.renderCommonTemplate(null, _container, 'number'); + const validationErrorMessageElement = DOM.append(common.containerElement, $('.setting-item-validation-message')); const inputBox = new InputBox(common.controlElement, this._contextViewService, { type: 'number' }); common.toDispose.push(inputBox); @@ -906,9 +910,11 @@ export class SettingNumberRenderer extends AbstractSettingRenderer implements IT export class SettingBoolRenderer extends AbstractSettingRenderer implements ITreeRenderer { templateId = SETTINGS_BOOL_TEMPLATE_ID; - renderTemplate(container: HTMLElement): ISettingBoolItemTemplate { - DOM.addClass(container, 'setting-item'); - DOM.addClass(container, 'setting-item-bool'); + renderTemplate(_container: HTMLElement): ISettingBoolItemTemplate { + DOM.addClass(_container, 'setting-item'); + DOM.addClass(_container, 'setting-item-bool'); + + const container = DOM.append(_container, $(AbstractSettingRenderer.CONTENTS_SELECTOR)); const titleElement = DOM.append(container, $('.setting-item-title')); const categoryElement = DOM.append(titleElement, $('span.setting-item-category')); @@ -1073,7 +1079,7 @@ export class SettingTreeRenderers { } getSettingDOMElementForDOMElement(domElement: HTMLElement): HTMLElement { - const parent = DOM.findParentWithClass(domElement, 'setting-item'); + const parent = DOM.findParentWithClass(domElement, AbstractSettingRenderer.CONTENTS_CLASS); if (parent) { return parent; } @@ -1324,27 +1330,27 @@ export class SettingsTree extends ObjectTree { // Links appear inside other elements in markdown. CSS opacity acts like a mask. So we have to dynamically compute the description color to avoid // applying an opacity to the link color. const fgWithOpacity = new Color(new RGBA(foregroundColor.rgba.r, foregroundColor.rgba.g, foregroundColor.rgba.b, 0.9)); - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description { color: ${fgWithOpacity}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description { color: ${fgWithOpacity}; }`); } const errorColor = theme.getColor(errorForeground); if (errorColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-deprecation-message { color: ${errorColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-deprecation-message { color: ${errorColor}; }`); } const invalidInputBackground = theme.getColor(inputValidationErrorBackground); if (invalidInputBackground) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-validation-message { background-color: ${invalidInputBackground}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-validation-message { background-color: ${invalidInputBackground}; }`); } const invalidInputForeground = theme.getColor(inputValidationErrorForeground); if (invalidInputForeground) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-validation-message { color: ${invalidInputForeground}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-validation-message { color: ${invalidInputForeground}; }`); } const invalidInputBorder = theme.getColor(inputValidationErrorBorder); if (invalidInputBorder) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-validation-message { border-style:solid; border-width: 1px; border-color: ${invalidInputBorder}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-validation-message { border-style:solid; border-width: 1px; border-color: ${invalidInputBorder}; }`); collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item.invalid-input .setting-item-control .monaco-inputbox.idle { outline-width: 0; border-style:solid; border-width: 1px; border-color: ${invalidInputBorder}; }`); } @@ -1356,7 +1362,7 @@ export class SettingsTree extends ObjectTree { const focusBorderColor = theme.getColor(focusBorder); if (focusBorderColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:focus { outline-color: ${focusBorderColor} }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:focus { outline-color: ${focusBorderColor} }`); } })); diff --git a/src/vs/workbench/parts/preferences/browser/settingsWidgets.ts b/src/vs/workbench/parts/preferences/browser/settingsWidgets.ts index bde2e02e2b0..39d3f19aae5 100644 --- a/src/vs/workbench/parts/preferences/browser/settingsWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/settingsWidgets.ts @@ -63,16 +63,16 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const link = theme.getColor(textLinkForeground); if (link) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a { color: ${link}; }`); - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a > code { color: ${link}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a { color: ${link}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a > code { color: ${link}; }`); collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a { color: ${link}; }`); collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a > code { color: ${link}; }`); } const activeLink = theme.getColor(textLinkActiveForeground); if (activeLink) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:hover, .settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:active { color: ${activeLink}; }`); - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:hover > code, .settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:active > code { color: ${activeLink}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:hover, .settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:active { color: ${activeLink}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:hover > code, .settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:active > code { color: ${activeLink}; }`); collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:hover, .monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:active { color: ${activeLink}; }`); collector.addRule(`.monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:hover > code, .monaco-select-box-dropdown-container > .select-box-details-pane > .select-box-description-markdown a:active > code { color: ${activeLink}; }`); } @@ -127,7 +127,7 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { const modifiedItemIndicatorColor = theme.getColor(modifiedItemIndicator); if (modifiedItemIndicatorColor) { - collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item > .setting-item-modified-indicator { border-color: ${modifiedItemIndicatorColor}; }`); + collector.addRule(`.settings-editor > .settings-body > .settings-tree-container .setting-item-contents > .setting-item-modified-indicator { border-color: ${modifiedItemIndicatorColor}; }`); } }); diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css b/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css index 0674380596b..3c84a5c7efe 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css +++ b/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css @@ -122,31 +122,9 @@ text-decoration: underline; } -.settings-editor.narrow-width > .settings-body .settings-tree-container .monaco-list-rows { - margin-left: 0px; -} - -.settings-editor > .settings-body .settings-tree-container .monaco-list-rows { - max-width: 1000px; - margin: auto; -} - -.settings-editor > .settings-body .settings-tree-container .monaco-list-row { - line-height: 1.4em !important; /* TODO */ - padding-left: 208px; - padding-right: 24px; - /* box-sizing: border-box; */ -} - -.settings-editor > .settings-body .settings-tree-container .monaco-list-row .monaco-tl-row { - position: relative; -} - -.settings-editor.no-toc-search > .settings-body .settings-tree-container .monaco-list-row, -.settings-editor.narrow-width > .settings-body .settings-tree-container .monaco-list-row { - /* 3 margin + 20 padding + 2 border */ - width: calc(100% - 25px); - padding-left: 25px; +.settings-editor.no-toc-search > .settings-body .settings-tree-container .monaco-list-row .monaco-tl-contents, +.settings-editor.narrow-width > .settings-body .settings-tree-container .monaco-list-row .monaco-tl-contents { + padding-left: 33px; } .settings-editor > .settings-body .settings-tree-container .monaco-list-row .monaco-tl-twistie { @@ -162,14 +140,15 @@ .settings-editor > .settings-body > .settings-tree-container .shadow.top { left: 50%; - max-width: 952px; /* 1000 - 24*2 padding */ + max-width: 952px; + /* 1000 - 24*2 padding */ margin-left: -476px; z-index: 1000; } .settings-editor > .settings-body .settings-tree-container .setting-toolbar-container { position: absolute; - left: -23px; + left: -32px; top: 11px; bottom: 0px; width: 26px; @@ -270,7 +249,6 @@ padding-left: 31px; } -.settings-editor > .settings-body .settings-tree-container .monaco-list-rows, .settings-editor > .settings-body .settings-toc-wrapper { height: 100%; max-width: 1000px; @@ -283,94 +261,105 @@ } .settings-editor > .settings-body > .settings-tree-container .monaco-list-row { + line-height: 1.4em !important; + + /* so validation messages don't get clipped */ overflow: visible; - /* so validation messages dont get clipped */ cursor: default; } -.settings-editor > .settings-body > .settings-tree-container .setting-item { - padding-top: 12px; - padding-bottom: 18px; +.settings-editor > .settings-body .settings-tree-container .monaco-list-row .monaco-tl-contents { + max-width: 1000px; + margin: auto; box-sizing: border-box; - white-space: normal; - height: 100%; + padding-left: 217px; + padding-right: 20px; + overflow: visible; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-title { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents { + position: relative; + padding-top: 12px; + padding-bottom: 18px; + white-space: normal; +} + +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - display: inline-block; /* size to contents for hover to show context button */ + display: inline-block; + /* size to contents for hover to show context button */ } -.settings-editor > .settings-body > .settings-tree-container .setting-item > .setting-item-modified-indicator { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-modified-indicator { display: none; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.is-configured > .setting-item-modified-indicator { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents.is-configured .setting-item-modified-indicator { display: block; content: ' '; position: absolute; width: 6px; border-left-width: 2px; border-left-style: solid; - left: 0px; + left: -9px; top: 15px; bottom: 16px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item-bool.is-configured > .setting-item-modified-indicator { +.settings-editor > .settings-body > .settings-tree-container .setting-item-bool .setting-item-contents.is-configured .setting-item-modified-indicator { bottom: 23px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-title .setting-item-overrides { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title .setting-item-overrides { opacity: 0.5; font-style: italic; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-title .setting-item-overrides a.modified-scope { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-title .setting-item-overrides a.modified-scope { text-decoration: underline; cursor: pointer; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-label { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-label { margin-right: 7px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-cat-label-container { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-cat-label-container { float: left; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-label, -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-category { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-label, +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-category { font-weight: 600; user-select: text; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-category { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-category { opacity: 0.9; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-deprecation-message { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-deprecation-message { margin-top: 3px; user-select: text; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description { margin-top: -1px; user-select: text; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-deprecation-message { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-deprecation-message { position: absolute; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-validation-message { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-validation-message { display: none; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.invalid-input .setting-item-validation-message { +.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-contents.invalid-input .setting-item-validation-message { display: block; position: absolute; padding: 5px; @@ -392,35 +381,35 @@ -webkit-appearance: none !important; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown * { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown * { margin: 0px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:focus { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:focus { outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; text-decoration: underline; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown a:hover { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown a:hover { text-decoration: underline; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-description-markdown code { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-description-markdown code { line-height: 15px; /** For some reason, this is needed, otherwise will take up 20px height */ font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Courier New", monospace, "Droid Sans Fallback"; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-enumDescription { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-enumDescription { display: none; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-enumDescription { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-enumDescription { display: block; } -.settings-editor > .settings-body > .settings-tree-container .setting-item.setting-item-bool { +.settings-editor > .settings-body > .settings-tree-container .setting-item-bool .setting-item-contents { padding-bottom: 26px; } @@ -449,7 +438,7 @@ background: url('check-inverse.svg') center center no-repeat; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-value { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-value { margin-top: 9px; display: flex; } @@ -471,15 +460,15 @@ width: 320px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-value .edit-in-settings-button, -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-value .edit-in-settings-button:hover, -.settings-editor > .settings-body > .settings-tree-container .setting-item .setting-item-value .edit-in-settings-button:active { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-value .edit-in-settings-button, +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-value .edit-in-settings-button:hover, +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .setting-item-value .edit-in-settings-button:active { text-align: left; text-decoration: underline; padding-left: 0px; } -.settings-editor > .settings-body > .settings-tree-container .setting-item .monaco-select-box { +.settings-editor > .settings-body > .settings-tree-container .setting-item-contents .monaco-select-box { width: initial; font: inherit; height: 26px; @@ -495,12 +484,6 @@ padding: 4px 10px; } -.settings-editor > .settings-body > .settings-tree-container .group-title, -.settings-editor > .settings-body > .settings-tree-container .setting-item { - padding-left: 9px; - padding-right: 9px; -} - .settings-editor > .settings-body > .settings-tree-container .group-title { cursor: default; } diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index 3d677bad6fd..ea9a1420deb 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -664,7 +664,7 @@ export class SettingsEditor2 extends BaseEditor { } // Hack, see https://github.com/Microsoft/vscode/issues/64749 - const settingItems = this.settingsTree.getHTMLElement().querySelectorAll('.setting-item'); + const settingItems = this.settingsTree.getHTMLElement().querySelectorAll(AbstractSettingRenderer.CONTENTS_SELECTOR); const firstEl = settingItems[1] || settingItems[0]; if (!firstEl) { return; From 84bebd0ff6ec0c4ba57eeb5ee757e5d5ef457e20 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 21:23:25 +0100 Subject: [PATCH 338/429] Final adoption (#67863) --- build/gulpfile.editor.js | 9 +- build/gulpfile.extensions.js | 12 ++- build/gulpfile.vscode.js | 162 ++++++++++++++++++--------------- build/gulpfile.vscode.linux.js | 61 ++++++++----- build/gulpfile.vscode.win32.js | 7 +- gulpfile.js | 22 +++-- 6 files changed, 160 insertions(+), 113 deletions(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index eb59eb533e1..2c68dc74185 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -370,7 +370,12 @@ function createTscCompileTask(watch) { }; } -gulp.task('monaco-typecheck-watch', createTscCompileTask(true)); -gulp.task('monaco-typecheck', createTscCompileTask(false)); +const monacoTypecheckWatchTask = createTscCompileTask(true); +monacoTypecheckWatchTask.displayName = 'monaco-typecheck-watch'; +exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask; + +const monacoTypecheckTask = createTscCompileTask(false); +monacoTypecheckTask.displayName = 'monaco-typecheck'; +exports.monacoTypecheckTask = monacoTypecheckTask; //#endregion diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index af3278cde5e..3a780a22e8d 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -141,10 +141,16 @@ const tasks = compilations.map(function (tsconfigFile) { }; }); -gulp.task('compile-extensions', util.task.parallel(...tasks.map(t => t.compileTask))); -gulp.task('watch-extensions', util.task.parallel(...tasks.map(t => t.watchTask))); +const compileExtensionsTask = util.task.parallel(...tasks.map(t => t.compileTask)); +compileExtensionsTask.displayName = 'compile-extensions'; +gulp.task(compileExtensionsTask.displayName, compileExtensionsTask); +exports.compileExtensionsTask = compileExtensionsTask; + +const watchExtensionsTask = util.task.parallel(...tasks.map(t => t.watchTask)); +watchExtensionsTask.displayName = 'watch-extensions'; +gulp.task(watchExtensionsTask.displayName, watchExtensionsTask); +exports.watchExtensionsTask = watchExtensionsTask; const compileExtensionsBuildTask = util.task.parallel(...tasks.map(t => t.compileBuildTask)); compileExtensionsBuildTask.displayName = 'compile-extensions-build'; - exports.compileExtensionsBuildTask = compileExtensionsBuildTask; diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index c5887cde3f7..1cbd189b79e 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -104,7 +104,6 @@ const optimizeVSCodeTask = util.task.series( }) ); optimizeVSCodeTask.displayName = 'optimize-vscode'; -gulp.task(optimizeVSCodeTask.displayName, optimizeVSCodeTask); const optimizeIndexJSTask = util.task.series( @@ -492,30 +491,40 @@ const apiHostname = process.env.TRANSIFEX_API_URL; const apiName = process.env.TRANSIFEX_API_NAME; const apiToken = process.env.TRANSIFEX_API_TOKEN; -gulp.task('vscode-translations-push', ['optimize-vscode'], function () { - const pathToMetadata = './out-vscode/nls.metadata.json'; - const pathToExtensions = './extensions/*'; - const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; +gulp.task('vscode-translations-push', + util.task.series( + optimizeVSCodeTask, + function () { + const pathToMetadata = './out-vscode/nls.metadata.json'; + const pathToExtensions = './extensions/*'; + const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; - return es.merge( - gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), - gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), - gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) - ).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken) - ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); -}); + return es.merge( + gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), + gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), + gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) + ).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken) + ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); + } + ) +); -gulp.task('vscode-translations-export', ['optimize-vscode'], function () { - const pathToMetadata = './out-vscode/nls.metadata.json'; - const pathToExtensions = './extensions/*'; - const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; +gulp.task('vscode-translations-export', + util.task.series( + optimizeVSCodeTask, + function () { + const pathToMetadata = './out-vscode/nls.metadata.json'; + const pathToExtensions = './extensions/*'; + const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; - return es.merge( - gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), - gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), - gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) - ).pipe(vfs.dest('../vscode-translations-export')); -}); + return es.merge( + gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()), + gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()), + gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions()) + ).pipe(vfs.dest('../vscode-translations-export')); + } + ) +); gulp.task('vscode-translations-pull', function () { return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => { @@ -565,57 +574,8 @@ gulp.task('upload-vscode-sourcemaps', () => { })); }); -const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json'); -gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => { - if (!shouldSetupSettingsSearch()) { - const branch = process.env.BUILD_SOURCEBRANCH; - console.log(`Only runs on master and release branches, not ${branch}`); - return; - } - - if (!fs.existsSync(allConfigDetailsPath)) { - throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`); - } - - const settingsSearchBuildId = getSettingsSearchBuildId(packageJson); - if (!settingsSearchBuildId) { - throw new Error('Failed to compute build number'); - } - - return gulp.src(allConfigDetailsPath) - .pipe(azure.upload({ - account: process.env.AZURE_STORAGE_ACCOUNT, - key: process.env.AZURE_STORAGE_ACCESS_KEY, - container: 'configuration', - prefix: `${settingsSearchBuildId}/${commit}/` - })); -}); - -function shouldSetupSettingsSearch() { - const branch = process.env.BUILD_SOURCEBRANCH; - return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0); -} - -function getSettingsSearchBuildId(packageJson) { - try { - const branch = process.env.BUILD_SOURCEBRANCH; - const branchId = branch.indexOf('/release/') >= 0 ? 0 : - /\/master$/.test(branch) ? 1 : - 2; // Some unexpected branch - - const out = cp.execSync(`git rev-list HEAD --count`); - const count = parseInt(out.toString()); - - // - // 1.25.1, 1,234,567 commits, master = 1250112345671 - return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId; - } catch (e) { - throw new Error('Could not determine build number: ' + e.toString()); - } -} - // This task is only run for the MacOS build -gulp.task('generate-vscode-configuration', () => { +const generateVSCodeConfigurationTask = () => { return new Promise((resolve, reject) => { const buildDir = process.env['AGENT_BUILDDIRECTORY']; if (!buildDir) { @@ -650,4 +610,60 @@ gulp.task('generate-vscode-configuration', () => { reject(err); }); }); -}); +}; +generateVSCodeConfigurationTask.displayName = 'generate-vscode-configuration'; + +const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json'); +gulp.task('upload-vscode-configuration', + util.task.series( + generateVSCodeConfigurationTask, + () => { + if (!shouldSetupSettingsSearch()) { + const branch = process.env.BUILD_SOURCEBRANCH; + console.log(`Only runs on master and release branches, not ${branch}`); + return; + } + + if (!fs.existsSync(allConfigDetailsPath)) { + throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`); + } + + const settingsSearchBuildId = getSettingsSearchBuildId(packageJson); + if (!settingsSearchBuildId) { + throw new Error('Failed to compute build number'); + } + + return gulp.src(allConfigDetailsPath) + .pipe(azure.upload({ + account: process.env.AZURE_STORAGE_ACCOUNT, + key: process.env.AZURE_STORAGE_ACCESS_KEY, + container: 'configuration', + prefix: `${settingsSearchBuildId}/${commit}/` + })); + } + ) +); + +function shouldSetupSettingsSearch() { + const branch = process.env.BUILD_SOURCEBRANCH; + return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0); +} + +function getSettingsSearchBuildId(packageJson) { + try { + const branch = process.env.BUILD_SOURCEBRANCH; + const branchId = branch.indexOf('/release/') >= 0 ? 0 : + /\/master$/.test(branch) ? 1 : + 2; // Some unexpected branch + + const out = cp.execSync(`git rev-list HEAD --count`); + const count = parseInt(out.toString()); + + // + // 1.25.1, 1,234,567 commits, master = 1250112345671 + return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId; + } catch (e) { + throw new Error('Could not determine build number: ' + e.toString()); + } +} + diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 6728a0ce640..b3599cbe39d 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -229,29 +229,42 @@ function buildSnapPackage(arch) { return shell.task(`cd ${snapBuildPath} && snapcraft build`); } -gulp.task('vscode-linux-ia32-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/i386'), prepareDebPackage('ia32'))); -gulp.task('vscode-linux-x64-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/amd64'), prepareDebPackage('x64'))); -gulp.task('vscode-linux-arm-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/armhf'), prepareDebPackage('arm'))); -gulp.task('vscode-linux-arm64-prepare-deb', util.task.series(util.rimraf('.build/linux/deb/arm64'), prepareDebPackage('arm64'))); -gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32')); -gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64')); -gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm')); -gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64')); +const BUILD_TARGETS = [ + { arch: 'ia32' }, + { arch: 'x64' }, + { arch: 'arm' }, + { arch: 'arm64' }, +]; -gulp.task('vscode-linux-ia32-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/i386'), prepareRpmPackage('ia32'))); -gulp.task('vscode-linux-x64-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/x86_64'), prepareRpmPackage('x64'))); -gulp.task('vscode-linux-arm-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/armhf'), prepareRpmPackage('arm'))); -gulp.task('vscode-linux-arm64-prepare-rpm', util.task.series(util.rimraf('.build/linux/rpm/arm64'), prepareRpmPackage('arm64'))); -gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32')); -gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64')); -gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm')); -gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64')); +BUILD_TARGETS.forEach((buildTarget) => { + const arch = buildTarget.arch; -gulp.task('vscode-linux-ia32-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('ia32'))); -gulp.task('vscode-linux-x64-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('x64'))); -gulp.task('vscode-linux-arm-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('arm'))); -gulp.task('vscode-linux-arm64-prepare-snap', util.task.series(util.rimraf('.build/linux/snap/x64'), prepareSnapPackage('arm64'))); -gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32')); -gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64')); -gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm')); -gulp.task('vscode-linux-arm64-build-snap', ['vscode-linux-arm64-prepare-snap'], buildSnapPackage('arm64')); + { + const debArch = getDebPackageArch(arch); + const prepareDebTask = util.task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)); + prepareDebTask.displayName = `vscode-linux-${arch}-prepare-deb`; + // gulp.task(prepareDebTask.displayName, prepareDebTask); + const buildDebTask = util.task.series(prepareDebTask, buildDebPackage(arch)); + buildDebTask.displayName = `vscode-linux-${arch}-build-deb`; + gulp.task(buildDebTask.displayName, buildDebTask); + } + + { + const rpmArch = getRpmPackageArch(arch); + const prepareRpmTask = util.task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)); + prepareRpmTask.displayName = `vscode-linux-${arch}-prepare-rpm`; + // gulp.task(prepareRpmTask.displayName, prepareRpmTask); + const buildRpmTask = util.task.series(prepareRpmTask, buildRpmPackage(arch)); + buildRpmTask.displayName = `vscode-linux-${arch}-build-rpm`; + gulp.task(buildRpmTask.displayName, buildRpmTask); + } + + { + const prepareSnapTask = util.task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)); + prepareSnapTask.displayName = `vscode-linux-${arch}-prepare-snap`; + gulp.task(prepareSnapTask.displayName, prepareSnapTask); + const buildSnapTask = util.task.series(prepareSnapTask, buildSnapPackage(arch)); + buildSnapTask.displayName = `vscode-linux-${arch}-build-snap`; + gulp.task(buildSnapTask.displayName, buildSnapTask); + } +}); diff --git a/build/gulpfile.vscode.win32.js b/build/gulpfile.vscode.win32.js index 3b3a21c1b69..b49fcbabcfc 100644 --- a/build/gulpfile.vscode.win32.js +++ b/build/gulpfile.vscode.win32.js @@ -134,9 +134,6 @@ function copyInnoUpdater(arch) { }; } -gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32')); -gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64')); - function patchInnoUpdater(arch) { return cb => { const icon = path.join(repoPath, 'resources', 'win32', 'code.ico'); @@ -144,5 +141,5 @@ function patchInnoUpdater(arch) { }; } -gulp.task('vscode-win32-ia32-inno-updater', ['vscode-win32-ia32-copy-inno-updater'], patchInnoUpdater('ia32')); -gulp.task('vscode-win32-x64-inno-updater', ['vscode-win32-x64-copy-inno-updater'], patchInnoUpdater('x64')); \ No newline at end of file +gulp.task('vscode-win32-ia32-inno-updater', util.task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))); +gulp.task('vscode-win32-x64-inno-updater', util.task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))); \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 0f3fc9cc72c..b41fa640399 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -12,17 +12,27 @@ const gulp = require('gulp'); const util = require('./build/lib/util'); const path = require('path'); const compilation = require('./build/lib/compilation'); +const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./build/gulpfile.editor'); +const { compileExtensionsTask, watchExtensionsTask } = require('./build/gulpfile.extensions'); // Fast compile for development time -gulp.task('compile-client', util.task.series(util.rimraf('out'), compilation.compileTask('src', 'out', false))); -gulp.task('watch-client', util.task.series(util.rimraf('out'), compilation.watchTask('out', false))); +const compileClientTask = util.task.series(util.rimraf('out'), compilation.compileTask('src', 'out', false)); +compileClientTask.displayName = 'compile-client'; +gulp.task(compileClientTask.displayName, compileClientTask); -// Default -gulp.task('default', ['compile']); +const watchClientTask = util.task.series(util.rimraf('out'), compilation.watchTask('out', false)); +watchClientTask.displayName = 'watch-client'; +gulp.task(watchClientTask.displayName, watchClientTask); // All -gulp.task('compile', ['monaco-typecheck', 'compile-client', 'compile-extensions']); -gulp.task('watch', [/* 'monaco-typecheck-watch', */ 'watch-client', 'watch-extensions']); +const compileTask = util.task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask); +compileTask.displayName = 'compile'; +gulp.task(compileTask.displayName, compileTask); + +gulp.task('watch', util.task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask)); + +// Default +gulp.task('default', compileTask); process.on('unhandledRejection', (reason, p) => { console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); From b4445a9f736a3a4d235391d9ff99d304acecd25e Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 22:21:05 +0100 Subject: [PATCH 339/429] Move away from deprecated gulp-util --- build/lib/builtInExtensions.js | 19 ++++++++++--------- build/lib/compilation.js | 5 +++-- build/lib/compilation.ts | 6 ++++-- build/lib/extensions.js | 7 ++++--- build/lib/extensions.ts | 7 ++++--- build/lib/i18n.js | 5 +++-- build/lib/i18n.ts | 6 +++--- build/lib/optimize.js | 5 +++-- build/lib/optimize.ts | 5 +++-- build/lib/reporter.js | 9 +++++---- build/lib/reporter.ts | 9 +++++---- build/lib/stats.js | 19 ++++++++++--------- build/lib/stats.ts | 19 ++++++++++--------- build/monaco/api.js | 5 +++-- build/monaco/api.ts | 5 +++-- build/package.json | 3 ++- build/yarn.lock | 24 ++++++++++++------------ package.json | 3 ++- yarn.lock | 20 ++++++++++++++++++++ 19 files changed, 109 insertions(+), 72 deletions(-) diff --git a/build/lib/builtInExtensions.js b/build/lib/builtInExtensions.js index c5797c78b61..a687bbccb4c 100644 --- a/build/lib/builtInExtensions.js +++ b/build/lib/builtInExtensions.js @@ -14,7 +14,8 @@ const es = require('event-stream'); const rename = require('gulp-rename'); const vfs = require('vinyl-fs'); const ext = require('./extensions'); -const util = require('gulp-util'); +const fancyLog = require('fancy-log'); +const ansiColors = require('ansi-colors'); const root = path.dirname(path.dirname(__dirname)); const builtInExtensions = require('../builtInExtensions.json'); @@ -43,7 +44,7 @@ function isUpToDate(extension) { function syncMarketplaceExtension(extension) { if (isUpToDate(extension)) { - util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎')); + fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎')); return es.readArray([]); } @@ -52,13 +53,13 @@ function syncMarketplaceExtension(extension) { return ext.fromMarketplace(extension.name, extension.version, extension.metadata) .pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`)) .pipe(vfs.dest('.build/builtInExtensions')) - .on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎'))); + .on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎'))); } function syncExtension(extension, controlState) { switch (controlState) { case 'disabled': - util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name)); + fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name)); return es.readArray([]); case 'marketplace': @@ -66,15 +67,15 @@ function syncExtension(extension, controlState) { default: if (!fs.existsSync(controlState)) { - util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`)); + fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`)); return es.readArray([]); } else if (!fs.existsSync(path.join(controlState, 'package.json'))) { - util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`)); + fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`)); return es.readArray([]); } - util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎')); + fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎')); return es.readArray([]); } } @@ -93,8 +94,8 @@ function writeControlFile(control) { } function main() { - util.log('Syncronizing built-in extensions...'); - util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`); + fancyLog('Syncronizing built-in extensions...'); + fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`); const control = readControlFile(); const streams = []; diff --git a/build/lib/compilation.js b/build/lib/compilation.js index f0468121d7a..592a5d087ce 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -16,7 +16,8 @@ const monacodts = require("../monaco/api"); const nls = require("./nls"); const reporter_1 = require("./reporter"); const util = require("./util"); -const util2 = require("gulp-util"); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const watch = require('./watch'); const reporter = reporter_1.createReporter(); function getTypeScriptCompilerOptions(src) { @@ -179,7 +180,7 @@ class MonacoGenerator { return r; } _log(message, ...rest) { - util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest); + fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest); } execute() { const startTime = Date.now(); diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index fede9e74492..b431a134f6c 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -17,7 +17,9 @@ import * as monacodts from '../monaco/api'; import * as nls from './nls'; import { createReporter } from './reporter'; import * as util from './util'; -import * as util2 from 'gulp-util'; +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; + const watch = require('./watch'); const reporter = createReporter(); @@ -218,7 +220,7 @@ class MonacoGenerator { } private _log(message: any, ...rest: any[]): void { - util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest); + fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest); } public execute(): void { diff --git a/build/lib/extensions.js b/build/lib/extensions.js index 994d1336e6b..3554fabc230 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -17,7 +17,8 @@ const remote = require("gulp-remote-src"); const vzip = require('gulp-vinyl-zip'); const filter = require("gulp-filter"); const rename = require("gulp-rename"); -const util = require('gulp-util'); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const buffer = require('gulp-buffer'); const json = require("gulp-json-editor"); const webpack = require('webpack'); @@ -79,7 +80,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) { .pipe(packageJsonFilter.restore); const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => { const webpackDone = (err, stats) => { - util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`); + fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`); if (err) { result.emit('error', err); } @@ -157,7 +158,7 @@ const baseHeaders = { function fromMarketplace(extensionName, version, metadata) { const [publisher, name] = extensionName.split('.'); const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`; - util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...'); + fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...'); const options = { base: url, requestOptions: { diff --git a/build/lib/extensions.ts b/build/lib/extensions.ts index 844b711a829..7b89942753f 100644 --- a/build/lib/extensions.ts +++ b/build/lib/extensions.ts @@ -17,7 +17,8 @@ import remote = require('gulp-remote-src'); const vzip = require('gulp-vinyl-zip'); import filter = require('gulp-filter'); import rename = require('gulp-rename'); -const util = require('gulp-util'); +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; const buffer = require('gulp-buffer'); import json = require('gulp-json-editor'); const webpack = require('webpack'); @@ -93,7 +94,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string | const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => { const webpackDone = (err: any, stats: any) => { - util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`); + fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`); if (err) { result.emit('error', err); } @@ -187,7 +188,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata const [publisher, name] = extensionName.split('.'); const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`; - util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...'); + fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...'); const options = { base: url, diff --git a/build/lib/i18n.js b/build/lib/i18n.js index 1fc6b060e9c..24ed4456f50 100644 --- a/build/lib/i18n.js +++ b/build/lib/i18n.js @@ -13,11 +13,12 @@ const xml2js = require("xml2js"); const glob = require("glob"); const https = require("https"); const gulp = require("gulp"); -const util = require("gulp-util"); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const iconv = require("iconv-lite"); const NUMBER_OF_CONCURRENT_DOWNLOADS = 4; function log(message, ...rest) { - util.log(util.colors.green('[i18n]'), message, ...rest); + fancyLog(ansiColors.green('[i18n]'), message, ...rest); } exports.defaultLanguages = [ { id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' }, diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 81ba0c0939e..5cde7d8f87a 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -13,14 +13,14 @@ import * as xml2js from 'xml2js'; import * as glob from 'glob'; import * as https from 'https'; import * as gulp from 'gulp'; - -import * as util from 'gulp-util'; +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; import * as iconv from 'iconv-lite'; const NUMBER_OF_CONCURRENT_DOWNLOADS = 4; function log(message: any, ...rest: any[]): void { - util.log(util.colors.green('[i18n]'), message, ...rest); + fancyLog(ansiColors.green('[i18n]'), message, ...rest); } export interface Language { diff --git a/build/lib/optimize.js b/build/lib/optimize.js index 07cdebe30ee..3756d01f538 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -13,7 +13,8 @@ const flatmap = require("gulp-flatmap"); const sourcemaps = require("gulp-sourcemaps"); const uglify = require("gulp-uglify"); const composer = require("gulp-uglify/composer"); -const gulpUtil = require("gulp-util"); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const path = require("path"); const pump = require("pump"); const uglifyes = require("uglify-es"); @@ -24,7 +25,7 @@ const stats_1 = require("./stats"); const util = require("./util"); const REPO_ROOT_PATH = path.join(__dirname, '../..'); function log(prefix, message) { - gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); + fancyLog(ansiColors.cyan('[' + prefix + ']'), message); } function loaderConfig(emptyPaths) { const result = { diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts index 85d15b23543..12b633b3ac9 100644 --- a/build/lib/optimize.ts +++ b/build/lib/optimize.ts @@ -14,7 +14,8 @@ import * as flatmap from 'gulp-flatmap'; import * as sourcemaps from 'gulp-sourcemaps'; import * as uglify from 'gulp-uglify'; import * as composer from 'gulp-uglify/composer'; -import * as gulpUtil from 'gulp-util'; +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; import * as path from 'path'; import * as pump from 'pump'; import * as sm from 'source-map'; @@ -28,7 +29,7 @@ import * as util from './util'; const REPO_ROOT_PATH = path.join(__dirname, '../..'); function log(prefix: string, message: string): void { - gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message); + fancyLog(ansiColors.cyan('[' + prefix + ']'), message); } export function loaderConfig(emptyPaths?: string[]) { diff --git a/build/lib/reporter.js b/build/lib/reporter.js index 598aabec244..e0461dc6d9d 100644 --- a/build/lib/reporter.js +++ b/build/lib/reporter.js @@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true }); const es = require("event-stream"); const _ = require("underscore"); -const util = require("gulp-util"); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const fs = require("fs"); const path = require("path"); const allErrors = []; @@ -17,7 +18,7 @@ function onStart() { return; } startTime = new Date().getTime(); - util.log(`Starting ${util.colors.green('compilation')}...`); + fancyLog(`Starting ${ansiColors.green('compilation')}...`); } function onEnd() { if (--count > 0) { @@ -38,7 +39,7 @@ function log() { errors.map(err => { if (!seen.has(err)) { seen.add(err); - util.log(`${util.colors.red('Error')}: ${err}`); + fancyLog(`${ansiColors.red('Error')}: ${err}`); } }); const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/; @@ -53,7 +54,7 @@ function log() { catch (err) { //noop } - util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`); + fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`); } function createReporter() { const errors = []; diff --git a/build/lib/reporter.ts b/build/lib/reporter.ts index 68e037e9224..ec908817518 100644 --- a/build/lib/reporter.ts +++ b/build/lib/reporter.ts @@ -7,7 +7,8 @@ import * as es from 'event-stream'; import * as _ from 'underscore'; -import * as util from 'gulp-util'; +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; import * as fs from 'fs'; import * as path from 'path'; @@ -21,7 +22,7 @@ function onStart(): void { } startTime = new Date().getTime(); - util.log(`Starting ${util.colors.green('compilation')}...`); + fancyLog(`Starting ${ansiColors.green('compilation')}...`); } function onEnd(): void { @@ -47,7 +48,7 @@ function log(): void { errors.map(err => { if (!seen.has(err)) { seen.add(err); - util.log(`${util.colors.red('Error')}: ${err}`); + fancyLog(`${ansiColors.red('Error')}: ${err}`); } }); @@ -65,7 +66,7 @@ function log(): void { //noop } - util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime!) + ' ms')}`); + fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`); } export interface IReporter { diff --git a/build/lib/stats.js b/build/lib/stats.js index c08cd57b3bc..99ad665f223 100644 --- a/build/lib/stats.js +++ b/build/lib/stats.js @@ -5,7 +5,8 @@ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); const es = require("event-stream"); -const util = require("gulp-util"); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const appInsights = require("applicationinsights"); class Entry { constructor(name, totalCount, totalSize) { @@ -24,13 +25,13 @@ class Entry { } else { if (this.totalCount === 1) { - return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`; + return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`; } else { const count = this.totalCount < 100 - ? util.colors.green(this.totalCount.toString()) - : util.colors.red(this.totalCount.toString()); - return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`; + ? ansiColors.green(this.totalCount.toString()) + : ansiColors.red(this.totalCount.toString()); + return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`; } } } @@ -57,13 +58,13 @@ function createStatsStream(group, log) { }, function () { if (log) { if (entry.totalCount === 1) { - util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`); + fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`); } else { const count = entry.totalCount < 100 - ? util.colors.green(entry.totalCount.toString()) - : util.colors.red(entry.totalCount.toString()); - util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`); + ? ansiColors.green(entry.totalCount.toString()) + : ansiColors.red(entry.totalCount.toString()); + fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`); } } this.emit('end'); diff --git a/build/lib/stats.ts b/build/lib/stats.ts index 7f5548dc1c4..a94b1c9ae1a 100644 --- a/build/lib/stats.ts +++ b/build/lib/stats.ts @@ -6,7 +6,8 @@ 'use strict'; import * as es from 'event-stream'; -import * as util from 'gulp-util'; +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; import * as File from 'vinyl'; import * as appInsights from 'applicationinsights'; @@ -22,14 +23,14 @@ class Entry { } } else { if (this.totalCount === 1) { - return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`; + return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`; } else { const count = this.totalCount < 100 - ? util.colors.green(this.totalCount.toString()) - : util.colors.red(this.totalCount.toString()); + ? ansiColors.green(this.totalCount.toString()) + : ansiColors.red(this.totalCount.toString()); - return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`; + return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`; } } } @@ -58,14 +59,14 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea }, function () { if (log) { if (entry.totalCount === 1) { - util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`); + fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`); } else { const count = entry.totalCount < 100 - ? util.colors.green(entry.totalCount.toString()) - : util.colors.red(entry.totalCount.toString()); + ? ansiColors.green(entry.totalCount.toString()) + : ansiColors.red(entry.totalCount.toString()); - util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`); + fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`); } } diff --git a/build/monaco/api.js b/build/monaco/api.js index 5c03df4088d..297510d14c1 100644 --- a/build/monaco/api.js +++ b/build/monaco/api.js @@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true }); const fs = require("fs"); const ts = require("typescript"); const path = require("path"); -const util = require("gulp-util"); +const fancyLog = require("fancy-log"); +const ansiColors = require("ansi-colors"); const dtsv = '2'; const tsfmt = require('../../tsfmt.json'); const SRC = path.join(__dirname, '../../src'); exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe'); const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); function logErr(message, ...rest) { - util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest); + fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest); } function isDeclaration(a) { return (a.kind === ts.SyntaxKind.InterfaceDeclaration diff --git a/build/monaco/api.ts b/build/monaco/api.ts index 1bdc612d6a2..7672188160b 100644 --- a/build/monaco/api.ts +++ b/build/monaco/api.ts @@ -6,7 +6,8 @@ import * as fs from 'fs'; import * as ts from 'typescript'; import * as path from 'path'; -import * as util from 'gulp-util'; +import * as fancyLog from 'fancy-log'; +import * as ansiColors from 'ansi-colors'; const dtsv = '2'; @@ -17,7 +18,7 @@ export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe'); const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); function logErr(message: any, ...rest: any[]): void { - util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest); + fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest); } type SourceFileGetter = (moduleId: string) => ts.SourceFile | null; diff --git a/build/package.json b/build/package.json index 4ad039a7e21..a05a6b9a622 100644 --- a/build/package.json +++ b/build/package.json @@ -2,9 +2,11 @@ "name": "code-oss-dev-build", "version": "1.0.0", "devDependencies": { + "@types/ansi-colors": "^3.2.0", "@types/azure": "0.9.19", "@types/debounce": "^1.0.0", "@types/documentdb": "1.10.2", + "@types/fancy-log": "^1.3.0", "@types/glob": "^7.1.1", "@types/gulp": "^4.0.5", "@types/gulp-concat": "^0.0.32", @@ -13,7 +15,6 @@ "@types/gulp-rename": "^0.0.33", "@types/gulp-sourcemaps": "^0.0.32", "@types/gulp-uglify": "^3.0.5", - "@types/gulp-util": "^3.0.34", "@types/mime": "0.0.29", "@types/minimatch": "^3.0.3", "@types/minimist": "^1.2.0", diff --git a/build/yarn.lock b/build/yarn.lock index c9384fe6d54..d5816c98f02 100644 --- a/build/yarn.lock +++ b/build/yarn.lock @@ -10,6 +10,11 @@ normalize-path "^2.0.1" through2 "^2.0.3" +"@types/ansi-colors@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@types/ansi-colors/-/ansi-colors-3.2.0.tgz#3e4fe85d9131ce1c6994f3040bd0b25306c16a6e" + integrity sha512-0caWAhXht9N2lOdMzJLXybsSkYCx1QOdxx6pae48tswI9QV3DFX26AoOpy0JxwhCb+zISTqmd6H8t9Zby9BoZg== + "@types/azure@0.9.19": version "0.9.19" resolved "https://registry.yarnpkg.com/@types/azure/-/azure-0.9.19.tgz#1a6a9bd856b437ddecf3f9fc8407a683c869ba02" @@ -47,6 +52,11 @@ resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86" integrity sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA== +"@types/fancy-log@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@types/fancy-log/-/fancy-log-1.3.0.tgz#a61ab476e5e628cd07a846330df53b85e05c8ce0" + integrity sha512-mQjDxyOM1Cpocd+vm1kZBP7smwKZ4TNokFeds9LV7OZibmPJFEzY3+xZMrKfUdNT71lv8GoCPD6upKwHxubClw== + "@types/form-data@*": version "2.2.1" resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e" @@ -117,16 +127,6 @@ "@types/node" "*" "@types/uglify-js" "^2" -"@types/gulp-util@^3.0.34": - version "3.0.34" - resolved "https://registry.yarnpkg.com/@types/gulp-util/-/gulp-util-3.0.34.tgz#d1291ebf706d93f46eb8df11344bbfd96247697e" - integrity sha512-E06WN1OfqL5UsMwJ1T7ClgnaXgaPipb7Ee8euMc3KRHLNqxdvWrDir9KA6uevgzBgT7XbjgmzZA2pkzDqBBX7A== - dependencies: - "@types/node" "*" - "@types/through2" "*" - "@types/vinyl" "*" - chalk "^2.2.0" - "@types/gulp@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/gulp/-/gulp-4.0.5.tgz#f5f498d5bf9538364792de22490a12c0e6bc5eb4" @@ -196,7 +196,7 @@ "@types/glob" "*" "@types/node" "*" -"@types/through2@*", "@types/through2@^2.0.34": +"@types/through2@^2.0.34": version "2.0.34" resolved "https://registry.yarnpkg.com/@types/through2/-/through2-2.0.34.tgz#9c2a259a238dace2a05a2f8e94b786961bc27ac4" integrity sha512-nhRG8+RuG/L+0fAZBQYaRflXKjTrHOKH8MFTChnf+dNVMxA3wHYYrfj0tztK0W51ABXjGfRCDc0vRkecCOrsow== @@ -512,7 +512,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.2.0, chalk@^2.3.0: +chalk@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.1.tgz#18c49ab16a037b6eb0152cc83e3471338215b66e" integrity sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ== diff --git a/package.json b/package.json index d1ccfcda47d..869a2188709 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "@types/sinon": "^1.16.36", "@types/webpack": "^4.4.10", "@types/winreg": "^1.2.30", + "ansi-colors": "^3.2.3", "asar": "^0.14.0", "chromium-pickle-js": "^0.2.0", "clean-css": "3.4.6", @@ -80,6 +81,7 @@ "eslint": "^3.4.0", "event-stream": "3.3.4", "express": "^4.13.1", + "fancy-log": "^1.3.3", "glob": "^5.0.13", "gulp": "^3.8.9", "gulp-atom-electron": "^1.19.2", @@ -100,7 +102,6 @@ "gulp-tsb": "2.0.5", "gulp-tslint": "^8.1.2", "gulp-uglify": "^3.0.0", - "gulp-util": "^3.0.6", "gulp-vinyl-zip": "^2.1.2", "husky": "^0.13.1", "innosetup-compiler": "^5.5.60", diff --git a/yarn.lock b/yarn.lock index 37c70a4517c..d485597df7b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -370,6 +370,11 @@ ansi-colors@^1.0.1: dependencies: ansi-wrap "^0.1.0" +ansi-colors@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" + integrity sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw== + ansi-cyan@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-cyan/-/ansi-cyan-0.1.1.tgz#538ae528af8982f28ae30d86f2f17456d2609873" @@ -2851,6 +2856,16 @@ fancy-log@^1.3.2: color-support "^1.1.3" time-stamp "^1.0.0" +fancy-log@^1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" + integrity sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw== + dependencies: + ansi-gray "^0.1.1" + color-support "^1.1.3" + parse-node-version "^1.0.0" + time-stamp "^1.0.0" + fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" @@ -6495,6 +6510,11 @@ parse-json@^2.2.0: dependencies: error-ex "^1.2.0" +parse-node-version@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parse-node-version/-/parse-node-version-1.0.1.tgz#e2b5dbede00e7fa9bc363607f53327e8b073189b" + integrity sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA== + parse-passwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" From 929177ff6ab5482ddac6515332f81686ef3f4579 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 22:29:35 +0100 Subject: [PATCH 340/429] Remove unused gulp task --- build/gulpfile.test.js | 15 --------------- package.json | 1 - yarn.lock | 28 ++-------------------------- 3 files changed, 2 insertions(+), 42 deletions(-) delete mode 100644 build/gulpfile.test.js diff --git a/build/gulpfile.test.js b/build/gulpfile.test.js deleted file mode 100644 index ff89922100a..00000000000 --- a/build/gulpfile.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -'use strict'; - -const gulp = require('gulp'); -const mocha = require('gulp-mocha'); - -gulp.task('test', function () { - return gulp.src('test/all.js') - .pipe(mocha({ ui: 'tdd', delay: true })) - .once('end', function () { process.exit(); }); -}); diff --git a/package.json b/package.json index 869a2188709..21e96b6c067 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,6 @@ "gulp-filter": "^3.0.0", "gulp-flatmap": "^1.0.0", "gulp-json-editor": "^2.2.1", - "gulp-mocha": "^2.1.3", "gulp-plumber": "^1.2.0", "gulp-remote-src": "^0.4.4", "gulp-rename": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index d485597df7b..0385a824bf6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3689,18 +3689,6 @@ gulp-json-editor@^2.2.1: js-beautify "~1.5.4" through2 "~0.5.0" -gulp-mocha@^2.1.3: - version "2.2.0" - resolved "https://registry.yarnpkg.com/gulp-mocha/-/gulp-mocha-2.2.0.tgz#1ce5eba4b94b40c7436afec3c4982c8eea894192" - integrity sha1-HOXrpLlLQMdDav7DxJgsjuqJQZI= - dependencies: - gulp-util "^3.0.0" - mocha "^2.0.1" - plur "^2.1.0" - resolve-from "^1.0.0" - temp "^0.8.3" - through "^2.3.4" - gulp-plumber@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/gulp-plumber/-/gulp-plumber-1.2.0.tgz#18ea03912c9ee483f8a5499973b5954cd90f6ad8" @@ -4338,11 +4326,6 @@ ipaddr.js@1.5.2: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.5.2.tgz#d4b505bde9946987ccf0fc58d9010ff9607e3fa0" integrity sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A= -irregular-plurals@^1.0.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-1.4.0.tgz#2ca9b033651111855412f16be5d77c62a458a766" - integrity sha1-LKmwM2UREYVUEvFr5dd8YqRYp2Y= - is-absolute-url@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6" @@ -5805,7 +5788,7 @@ mocha-junit-reporter@^1.17.0: strip-ansi "^4.0.0" xml "^1.0.0" -mocha@^2.0.1, mocha@^2.2.5: +mocha@^2.2.5: version "2.5.3" resolved "https://registry.yarnpkg.com/mocha/-/mocha-2.5.3.tgz#161be5bdeb496771eb9b35745050b622b5aefc58" integrity sha1-FhvlvetJZ3HrmzV0UFC2IrWu/Fg= @@ -6711,13 +6694,6 @@ plugin-error@^1.0.1: arr-union "^3.1.0" extend-shallow "^3.0.2" -plur@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/plur/-/plur-2.1.2.tgz#7482452c1a0f508e3e344eaec312c91c29dc655a" - integrity sha1-dIJFLBoPUI4+NE6uwxLJHCncZVo= - dependencies: - irregular-plurals "^1.0.0" - pluralize@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-1.2.1.tgz#d1a21483fd22bb41e58a12fa3421823140897c45" @@ -8580,7 +8556,7 @@ through2@~0.4.0: readable-stream "~1.0.17" xtend "~2.1.1" -through@2, through@^2.3.4, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1, through@~2.3.8: +through@2, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= From cf381901e4ba011c5954a7caaad28d97f2055cec Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Fri, 25 Jan 2019 09:48:11 -0800 Subject: [PATCH 341/429] Refactor terminal launch code --- .../parts/terminal/common/terminal.ts | 1 + .../electron-browser/terminalConfigHelper.ts | 53 +++++++++++++------ .../terminalProcessManager.ts | 9 +++- 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/parts/terminal/common/terminal.ts index 8f61e7761ce..d36b3cbeae3 100644 --- a/src/vs/workbench/parts/terminal/common/terminal.ts +++ b/src/vs/workbench/parts/terminal/common/terminal.ts @@ -114,6 +114,7 @@ export interface ITerminalConfigHelper { mergeDefaultShellPathAndArgs(shell: IShellLaunchConfig, platformOverride?: platform.Platform): void; /** Sets whether a workspace shell configuration is allowed or not */ setWorkspaceShellAllowed(isAllowed: boolean): void; + checkWorkspaceShellPermissions(platformOverride?: platform.Platform): boolean; } export interface ITerminalFont { diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index 3321227befc..9aee7905251 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -163,20 +163,26 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, isAllowed, StorageScope.WORKSPACE); } - public mergeDefaultShellPathAndArgs(shell: IShellLaunchConfig, platformOverride: platform.Platform = platform.platform): void { + public isWorkspaceShellAllowed(defaultValue: boolean | undefined = undefined): boolean | undefined { + return this._storageService.getBoolean(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, StorageScope.WORKSPACE, defaultValue); + } + + public checkWorkspaceShellPermissions(platformOverride: platform.Platform = platform.platform): boolean { // Check whether there is a workspace setting const platformKey = platformOverride === platform.Platform.Windows ? 'windows' : platformOverride === platform.Platform.Mac ? 'osx' : 'linux'; const shellConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.shell.${platformKey}`); const shellArgsConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.shellArgs.${platformKey}`); + const envConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.env.${platformKey}`); // Check if workspace setting exists and whether it's whitelisted let isWorkspaceShellAllowed: boolean | undefined = false; - if (shellConfigValue.workspace !== undefined || shellArgsConfigValue.workspace !== undefined) { - isWorkspaceShellAllowed = this._storageService.getBoolean(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, StorageScope.WORKSPACE, undefined); + if (shellConfigValue.workspace !== undefined || shellArgsConfigValue.workspace !== undefined || envConfigValue.workspace !== undefined) { + isWorkspaceShellAllowed = this.isWorkspaceShellAllowed(undefined); } // Always allow [] args as it would lead to an odd error message and should not be dangerous - if (shellConfigValue.workspace === undefined && shellArgsConfigValue.workspace && shellArgsConfigValue.workspace.length === 0) { + if (shellConfigValue.workspace === undefined && envConfigValue.workspace === undefined && + shellArgsConfigValue.workspace && shellArgsConfigValue.workspace.length === 0) { isWorkspaceShellAllowed = true; } @@ -185,34 +191,47 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { if (isWorkspaceShellAllowed === undefined) { let shellString: string | undefined; if (shellConfigValue.workspace) { - shellString = `"${shellConfigValue.workspace}"`; + shellString = `shell: "${shellConfigValue.workspace}"`; } let argsString: string | undefined; if (shellArgsConfigValue.workspace) { - argsString = `[${shellArgsConfigValue.workspace.map(v => '"' + v + '"').join(', ')}]`; + argsString = `shellArgs: [${shellArgsConfigValue.workspace.map(v => '"' + v + '"').join(', ')}]`; + } + let envString: string | undefined; + if (envConfigValue.workspace) { + envString = `env: {${Object.keys(envConfigValue.workspace).map(k => `${k}:${envConfigValue.workspace[k]}`).join(', ')}}`; } // Should not be localized as it's json-like syntax referencing settings keys - let changeString: string; + const workspaceConfigStrings: string[] = []; if (shellString) { - if (argsString) { - changeString = `shell: ${shellString}, shellArgs: ${argsString}`; - } else { - changeString = `shell: ${shellString}`; - } - } else { // if (shellArgsConfigValue.workspace !== undefined) - changeString = `shellArgs: ${argsString}`; + workspaceConfigStrings.push(shellString); } - this._notificationService.prompt(Severity.Info, nls.localize('terminal.integrated.allowWorkspaceShell', "Do you allow {0} (defined as a workspace setting) to be launched in the terminal?", changeString), + if (argsString) { + workspaceConfigStrings.push(argsString); + } + if (envString) { + workspaceConfigStrings.push(envString); + } + const workspaceConfigString = workspaceConfigStrings.join(', '); + this._notificationService.prompt(Severity.Info, nls.localize('terminal.integrated.allowWorkspaceShell', "Do you allow this workspace to modify your terminal shell? {0}", workspaceConfigString), [{ label: nls.localize('allow', "Allow"), - run: () => this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, true, StorageScope.WORKSPACE) + run: () => this.setWorkspaceShellAllowed(true) }, { label: nls.localize('disallow', "Disallow"), - run: () => this._storageService.store(IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, false, StorageScope.WORKSPACE) + run: () => this.setWorkspaceShellAllowed(false) }] ); } + return !!isWorkspaceShellAllowed; + } + + public mergeDefaultShellPathAndArgs(shell: IShellLaunchConfig, platformOverride: platform.Platform = platform.platform): void { + const isWorkspaceShellAllowed = this.checkWorkspaceShellPermissions(platformOverride); + const platformKey = platformOverride === platform.Platform.Windows ? 'windows' : platformOverride === platform.Platform.Mac ? 'osx' : 'linux'; + const shellConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.shell.${platformKey}`); + const shellArgsConfigValue = this._workspaceConfigurationService.inspect(`terminal.integrated.shellArgs.${platformKey}`); shell.executable = (isWorkspaceShellAllowed ? shellConfigValue.value : shellConfigValue.user) || shellConfigValue.default; shell.args = (isWorkspaceShellAllowed ? shellArgsConfigValue.value : shellArgsConfigValue.user) || shellArgsConfigValue.default; diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts index a49259ddcd4..466e6e7326d 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts @@ -20,6 +20,7 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; import { Schemas } from 'vs/base/common/network'; import { REMOTE_HOST_SCHEME, getRemoteAuthority } from 'vs/platform/remote/common/remoteHosts'; import { sanitizeProcessEnvironment } from 'vs/base/node/processes'; +import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; /** The amount of time to consider terminal errors to be related to the launch */ const LAUNCHING_DURATION = 500; @@ -58,7 +59,8 @@ export class TerminalProcessManager implements ITerminalProcessManager { @ILogService private readonly _logService: ILogService, @IWorkspaceContextService private readonly _workspaceContextService: IWorkspaceContextService, @IConfigurationResolverService private readonly _configurationResolverService: IConfigurationResolverService, - @IWindowService private readonly _windowService: IWindowService + @IWindowService private readonly _windowService: IWindowService, + @IWorkspaceConfigurationService private readonly _workspaceConfigurationService: IWorkspaceConfigurationService, ) { this.ptyProcessReady = new Promise(c => { this.onProcessReady(() => { @@ -125,7 +127,10 @@ export class TerminalProcessManager implements ITerminalProcessManager { // Resolve env vars from config and shell const lastActiveWorkspaceRoot = activeWorkspaceRootUri ? this._workspaceContextService.getWorkspaceFolder(activeWorkspaceRootUri) : null; const platformKey = platform.isWindows ? 'windows' : (platform.isMacintosh ? 'osx' : 'linux'); - const envFromConfig = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...this._configHelper.config.env[platformKey] }, lastActiveWorkspaceRoot); + const isWorkspaceShellAllowed = this._configHelper.checkWorkspaceShellPermissions(); + const envFromConfigValue = this._workspaceConfigurationService.inspect<{ [key: string]: string }>(`terminal.integrated.env.${platformKey}`); + const allowedEnvFromConfig = (isWorkspaceShellAllowed ? envFromConfigValue.value : envFromConfigValue.user); + const envFromConfig = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...allowedEnvFromConfig }, lastActiveWorkspaceRoot); const envFromShell = terminalEnvironment.resolveConfigurationVariables(this._configurationResolverService, { ...shellLaunchConfig.env }, lastActiveWorkspaceRoot); shellLaunchConfig.env = envFromShell; From 66614c07d359ac4cb8b5fd5569da501018df1af0 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 11:42:43 -0800 Subject: [PATCH 342/429] Strict null check quickopen --- src/tsconfig.strictNullChecks.json | 3 +++ src/vs/base/common/arrays.ts | 1 + src/vs/workbench/browser/quickopen.ts | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index edc118aff8d..4d89719082c 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -457,6 +457,7 @@ "./vs/workbench/browser/parts/views/panelViewlet.ts", "./vs/workbench/browser/parts/views/views.ts", "./vs/workbench/browser/parts/views/viewsViewlet.ts", + "./vs/workbench/browser/quickopen.ts", "./vs/workbench/browser/viewlet.ts", "./vs/workbench/browser/workbench.contribution.ts", "./vs/workbench/common/actions.ts", @@ -523,6 +524,7 @@ "./vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ts", "./vs/workbench/parts/experiments/electron-browser/experiments.contribution.ts", "./vs/workbench/parts/experiments/node/experimentService.ts", + "./vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts", "./vs/workbench/parts/extensions/browser/extensionsViewer.ts", "./vs/workbench/parts/extensions/common/extensionQuery.ts", "./vs/workbench/parts/extensions/common/extensions.ts", @@ -563,6 +565,7 @@ "./vs/workbench/parts/preferences/browser/settingsWidgets.ts", "./vs/workbench/parts/preferences/common/smartSnippetInserter.ts", "./vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts", + "./vs/workbench/parts/quickopen/browser/helpHandler.ts", "./vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts", "./vs/workbench/parts/scm/common/scm.ts", "./vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts", diff --git a/src/vs/base/common/arrays.ts b/src/vs/base/common/arrays.ts index ab01e07bded..ce2f41cf633 100644 --- a/src/vs/base/common/arrays.ts +++ b/src/vs/base/common/arrays.ts @@ -393,6 +393,7 @@ export function firstIndex(array: ReadonlyArray, fn: (item: T) => boolean) export function first(array: ReadonlyArray, fn: (item: T) => boolean, notFoundValue: T): T; export function first(array: ReadonlyArray, fn: (item: T) => boolean): T | null; +export function first(array: ReadonlyArray, fn: (item: T) => boolean, notFoundValue: T | null): T | null; export function first(array: ReadonlyArray, fn: (item: T) => boolean, notFoundValue: T | null = null): T | null { const index = firstIndex(array, fn); return index < 0 ? notFoundValue : array[index]; diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index 97b8b9b2678..af06b1fbade 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -57,7 +57,7 @@ export class QuickOpenHandler { /** * Extra CSS class name to add to the quick open widget to do custom styling of entries. */ - getClass(): string { + getClass() { return null; } @@ -102,7 +102,7 @@ export class QuickOpenHandler { /** * Allows to return a label that will be placed to the side of the results from this handler or null if none. */ - getGroupLabel(): string { + getGroupLabel() { return null; } @@ -185,7 +185,7 @@ export interface IQuickOpenRegistry { /** * Get a specific quick open handler for a given prefix. */ - getQuickOpenHandler(prefix: string): QuickOpenHandlerDescriptor; + getQuickOpenHandler(prefix: string): QuickOpenHandlerDescriptor | null; /** * Returns the default quick open handler. @@ -213,8 +213,8 @@ class QuickOpenRegistry implements IQuickOpenRegistry { return this.handlers.slice(0); } - getQuickOpenHandler(text: string): QuickOpenHandlerDescriptor { - return text ? arrays.first(this.handlers, h => strings.startsWith(text, h.prefix), null) : null; + getQuickOpenHandler(text: string): QuickOpenHandlerDescriptor | null { + return text ? arrays.first(this.handlers, h => strings.startsWith(text, h.prefix), null) : null; } getDefaultQuickOpenHandler(): QuickOpenHandlerDescriptor { @@ -229,12 +229,12 @@ export interface IEditorQuickOpenEntry { /** * The editor input used for this entry when opening. */ - getInput(): IResourceInput | IEditorInput; + getInput(): IResourceInput | IEditorInput | null; /** * The editor options used for this entry when opening. */ - getOptions(): IEditorOptions; + getOptions(): IEditorOptions | null; } /** @@ -250,11 +250,11 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick return this._editorService; } - getInput(): IResourceInput | IEditorInput { + getInput(): IResourceInput | IEditorInput | null { return null; } - getOptions(): IEditorOptions { + getOptions(): IEditorOptions | null { return null; } @@ -264,7 +264,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick if (mode === Mode.OPEN || mode === Mode.OPEN_IN_BACKGROUND) { const sideBySide = context.keymods.ctrlCmd; - let openOptions: IEditorOptions; + let openOptions: IEditorOptions | undefined; if (mode === Mode.OPEN_IN_BACKGROUND) { openOptions = { pinned: true, preserveFocus: true }; } else if (context.keymods.alt) { @@ -280,7 +280,7 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick opts = EditorOptions.create(openOptions); } - this.editorService.openEditor(input, opts, sideBySide ? SIDE_GROUP : ACTIVE_GROUP); + this.editorService.openEditor(input, opts || undefined, sideBySide ? SIDE_GROUP : ACTIVE_GROUP); } else { const resourceInput = input; @@ -301,11 +301,11 @@ export class EditorQuickOpenEntry extends QuickOpenEntry implements IEditorQuick */ export class EditorQuickOpenEntryGroup extends QuickOpenEntryGroup implements IEditorQuickOpenEntry { - getInput(): IEditorInput | IResourceInput { + getInput(): IEditorInput | IResourceInput | null { return null; } - getOptions(): IEditorOptions { + getOptions(): IEditorOptions | null { return null; } } From 815a3cb8600d8925add277939228913a2e544a3b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 12:00:16 -0800 Subject: [PATCH 343/429] Strict null check more files related to quick open --- src/tsconfig.strictNullChecks.json | 8 ++++ .../parts/quickopen/browser/quickOpenModel.ts | 2 +- src/vs/workbench/browser/quickopen.ts | 6 +-- .../quickopen/browser/commandsHandler.ts | 18 ++++----- .../quickopen/browser/gotoLineHandler.ts | 38 +++++++++++-------- .../quickopen/browser/viewPickerHandler.ts | 4 +- .../parts/search/browser/openFileHandler.ts | 15 +++----- .../parts/search/browser/openSymbolHandler.ts | 10 ++--- .../terminal/browser/terminalQuickOpen.ts | 6 ++- .../welcome/overlay/browser/welcomeOverlay.ts | 2 +- 10 files changed, 62 insertions(+), 47 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 4d89719082c..f2ceaf10385 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -565,13 +565,18 @@ "./vs/workbench/parts/preferences/browser/settingsWidgets.ts", "./vs/workbench/parts/preferences/common/smartSnippetInserter.ts", "./vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts", + "./vs/workbench/parts/quickopen/browser/commandsHandler.ts", + "./vs/workbench/parts/quickopen/browser/gotoLineHandler.ts", "./vs/workbench/parts/quickopen/browser/helpHandler.ts", + "./vs/workbench/parts/quickopen/browser/viewPickerHandler.ts", "./vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts", "./vs/workbench/parts/scm/common/scm.ts", "./vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts", "./vs/workbench/parts/scm/electron-browser/scmActivity.ts", "./vs/workbench/parts/scm/electron-browser/scmMenus.ts", "./vs/workbench/parts/scm/electron-browser/scmUtil.ts", + "./vs/workbench/parts/search/browser/openFileHandler.ts", + "./vs/workbench/parts/search/browser/openSymbolHandler.ts", "./vs/workbench/parts/search/browser/patternInputWidget.ts", "./vs/workbench/parts/search/browser/replaceContributions.ts", "./vs/workbench/parts/search/browser/replaceService.ts", @@ -581,6 +586,7 @@ "./vs/workbench/parts/search/common/search.ts", "./vs/workbench/parts/search/common/searchModel.ts", "./vs/workbench/parts/search/test/browser/mockSearchTree.ts", + "./vs/workbench/parts/search/test/browser/openFileHandler.test.ts", "./vs/workbench/parts/search/test/common/searchModel.test.ts", "./vs/workbench/parts/search/test/common/searchResult.test.ts", "./vs/workbench/parts/snippets/electron-browser/configureSnippets.ts", @@ -619,6 +625,7 @@ "./vs/workbench/parts/tasks/test/common/problemMatcher.test.ts", "./vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts", "./vs/workbench/parts/terminal/browser/terminalFindWidget.ts", + "./vs/workbench/parts/terminal/browser/terminalQuickOpen.ts", "./vs/workbench/parts/terminal/browser/terminalTab.ts", "./vs/workbench/parts/terminal/browser/terminalWidgetManager.ts", "./vs/workbench/parts/terminal/common/terminal.ts", @@ -648,6 +655,7 @@ "./vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts", "./vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts", "./vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts", + "./vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts", "./vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts", "./vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts", "./vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts", diff --git a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts index 7acd2cbbb9b..907b9e8e7e0 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenModel.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenModel.ts @@ -214,7 +214,7 @@ export class QuickOpenEntryGroup extends QuickOpenEntry { return this.groupLabel; } - setGroupLabel(groupLabel: string): void { + setGroupLabel(groupLabel: string | undefined): void { this.groupLabel = groupLabel; } diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index af06b1fbade..843dce6d80f 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -50,14 +50,14 @@ export class QuickOpenHandler { /** * The ARIA label to apply when this quick open handler is active in quick open. */ - getAriaLabel() { + getAriaLabel(): string | null { return null; } /** * Extra CSS class name to add to the quick open widget to do custom styling of entries. */ - getClass() { + getClass(): string | null { return null; } @@ -102,7 +102,7 @@ export class QuickOpenHandler { /** * Allows to return a label that will be placed to the side of the results from this handler or null if none. */ - getGroupLabel() { + getGroupLabel(): string | null { return null; } diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts index d86c5ac4cfd..13019490a5b 100644 --- a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts @@ -91,7 +91,7 @@ class CommandsHistory extends Disposable { private load(): void { const raw = this.storageService.get(CommandsHistory.PREF_KEY_CACHE, StorageScope.GLOBAL); - let serializedCache: ISerializedCommandHistory; + let serializedCache: ISerializedCommandHistory | undefined; if (raw) { try { serializedCache = JSON.parse(raw); @@ -118,7 +118,7 @@ class CommandsHistory extends Disposable { commandHistory.set(commandId, commandCounter++); // set counter to command } - peek(commandId: string): number { + peek(commandId: string): number | undefined { return commandHistory.peek(commandId); } @@ -214,14 +214,14 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { private description: string; private alias: string; private labelLowercase: string; - private keybindingAriaLabel: string; + private readonly keybindingAriaLabel?: string; constructor( private commandId: string, private keybinding: ResolvedKeybinding, private label: string, alias: string, - highlights: { label: IHighlight[], alias: IHighlight[] }, + highlights: { label: IHighlight[], alias?: IHighlight[] }, private onBeforeRun: (commandId: string) => void, @INotificationService private readonly notificationService: INotificationService, @ITelemetryService protected telemetryService: ITelemetryService @@ -229,15 +229,15 @@ abstract class BaseCommandEntry extends QuickOpenEntryGroup { super(); this.labelLowercase = this.label.toLowerCase(); - this.keybindingAriaLabel = keybinding ? keybinding.getAriaLabel() : undefined; + this.keybindingAriaLabel = keybinding ? keybinding.getAriaLabel() || undefined : undefined; if (this.label !== alias) { this.alias = alias; } else { - highlights.alias = null; + highlights.alias = undefined; } - this.setHighlights(highlights.label, null, highlights.alias); + this.setHighlights(highlights.label, undefined, highlights.alias); } getCommandId(): string { @@ -541,7 +541,7 @@ export class CommandsHandler extends QuickOpenHandler { // Add an 'alias' in original language when running in different locale const aliasTitle = (language !== LANGUAGE_DEFAULT && typeof action.item.title !== 'string') ? action.item.title.original : null; - const aliasCategory = (language !== LANGUAGE_DEFAULT && category && typeof action.item.category !== 'string') ? action.item.category.original : null; + const aliasCategory = (language !== LANGUAGE_DEFAULT && category && action.item.category && typeof action.item.category !== 'string') ? action.item.category.original : null; let alias; if (aliasTitle && category) { alias = aliasCategory ? `${aliasCategory}: ${aliasTitle}` : `${category}: ${aliasTitle}`; @@ -560,7 +560,7 @@ export class CommandsHandler extends QuickOpenHandler { } getAutoFocus(searchValue: string, context: { model: IModel, quickNavigateConfiguration?: IQuickNavigateConfiguration }): IAutoFocus { - let autoFocusPrefixMatch = searchValue.trim(); + let autoFocusPrefixMatch: string | undefined = searchValue.trim(); if (autoFocusPrefixMatch && this.commandHistoryEnabled) { const firstEntry = context.model && context.model.entries[0]; diff --git a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts index a29d34e5c9c..4db21cc95fd 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts @@ -61,7 +61,7 @@ export class GotoLineAction extends QuickOpenAction { if (restoreOptions) { Event.once(this._quickOpenService.onHide)(() => { - activeTextEditorWidget.updateOptions(restoreOptions); + activeTextEditorWidget.updateOptions(restoreOptions!); }); } @@ -93,13 +93,16 @@ class GotoLineEntry extends EditorQuickOpenEntry { const maxLineNumber = this.getMaxLineNumber(); if (this.invalidRange(maxLineNumber)) { - const currentLine = this.editorService.activeTextEditorWidget.getPosition().lineNumber; + const position = this.editorService.activeTextEditorWidget.getPosition(); + if (position) { + const currentLine = position.lineNumber; - if (maxLineNumber > 0) { - return nls.localize('gotoLineLabelEmptyWithLimit', "Current Line: {0}. Type a line number between 1 and {1} to navigate to.", currentLine, maxLineNumber); + if (maxLineNumber > 0) { + return nls.localize('gotoLineLabelEmptyWithLimit', "Current Line: {0}. Type a line number between 1 and {1} to navigate to.", currentLine, maxLineNumber); + } + + return nls.localize('gotoLineLabelEmpty', "Current Line: {0}. Type a line number to navigate to.", currentLine); } - - return nls.localize('gotoLineLabelEmpty', "Current Line: {0}. Type a line number to navigate to.", currentLine); } // Input valid, indicate action @@ -181,7 +184,7 @@ class GotoLineEntry extends EditorQuickOpenEntry { // Decorate if possible if (types.isFunction(activeTextEditorWidget.changeDecorations)) { - this.handler.decorateOutline(range, activeTextEditorWidget, this.editorService.activeControl.group); + this.handler.decorateOutline(range, activeTextEditorWidget, this.editorService.activeControl.group!); } } @@ -208,8 +211,8 @@ export class GotoLineHandler extends QuickOpenHandler { static readonly ID = 'workbench.picker.line'; - private rangeHighlightDecorationId: IEditorLineDecoration; - private lastKnownEditorViewState: IEditorViewState; + private rangeHighlightDecorationId: IEditorLineDecoration | null; + private lastKnownEditorViewState: IEditorViewState | null; constructor(@IEditorService private readonly editorService: IEditorService) { super(); @@ -217,9 +220,11 @@ export class GotoLineHandler extends QuickOpenHandler { getAriaLabel(): string { if (this.editorService.activeTextEditorWidget) { - const currentLine = this.editorService.activeTextEditorWidget.getPosition().lineNumber; - - return nls.localize('gotoLineLabelEmpty', "Current Line: {0}. Type a line number to navigate to.", currentLine); + const position = this.editorService.activeTextEditorWidget.getPosition(); + if (position) { + const currentLine = position.lineNumber; + return nls.localize('gotoLineLabelEmpty', "Current Line: {0}. Type a line number to navigate to.", currentLine); + } } return nls.localize('cannotRunGotoLine', "Open a text file first to go to a line."); @@ -288,14 +293,15 @@ export class GotoLineHandler extends QuickOpenHandler { } clearDecorations(): void { - if (this.rangeHighlightDecorationId) { + const rangeHighlightDecorationId = this.rangeHighlightDecorationId; + if (rangeHighlightDecorationId) { this.editorService.visibleControls.forEach(editor => { - if (editor.group.id === this.rangeHighlightDecorationId.groupId) { + if (editor.group && editor.group.id === rangeHighlightDecorationId.groupId) { const editorControl = editor.getControl(); editorControl.changeDecorations(changeAccessor => { changeAccessor.deltaDecorations([ - this.rangeHighlightDecorationId.lineDecorationId, - this.rangeHighlightDecorationId.rangeHighlightId + rangeHighlightDecorationId.lineDecorationId, + rangeHighlightDecorationId.rangeHighlightId ], []); }); } diff --git a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts b/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts index 5c6b0713db8..fe8cccaf627 100644 --- a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts @@ -137,7 +137,7 @@ export class ViewPickerHandler extends QuickOpenHandler { const result: ViewEntry[] = []; if (views.length) { for (const view of views) { - if (this.contextKeyService.contextMatchesRules(view.when)) { + if (this.contextKeyService.contextMatchesRules(view.when || null)) { result.push(new ViewEntry(view.name, viewlet.name, () => this.viewsService.openView(view.id, true))); } } @@ -155,7 +155,7 @@ export class ViewPickerHandler extends QuickOpenHandler { // Viewlet Views viewlets.forEach((viewlet, index) => { - const viewContainer: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).get(viewlet.id); + const viewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).get(viewlet.id); if (viewContainer) { const viewEntriesForViewlet: ViewEntry[] = getViewEntriesForViewlet(viewlet, viewContainer); viewEntries.push(...viewEntriesForViewlet); diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index ff7a3ec092b..5e5566fd385 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -97,14 +97,11 @@ export class FileEntry extends EditorQuickOpenEntry { const input: IResourceInput = { resource: this.resource, options: { - pinned: !this.configurationService.getValue().workbench.editor.enablePreviewFromQuickOpen + pinned: !this.configurationService.getValue().workbench.editor.enablePreviewFromQuickOpen, + selection: this.range ? this.range : undefined } }; - if (this.range) { - input.options.selection = this.range; - } - return input; } } @@ -178,7 +175,7 @@ export class OpenFileHandler extends QuickOpenHandler { for (const fileMatch of complete.results) { const label = paths.basename(fileMatch.resource.fsPath); - const description = this.labelService.getUriLabel(resources.dirname(fileMatch.resource), { relative: true }); + const description = this.labelService.getUriLabel(resources.dirname(fileMatch.resource)!, { relative: true }); results.push(this.instantiationService.createInstance(FileEntry, fileMatch.resource, label, description, iconClass)); } @@ -188,14 +185,14 @@ export class OpenFileHandler extends QuickOpenHandler { }); } - private getAbsolutePathResult(query: IPreparedQuery): Promise { + private getAbsolutePathResult(query: IPreparedQuery): Promise { if (paths.isAbsolute(query.original)) { const resource = URI.file(query.original); return this.fileService.resolveFile(resource).then(stat => stat.isDirectory ? undefined : resource, error => undefined); } - return Promise.resolve(null); + return Promise.resolve(undefined); } private doResolveQueryOptions(query: IPreparedQuery, cacheKey?: string, maxSortedResults?: number): IFileQueryBuilderOptions { @@ -273,7 +270,7 @@ export class CacheState { private loadingPhase = LoadingPhase.Created; private promise: Promise; - constructor(cacheQuery: (cacheKey: string) => IFileQuery, private doLoad: (query: IFileQuery) => Promise, private doDispose: (cacheKey: string) => Promise, private previous: CacheState) { + constructor(cacheQuery: (cacheKey: string) => IFileQuery, private doLoad: (query: IFileQuery) => Promise, private doDispose: (cacheKey: string) => Promise, private previous: CacheState | null) { this.query = cacheQuery(this._cacheKey); if (this.previous) { const current = objects.assign({}, this.query, { cacheKey: null }); diff --git a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts index bcc785e66b8..c57bea9b782 100644 --- a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts @@ -27,7 +27,7 @@ import { Schemas } from 'vs/base/common/network'; import { IOpenerService } from 'vs/platform/opener/common/opener'; class SymbolEntry extends EditorQuickOpenEntry { - private bearingResolve: Promise; + private bearingResolve: Promise; constructor( private bearing: IWorkspaceSymbol, @@ -48,7 +48,7 @@ class SymbolEntry extends EditorQuickOpenEntry { return nls.localize('entryAriaLabel', "{0}, symbols picker", this.getLabel()); } - getDescription(): string { + getDescription(): string | null { const containerName = this.bearing.containerName; if (this.bearing.location.uri) { if (containerName) { @@ -58,7 +58,7 @@ class SymbolEntry extends EditorQuickOpenEntry { return this.labelService.getUriLabel(this.bearing.location.uri, { relative: true }); } - return containerName; + return containerName || null; } getIcon(): string { @@ -105,7 +105,7 @@ class SymbolEntry extends EditorQuickOpenEntry { }; if (this.bearing.location.range) { - input.options.selection = Range.collapseToStart(this.bearing.location.range); + input.options!.selection = Range.collapseToStart(this.bearing.location.range); } return input; @@ -206,7 +206,7 @@ export class OpenSymbolHandler extends QuickOpenHandler { } const entry = this.instantiationService.createInstance(SymbolEntry, element, provider); - entry.setHighlights(filters.matchesFuzzy2(searchValue, entry.getLabel())); + entry.setHighlights(filters.matchesFuzzy2(searchValue, entry.getLabel()) || []); bucket.push(entry); } } diff --git a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts b/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts index 1b8f9848510..a2000fb85fb 100644 --- a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts +++ b/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts @@ -95,7 +95,11 @@ export class TerminalPickerHandler extends QuickOpenHandler { return true; } - const highlights = matchesFuzzy(normalizedSearchValueLowercase, e.getLabel(), true); + const label = e.getLabel(); + if (!label) { + return false; + } + const highlights = matchesFuzzy(normalizedSearchValueLowercase, label, true); if (!highlights) { return false; } diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts index e44c0f8d11f..a7a6c4054f5 100644 --- a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts @@ -171,7 +171,7 @@ class WelcomeOverlay { const container = this.partService.getContainer(Parts.EDITOR_PART); const offset = this.partService.getTitleBarOffset(); - this._overlay = dom.append(container.parentElement, $('.welcomeOverlay')); + this._overlay = dom.append(container.parentElement!, $('.welcomeOverlay')); this._overlay.style.top = `${offset}px`; this._overlay.style.height = `calc(100% - ${offset}px)`; this._overlay.style.display = 'none'; From 6e2995e40c3e3ef1e63ff519c8da88f5d586a2a6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 14:06:08 -0800 Subject: [PATCH 344/429] More work strict null checking quick open related files --- src/tsconfig.strictNullChecks.json | 2 ++ .../browser/parts/quickinput/quickInput.ts | 2 +- .../parts/quickopen/browser/gotoSymbolHandler.ts | 4 ++-- .../parts/search/browser/openAnythingHandler.ts | 2 +- src/vs/workbench/parts/tasks/browser/quickOpen.ts | 15 +++++++++------ .../parts/tasks/browser/taskQuickOpen.ts | 2 +- .../common/configurationResolver.ts | 6 +++--- .../node/variableResolver.ts | 8 ++++---- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index f2ceaf10385..298d66413ce 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -606,6 +606,8 @@ "./vs/workbench/parts/stats/test/workspaceStats.test.ts", "./vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts", "./vs/workbench/parts/surveys/electron-browser/nps.contribution.ts", + "./vs/workbench/parts/tasks/browser/quickOpen.ts", + "./vs/workbench/parts/tasks/browser/taskQuickOpen.ts", "./vs/workbench/parts/tasks/common/problemCollectors.ts", "./vs/workbench/parts/tasks/common/problemMatcher.ts", "./vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts", diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index 9926fb1de1f..1816f6118ff 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -115,7 +115,7 @@ class QuickInput implements IQuickInput { this.onDidHideEmitter, ]; - private busyDelay: TimeoutTimer; + private busyDelay: TimeoutTimer | null; constructor(protected ui: QuickInputUI) { } diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts index 4e161da020a..dfab2401a49 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts @@ -82,9 +82,9 @@ class OutlineModel extends QuickOpenModel { this.entries.forEach((entry: SymbolEntry) => { // Clear all state first - entry.setGroupLabel(null); + entry.setGroupLabel(undefined); entry.setShowBorder(false); - entry.setHighlights(null); + entry.setHighlights([]); entry.setHidden(false); // Filter by search diff --git a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts index 7ff26d8ff63..6318be52a6a 100644 --- a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts +++ b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts @@ -120,7 +120,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { } // Combine results. - const mergedResults: QuickOpenEntry[] = [].concat(...results.map(r => r.entries)); + const mergedResults: QuickOpenEntry[] = ([] as QuickOpenEntry[]).concat(...results.map(r => r.entries)); // Sort const compare = (elementA: QuickOpenEntry, elementB: QuickOpenEntry) => compareItemsByScore(elementA, elementB, query, true, QuickOpenItemAccessor, this.scorerCache); diff --git a/src/vs/workbench/parts/tasks/browser/quickOpen.ts b/src/vs/workbench/parts/tasks/browser/quickOpen.ts index fb5f8c33e84..ab7796f27a5 100644 --- a/src/vs/workbench/parts/tasks/browser/quickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/quickOpen.ts @@ -28,7 +28,7 @@ export class TaskEntry extends Model.QuickOpenEntry { return this.task._label; } - public getDescription(): string { + public getDescription(): string | null { if (!this.taskService.needsFolderQualification()) { return null; } @@ -51,7 +51,7 @@ export class TaskEntry extends Model.QuickOpenEntry { this.taskService.run(task, options).then(undefined, reason => { // eat the error, it has already been surfaced to the user and we don't care about it here }); - if (!task.command || task.command.presentation.focus) { + if (!task.command || (task.command.presentation && task.command.presentation.focus)) { this.quickOpenService.close(); return false; } @@ -67,7 +67,7 @@ export class TaskGroupEntry extends Model.QuickOpenEntryGroup { export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { - private tasks: Promise>; + private tasks?: Promise>; constructor( protected quickOpenService: IQuickOpenService, @@ -87,7 +87,10 @@ export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { this.tasks = undefined; } - public getResults(input: string, token: CancellationToken): Promise { + public getResults(input: string, token: CancellationToken): Promise { + if (!this.tasks) { + return Promise.resolve(null); + } return this.tasks.then((tasks) => { let entries: Model.QuickOpenEntry[] = []; if (tasks.length === 0 || token.isCancellationRequested) { @@ -186,7 +189,7 @@ class CustomizeTaskAction extends Action { } } - private getTask(element: any): CustomTask | ContributedTask { + private getTask(element: any): CustomTask | ContributedTask | undefined { if (element instanceof TaskEntry) { return element.task; } else if (element instanceof TaskGroupEntry) { @@ -220,7 +223,7 @@ export class QuickOpenActionContributor extends ActionBarContributor { return actions; } - private getTask(context: any): CustomTask | ContributedTask { + private getTask(context: any): CustomTask | ContributedTask | undefined { if (!context) { return undefined; } diff --git a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts b/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts index 16ea1b58b0c..289ef28e7d1 100644 --- a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts @@ -19,7 +19,7 @@ class TaskEntry extends base.TaskEntry { super(quickOpenService, taskService, task, highlights); } - public run(mode: QuickOpen.Mode, context: Model.IContext): boolean { + public run(mode: QuickOpen.Mode, context: QuickOpen.IEntryRunContext): boolean { if (mode === QuickOpen.Mode.PREVIEW) { return false; } diff --git a/src/vs/workbench/services/configurationResolver/common/configurationResolver.ts b/src/vs/workbench/services/configurationResolver/common/configurationResolver.ts index d1004cf5a04..d6993e1b41b 100644 --- a/src/vs/workbench/services/configurationResolver/common/configurationResolver.ts +++ b/src/vs/workbench/services/configurationResolver/common/configurationResolver.ts @@ -12,9 +12,9 @@ export const IConfigurationResolverService = createDecorator): IStringDictionary; + resolve(folder: IWorkspaceFolder | undefined, value: string): string; + resolve(folder: IWorkspaceFolder | undefined, value: string[]): string[]; + resolve(folder: IWorkspaceFolder | undefined, value: IStringDictionary): IStringDictionary; /** * Recursively resolves all variables in the given config and returns a copy of it with substituted values. diff --git a/src/vs/workbench/services/configurationResolver/node/variableResolver.ts b/src/vs/workbench/services/configurationResolver/node/variableResolver.ts index af4d991f3d3..7e86f0e4185 100644 --- a/src/vs/workbench/services/configurationResolver/node/variableResolver.ts +++ b/src/vs/workbench/services/configurationResolver/node/variableResolver.ts @@ -43,10 +43,10 @@ export class AbstractVariableResolverService implements IConfigurationResolverSe } } - public resolve(root: IWorkspaceFolder, value: string): string; - public resolve(root: IWorkspaceFolder, value: string[]): string[]; - public resolve(root: IWorkspaceFolder, value: IStringDictionary): IStringDictionary; - public resolve(root: IWorkspaceFolder, value: any): any { + public resolve(root: IWorkspaceFolder | undefined, value: string): string; + public resolve(root: IWorkspaceFolder | undefined, value: string[]): string[]; + public resolve(root: IWorkspaceFolder | undefined, value: IStringDictionary): IStringDictionary; + public resolve(root: IWorkspaceFolder | undefined, value: any): any { return this.recursiveResolve(root ? root.uri : undefined, value); } From d71299fe5d9cc06fc24389b3d361b4c2d81264c3 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 23:11:05 +0100 Subject: [PATCH 345/429] Upgrade to gulp4 --- build/gulpfile.extensions.js | 1 + build/lib/compilation.js | 1 + build/lib/compilation.ts | 1 + build/lib/typings/vinyl.d.ts | 3 + build/lib/util.js | 12 + build/lib/util.ts | 12 + package.json | 26 +- yarn.lock | 1775 +++++++++++++++++++--------------- 8 files changed, 1043 insertions(+), 788 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 3a780a22e8d..d45a12af6eb 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -80,6 +80,7 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(compilation()) + .pipe(util.toLatestVinylFile()) .pipe(build ? nlsDev.rewriteLocalizeCalls() : es.through()) .pipe(build ? util.stripSourceMappingURL() : es.through()) .pipe(sourcemaps.write('.', { diff --git a/build/lib/compilation.js b/build/lib/compilation.js index 592a5d087ce..af6b3daea03 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -58,6 +58,7 @@ function createCompile(src, build, emitError) { .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(ts(token)) + .pipe(util.toLatestVinylFile()) .pipe(noDeclarationsFilter) .pipe(build ? nls() : es.through()) .pipe(noDeclarationsFilter.restore) diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index b431a134f6c..68920f3dd84 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -66,6 +66,7 @@ function createCompile(src: string, build: boolean, emitError?: boolean): (token .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(ts(token)) + .pipe(util.toLatestVinylFile()) .pipe(noDeclarationsFilter) .pipe(build ? nls() : es.through()) .pipe(noDeclarationsFilter.restore) diff --git a/build/lib/typings/vinyl.d.ts b/build/lib/typings/vinyl.d.ts index a85632e172b..7ebeea84f8e 100644 --- a/build/lib/typings/vinyl.d.ts +++ b/build/lib/typings/vinyl.d.ts @@ -11,6 +11,9 @@ declare module "vinyl" { * A virtual file format. */ class File { + + public static isVinyl(t: any): t is File; + constructor(options?: { /** * Default: process.cwd() diff --git a/build/lib/util.js b/build/lib/util.js index b6228ad4cf9..96deabf747b 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -98,6 +98,18 @@ function skipDirectories() { }); } exports.skipDirectories = skipDirectories; +/** + * gulp does not like anything except the latest VinylFile (it checks for VinylFile.isVinyl) + */ +function toLatestVinylFile() { + return es.mapSync(f => { + if (VinylFile.isVinyl(f)) { + return f; + } + return new VinylFile(f); + }); +} +exports.toLatestVinylFile = toLatestVinylFile; function cleanNodeModule(name, excludes, includes) { const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : ''); const negate = (str) => '!' + str; diff --git a/build/lib/util.ts b/build/lib/util.ts index 42d3aba2fee..7415d0d0e0c 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -129,6 +129,18 @@ export function skipDirectories(): NodeJS.ReadWriteStream { }); } +/** + * gulp does not like anything except the latest VinylFile (it checks for VinylFile.isVinyl) + */ +export function toLatestVinylFile(): NodeJS.ReadWriteStream { + return es.mapSync(f => { + if (VinylFile.isVinyl(f)) { + return f; + } + return new VinylFile(f); + }); +} + export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream { const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : ''); const negate = (str: string) => '!' + str; diff --git a/package.json b/package.json index 21e96b6c067..0862e82a93c 100644 --- a/package.json +++ b/package.json @@ -83,23 +83,23 @@ "express": "^4.13.1", "fancy-log": "^1.3.3", "glob": "^5.0.13", - "gulp": "^3.8.9", + "gulp": "^4.0.0", "gulp-atom-electron": "^1.19.2", - "gulp-azure-storage": "^0.8.2", + "gulp-azure-storage": "^0.9.0", "gulp-buffer": "0.0.2", - "gulp-concat": "^2.6.0", - "gulp-cssnano": "^2.1.0", - "gulp-eslint": "^3.0.1", - "gulp-filter": "^3.0.0", - "gulp-flatmap": "^1.0.0", - "gulp-json-editor": "^2.2.1", + "gulp-concat": "^2.6.1", + "gulp-cssnano": "^2.1.3", + "gulp-eslint": "^5.0.0", + "gulp-filter": "^5.1.0", + "gulp-flatmap": "^1.0.2", + "gulp-json-editor": "^2.5.0", "gulp-plumber": "^1.2.0", "gulp-remote-src": "^0.4.4", "gulp-rename": "^1.2.0", "gulp-replace": "^0.5.4", - "gulp-shell": "^0.5.2", + "gulp-shell": "^0.6.5", "gulp-tsb": "2.0.5", - "gulp-tslint": "^8.1.2", + "gulp-tslint": "^8.1.3", "gulp-uglify": "^3.0.0", "gulp-vinyl-zip": "^2.1.2", "husky": "^0.13.1", @@ -119,7 +119,7 @@ "pump": "^1.0.1", "queue": "3.0.6", "rcedit": "^1.1.0", - "remap-istanbul": "^0.6.4", + "remap-istanbul": "^0.13.0", "rimraf": "^2.2.8", "sinon": "^1.17.2", "source-map": "^0.4.4", @@ -130,8 +130,8 @@ "typescript-tslint-plugin": "^0.0.7", "uglify-es": "^3.0.18", "underscore": "^1.8.2", - "vinyl": "^0.4.5", - "vinyl-fs": "^2.4.3", + "vinyl": "^2.0.0", + "vinyl-fs": "^3.0.0", "vsce": "1.48.0", "vscode-nls-dev": "3.2.2", "webpack": "^4.16.5", diff --git a/yarn.lock b/yarn.lock index 0385a824bf6..6d53114fe17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,22 @@ resolved "https://registry.yarnpkg.com/7zip/-/7zip-0.0.6.tgz#9cafb171af82329490353b4816f03347aa150a30" integrity sha1-nK+xca+CMpSQNTtIFvAzR6oVCjA= +"@babel/code-frame@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" + integrity sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" + integrity sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + "@types/commander@^2.11.0": version "2.12.2" resolved "https://registry.yarnpkg.com/@types/commander/-/commander-2.12.2.tgz#183041a23842d4281478fa5d23c5ca78e6fd08ae" @@ -14,6 +30,11 @@ dependencies: commander "*" +"@types/fancy-log@1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@types/fancy-log/-/fancy-log-1.3.0.tgz#a61ab476e5e628cd07a846330df53b85e05c8ce0" + integrity sha512-mQjDxyOM1Cpocd+vm1kZBP7smwKZ4TNokFeds9LV7OZibmPJFEzY3+xZMrKfUdNT71lv8GoCPD6upKwHxubClw== + "@types/keytar@^4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/keytar/-/keytar-4.0.1.tgz#e2cf6405dc33861424e59b67516c66d2cf7bc21b" @@ -34,6 +55,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-4.2.22.tgz#cf488a0f6b4a9c245d09927f4f757ca278b9c8ce" integrity sha512-LXRap3bb4AjtLZ5NOFc4ssVZrQPTgdPcNm++0SEJuJZaOA+xHkojJNYqy33A5q/94BmG5tA6yaMeD4VdCv5aSA== +"@types/node@^10.11.7": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== + "@types/node@^10.12.12": version "10.12.12" resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.12.tgz#e15a9d034d9210f00320ef718a50c4a799417c47" @@ -262,6 +288,11 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn-jsx@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.1.tgz#32a064fd925429216a09b141102bfdd185fae40e" + integrity sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg== + acorn@^3.0.4: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -277,6 +308,11 @@ acorn@^5.2.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7" integrity sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w== +acorn@^6.0.2: + version "6.0.7" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.7.tgz#490180ce18337270232d9488a44be83d9afb7fd3" + integrity sha512-HNJNgE60C9eOTgn974Tlp3dpLZdUr+SoxxDwPaY9J/kDNOLQTkaDgwBUXAF4SSsrAwD9RpdxuHK/EbuF+W9Ahw== + agent-base@4, agent-base@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce" @@ -339,6 +375,16 @@ ajv@^6.1.0: json-schema-traverse "^0.4.1" uri-js "^4.2.1" +ajv@^6.5.3, ajv@^6.6.1: + version "6.8.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.8.1.tgz#0890b93742985ebf8973cd365c5b23920ce3cb20" + integrity sha512-eqxCp82P+JfqL683wwsL73XmFs1eG6qjw+RD3YHx+Jll1r0jNd4dh8QG9NYAeNGA/hnZjeEDgtTskgJULbxpWQ== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + align-text@^0.1.1, align-text@^0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" @@ -353,11 +399,6 @@ alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= -amdefine@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.0.tgz#fd17474700cb5cc9c2b709f0be9d23ce3c198c33" - integrity sha1-/RdHRwDLXMnCtwnwvp0jzjwZjDM= - amdefine@>=0.0.4: version "1.0.1" resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" @@ -392,6 +433,11 @@ ansi-escapes@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.1.0.tgz#f73207bb81207d75fd6c83f125af26eea378ca30" integrity sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw== +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + ansi-gray@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/ansi-gray/-/ansi-gray-0.1.1.tgz#2962cf54ec9792c48510a3deb524436861ef7251" @@ -406,11 +452,6 @@ ansi-red@^0.1.1: dependencies: ansi-wrap "0.1.0" -ansi-regex@^0.2.0, ansi-regex@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-0.2.1.tgz#0d8e946967a3d8143f93e24e298525fc1b2235f9" - integrity sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk= - ansi-regex@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" @@ -421,10 +462,10 @@ ansi-regex@^3.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= -ansi-styles@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-1.1.0.tgz#eaecbf66cd706882760b2f4691582b8f55d7a7de" - integrity sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94= +ansi-regex@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.0.0.tgz#70de791edf021404c3fd615aa89118ae0432e5a9" + integrity sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w== ansi-styles@^2.2.1: version "2.2.1" @@ -438,7 +479,7 @@ ansi-styles@^3.1.0: dependencies: color-convert "^1.9.0" -ansi-styles@^3.2.1: +ansi-styles@^3.2.0, ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -519,6 +560,13 @@ arr-diff@^4.0.0: resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= +arr-filter@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/arr-filter/-/arr-filter-1.1.2.tgz#43fdddd091e8ef11aa4c45d9cdc18e2dff1711ee" + integrity sha1-Q/3d0JHo7xGqTEXZzcGOLf8XEe4= + dependencies: + make-iterator "^1.0.0" + arr-flatten@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.1.tgz#e5ffe54d45e19f32f216e91eb99c8ce892bb604b" @@ -529,6 +577,13 @@ arr-flatten@^1.1.0: resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== +arr-map@^2.0.0, arr-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/arr-map/-/arr-map-2.0.2.tgz#3a77345ffc1cf35e2a91825601f9e58f2e24cac4" + integrity sha1-Onc0X/wc814qkYJWAfnljy4kysQ= + dependencies: + make-iterator "^1.0.0" + arr-union@^2.0.1: version "2.1.0" resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-2.1.0.tgz#20f9eab5ec70f5c7d215b1077b1c39161d292c7d" @@ -544,7 +599,7 @@ array-differ@^1.0.0: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= -array-each@^1.0.1: +array-each@^1.0.0, array-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" integrity sha1-p5SvDAWrF1KEbudTofIRoFugxE8= @@ -559,6 +614,21 @@ array-flatten@1.1.1: resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= +array-initial@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/array-initial/-/array-initial-1.1.0.tgz#2fa74b26739371c3947bd7a7adc73be334b3d795" + integrity sha1-L6dLJnOTccOUe9enrcc74zSz15U= + dependencies: + array-slice "^1.0.0" + is-number "^4.0.0" + +array-last@^1.1.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array-last/-/array-last-1.3.0.tgz#7aa77073fec565ddab2493f5f88185f404a9d336" + integrity sha512-eOCut5rXlI6aCOS7Z7kCplKRKyiFQ6dHFBem4PwlwKeNFk2/XxTrhRh5T9PyaEWGy/NHTZWbY+nsZlNFJu9rYg== + dependencies: + is-number "^4.0.0" + array-slice@^0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-0.2.3.tgz#dd3cfb80ed7973a75117cdac69b0b99ec86186f5" @@ -569,6 +639,15 @@ array-slice@^1.0.0: resolved "https://registry.yarnpkg.com/array-slice/-/array-slice-1.0.0.tgz#e73034f00dcc1f40876008fd20feae77bd4b7c2f" integrity sha1-5zA08A3MH0CHYAj9IP6ud71LfC8= +array-sort@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-sort/-/array-sort-1.0.0.tgz#e4c05356453f56f53512a7d1d6123f2c54c0a88a" + integrity sha512-ihLeJkonmdiAsD7vpgN3CRcx2J2S0TiYW+IS/5zHBI7mKUq3ySvBdzzBfD236ubDBQFiiyG3SWCPc+msQ9KoYg== + dependencies: + default-compare "^1.0.0" + get-value "^2.0.6" + kind-of "^5.0.2" + array-union@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" @@ -646,7 +725,22 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -async-each@^1.0.0: +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +async-done@^1.2.0, async-done@^1.2.2: + version "1.3.1" + resolved "https://registry.yarnpkg.com/async-done/-/async-done-1.3.1.tgz#14b7b73667b864c8f02b5b253fc9c6eddb777f3e" + integrity sha512-R1BaUeJ4PMoLNJuk+0tLJgjmEqVsdN118+Z8O+alhnQDQgy0kmD5Mqi0DNEmMx2LM0Ed5yekKu+ZXYvIHceicg== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.2" + process-nextick-args "^1.0.7" + stream-exhaust "^1.0.1" + +async-each@^1.0.0, async-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" integrity sha1-GdOGodntxufByF04iu28xW0zYC0= @@ -656,17 +750,24 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8" integrity sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg== -async@1.x, async@^1.4.0, async@^1.5.0: +async-settle@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/async-settle/-/async-settle-1.0.0.tgz#1d0a914bb02575bec8a8f3a74e5080f72b2c0c6b" + integrity sha1-HQqRS7Aldb7IqPOnTlCA9yssDGs= + dependencies: + async-done "^1.2.2" + +async@1.x, async@^1.4.0: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" integrity sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo= -async@^2.0.1: - version "2.6.0" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" - integrity sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw== +async@^2.1.5: + version "2.6.1" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610" + integrity sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ== dependencies: - lodash "^4.14.0" + lodash "^4.17.10" asynckit@^0.4.0: version "0.4.0" @@ -710,21 +811,22 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f" integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ== -azure-storage@^1.3.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/azure-storage/-/azure-storage-1.4.0.tgz#fb52fa68b3efa6980c33fd7c5cd489b7adc46ed1" - integrity sha1-+1L6aLPvppgMM/18XNSJt63EbtE= +azure-storage@^2.10.2: + version "2.10.2" + resolved "https://registry.yarnpkg.com/azure-storage/-/azure-storage-2.10.2.tgz#3bcabdbf10e72fd0990db81116e49023c4a675b6" + integrity sha512-pOyGPya9+NDpAfm5YcFfklo57HfjDbYLXxs4lomPwvRxmb0Di/A+a+RkUmEFzaQ8S13CqxK40bRRB0sjj2ZQxA== dependencies: browserify-mime "~1.2.9" - extend "~1.2.1" + extend "^3.0.2" json-edm-parser "0.1.2" - node-uuid "~1.4.0" + md5.js "1.3.4" readable-stream "~2.0.0" - request "~2.74.0" - underscore "~1.4.4" - validator "~3.22.2" - xml2js "0.2.7" - xmlbuilder "0.4.3" + request "^2.86.0" + underscore "~1.8.3" + uuid "^3.0.0" + validator "~9.4.1" + xml2js "0.2.8" + xmlbuilder "^9.0.7" babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: version "6.26.0" @@ -735,6 +837,21 @@ babel-code-frame@^6.16.0, babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.2" +bach@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/bach/-/bach-1.2.0.tgz#4b3ce96bf27134f79a1b414a51c14e34c3bd9880" + integrity sha1-Szzpa/JxNPeaG0FKUcFONMO9mIA= + dependencies: + arr-filter "^1.1.1" + arr-flatten "^1.0.1" + arr-map "^2.0.0" + array-each "^1.0.0" + array-initial "^1.0.0" + array-last "^1.1.1" + async-done "^1.2.2" + async-settle "^1.0.0" + now-and-later "^2.0.0" + balanced-match@^0.4.2: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -821,13 +938,6 @@ bl@^1.0.0: 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" - integrity sha1-/cqHGplxOqANGeO7ukHER4emU5g= - dependencies: - readable-stream "~2.0.5" - bluebird@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9" @@ -897,7 +1007,7 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" -braces@^2.3.0, braces@^2.3.1: +braces@^2.3.0, braces@^2.3.1, braces@^2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== @@ -1047,13 +1157,6 @@ buffers@~0.1.1: resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb" integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s= -bufferstreams@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/bufferstreams/-/bufferstreams-1.1.1.tgz#0161373060ac5988eff99058731114f6e195d51e" - integrity sha1-AWE3MGCsWYjv+ZBYcxEU9uGV1R4= - dependencies: - readable-stream "^2.0.2" - builtin-modules@^1.0.0, builtin-modules@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" @@ -1115,6 +1218,11 @@ callsites@^0.2.0: resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" integrity sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo= +callsites@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.0.0.tgz#fb7eb569b72ad7a45812f93fd9430a3e410b3dd3" + integrity sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw== + camelcase-keys@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/camelcase-keys/-/camelcase-keys-2.1.0.tgz#308beeaffdf28119051efa1d932213c91b8f92e7" @@ -1133,6 +1241,11 @@ camelcase@^2.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f" integrity sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8= +camelcase@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" + integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo= + camelcase@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" @@ -1178,16 +1291,14 @@ chainsaw@~0.1.0: dependencies: traverse ">=0.3.0 <0.4" -chalk@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-0.5.1.tgz#663b3a648b68b55d04690d49167aa837858f2174" - integrity sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ= +chalk@2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.1.tgz#523fe2678aec7b04e8041909292fe8b17059b796" + integrity sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g== dependencies: - ansi-styles "^1.1.0" - escape-string-regexp "^1.0.0" - has-ansi "^0.1.0" - strip-ansi "^0.3.0" - supports-color "^0.2.0" + ansi-styles "^3.2.0" + escape-string-regexp "^1.0.5" + supports-color "^5.2.0" chalk@^1.0.0, chalk@^1.1.1, chalk@^1.1.3: version "1.1.3" @@ -1209,6 +1320,15 @@ chalk@^2.0.0, chalk@^2.4.1: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^2.1.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" @@ -1223,6 +1343,11 @@ chardet@^0.5.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.5.0.tgz#fe3ac73c00c3d865ffcc02a0682e2c20b6a06029" integrity sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g== +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + charenc@~0.0.1: version "0.0.2" resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" @@ -1240,6 +1365,25 @@ cheerio@^1.0.0-rc.1: lodash "^4.15.0" parse5 "^3.0.1" +chokidar@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.0.tgz#5fcb70d0b28ebe0867eb0f09d5f6a08f29a1efa0" + integrity sha512-5t6G2SH8eO6lCvYOoUpaRnF5Qfd//gd7qJAkwRUw9qlGVkiQ13uwQngqbWWaurOsaAm9+kUGbITADxt6H0XFNQ== + dependencies: + anymatch "^2.0.0" + async-each "^1.0.1" + braces "^2.3.2" + glob-parent "^3.1.0" + inherits "^2.0.3" + is-binary-path "^1.0.0" + is-glob "^4.0.0" + normalize-path "^3.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.2.1" + upath "^1.1.0" + optionalDependencies: + fsevents "^1.2.7" + chokidar@^2.0.2: version "2.0.4" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.4.tgz#356ff4e2b0e8e43e322d18a372460bbcf3accd26" @@ -1356,6 +1500,15 @@ cliui@^2.1.0: right-align "^0.1.1" wordwrap "0.0.2" +cliui@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" + integrity sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0= + dependencies: + string-width "^1.0.1" + strip-ansi "^3.0.1" + wrap-ansi "^2.0.0" + cliui@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc" @@ -1370,7 +1523,7 @@ clone-buffer@^1.0.0: resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" integrity sha1-4+JbIHrE5wGvch4staFnksrD3Fg= -clone-stats@^0.0.1, clone-stats@~0.0.1: +clone-stats@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-0.0.1.tgz#b88f94a82cf38b8791d58046ea4029ad88ca99d1" integrity sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE= @@ -1426,6 +1579,15 @@ coffee-script@^1.10.0: resolved "https://registry.yarnpkg.com/coffee-script/-/coffee-script-1.12.7.tgz#c05dae0cb79591d05b3070a8433a98c9a89ccc53" integrity sha512-fLeEhqwymYat/MpTPUjSKHVYYl0ec2mOyALEMLmzr5i1isuG+6jfI2j2d5oBO3VIzgUXgBVIcOT9uH1TFxBckw== +collection-map@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-map/-/collection-map-1.0.0.tgz#aea0f06f8d26c780c2b75494385544b2255af18c" + integrity sha1-rqDwb40mx4DCt1SUOFVEsiVa8Yw= + dependencies: + arr-map "^2.0.2" + for-own "^1.0.0" + make-iterator "^1.0.0" + collection-visit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" @@ -1539,6 +1701,11 @@ commander@^2.12.1, commander@~2.13.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.13.0.tgz#6964bca67685df7c1f1430c584f07d7597885b9c" integrity sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA== +commander@^2.19.0: + version "2.19.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a" + integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg== + commandpost@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/commandpost/-/commandpost-1.2.1.tgz#2e9c4c7508b9dc704afefaa91cab92ee6054cc68" @@ -1568,7 +1735,7 @@ concat-stream@1.6.0, concat-stream@^1.5.2: readable-stream "^2.2.2" typedarray "^0.0.6" -concat-stream@^1.5.0: +concat-stream@^1.5.0, concat-stream@^1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -1585,10 +1752,10 @@ concat-with-sourcemaps@^1.0.0: dependencies: source-map "^0.5.1" -config-chain@~1.1.5: - version "1.1.11" - resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.11.tgz#aba09747dfbe4c3e70e766a6e41586e1859fc6f2" - integrity sha1-q6CXR9++TD5w52am5BWG4YWfxvI= +config-chain@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/config-chain/-/config-chain-1.1.12.tgz#0fde8d091200eb5e808caf25fe618c02f48e4efa" + integrity sha512-a1eOIcu8+7lUInge4Rpf/n4Krkf3Dd9lqhljRzII1/Zno/kRtUWnznPO3jOKBmTEktkt3fkxisUcivoj0ebzoA== dependencies: ini "^1.3.4" proto-list "~1.2.1" @@ -1659,6 +1826,14 @@ copy-descriptor@^0.1.0: resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= +copy-props@^2.0.1: + version "2.0.4" + resolved "https://registry.yarnpkg.com/copy-props/-/copy-props-2.0.4.tgz#93bb1cadfafd31da5bb8a9d4b41f471ec3a72dfe" + integrity sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A== + dependencies: + each-props "^1.3.0" + is-plain-object "^2.0.1" + copy-webpack-plugin@^4.5.2: version "4.5.2" resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.5.2.tgz#d53444a8fea2912d806e78937390ddd7e632ee5c" @@ -1897,14 +2072,6 @@ date-now@^0.1.4: resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= -dateformat@^1.0.11, dateformat@^1.0.7-1.2.3: - version "1.0.12" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-1.0.12.tgz#9f124b67594c937ff706932e4a642cca8dbbfee9" - integrity sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk= - dependencies: - get-stdin "^4.0.1" - meow "^3.3.0" - dateformat@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" @@ -1936,6 +2103,13 @@ debug@3.1.0, debug@^3.1.0: dependencies: ms "2.0.0" +debug@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + 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" @@ -1988,17 +2162,22 @@ deep-is@~0.1.2, deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -deepmerge@~0.2.7: - version "0.2.10" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-0.2.10.tgz#8906bf9e525a4fbf1b203b2afcb4640249821219" - integrity sha1-iQa/nlJaT78bIDsq/LRkAkmCEhk= +deepmerge@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-3.1.0.tgz#a612626ce4803da410d77554bfd80361599c034d" + integrity sha512-/TnecbwXEdycfbsM2++O3eGiatEFHjjNciHEwJclM+T5Kd94qD1AP+2elP/Mq0L5b9VZJao5znR01Mz6eX8Seg== -defaults@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/defaults/-/defaults-1.0.3.tgz#c656051e9817d9ff08ed881477f3fe4019f3ef7d" - integrity sha1-xlYFHpgX2f8I7YgUd/P+QBnz730= +default-compare@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/default-compare/-/default-compare-1.0.0.tgz#cb61131844ad84d84788fb68fd01681ca7781a2f" + integrity sha512-QWfXlM0EkAbqOCbD/6HjdwT19j7WCkMyiRhWilc4H9/5h/RzTF9gv5LYh1+CmDV5d1rki6KAWLtQale0xt20eQ== dependencies: - clone "^1.0.2" + kind-of "^5.0.2" + +default-resolution@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/default-resolution/-/default-resolution-2.0.0.tgz#bcb82baa72ad79b426a76732f1a81ad6df26d684" + integrity sha1-vLgrqnKtebQmp2cy8aga1t8m1oQ= define-properties@^1.1.2: version "1.1.3" @@ -2072,11 +2251,6 @@ depd@1.1.1, depd@~1.1.1: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.1.tgz#5783b4e1c459f06fa5ca27f991f3d06e7a310359" integrity sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k= -deprecated@^0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/deprecated/-/deprecated-0.0.1.tgz#f9c9af5464afa1e7a971458a8bdef2aa94d5bb19" - integrity sha1-+cmvVGSvoeepcUWKi97yqpTVuxk= - des.js@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/des.js/-/des.js-1.0.0.tgz#c074d2e2aa6a8a9a07dbd61f9a15c2cd83ec8ecc" @@ -2090,21 +2264,15 @@ destroy@~1.0.4: resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= -detect-file@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-0.1.0.tgz#4935dedfd9488648e006b0129566e9386711ea63" - integrity sha1-STXe39lIhkjgBrASlWbpOGcR6mM= - dependencies: - fs-exists-sync "^0.1.0" +detect-file@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/detect-file/-/detect-file-1.0.0.tgz#f0d66d03672a825cb1b73bdb3fe62310c8e552b7" + integrity sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc= -detect-indent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-2.0.0.tgz#720ff51e4d97b76884f6bf57292348b13dfde939" - integrity sha1-cg/1Hk2Xt2iE9r9XKSNIsT396Tk= - dependencies: - get-stdin "^3.0.0" - minimist "^1.1.0" - repeating "^1.1.0" +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + integrity sha1-OHHMCmoALow+Wzz38zYmRnXwa50= detect-libc@^1.0.2, detect-libc@^1.0.3: version "1.0.3" @@ -2158,6 +2326,13 @@ doctrine@^2.0.0: esutils "^2.0.2" isarray "^1.0.0" +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + documentdb@^1.5.1: version "1.14.1" resolved "https://registry.yarnpkg.com/documentdb/-/documentdb-1.14.1.tgz#1a4716c0b38a40daf375dc9a4b2a2beb4e26294a" @@ -2248,6 +2423,14 @@ duplexify@^3.4.2, duplexify@^3.6.0: readable-stream "^2.0.0" stream-shift "^1.0.0" +each-props@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/each-props/-/each-props-1.3.2.tgz#ea45a414d16dd5cfa419b1a81720d5ca06892333" + integrity sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA== + dependencies: + is-plain-object "^2.0.1" + object.defaults "^1.1.0" + eachr@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eachr/-/eachr-3.2.0.tgz#2c35e43ea086516f7997cf80b7aa64d55a4a4484" @@ -2280,6 +2463,18 @@ editorconfig@^0.15.0: semver "^5.4.1" sigmund "^1.0.1" +editorconfig@^0.15.2: + version "0.15.2" + resolved "https://registry.yarnpkg.com/editorconfig/-/editorconfig-0.15.2.tgz#047be983abb9ab3c2eefe5199cb2b7c5689f0702" + integrity sha512-GWjSI19PVJAM9IZRGOS+YKI8LN+/sjkSjNyvxL5ucqP9/IqtYNXBaQ/6c/hkPNYQHyOHra2KoXZI/JVpuqwmcQ== + dependencies: + "@types/node" "^10.11.7" + "@types/semver" "^5.5.0" + commander "^2.19.0" + lru-cache "^4.1.3" + semver "^5.6.0" + sigmund "^1.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -2343,13 +2538,6 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0: dependencies: once "^1.4.0" -end-of-stream@~0.1.5: - version "0.1.5" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-0.1.5.tgz#8e177206c3c80837d85632e8b9359dfe8b2f6eaf" - integrity sha1-jhdyBsPICDfYVjLouTWd/osvbq8= - dependencies: - once "~1.3.0" - enhanced-resolve@^4.0.0, enhanced-resolve@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz#41c7e0bfdfe74ac1ffe1e57ad6a5c6c9f3742a7f" @@ -2463,7 +2651,7 @@ escape-string-regexp@1.0.2: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" integrity sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE= -escape-string-regexp@^1.0.0, escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -2510,7 +2698,17 @@ eslint-scope@^4.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@^3.0.0, eslint@^3.4.0: +eslint-utils@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.3.1.tgz#9a851ba89ee7c460346f97cf8939c7298827e512" + integrity sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q== + +eslint-visitor-keys@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d" + integrity sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ== + +eslint@^3.4.0: version "3.19.0" resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.19.0.tgz#c8fc6201c7f40dd08941b87c085767386a679acc" integrity sha1-yPxiAcf0DdCJQbh8CFdnOGpnmsw= @@ -2551,6 +2749,48 @@ eslint@^3.0.0, eslint@^3.4.0: text-table "~0.2.0" user-home "^2.0.0" +eslint@^5.0.1: + version "5.13.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.13.0.tgz#ce71cc529c450eed9504530939aa97527861ede9" + integrity sha512-nqD5WQMisciZC5EHZowejLKQjWGuFS5c70fxqSKlnDME+oz9zmE8KTlX+lHSg+/5wsC/kf9Q9eMkC8qS3oM2fg== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.5.3" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^2.1.0" + eslint-scope "^4.0.0" + eslint-utils "^1.3.1" + eslint-visitor-keys "^1.0.0" + espree "^5.0.0" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" + glob "^7.1.2" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.1.0" + js-yaml "^3.12.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.5" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + path-is-inside "^1.0.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^5.5.1" + strip-ansi "^4.0.0" + strip-json-comments "^2.0.1" + table "^5.0.2" + text-table "^0.2.0" + espree@^3.4.0: version "3.5.2" resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca" @@ -2559,6 +2799,15 @@ espree@^3.4.0: acorn "^5.2.1" acorn-jsx "^3.0.0" +espree@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-5.0.0.tgz#fc7f984b62b36a0f543b13fb9cd7b9f4a7f5b65c" + integrity sha512-1MpUfwsdS9MMoN7ZXqAr9e9UKdVHDcvrJpyx7mm1WuQlx/ygErEQBzgi5Nh5qBHIoYweprhtMkTCb9GhcAIcsA== + dependencies: + acorn "^6.0.2" + acorn-jsx "^5.0.0" + eslint-visitor-keys "^1.0.0" + esprima@2.5.x: version "2.5.0" resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.5.0.tgz#f387a46fd344c1b1a39baf8c20bfb43b6d0058cc" @@ -2586,6 +2835,13 @@ esquery@^1.0.0: dependencies: estraverse "^4.0.0" +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + esrecurse@^4.1.0: version "4.2.0" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.0.tgz#fa9568d98d3823f9a41d91e902dcab9ea6e5b163" @@ -2698,14 +2954,7 @@ expand-template@^1.0.2: resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.1.1.tgz#981f188c0c3a87d2e28f559bc541426ff94f21dd" integrity sha512-cebqLtV8KOZfw0UI8TEFWxtczxxC1jvyUvx6H4fyp1K1FN7A4Q+uggVUlOsI1K8AGU0rwOGqP8nCapdrw8CYQg== -expand-tilde@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-1.2.2.tgz#0b81eba897e5a3d31d1c3d102f8f01441e559449" - integrity sha1-C4HrqJflo9MdHD0QL48BRB5VlEk= - dependencies: - os-homedir "^1.0.1" - -expand-tilde@^2.0.2: +expand-tilde@^2.0.0, expand-tilde@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" integrity sha1-l+gBqgUt8CRU3kawK/YhZCzchQI= @@ -2775,12 +3024,7 @@ extend@^3.0.0, extend@~3.0.0, extend@~3.0.1: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444" integrity sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ= -extend@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/extend/-/extend-1.2.1.tgz#a0f5fd6cfc83a5fe49ef698d60ec8a624dd4576c" - integrity sha1-oPX9bPyDpf5J72mNYOyKYk3UV2w= - -extend@~3.0.2: +extend@^3.0.2, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -2794,6 +3038,15 @@ external-editor@^3.0.0: iconv-lite "^0.4.22" tmp "^0.0.33" +external-editor@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.0.3.tgz#5866db29a97826dbe4bf3afd24070ead9ea43a27" + integrity sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + extglob@^0.3.1: version "0.3.2" resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" @@ -2839,15 +3092,7 @@ extsprintf@1.3.0, extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= -fancy-log@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" - integrity sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg= - dependencies: - chalk "^1.1.1" - time-stamp "^1.0.0" - -fancy-log@^1.3.2: +fancy-log@1.3.2, fancy-log@^1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" integrity sha1-9BEl49hPLn2JpD0G2VjI94vha+E= @@ -2856,6 +3101,14 @@ fancy-log@^1.3.2: color-support "^1.1.3" time-stamp "^1.0.0" +fancy-log@^1.1.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" + integrity sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg= + dependencies: + chalk "^1.1.1" + time-stamp "^1.0.0" + fancy-log@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" @@ -2982,11 +3235,6 @@ find-cache-dir@^1.0.0: make-dir "^1.0.0" pkg-dir "^2.0.0" -find-index@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-index/-/find-index-0.1.1.tgz#675d358b2ca3892d795a1ab47232f8b6e2e0dde4" - integrity sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ= - find-parent-dir@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/find-parent-dir/-/find-parent-dir-0.3.0.tgz#33c44b429ab2b2f0646299c5f9f718f376ff8d54" @@ -3014,15 +3262,15 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -findup-sync@^0.4.2: - version "0.4.3" - resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-0.4.3.tgz#40043929e7bc60adf0b7f4827c4c6e75a0deca12" - integrity sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI= +findup-sync@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/findup-sync/-/findup-sync-2.0.0.tgz#9326b1488c22d1a6088650a86901b2d9a90a2cbc" + integrity sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw= dependencies: - detect-file "^0.1.0" - is-glob "^2.0.1" - micromatch "^2.3.7" - resolve-dir "^0.1.0" + detect-file "^1.0.0" + is-glob "^3.1.0" + micromatch "^3.0.4" + resolve-dir "^1.0.1" fined@^1.0.1: version "1.1.0" @@ -3040,10 +3288,10 @@ first-chunk-stream@^1.0.0: resolved "https://registry.yarnpkg.com/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz#59bfb50cd905f60d7c394cd3d9acaab4e6ad934e" integrity sha1-Wb+1DNkF9g18OUzT2ayqtOatk04= -flagged-respawn@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-0.3.2.tgz#ff191eddcd7088a675b2610fffc976be9b8074b5" - integrity sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU= +flagged-respawn@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/flagged-respawn/-/flagged-respawn-1.0.1.tgz#e7de6f1279ddd9ca9aac8a5971d618606b3aab41" + integrity sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q== flat-cache@^1.2.1: version "1.3.0" @@ -3097,15 +3345,6 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= -form-data@~1.0.0-rc4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-1.0.1.tgz#ae315db9a4907fa065502304a66d7733475ee37c" - integrity sha1-rjFduaSQf6BlUCMEpm13M0de43w= - dependencies: - async "^2.0.1" - combined-stream "^1.0.5" - mime-types "^2.1.11" - form-data@~2.1.1: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" @@ -3175,11 +3414,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -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" - integrity sha1-mC1ok6+RjnLQjeyehnP/K1qNat0= - fs-extra@0.26.7: version "0.26.7" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.26.7.tgz#9ae1fdd94897798edab76d0918cf42d0c3184fa9" @@ -3246,11 +3480,24 @@ fsevents@^1.2.2: nan "^2.9.2" node-pre-gyp "^0.10.0" +fsevents@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.7.tgz#4851b664a3783e52003b3c66eb0eee1074933aa4" + integrity sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + function-bind@^1.0.2, function-bind@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -3265,13 +3512,6 @@ gauge@~2.7.3: 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" - integrity sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8= - dependencies: - globule "~0.1.0" - gc-signals@^0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/gc-signals/-/gc-signals-0.0.1.tgz#91e3b7904168b58aa3dc78b619b7b4495b4038ab" @@ -3294,11 +3534,6 @@ get-caller-file@^1.0.1: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" integrity sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U= -get-stdin@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-3.0.2.tgz#c1ced24b9039b38ded85bdf161e57713b6dd4abe" - integrity sha1-wc7SS5A5s43thb3xYeV3E7bdSr4= - get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" @@ -3367,18 +3602,6 @@ glob-parent@^3.0.0, glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" -glob-stream@^3.1.5: - version "3.1.18" - resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-3.1.18.tgz#9170a5f12b790306fdfe598f313f8f7954fd143b" - integrity sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs= - dependencies: - glob "^4.3.1" - glob2base "^0.0.12" - minimatch "^2.0.1" - ordered-read-streams "^0.1.0" - through2 "^0.6.1" - unique-stream "^1.0.0" - glob-stream@^5.3.2: version "5.3.5" resolved "https://registry.yarnpkg.com/glob-stream/-/glob-stream-5.3.5.tgz#a55665a9a8ccdc41915a87c701e32d4e016fad22" @@ -3409,19 +3632,17 @@ glob-stream@^6.1.0: to-absolute-glob "^2.0.0" unique-stream "^2.0.2" -glob-watcher@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-0.0.6.tgz#b95b4a8df74b39c83298b0c05c978b4d9a3b710b" - integrity sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs= +glob-watcher@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/glob-watcher/-/glob-watcher-5.0.3.tgz#88a8abf1c4d131eb93928994bc4a593c2e5dd626" + integrity sha512-8tWsULNEPHKQ2MR4zXuzSmqbdyV5PtwwCaWSGQ1WwHsJ07ilNeN1JB8ntxhckbnpSHaf9dXFUHzIWvm1I13dsg== dependencies: - gaze "^0.5.1" - -glob2base@^0.0.12: - version "0.0.12" - resolved "https://registry.yarnpkg.com/glob2base/-/glob2base-0.0.12.tgz#9d419b3e28f12e83a362164a277055922c9c0d56" - integrity sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY= - dependencies: - find-index "^0.1.1" + anymatch "^2.0.0" + async-done "^1.2.0" + chokidar "^2.0.0" + is-negated-glob "^1.0.0" + just-debounce "^1.0.0" + object.defaults "^1.1.0" glob@3.2.11: version "3.2.11" @@ -3431,7 +3652,7 @@ glob@3.2.11: inherits "2" minimatch "0.3" -glob@5.x, glob@^5.0.13, glob@^5.0.3: +glob@5.x, glob@^5.0.13, glob@^5.0.15, glob@^5.0.3: version "5.0.15" resolved "https://registry.yarnpkg.com/glob/-/glob-5.0.15.tgz#1bc936b9e02f4a603fcc222ecf7633d30b8b93b1" integrity sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E= @@ -3442,16 +3663,6 @@ glob@5.x, glob@^5.0.13, glob@^5.0.3: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^4.3.1: - version "4.5.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-4.5.3.tgz#c6cb73d3226c1efef04de3c56d012f03377ee15f" - integrity sha1-xstz0yJsHv7wTePFbQEvAzd+4V8= - dependencies: - inflight "^1.0.4" - inherits "2" - minimatch "^2.0.1" - once "^1.3.0" - glob@^6.0.4: version "6.0.4" resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" @@ -3475,37 +3686,47 @@ glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.0.6, glob@^7.1.1, glob@^7.1.2: once "^1.3.0" path-is-absolute "^1.0.0" -glob@~3.1.21: - version "3.1.21" - resolved "https://registry.yarnpkg.com/glob/-/glob-3.1.21.tgz#d29e0a055dea5138f4d07ed40e8982e83c2066cd" - integrity sha1-0p4KBV3qUTj00H7UDomC6DwgZs0= +glob@^7.1.3: + version "7.1.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" + integrity sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ== dependencies: - graceful-fs "~1.2.0" - inherits "1" - minimatch "~0.2.11" + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" global-modules-path@^2.1.0: version "2.3.0" resolved "https://registry.yarnpkg.com/global-modules-path/-/global-modules-path-2.3.0.tgz#b0e2bac6beac39745f7db5c59d26a36a0b94f7dc" integrity sha512-HchvMJNYh9dGSCy8pOQ2O8u/hoXaL+0XhnrwH0RyLiSXMMTl9W3N6KUU73+JFOg5PGjtzl6VZzUQsnrpm7Szag== -global-modules@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-0.2.3.tgz#ea5a3bed42c6d6ce995a4f8a1269b5dae223828d" - integrity sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0= +global-modules@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/global-modules/-/global-modules-1.0.0.tgz#6d770f0eb523ac78164d72b5e71a8877265cc3ea" + integrity sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg== dependencies: - global-prefix "^0.1.4" - is-windows "^0.2.0" + global-prefix "^1.0.1" + is-windows "^1.0.1" + resolve-dir "^1.0.0" -global-prefix@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-0.1.5.tgz#8d3bc6b8da3ca8112a160d8d496ff0462bfef78f" - integrity sha1-jTvGuNo8qBEqFg2NSW/wRiv+948= +global-prefix@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/global-prefix/-/global-prefix-1.0.2.tgz#dbf743c6c14992593c655568cb66ed32c0122ebe" + integrity sha1-2/dDxsFJklk8ZVVoy2btMsASLr4= dependencies: - homedir-polyfill "^1.0.0" + expand-tilde "^2.0.2" + homedir-polyfill "^1.0.1" ini "^1.3.4" - is-windows "^0.2.0" - which "^1.2.12" + is-windows "^1.0.1" + which "^1.2.14" + +globals@^11.7.0: + version "11.10.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.10.0.tgz#1e09776dffda5e01816b3bb4077c8b59c24eaa50" + integrity sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ== globals@^9.14.0: version "9.18.0" @@ -3536,15 +3757,6 @@ globby@^7.1.1: pify "^3.0.0" slash "^1.0.0" -globule@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/globule/-/globule-0.1.0.tgz#d9c8edde1da79d125a151b79533b978676346ae5" - integrity sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU= - dependencies: - glob "~3.1.21" - lodash "~1.0.1" - minimatch "~0.2.11" - glogg@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/glogg/-/glogg-1.0.0.tgz#7fe0f199f57ac906cf512feead8f90ee4a284fc5" @@ -3557,18 +3769,6 @@ graceful-fs@4.1.11, graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.2, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" integrity sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg= -graceful-fs@^3.0.0: - version "3.0.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-3.0.11.tgz#7613c778a1afea62f25c630a086d7f3acbbdd818" - integrity sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg= - dependencies: - natives "^1.1.0" - -graceful-fs@~1.2.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-1.2.3.tgz#15a4806a57547cb2d2dbf27f42e89a8c3451b364" - integrity sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q= - "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -3601,12 +3801,12 @@ gulp-atom-electron@^1.19.2: vinyl "^2.2.0" vinyl-fs "^3.0.3" -gulp-azure-storage@^0.8.2: - version "0.8.2" - resolved "https://registry.yarnpkg.com/gulp-azure-storage/-/gulp-azure-storage-0.8.2.tgz#2dba8946f141f746c2c0b83c032530d79905b40e" - integrity sha512-oiVt+DL3e/cgGrr7dlI5aTbpjVYMcosDdYmkBf4s1rfTsdNFUH8cQu+/IoT4MWm1cmgN/TX1I48NnN69JSRTJA== +gulp-azure-storage@^0.9.0: + version "0.9.0" + resolved "https://registry.yarnpkg.com/gulp-azure-storage/-/gulp-azure-storage-0.9.0.tgz#f076aebdd478015d7a6863681b2fc32709535878" + integrity sha512-b6CfmmEtyLDT3afv7wvNin3FJh3eAJy9N26HIXQTbQFP3LzP8XLJrvDe+G9lxFzJt943xgoYFNWUZz3wiJTZdQ== dependencies: - azure-storage "^1.3.1" + azure-storage "^2.10.2" delayed-stream "0.0.6" event-stream "3.3.4" mime "^1.3.4" @@ -3615,7 +3815,7 @@ gulp-azure-storage@^0.8.2: queue "^3.0.10" streamifier "^0.1.1" vinyl "^0.4.5" - vinyl-fs "^0.3.13" + vinyl-fs "^3.0.3" gulp-buffer@0.0.2: version "0.0.2" @@ -3624,7 +3824,31 @@ gulp-buffer@0.0.2: dependencies: through2 "~0.4.0" -gulp-concat@^2.6.0: +gulp-cli@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/gulp-cli/-/gulp-cli-2.0.1.tgz#7847e220cb3662f2be8a6d572bf14e17be5a994b" + integrity sha512-RxujJJdN8/O6IW2nPugl7YazhmrIEjmiVfPKrWt68r71UCaLKS71Hp0gpKT+F6qOUFtr7KqtifDKaAJPRVvMYQ== + dependencies: + ansi-colors "^1.0.1" + archy "^1.0.0" + array-sort "^1.0.0" + color-support "^1.1.3" + concat-stream "^1.6.0" + copy-props "^2.0.1" + fancy-log "^1.3.2" + gulplog "^1.0.0" + interpret "^1.1.0" + isobject "^3.0.1" + liftoff "^2.5.0" + matchdep "^2.0.0" + mute-stdout "^1.0.0" + pretty-hrtime "^1.0.0" + replace-homedir "^1.0.0" + semver-greatest-satisfied-range "^1.1.0" + v8flags "^3.0.1" + yargs "^7.1.0" + +gulp-concat@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/gulp-concat/-/gulp-concat-2.6.1.tgz#633d16c95d88504628ad02665663cee5a4793353" integrity sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M= @@ -3633,33 +3857,25 @@ gulp-concat@^2.6.0: through2 "^2.0.0" vinyl "^2.0.0" -gulp-cssnano@^2.1.0: - version "2.1.2" - resolved "https://registry.yarnpkg.com/gulp-cssnano/-/gulp-cssnano-2.1.2.tgz#e08a09771ec5454a549f1a005bdd256cb8e5e0a3" - integrity sha1-4IoJdx7FRUpUnxoAW90lbLjl4KM= +gulp-cssnano@^2.1.3: + version "2.1.3" + resolved "https://registry.yarnpkg.com/gulp-cssnano/-/gulp-cssnano-2.1.3.tgz#02007e2817af09b3688482b430ad7db807aebf72" + integrity sha512-r8qdX5pTXsBb/IRm9loE8Ijz8UiPW/URMC/bKJe4FPNHRaz4aEx8Bev03L0FYHd/7BSGu/ebmfumAkpGuTdenA== dependencies: + buffer-from "^1.0.0" cssnano "^3.0.0" - gulp-util "^3.0.6" object-assign "^4.0.1" + plugin-error "^1.0.1" vinyl-sourcemaps-apply "^0.2.1" -gulp-eslint@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/gulp-eslint/-/gulp-eslint-3.0.1.tgz#04e57e3e18c6974267c12cf6855dc717d4a313bd" - integrity sha1-BOV+PhjGl0JnwSz2hV3HF9SjE70= +gulp-eslint@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/gulp-eslint/-/gulp-eslint-5.0.0.tgz#2a2684095f774b2cf79310262078c56cc7a12b52" + integrity sha512-9GUqCqh85C7rP9120cpxXuZz2ayq3BZc85pCTuPJS03VQYxne0aWPIXWx6LSvsGPa3uRqtSO537vaugOh+5cXg== dependencies: - bufferstreams "^1.1.1" - eslint "^3.0.0" - gulp-util "^3.0.6" - -gulp-filter@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/gulp-filter/-/gulp-filter-3.0.1.tgz#7c6ffce5b563e89de7a90dfceff16ec8a8cb1562" - integrity sha1-fG/85bVj6J3nqQ387/FuyKjLFWI= - dependencies: - gulp-util "^3.0.6" - multimatch "^2.0.0" - streamfilter "^1.0.5" + eslint "^5.0.1" + fancy-log "^1.3.2" + plugin-error "^1.0.1" gulp-filter@^4.0.0: version "4.0.0" @@ -3670,24 +3886,33 @@ gulp-filter@^4.0.0: multimatch "^2.0.0" streamfilter "^1.0.5" -gulp-flatmap@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/gulp-flatmap/-/gulp-flatmap-1.0.0.tgz#e634e03cffb263aebacfdc22dd8ce2f3d76ffe97" - integrity sha1-5jTgPP+yY666z9wi3Yzi89dv/pc= +gulp-filter@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/gulp-filter/-/gulp-filter-5.1.0.tgz#a05e11affb07cf7dcf41a7de1cb7b63ac3783e73" + integrity sha1-oF4Rr/sHz33PQafeHLe2OsN4PnM= dependencies: - gulp-util "~2.2.14" - through2 "~0.6.3" + multimatch "^2.0.0" + plugin-error "^0.1.2" + streamfilter "^1.0.5" -gulp-json-editor@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/gulp-json-editor/-/gulp-json-editor-2.2.1.tgz#7c4dd7477e8d06dc5dc49c0b81e745cdb04f97bb" - integrity sha1-fE3XR36NBtxdxJwLgedFzbBPl7s= +gulp-flatmap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/gulp-flatmap/-/gulp-flatmap-1.0.2.tgz#b515ae6081d66af99daf56c612e2d92502720133" + integrity sha512-xm+Ax2vPL/xiMBqLFI++wUyPtncm3b55ztGHewmRcoG/sYb0OUTatjSacOud3fee77rnk+jOgnDEHhwBtMHgFA== dependencies: - deepmerge "~0.2.7" - detect-indent "^2.0.0" - gulp-util "~3.0.0" - js-beautify "~1.5.4" - through2 "~0.5.0" + plugin-error "0.1.2" + through2 "2.0.3" + +gulp-json-editor@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/gulp-json-editor/-/gulp-json-editor-2.5.0.tgz#23aaa7d30f8425cf60cf1aefae098c257da11ada" + integrity sha512-HyrBSaE+Di6oQbKsfNM6X7dPFowOuTTuVYjxratU8QAiW7LR7Rydm+/fSS3OehdnuP++A/07q/nksihuD5FZSA== + dependencies: + deepmerge "^3.0.0" + detect-indent "^5.0.0" + js-beautify "^1.8.9" + plugin-error "^1.0.1" + through2 "^3.0.0" gulp-plumber@^1.2.0: version "1.2.0" @@ -3724,15 +3949,18 @@ gulp-replace@^0.5.4: readable-stream "^2.0.1" replacestream "^4.0.0" -gulp-shell@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/gulp-shell/-/gulp-shell-0.5.2.tgz#a4959ca0651ad1c7bbfe70b2d0adbbb4e1aea98d" - integrity sha1-pJWcoGUa0ce7/nCy0K27tOGuqY0= +gulp-shell@^0.6.5: + version "0.6.5" + resolved "https://registry.yarnpkg.com/gulp-shell/-/gulp-shell-0.6.5.tgz#f07b204ad8ad1c2659f7a1b6d76efa16d416a759" + integrity sha512-f3m1WcS0o2B72/PGj1Jbv9zYR9rynBh/EQJv64n01xQUo7j7anols0eww9GG/WtDTzGVQLrupVDYkifRFnj5Zg== dependencies: - async "^1.5.0" - gulp-util "^3.0.7" - lodash "^4.0.0" - through2 "^2.0.0" + async "^2.1.5" + chalk "^2.3.0" + fancy-log "^1.3.2" + lodash "^4.17.4" + lodash.template "^4.4.0" + plugin-error "^0.1.2" + through2 "^2.0.3" gulp-sourcemaps@1.6.0: version "1.6.0" @@ -3764,13 +3992,16 @@ gulp-tsb@2.0.5: through "^2.3.6" vinyl "^0.4.3" -gulp-tslint@^8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/gulp-tslint/-/gulp-tslint-8.1.2.tgz#e0f43194b473d7e76bb45a58fe8c60e7dfe3beb2" - integrity sha512-0RNGqbp2TKPdbG+sWU3mNMXEMuF/noY1KS4+jd5lOStkvuFINkFL29dHX3IT1u+vVFD4Glwf+lkcdR2QMVNMzA== +gulp-tslint@^8.1.3: + version "8.1.3" + resolved "https://registry.yarnpkg.com/gulp-tslint/-/gulp-tslint-8.1.3.tgz#a89ed144038ae861ee7bfea9528272d126a93da1" + integrity sha512-KEP350N5B9Jg6o6jnyCyKVBPemJePYpMsGfIQq0G0ErvY7tw4Lrfb/y3L4WRf7ek0OsaE8nnj86w+lcLXW8ovw== dependencies: - gulp-util "~3.0.8" + "@types/fancy-log" "1.3.0" + chalk "2.3.1" + fancy-log "1.3.2" map-stream "~0.0.7" + plugin-error "1.0.1" through "~2.3.8" gulp-uglify@^3.0.0: @@ -3786,31 +4017,7 @@ gulp-uglify@^3.0.0: uglify-js "^3.0.5" vinyl-sourcemaps-apply "^0.2.0" -gulp-util@3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.7.tgz#78925c4b8f8b49005ac01a011c557e6218941cbb" - integrity sha1-eJJcS4+LSQBawBoBHFV+YhiUHLs= - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^1.0.11" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - -gulp-util@^3.0.0, gulp-util@^3.0.1, gulp-util@^3.0.6, gulp-util@^3.0.7, gulp-util@^3.0.8, gulp-util@~3.0.0, gulp-util@~3.0.8: +gulp-util@^3.0.1, gulp-util@^3.0.6, gulp-util@^3.0.8: version "3.0.8" resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08= @@ -3834,20 +4041,6 @@ gulp-util@^3.0.0, gulp-util@^3.0.1, gulp-util@^3.0.6, gulp-util@^3.0.7, gulp-uti through2 "^2.0.0" vinyl "^0.5.0" -gulp-util@~2.2.14: - version "2.2.20" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-2.2.20.tgz#d7146e5728910bd8f047a6b0b1e549bc22dbd64c" - integrity sha1-1xRuVyiRC9jwR6awseVJvCLb1kw= - dependencies: - chalk "^0.5.0" - dateformat "^1.0.7-1.2.3" - lodash._reinterpolate "^2.4.1" - lodash.template "^2.4.1" - minimist "^0.2.0" - multipipe "^0.1.0" - through2 "^0.5.0" - vinyl "^0.2.1" - gulp-vinyl-zip@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.2.tgz#b79cc1a0e2c3b158ffee294590ade1e9caaf5e7b" @@ -3861,24 +4054,15 @@ gulp-vinyl-zip@^2.1.2: yauzl "^2.2.1" yazl "^2.2.1" -gulp@^3.8.9: - version "3.9.1" - resolved "https://registry.yarnpkg.com/gulp/-/gulp-3.9.1.tgz#571ce45928dd40af6514fc4011866016c13845b4" - integrity sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ= +gulp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/gulp/-/gulp-4.0.0.tgz#95766c601dade4a77ed3e7b2b6dc03881b596366" + integrity sha1-lXZsYB2t5Kd+0+eyttwDiBtZY2Y= dependencies: - archy "^1.0.0" - chalk "^1.0.0" - deprecated "^0.0.1" - gulp-util "^3.0.0" - interpret "^1.0.0" - liftoff "^2.1.0" - minimist "^1.1.0" - orchestrator "^0.3.0" - pretty-hrtime "^1.0.0" - semver "^4.1.0" - tildify "^1.0.0" - v8flags "^2.0.2" - vinyl-fs "^0.3.0" + glob-watcher "^5.0.0" + gulp-cli "^2.0.0" + undertaker "^1.0.0" + vinyl-fs "^3.0.0" gulplog@^1.0.0: version "1.0.0" @@ -3929,13 +4113,6 @@ har-validator@~5.1.0: ajv "^5.3.0" har-schema "^2.0.0" -has-ansi@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-0.1.0.tgz#84f265aae8c0e6a88a12d7022894b7568894c62e" - integrity sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4= - dependencies: - ansi-regex "^0.2.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -4068,7 +4245,7 @@ hoek@4.x.x: resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d" integrity sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ== -homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: +homedir-polyfill@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz#4c2bbc8a758998feebf5ed68580f76d46768b4bc" integrity sha1-TCu8inWJmP7r9e1oWA921GdotLw= @@ -4168,6 +4345,13 @@ iconv-lite@0.4.23, iconv-lite@^0.4.22, iconv-lite@^0.4.4: dependencies: safer-buffer ">= 2.1.2 < 3" +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + ieee754@^1.1.11, ieee754@^1.1.4: version "1.1.12" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" @@ -4195,6 +4379,19 @@ ignore@^3.3.5: resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.0.0.tgz#a3d897f420cab0e671236897f75bc14b4885c390" + integrity sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + import-local@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-1.0.0.tgz#5e4ffdc03f4fe6c009c6729beb29631c2f8227bc" @@ -4233,11 +4430,6 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-1.0.2.tgz#ca4309dadee6b54cc0b8d247e8d7c7a0975bdc9b" - integrity sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js= - inherits@2, inherits@2.0.3, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" @@ -4296,6 +4488,25 @@ inquirer@^6.0.0: strip-ansi "^4.0.0" through "^2.3.6" +inquirer@^6.1.0: + version "6.2.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.2.2.tgz#46941176f65c9eb20804627149b743a218f25406" + integrity sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.11" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.0.0" + through "^2.3.6" + int64-buffer@^0.1.9: version "0.1.9" resolved "https://registry.yarnpkg.com/int64-buffer/-/int64-buffer-0.1.9.tgz#9e039da043b24f78b196b283e04653ef5e990f61" @@ -4532,6 +4743,11 @@ is-number@^3.0.0: dependencies: kind-of "^3.0.2" +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + is-path-cwd@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" @@ -4697,16 +4913,16 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul@0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.3.tgz#5b714ee0ae493ac5ef204b99f3872bceef73d53a" - integrity sha1-W3FO4K5JOsXvIEuZ84crzu9z1To= +istanbul@0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/istanbul/-/istanbul-0.4.5.tgz#65c7d73d4c4da84d4f3ac310b918fb0b8033733b" + integrity sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs= dependencies: abbrev "1.0.x" async "1.x" escodegen "1.8.x" esprima "2.7.x" - fileset "0.2.x" + glob "^5.0.15" handlebars "^4.0.1" js-yaml "3.x" mkdirp "0.5.x" @@ -4758,20 +4974,27 @@ js-base64@^2.1.9: resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.3.2.tgz#a79a923666372b580f8e27f51845c6f7e8fbfbaf" integrity sha512-Y2/+DnfJJXT1/FCwUebUhLWb3QihxiSC42+ctHLGogmW2jPY6LCapMdFZXRvVP2z6qyKW7s6qncE/9gSqZiArw== -js-beautify@~1.5.4: - version "1.5.10" - resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.5.10.tgz#4d95371702699344a516ca26bf59f0a27bb75719" - integrity sha1-TZU3FwJpk0SlFsomv1nwonu3Vxk= +js-beautify@^1.8.9: + version "1.8.9" + resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.8.9.tgz#08e3c05ead3ecfbd4f512c3895b1cda76c87d523" + integrity sha512-MwPmLywK9RSX0SPsUJjN7i+RQY9w/yC17Lbrq9ViEefpLRgqAR2BgrMN2AbifkUuhDV8tRauLhLda/9+bE0YQA== dependencies: - config-chain "~1.1.5" + config-chain "^1.1.12" + editorconfig "^0.15.2" + glob "^7.1.3" mkdirp "~0.5.0" - nopt "~3.0.1" + nopt "~4.0.1" js-tokens@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + js-yaml@3.6.1: version "3.6.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.6.1.tgz#6e5fe67d8b205ce4d22fad05b7781e8dadcc4b30" @@ -4788,6 +5011,14 @@ js-yaml@3.x, js-yaml@^3.5.1, js-yaml@^3.7.0: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^3.12.0: + version "3.12.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.1.tgz#295c8632a18a23e054cf5c9d3cecafe678167600" + integrity sha512-um46hB9wNOKlwkHgiuyEVAybXBjwFUV0Z/RaHJblRd9DXltue9FTYvzCr9ErQrK9Adz5MU4gHWVaNUfdmrC8qA== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + js-yaml@~3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" @@ -4848,6 +5079,11 @@ json-schema@0.2.3: resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" @@ -4904,6 +5140,11 @@ jsprim@^1.2.2: json-schema "0.2.3" verror "1.10.0" +just-debounce@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" + integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= + keytar@4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/keytar/-/keytar-4.2.1.tgz#8a06a6577fdf6373e0aa6b112277e63dec77fd12" @@ -4938,7 +5179,7 @@ kind-of@^4.0.0: dependencies: is-buffer "^1.1.5" -kind-of@^5.0.0: +kind-of@^5.0.0, kind-of@^5.0.2: version "5.1.0" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== @@ -4955,6 +5196,14 @@ klaw@^1.0.0: optionalDependencies: graceful-fs "^4.1.9" +last-run@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/last-run/-/last-run-1.1.1.tgz#45b96942c17b1c79c772198259ba943bebf8ca5b" + integrity sha1-RblpQsF7HHnHchmCWbqUO+v4yls= + dependencies: + default-resolution "^2.0.0" + es6-weak-map "^2.0.1" + lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" @@ -5007,18 +5256,17 @@ levn@~0.2.5: prelude-ls "~1.1.0" type-check "~0.3.1" -liftoff@^2.1.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.3.0.tgz#a98f2ff67183d8ba7cfaca10548bd7ff0550b385" - integrity sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U= +liftoff@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/liftoff/-/liftoff-2.5.0.tgz#2009291bb31cea861bbf10a7c15a28caf75c31ec" + integrity sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew= dependencies: extend "^3.0.0" - findup-sync "^0.4.2" + findup-sync "^2.0.0" fined "^1.0.1" - flagged-respawn "^0.3.2" - lodash.isplainobject "^4.0.4" - lodash.isstring "^4.0.1" - lodash.mapvalues "^4.4.0" + flagged-respawn "^1.0.0" + is-plain-object "^2.0.4" + object.map "^1.0.0" rechoir "^0.6.2" resolve "^1.1.7" @@ -5085,43 +5333,16 @@ lodash._basevalues@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" integrity sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc= -lodash._escapehtmlchar@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz#df67c3bb6b7e8e1e831ab48bfa0795b92afe899d" - integrity sha1-32fDu2t+jh6DGrSL+geVuSr+iZ0= - dependencies: - lodash._htmlescapes "~2.4.1" - -lodash._escapestringchar@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz#ecfe22618a2ade50bfeea43937e51df66f0edb72" - integrity sha1-7P4iYYoq3lC/7qQ5N+Ud9m8O23I= - lodash._getnative@^3.0.0: version "3.9.1" resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= -lodash._htmlescapes@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz#32d14bf0844b6de6f8b62a051b4f67c228b624cb" - integrity sha1-MtFL8IRLbeb4tioFG09nwii2JMs= - lodash._isiterateecall@^3.0.0: version "3.0.9" resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" integrity sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw= -lodash._isnative@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._isnative/-/lodash._isnative-2.4.1.tgz#3ea6404b784a7be836c7b57580e1cdf79b14832c" - integrity sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw= - -lodash._objecttypes@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz#7c0b7f69d98a1f76529f890b0cdb1b4dfec11c11" - integrity sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE= - lodash._reescape@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" @@ -5132,36 +5353,16 @@ lodash._reevaluate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" integrity sha1-WLx0xAZklTrgsSTYBpltrKQx4u0= -lodash._reinterpolate@^2.4.1, lodash._reinterpolate@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz#4f1227aa5a8711fc632f5b07a1f4607aab8b3222" - integrity sha1-TxInqlqHEfxjL1sHofRgequLMiI= - -lodash._reinterpolate@^3.0.0: +lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= -lodash._reunescapedhtml@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz#747c4fc40103eb3bb8a0976e571f7a2659e93ba7" - integrity sha1-dHxPxAED6zu4oJduVx96JlnpO6c= - dependencies: - lodash._htmlescapes "~2.4.1" - lodash.keys "~2.4.1" - lodash._root@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= -lodash._shimkeys@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz#6e9cc9666ff081f0b5a6c978b83e242e6949d203" - integrity sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM= - dependencies: - lodash._objecttypes "~2.4.1" - lodash.clone@^4.3.2: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" @@ -5172,14 +5373,6 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.defaults@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-2.4.1.tgz#a7e8885f05e68851144b6e12a8f3678026bc4c54" - integrity sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ= - dependencies: - lodash._objecttypes "~2.4.1" - lodash.keys "~2.4.1" - lodash.escape@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" @@ -5187,15 +5380,6 @@ lodash.escape@^3.0.0: dependencies: lodash._root "^3.0.0" -lodash.escape@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-2.4.1.tgz#2ce12c5e084db0a57dda5e5d1eeeb9f5d175a3b4" - integrity sha1-LOEsXghNsKV92l5dHu659dF1o7Q= - dependencies: - lodash._escapehtmlchar "~2.4.1" - lodash._reunescapedhtml "~2.4.1" - lodash.keys "~2.4.1" - lodash.isarguments@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" @@ -5216,23 +5400,6 @@ lodash.isinteger@^4.0.4: resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343" integrity sha1-YZwK89A/iwTDH1iChAt3sRzWg0M= -lodash.isobject@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-2.4.1.tgz#5a2e47fe69953f1ee631a7eba1fe64d2d06558f5" - integrity sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU= - dependencies: - lodash._objecttypes "~2.4.1" - -lodash.isplainobject@^4.0.4: - version "4.0.6" - resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb" - integrity sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs= - -lodash.isstring@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451" - integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE= - lodash.isundefined@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz#23ef3d9535565203a66cefd5b830f848911afb48" @@ -5247,20 +5414,6 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.keys@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-2.4.1.tgz#48dea46df8ff7632b10d706b8acb26591e2b3727" - integrity sha1-SN6kbfj/djKxDXBrissmWR4rNyc= - dependencies: - lodash._isnative "~2.4.1" - lodash._shimkeys "~2.4.1" - lodash.isobject "~2.4.1" - -lodash.mapvalues@^4.4.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" - integrity sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw= - lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -5276,19 +5429,6 @@ lodash.some@^4.2.2: resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= -lodash.template@^2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-2.4.1.tgz#9e611007edf629129a974ab3c48b817b3e1cf20d" - integrity sha1-nmEQB+32KRKal0qzxIuBez4c8g0= - dependencies: - lodash._escapestringchar "~2.4.1" - lodash._reinterpolate "~2.4.1" - lodash.defaults "~2.4.1" - lodash.escape "~2.4.1" - lodash.keys "~2.4.1" - lodash.templatesettings "~2.4.1" - lodash.values "~2.4.1" - lodash.template@^3.0.0: version "3.6.2" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" @@ -5304,6 +5444,14 @@ lodash.template@^3.0.0: lodash.restparam "^3.0.0" lodash.templatesettings "^3.0.0" +lodash.template@^4.4.0: + version "4.4.0" + resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" + integrity sha1-5zoDhcg1VZF0bgILmWecaQ5o+6A= + dependencies: + lodash._reinterpolate "~3.0.0" + lodash.templatesettings "^4.0.0" + lodash.templatesettings@^3.0.0: version "3.1.1" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" @@ -5312,27 +5460,19 @@ lodash.templatesettings@^3.0.0: lodash._reinterpolate "^3.0.0" lodash.escape "^3.0.0" -lodash.templatesettings@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz#ea76c75d11eb86d4dbe89a83893bb861929ac699" - integrity sha1-6nbHXRHrhtTb6JqDiTu4YZKaxpk= +lodash.templatesettings@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" + integrity sha1-K01OlbpEDZFf8IvImeRVNmZxMxY= dependencies: - lodash._reinterpolate "~2.4.1" - lodash.escape "~2.4.1" + lodash._reinterpolate "~3.0.0" lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash.values@~2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/lodash.values/-/lodash.values-2.4.1.tgz#abf514436b3cb705001627978cbcf30b1280eea4" - integrity sha1-q/UUQ2s8twUAFieXjLzzCxKA7qQ= - dependencies: - lodash.keys "~2.4.1" - -lodash@^4.0.0, lodash@^4.13.1, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.3.0: +lodash@^4.0.0, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.3.0: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" integrity sha1-eCA6TRwyiuHYbcpkYONptX9AVa4= @@ -5342,10 +5482,10 @@ lodash@^4.17.10: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" integrity sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg== -lodash@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-1.0.2.tgz#8f57560c83b59fc270bd3d561b690043430e2551" - integrity sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE= +lodash@^4.17.11, lodash@^4.17.4, lodash@^4.17.5: + version "4.17.11" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d" + integrity sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg== log-driver@1.2.5: version "1.2.5" @@ -5401,6 +5541,14 @@ lru-cache@^4.1.1: pseudomap "^1.0.2" yallist "^2.1.2" +lru-cache@^4.1.3: + version "4.1.5" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.5.tgz#8bbe50ea85bed59bc9e33dcab8235ee9bcf443cd" + integrity sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g== + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" @@ -5425,6 +5573,13 @@ make-error@^1.2.0: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96" integrity sha1-Uq06M5zPEM5itAQLcI/nByRLi5Y= +make-iterator@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/make-iterator/-/make-iterator-1.0.1.tgz#29b33f312aa8f547c4a5e490f56afcec99133ad6" + integrity sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw== + dependencies: + kind-of "^6.0.2" + mamacro@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/mamacro/-/mamacro-0.0.3.tgz#ad2c9576197c9f1abf308d0787865bd975a3f3e4" @@ -5468,12 +5623,22 @@ markdown-it@^8.3.1: mdurl "^1.0.1" uc.micro "^1.0.3" +matchdep@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e" + integrity sha1-xvNINKDY28OzfCfui7yyfHd1WC4= + dependencies: + findup-sync "^2.0.0" + micromatch "^3.0.4" + resolve "^1.4.0" + stack-trace "0.0.10" + math-expression-evaluator@^1.2.14: version "1.2.17" resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" integrity sha1-3oGf282E3M2PrlnGrreWFbnSZqw= -md5.js@^1.3.4: +md5.js@1.3.4, md5.js@^1.3.4: version "1.3.4" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.4.tgz#e9bdbde94a20a5ac18b04340fc5764d5b09d901d" integrity sha1-6b296UogpawYsENA/Fdk1bCdkB0= @@ -5515,7 +5680,7 @@ memory-fs@^0.4.0, memory-fs@^0.4.1, memory-fs@~0.4.1: errno "^0.1.3" readable-stream "^2.0.1" -meow@^3.1.0, meow@^3.3.0: +meow@^3.1.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" integrity sha1-cstmi0JSKCkKu/qFaJJYcwioAfs= @@ -5574,7 +5739,7 @@ micromatch@^2.1.5, micromatch@^2.3.7: parse-glob "^3.0.4" regex-cache "^0.4.2" -micromatch@^3.1.4, micromatch@^3.1.8: +micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== @@ -5611,7 +5776,7 @@ mime-db@~1.36.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.36.0.tgz#5020478db3c7fe93aad7bbcc4dcf869c43363397" integrity sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw== -mime-types@^2.1.11, mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.17, mime-types@~2.1.7: +mime-types@^2.1.12, mime-types@~2.1.15, mime-types@~2.1.16, mime-types@~2.1.17, mime-types@~2.1.7: version "2.1.17" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a" integrity sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo= @@ -5670,21 +5835,13 @@ minimatch@0.3: dependencies: brace-expansion "^1.1.7" -minimatch@2.x, minimatch@^2.0.1: +minimatch@2.x: version "2.0.10" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-2.0.10.tgz#8d087c39c6b38c001b97fca7ce6d0e1e80afbac7" integrity sha1-jQh8OcazjAAbl/ynzm0OHoCvusc= dependencies: brace-expansion "^1.0.0" -minimatch@~0.2.11: - version "0.2.14" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-0.2.14.tgz#c74e780574f63c6f9a090e90efbe6ef53a6a756a" - integrity sha1-x054BXT2PG+aCQ6Q775u9TpqdWo= - dependencies: - lru-cache "2" - sigmund "~1.0.0" - minimist@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" @@ -5695,11 +5852,6 @@ minimist@1.2.0, minimist@^1.1.0, minimist@^1.1.3, minimist@^1.2.0: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" integrity sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ= -minimist@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.0.tgz#4dffe525dae2b864c66c2e23c6271d7afdecefce" - integrity sha1-Tf/lJdriuGTGbC4jxicdev3s784= - minimist@~0.0.1: version "0.0.10" resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.10.tgz#de3f98543dbf96082be48ad1a0c7cda836301dcf" @@ -5826,6 +5978,11 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= +ms@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + multimatch@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-2.1.0.tgz#9c7906a22fb4c02919e2f5f75161b4cdbd4b2a2b" @@ -5836,13 +5993,18 @@ multimatch@^2.0.0: arrify "^1.0.0" minimatch "^3.0.0" -multipipe@^0.1.0, multipipe@^0.1.2: +multipipe@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" integrity sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s= dependencies: duplexer2 "0.0.2" +mute-stdout@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" + integrity sha512-kDcwXR4PS7caBpuRYYBUz9iVixUk3anO3f5OYFiIPwK/20vCzKCHyKoulbiDY1S53zD2bxUpxN/IJ+TnXjfvxg== + mute-stream@0.0.5: version "0.0.5" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.5.tgz#8fbfabb0a98a253d3184331f9e8deb7372fac6c0" @@ -5905,11 +6067,6 @@ native-watchdog@1.0.0: resolved "https://registry.yarnpkg.com/native-watchdog/-/native-watchdog-1.0.0.tgz#97344e83cd6815a8c8e6c44a52e7be05832e65ca" integrity sha512-HKQATz5KLUMPyQQ/QaalzgTXaGz2plYPBxjyalaR4ECIu/UznXY8YJD+a9SLkkcvtxnJ8/zHLY3xik06vUZ7uA== -natives@^1.1.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/natives/-/natives-1.1.4.tgz#2f0f224fc9a7dd53407c7667c84cf8dbe773de58" - integrity sha512-Q29yeg9aFKwhLVdkTAejM/HvYG0Y1Am1+HUkFQGn5k2j8GS+v60TVmZh6nujpEAj/qql+wGUrlryO8bF+b1jEg== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -5998,11 +6155,6 @@ node-pty@0.8.1: dependencies: nan "2.12.1" -node-uuid@~1.4.0, node-uuid@~1.4.7: - version "1.4.8" - resolved "https://registry.yarnpkg.com/node-uuid/-/node-uuid-1.4.8.tgz#b040eb0923968afabf8d32fb1f17f1167fdab907" - integrity sha1-sEDrCSOWivq/jTL7HxfxFn/auQc= - node.extend@~1.1.2: version "1.1.6" resolved "https://registry.yarnpkg.com/node.extend/-/node.extend-1.1.6.tgz#a7b882c82d6c93a4863a5504bd5de8ec86258b96" @@ -6015,14 +6167,14 @@ noop-logger@^0.1.1: resolved "https://registry.yarnpkg.com/noop-logger/-/noop-logger-0.1.1.tgz#94a2b1633c4f1317553007d8966fd0e841b6a4c2" integrity sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI= -nopt@3.x, nopt@^3.0.1, nopt@~3.0.1: +nopt@3.x, nopt@^3.0.1: version "3.0.6" resolved "https://registry.yarnpkg.com/nopt/-/nopt-3.0.6.tgz#c6465dbf08abcd4db359317f79ac68a646b28ff9" integrity sha1-xkZdvwirzU2zWTF/eaxopkayj/k= dependencies: abbrev "1" -nopt@^4.0.1: +nopt@^4.0.1, nopt@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" integrity sha1-0NRoWv1UFRk8jHUFYC0NF81kR00= @@ -6064,6 +6216,11 @@ normalize-path@^2.0.1: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a" integrity sha1-R4hqwWYnYNQmG32XnSQXCdPOP3o= +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + normalize-range@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" @@ -6207,7 +6364,7 @@ object.assign@^4.0.4: has-symbols "^1.0.0" object-keys "^1.0.11" -object.defaults@^1.1.0: +object.defaults@^1.0.0, object.defaults@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/object.defaults/-/object.defaults-1.1.0.tgz#3a7f868334b407dea06da16d88d5cd29e435fecf" integrity sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8= @@ -6217,6 +6374,14 @@ object.defaults@^1.1.0: for-own "^1.0.0" isobject "^3.0.0" +object.map@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.map/-/object.map-1.0.1.tgz#cf83e59dc8fcc0ad5f4250e1f78b3b81bd801d37" + integrity sha1-z4Plncj8wK1fQlDh94s7gb2AHTc= + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + object.omit@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.0.tgz#868597333d54e60662940bb458605dd6ae12fe94" @@ -6232,6 +6397,14 @@ object.pick@^1.2.0, object.pick@^1.3.0: dependencies: isobject "^3.0.1" +object.reduce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object.reduce/-/object.reduce-1.0.1.tgz#6fe348f2ac7fa0f95ca621226599096825bb03ad" + integrity sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60= + dependencies: + for-own "^1.0.0" + make-iterator "^1.0.0" + on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" @@ -6246,13 +6419,6 @@ once@1.x, once@^1.3.0, once@^1.3.1, once@^1.3.2, once@^1.4.0: dependencies: wrappy "1" -once@~1.3.0: - version "1.3.3" - resolved "https://registry.yarnpkg.com/once/-/once-1.3.3.tgz#b2e261557ce4c314ec8304f3fa82663e4297ca20" - integrity sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA= - dependencies: - wrappy "1" - onetime@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" @@ -6311,20 +6477,6 @@ optionator@^0.8.1, optionator@^0.8.2: type-check "~0.3.2" wordwrap "~1.0.0" -orchestrator@^0.3.0: - version "0.3.8" - resolved "https://registry.yarnpkg.com/orchestrator/-/orchestrator-0.3.8.tgz#14e7e9e2764f7315fbac184e506c7aa6df94ad7e" - integrity sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4= - dependencies: - end-of-stream "~0.1.5" - sequencify "~0.0.7" - stream-consume "~0.1.0" - -ordered-read-streams@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz#fd565a9af8eb4473ba69b6ed8a34352cb552f126" - integrity sha1-/VZamvjrRHO6abbtijQ1LLVS8SY= - ordered-read-streams@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz#7137e69b3298bb342247a1bbee3881c80e2fd78b" @@ -6350,6 +6502,13 @@ os-homedir@^1.0.0, os-homedir@^1.0.1: resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= +os-locale@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9" + integrity sha1-IPnxeuKe00XoveWDsT0gCYA8FNk= + dependencies: + lcid "^1.0.0" + os-locale@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.1.0.tgz#42bc2900a6b5b8bd17376c8e882b65afccf24bf2" @@ -6456,6 +6615,13 @@ parallel-transform@^1.1.0: inherits "^2.0.3" readable-stream "^2.1.5" +parent-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.0.tgz#df250bdc5391f4a085fb589dad761f5ad6b865b5" + integrity sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA== + dependencies: + callsites "^3.0.0" + parse-asn1@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/parse-asn1/-/parse-asn1-5.1.1.tgz#f6bf293818332bd0dab54efb16087724745e6ca8" @@ -6559,7 +6725,7 @@ path-is-absolute@^1.0.0: resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= -path-is-inside@^1.0.1: +path-is-inside@^1.0.1, path-is-inside@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= @@ -6574,6 +6740,11 @@ path-parse@^1.0.5: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" integrity sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME= +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + path-root-regex@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/path-root-regex/-/path-root-regex-0.1.2.tgz#bfccdc8df5b12dc52c8b43ec38d18d72c04ba96d" @@ -6673,7 +6844,7 @@ plist@^3.0.1: xmlbuilder "^9.0.7" xmldom "0.1.x" -plugin-error@^0.1.2: +plugin-error@0.1.2, plugin-error@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-0.1.2.tgz#3b9bb3335ccf00f425e07437e19276967da47ace" integrity sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4= @@ -6684,7 +6855,7 @@ plugin-error@^0.1.2: arr-union "^2.0.1" extend-shallow "^1.1.2" -plugin-error@^1.0.1: +plugin-error@1.0.1, plugin-error@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/plugin-error/-/plugin-error-1.0.1.tgz#77016bd8919d0ac377fdcdd0322328953ca5781c" integrity sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA== @@ -7006,7 +7177,7 @@ priorityqueuejs@1.0.0: resolved "https://registry.yarnpkg.com/priorityqueuejs/-/priorityqueuejs-1.0.0.tgz#2ee4f23c2560913e08c07ce5ccdd6de3df2c5af8" integrity sha1-LuTyPCVgkT4IwHzlzN1t498sWvg= -process-nextick-args@^1.0.6, process-nextick-args@~1.0.6: +process-nextick-args@^1.0.6, process-nextick-args@^1.0.7, 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" integrity sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M= @@ -7034,6 +7205,11 @@ progress@^1.1.8: resolved "https://registry.yarnpkg.com/progress/-/progress-1.1.8.tgz#e260c78f6161cdd9b0e56cc3e0a85de17c7a57be" integrity sha1-4mDHj2Fhzdmw5WzD4Khd4Xx6V74= +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + promise-inflight@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/promise-inflight/-/promise-inflight-1.0.1.tgz#98472870bf228132fcbdd868129bad12c3c029e3" @@ -7136,11 +7312,6 @@ qs@6.5.1, qs@~6.5.1: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" integrity sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A== -qs@~6.2.0: - version "6.2.3" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.2.3.tgz#1cfcb25c10a9b2b483053ff39f5dfc9233908cfe" - integrity sha1-HPyyXBCpsrSDBT/zn138kjOQjP4= - qs@~6.3.0: version "6.3.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" @@ -7295,6 +7466,15 @@ read@^1.0.7: string_decoder "~1.1.1" util-deprecate "~1.0.1" +"readable-stream@2 || 3": + version "3.1.1" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.1.1.tgz#ed6bbc6c5ba58b090039ff18ce670515795aeb06" + integrity sha512-DkN66hPyqDhnIQ6Jcsvx9bFjhw214O4poMBcIMgPVpQvNy9a0e0Uhg5SqySyDKAmUlwt8LonTBz1ezOnM8pUdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + "readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0.17: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" @@ -7328,7 +7508,7 @@ 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.0, readable-stream@~2.0.5: +readable-stream@~2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" integrity sha1-j5A0HmilPMySh4jaz80Rs265t44= @@ -7350,6 +7530,15 @@ readdirp@^2.0.0: readable-stream "^2.0.2" set-immediate-shim "^1.0.1" +readdirp@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + readline2@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/readline2/-/readline2-1.0.1.tgz#41059608ffc154757b715d9989d199ffbf372e35" @@ -7406,16 +7595,21 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -remap-istanbul@^0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.6.4.tgz#ac551eff1aa641504b4f318d0303dda61e3bb695" - integrity sha1-rFUe/xqmQVBLTzGNAwPdph47tpU= +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +remap-istanbul@^0.13.0: + version "0.13.0" + resolved "https://registry.yarnpkg.com/remap-istanbul/-/remap-istanbul-0.13.0.tgz#a529dfd080bb760f5274e3671c9c065f29923ed1" + integrity sha512-rS5ZpVAx3fGtKZkiBe1esXg5mKYbgW9iz8kkADFt3p6lo3NsBBUX1q6SwdhwUtYCGnr7nK6gRlbYK3i8R0jbRA== dependencies: - amdefine "1.0.0" - gulp-util "3.0.7" - istanbul "0.4.3" - source-map ">=0.5.6" - through2 "2.0.1" + istanbul "0.4.5" + minimatch "^3.0.4" + plugin-error "^1.0.1" + source-map "0.6.1" + through2 "3.0.0" remove-bom-buffer@^3.0.0: version "3.0.0" @@ -7434,7 +7628,7 @@ remove-bom-stream@^1.2.0: safe-buffer "^5.1.0" through2 "^2.0.3" -remove-trailing-separator@^1.0.1: +remove-trailing-separator@^1.0.1, remove-trailing-separator@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= @@ -7454,13 +7648,6 @@ repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -repeating@^1.1.0: - version "1.1.3" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-1.1.3.tgz#3d4114218877537494f97f77f9785fab810fa4ac" - integrity sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw= - dependencies: - is-finite "^1.0.0" - repeating@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" @@ -7478,6 +7665,15 @@ replace-ext@^1.0.0: resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-1.0.0.tgz#de63128373fcbf7c3ccfa4de5a480c45a67958eb" integrity sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs= +replace-homedir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/replace-homedir/-/replace-homedir-1.0.0.tgz#e87f6d513b928dde808260c12be7fec6ff6e798c" + integrity sha1-6H9tUTuSjd6AgmDBK+f+xv9ueYw= + dependencies: + homedir-polyfill "^1.0.1" + is-absolute "^1.0.0" + remove-trailing-separator "^1.1.0" + replacestream@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/replacestream/-/replacestream-4.0.3.tgz#3ee5798092be364b1cdb1484308492cb3dff2f36" @@ -7541,7 +7737,7 @@ request@2.79.0: tunnel-agent "^0.6.0" uuid "^3.1.0" -request@^2.88.0: +request@^2.86.0, request@^2.88.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -7567,33 +7763,6 @@ request@^2.88.0: tunnel-agent "^0.6.0" uuid "^3.3.2" -request@~2.74.0: - version "2.74.0" - resolved "https://registry.yarnpkg.com/request/-/request-2.74.0.tgz#7693ca768bbb0ea5c8ce08c084a45efa05b892ab" - integrity sha1-dpPKdou7DqXIzgjAhKRe+gW4kqs= - dependencies: - aws-sign2 "~0.6.0" - aws4 "^1.2.1" - bl "~1.1.2" - caseless "~0.11.0" - combined-stream "~1.0.5" - extend "~3.0.0" - forever-agent "~0.6.1" - form-data "~1.0.0-rc4" - har-validator "~2.0.6" - hawk "~3.1.3" - http-signature "~1.1.0" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.7" - node-uuid "~1.4.7" - oauth-sign "~0.8.1" - qs "~6.2.0" - stringstream "~0.0.4" - tough-cookie "~2.3.0" - tunnel-agent "~0.4.1" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -7619,13 +7788,13 @@ resolve-cwd@^2.0.0: dependencies: resolve-from "^3.0.0" -resolve-dir@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-0.1.1.tgz#b219259a5602fac5c5c496ad894a6e8cc430261e" - integrity sha1-shklmlYC+sXFxJatiUpujMQwJh4= +resolve-dir@^1.0.0, resolve-dir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/resolve-dir/-/resolve-dir-1.0.1.tgz#79a40644c362be82f26effe739c9bb5382046f43" + integrity sha1-eaQGRMNivoLybv/nOcm7U4IEb0M= dependencies: - expand-tilde "^1.2.2" - global-modules "^0.2.3" + expand-tilde "^2.0.0" + global-modules "^1.0.0" resolve-from@^1.0.0: version "1.0.1" @@ -7637,6 +7806,11 @@ resolve-from@^3.0.0: resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748" integrity sha1-six699nWiBvItuZTM17rywoYh0g= +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + resolve-options@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/resolve-options/-/resolve-options-1.1.0.tgz#32bb9e39c06d67338dc9378c0d6d6074566ad131" @@ -7661,6 +7835,13 @@ resolve@^1.1.6, resolve@^1.1.7, resolve@^1.3.2: dependencies: path-parse "^1.0.5" +resolve@^1.4.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.10.0.tgz#3bdaaeaf45cc07f375656dfd2e54ed0810b101ba" + integrity sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg== + dependencies: + path-parse "^1.0.6" + restore-cursor@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" @@ -7749,6 +7930,13 @@ rxjs@^6.1.0: dependencies: tslib "^1.9.0" +rxjs@^6.4.0: + version "6.4.0" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.4.0.tgz#f3bb0fe7bda7fb69deac0c16f17b50b0b8790504" + integrity sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw== + dependencies: + tslib "^1.9.0" + safe-buffer@5.1.1, safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" @@ -7781,10 +7969,10 @@ samsam@~1.1: resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.1.3.tgz#9f5087419b4d091f232571e7fa52e90b0f552621" integrity sha1-n1CHQZtNCR8jJXHn+lLpCw9VJiE= -sax@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.2.tgz#735ffaa39a1cff8ffb9598f0223abdb03a9fb2ea" - integrity sha1-c1/6o5oc/4/7lZjwIjq9sDqfsuo= +sax@0.5.x: + version "0.5.8" + resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" + integrity sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE= sax@>=0.6.0, sax@^1.2.4, sax@~1.2.1: version "1.2.4" @@ -7804,12 +7992,19 @@ semaphore@1.0.5: resolved "https://registry.yarnpkg.com/semaphore/-/semaphore-1.0.5.tgz#b492576e66af193db95d65e25ec53f5f19798d60" integrity sha1-tJJXbmavGT25XWXiXsU/Xxl5jWA= +semver-greatest-satisfied-range@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz#13e8c2658ab9691cb0cd71093240280d36f77a5b" + integrity sha1-E+jCZYq5aRywzXEJMkAoDTb3els= + dependencies: + sver-compat "^1.5.0" + "semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0: version "5.4.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== -semver@^4.1.0, semver@^4.3.4: +semver@^4.3.4: version "4.3.6" resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da" integrity sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto= @@ -7819,6 +8014,11 @@ semver@^5.0.1, semver@^5.4.1, semver@^5.5.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab" integrity sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA== +semver@^5.5.1, semver@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004" + integrity sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg== + send@0.16.1: version "0.16.1" resolved "https://registry.yarnpkg.com/send/-/send-0.16.1.tgz#a70e1ca21d1382c11d0d9f6231deb281080d7ab3" @@ -7838,11 +8038,6 @@ send@0.16.1: range-parser "~1.2.0" statuses "~1.3.1" -sequencify@~0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/sequencify/-/sequencify-0.0.7.tgz#90cff19d02e07027fd767f5ead3e7b95d1e7380c" - integrity sha1-kM/xnQLgcCf9dn9erT57ldHnOAw= - serialize-javascript@^1.4.0: version "1.5.0" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.5.0.tgz#1aa336162c88a890ddad5384baebc93a655161fe" @@ -7983,6 +8178,15 @@ slice-ansi@0.0.4: resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" integrity sha1-7b+JA/ZvfOL46v1s7tZeJkyDGzU= +slice-ansi@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + smart-buffer@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.0.1.tgz#07ea1ca8d4db24eb4cac86537d7d18995221ace3" @@ -8083,7 +8287,7 @@ source-map@0.4.x, source-map@^0.4.4: dependencies: amdefine ">=0.0.4" -source-map@>=0.5.6, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: +source-map@0.6.1, source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -8177,6 +8381,11 @@ ssri@^5.2.4: dependencies: safe-buffer "^5.1.1" +stack-trace@0.0.10: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + integrity sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA= + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -8210,11 +8419,6 @@ stream-combiner@~0.0.4: dependencies: duplexer "~0.1.1" -stream-consume@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/stream-consume/-/stream-consume-0.1.0.tgz#a41ead1a6d6081ceb79f65b061901b6d8f3d1d0f" - integrity sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8= - stream-each@^1.1.0: version "1.2.3" resolved "https://registry.yarnpkg.com/stream-each/-/stream-each-1.2.3.tgz#ebe27a0c389b04fbcc233642952e10731afa9bae" @@ -8223,6 +8427,11 @@ stream-each@^1.1.0: end-of-stream "^1.1.0" stream-shift "^1.0.0" +stream-exhaust@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/stream-exhaust/-/stream-exhaust-1.0.2.tgz#acdac8da59ef2bc1e17a2c0ccf6c320d120e555d" + integrity sha512-b/qaq/GlBK5xaq1yrK9/zFcyRSTNxmcZwFLGSTG0mXgZl/4Z6GgiyYOXOvY7N3eEvFRAG1bkDRz5EPGSvPYQlw== + stream-http@^2.7.2: version "2.8.3" resolved "https://registry.yarnpkg.com/stream-http/-/stream-http-2.8.3.tgz#b2d242469288a5a27ec4fe8933acf623de6514fc" @@ -8256,7 +8465,7 @@ strict-uri-encode@^1.0.0: resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= -string-width@^1.0.1: +string-width@^1.0.1, string-width@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M= @@ -8280,6 +8489,13 @@ string_decoder@^1.0.0, string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +string_decoder@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.2.0.tgz#fe86e738b19544afe70469243b2a1ee9240eae8d" + integrity sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w== + dependencies: + safe-buffer "~5.1.0" + string_decoder@~0.10.x: version "0.10.31" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94" @@ -8297,13 +8513,6 @@ stringstream@~0.0.4, stringstream@~0.0.5: resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" integrity sha1-TkhM1N5aC7vuGORjB3EKioFiGHg= -strip-ansi@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-0.3.0.tgz#25f48ea22ca79187f3174a4db8759347bb126220" - integrity sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA= - dependencies: - ansi-regex "^0.2.1" - strip-ansi@^3.0.0, strip-ansi@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -8318,6 +8527,13 @@ strip-ansi@^4.0.0: dependencies: ansi-regex "^3.0.0" +strip-ansi@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.0.0.tgz#f78f68b5d0866c20b2c9b8c61b5298508dc8756f" + integrity sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow== + dependencies: + ansi-regex "^4.0.0" + strip-bom-stream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz#e7144398577d51a6bed0fa1994fa05f43fd988ee" @@ -8326,14 +8542,6 @@ strip-bom-stream@^1.0.0: first-chunk-stream "^1.0.0" strip-bom "^2.0.0" -strip-bom@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-1.0.0.tgz#85b8862f3844b5a6d5ec8467a93598173a36f794" - integrity sha1-hbiGLzhEtabV7IRnqTWYFzo295Q= - dependencies: - first-chunk-stream "^1.0.0" - is-utf8 "^0.2.0" - strip-bom@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" @@ -8358,7 +8566,7 @@ strip-indent@^1.0.1: dependencies: get-stdin "^4.0.1" -strip-json-comments@~2.0.1: +strip-json-comments@^2.0.1, strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= @@ -8380,11 +8588,6 @@ supports-color@1.2.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-1.2.0.tgz#ff1ed1e61169d06b3cf2d588e188b18d8847e17e" integrity sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4= -supports-color@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-0.2.0.tgz#d92de2694eb3f67323973d7ae3d8b55b4c22190a" - integrity sha1-2S3iaU6z9nMjlz1649i1W0wiGQo= - supports-color@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" @@ -8404,6 +8607,13 @@ supports-color@^4.0.0: dependencies: has-flag "^2.0.0" +supports-color@^5.2.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + supports-color@^5.3.0, supports-color@^5.4.0: version "5.4.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54" @@ -8411,6 +8621,14 @@ supports-color@^5.3.0, supports-color@^5.4.0: dependencies: has-flag "^3.0.0" +sver-compat@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/sver-compat/-/sver-compat-1.5.0.tgz#3cf87dfeb4d07b4a3f14827bc186b3fd0c645cd8" + integrity sha1-PPh9/rTQe0o/FIJ7wYaz/QxkXNg= + dependencies: + es6-iterator "^2.0.1" + es6-symbol "^3.1.1" + svgo@^0.7.0: version "0.7.2" resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" @@ -8436,6 +8654,16 @@ table@^3.7.8: slice-ansi "0.0.4" string-width "^2.0.0" +table@^5.0.2: + version "5.2.2" + resolved "https://registry.yarnpkg.com/table/-/table-5.2.2.tgz#61d474c9e4d8f4f7062c98c7504acb3c08aa738f" + integrity sha512-f8mJmuu9beQEDkKHLzOv4VxVYlU68NpdzjbGPl69i4Hx0sTopJuNxuzJd17iV2h24dAfa93u794OnDA5jqXvfQ== + dependencies: + ajv "^6.6.1" + lodash "^4.17.11" + slice-ansi "^2.0.0" + string-width "^2.1.1" + tapable@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" @@ -8485,7 +8713,7 @@ temp@^0.8.3: os-tmpdir "^1.0.0" rimraf "~2.2.6" -text-table@~0.2.0: +text-table@^0.2.0, text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= @@ -8508,31 +8736,7 @@ through2-filter@^2.0.0: through2 "~2.0.0" xtend "~4.0.0" -through2@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.1.tgz#384e75314d49f32de12eebb8136b8eb6b5d59da9" - integrity sha1-OE51MU1J8y3hLuu4E2uOtrXVnak= - dependencies: - readable-stream "~2.0.0" - xtend "~4.0.0" - -through2@^0.5.0, through2@~0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.5.1.tgz#dfdd012eb9c700e2323fd334f38ac622ab372da7" - integrity sha1-390BLrnHAOIyP9M084rGIqs3Lac= - dependencies: - readable-stream "~1.0.17" - xtend "~3.0.0" - -through2@^0.6.0, through2@^0.6.1, through2@~0.6.3: - version "0.6.5" - resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" - integrity sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg= - dependencies: - readable-stream ">=1.0.33-1 <1.1.0-0" - xtend ">=4.0.0 <4.1.0-0" - -through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0, through2@~2.0.3: +through2@2.0.3, through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0, through2@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" integrity sha1-AARWmzfHx0ujnEPzzteNGtlBQL4= @@ -8540,6 +8744,22 @@ through2@^2.0.0, through2@^2.0.1, through2@^2.0.3, through2@~2.0.0, through2@~2. readable-stream "^2.1.5" xtend "~4.0.1" +through2@3.0.0, through2@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/through2/-/through2-3.0.0.tgz#468b461df9cd9fcc170f22ebf6852e467e578ff2" + integrity sha512-8B+sevlqP4OiCjonI1Zw03Sf8PuV1eRsYQgLad5eonILOdyeRsY27A/2Ze8IlvlMvq31OH+3fz/styI7Ya62yQ== + dependencies: + readable-stream "2 || 3" + xtend "~4.0.1" + +through2@^0.6.0: + version "0.6.5" + resolved "https://registry.yarnpkg.com/through2/-/through2-0.6.5.tgz#41ab9c67b29d57209071410e1d7a7a968cd3ad48" + integrity sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg= + dependencies: + readable-stream ">=1.0.33-1 <1.1.0-0" + xtend ">=4.0.0 <4.1.0-0" + through2@~0.2.3: version "0.2.3" resolved "https://registry.yarnpkg.com/through2/-/through2-0.2.3.tgz#eb3284da4ea311b6cc8ace3653748a52abf25a3f" @@ -8561,13 +8781,6 @@ through@2, through@^2.3.6, through@^2.3.8, through@~2.3, through@~2.3.1, through resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -tildify@^1.0.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/tildify/-/tildify-1.2.0.tgz#dcec03f55dca9b7aa3e5b04f21817eb56e63588a" - integrity sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo= - dependencies: - os-homedir "^1.0.0" - time-stamp@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/time-stamp/-/time-stamp-1.1.0.tgz#764a5a11af50561921b133f3b44e618687e0f5c3" @@ -8902,15 +9115,30 @@ unc-path-regex@^0.1.0, unc-path-regex@^0.1.2: resolved "https://registry.yarnpkg.com/unc-path-regex/-/unc-path-regex-0.1.2.tgz#e73dd3d7b0d7c5ed86fbac6b0ae7d8c6a69d50fa" integrity sha1-5z3T17DXxe2G+6xrCufYxqadUPo= -underscore@1.8.3, underscore@^1.8.2, underscore@^1.8.3: +underscore@1.8.3, underscore@^1.8.2, underscore@^1.8.3, underscore@~1.8.3: version "1.8.3" resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.8.3.tgz#4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022" integrity sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI= -underscore@~1.4.4: - version "1.4.4" - resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.4.4.tgz#61a6a32010622afa07963bf325203cf12239d604" - integrity sha1-YaajIBBiKvoHljvzJSA88SI51gQ= +undertaker-registry@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/undertaker-registry/-/undertaker-registry-1.0.1.tgz#5e4bda308e4a8a2ae584f9b9a4359a499825cc50" + integrity sha1-XkvaMI5KiirlhPm5pDWaSZglzFA= + +undertaker@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/undertaker/-/undertaker-1.2.0.tgz#339da4646252d082dc378e708067299750e11b49" + integrity sha1-M52kZGJS0ILcN45wgGcpl1DhG0k= + dependencies: + arr-flatten "^1.0.1" + arr-map "^2.0.0" + bach "^1.0.0" + collection-map "^1.0.0" + es6-weak-map "^2.0.1" + last-run "^1.1.0" + object.defaults "^1.0.0" + object.reduce "^1.0.0" + undertaker-registry "^1.0.0" union-value@^1.0.0: version "1.0.0" @@ -8953,11 +9181,6 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" -unique-stream@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-1.0.0.tgz#d59a4a75427447d9aa6c91e70263f8d26a4b104b" - integrity sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs= - unique-stream@^2.0.2: version "2.2.1" resolved "https://registry.yarnpkg.com/unique-stream/-/unique-stream-2.2.1.tgz#5aa003cfbe94c5ff866c4e7d668bb1c4dbadb369" @@ -8984,12 +9207,12 @@ unset-value@^1.0.0: has-value "^0.3.1" isobject "^3.0.0" -upath@^1.0.5: +upath@^1.0.5, upath@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/upath/-/upath-1.1.0.tgz#35256597e46a581db4793d0ce47fa9aebfc9fabd" integrity sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw== -uri-js@^4.2.1: +uri-js@^4.2.1, uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== @@ -9019,11 +9242,6 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= - user-home@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/user-home/-/user-home-2.0.0.tgz#9c70bfd8169bc1dcbf48604e0f04b8b49cde9e9f" @@ -9031,7 +9249,7 @@ user-home@^2.0.0: dependencies: os-homedir "^1.0.0" -util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= @@ -9077,12 +9295,12 @@ v8-inspect-profiler@^0.0.20: dependencies: chrome-remote-interface "0.26.1" -v8flags@^2.0.2: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= +v8flags@^3.0.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.1.2.tgz#fc5cd0c227428181e6c29b2992e4f8f1da5e0c9f" + integrity sha512-MtivA7GF24yMPte9Rp/BWGCYQNaUj86zeYxV/x2RRJMKagImbbv3u8iJC57lNhWLPcGLJmHcHmFWkNsplbbLWw== dependencies: - user-home "^1.1.1" + homedir-polyfill "^1.0.1" vali-date@^1.0.0: version "1.0.0" @@ -9097,10 +9315,10 @@ validate-npm-package-license@^3.0.1: spdx-correct "~1.0.0" spdx-expression-parse "~1.0.0" -validator@~3.22.2: - version "3.22.2" - resolved "https://registry.yarnpkg.com/validator/-/validator-3.22.2.tgz#6f297ae67f7f82acc76d0afdb49f18d9a09c18c0" - integrity sha1-byl65n9/gqzHbQr9tJ8Y2aCcGMA= +validator@~9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/validator/-/validator-9.4.1.tgz#abf466d398b561cd243050112c6ff1de6cc12663" + integrity sha512-YV5KjzvRmSyJ1ee/Dm5UED0G+1L4GZnLN3w6/T+zZm8scVua4sOhYKWTUrKa0H/tMiJyO9QLHMPN+9mB/aMunA== value-or-function@^3.0.0: version "3.0.0" @@ -9126,20 +9344,6 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vinyl-fs@^0.3.0, vinyl-fs@^0.3.13: - version "0.3.14" - resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-0.3.14.tgz#9a6851ce1cac1c1cea5fe86c0931d620c2cfa9e6" - integrity sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY= - dependencies: - defaults "^1.0.0" - glob-stream "^3.1.5" - glob-watcher "^0.0.6" - graceful-fs "^3.0.0" - mkdirp "^0.5.0" - strip-bom "^1.0.0" - through2 "^0.6.1" - vinyl "^0.4.0" - vinyl-fs@^2.4.3: version "2.4.4" resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-2.4.4.tgz#be6ff3270cb55dfd7d3063640de81f25d7532239" @@ -9163,7 +9367,7 @@ vinyl-fs@^2.4.3: vali-date "^1.0.0" vinyl "^1.0.0" -vinyl-fs@^3.0.3: +vinyl-fs@^3.0.0, vinyl-fs@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/vinyl-fs/-/vinyl-fs-3.0.3.tgz#c85849405f67428feabbbd5c5dbdd64f47d31bc7" integrity sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng== @@ -9206,14 +9410,7 @@ vinyl-sourcemaps-apply@^0.2.0, vinyl-sourcemaps-apply@^0.2.1: dependencies: source-map "^0.5.1" -vinyl@^0.2.1: - version "0.2.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.2.3.tgz#bca938209582ec5a49ad538a00fa1f125e513252" - integrity sha1-vKk4IJWC7FpJrVOKAPofEl5RMlI= - dependencies: - clone-stats "~0.0.1" - -vinyl@^0.4.0, vinyl@^0.4.3, vinyl@^0.4.5: +vinyl@^0.4.3, vinyl@^0.4.5: version "0.4.6" resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" integrity sha1-LzVsh6VQolVGHza76ypbqL94SEc= @@ -9529,6 +9726,11 @@ whet.extend@~0.9.9: resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" integrity sha1-+HfVv2SMl+WqVC+twW1qJZucEaE= +which-module@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" + integrity sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8= + which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -9539,13 +9741,20 @@ which-pm-runs@^1.0.0: resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb" integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs= -which@^1.1.1, which@^1.2.12, which@^1.2.9: +which@^1.1.1, which@^1.2.9: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" integrity sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg== dependencies: isexe "^2.0.0" +which@^1.2.14: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + 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" @@ -9639,12 +9848,12 @@ xml-name-validator@^1.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-1.0.0.tgz#dcf82ee092322951ef8cc1ba596c9cbfd14a83f1" integrity sha1-3Pgu4JIyKVHvjMG6WWycv9FKg/E= -xml2js@0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.2.7.tgz#1838518bb01741cae0878bab4915e494c32306af" - integrity sha1-GDhRi7AXQcrgh4urSRXklMMjBq8= +xml2js@0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.2.8.tgz#9b81690931631ff09d1957549faf54f4f980b3c2" + integrity sha1-m4FpCTFjH/CdGVdUn69U9PmAs8I= dependencies: - sax "0.5.2" + sax "0.5.x" xml2js@^0.4.19: version "0.4.19" @@ -9659,11 +9868,6 @@ xml@^1.0.0: resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= -xmlbuilder@0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-0.4.3.tgz#c4614ba74e0ad196e609c9272cd9e1ddb28a8a58" - integrity sha1-xGFLp04K0ZbmCcknLNnh3bKKilg= - xmlbuilder@^9.0.7: version "9.0.7" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" @@ -9701,11 +9905,6 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" -xtend@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-3.0.0.tgz#5cce7407baf642cba7becda568111c493f59665a" - integrity sha1-XM50B7r2Qsunvs2laBEcST9ZZlo= - y18n@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" @@ -9733,6 +9932,13 @@ yargs-parser@^10.1.0: dependencies: camelcase "^4.1.0" +yargs-parser@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" + integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo= + dependencies: + camelcase "^3.0.0" + yargs-parser@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-8.1.0.tgz#f1376a33b6629a5d063782944da732631e966950" @@ -9776,6 +9982,25 @@ yargs@^12.0.1: y18n "^3.2.1 || ^4.0.0" yargs-parser "^10.1.0" +yargs@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8" + integrity sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg= + dependencies: + camelcase "^3.0.0" + cliui "^3.2.0" + decamelize "^1.1.1" + get-caller-file "^1.0.1" + os-locale "^1.4.0" + read-pkg-up "^1.0.1" + require-directory "^2.1.1" + require-main-filename "^1.0.1" + set-blocking "^2.0.0" + string-width "^1.0.2" + which-module "^1.0.0" + y18n "^3.2.1" + yargs-parser "^5.0.0" + yargs@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" From 34dbc7195c5d8cb76a5066c74b73ef2713be50ce Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Tue, 5 Feb 2019 14:16:02 -0800 Subject: [PATCH 346/429] Fix strict null checks --- .../parts/terminal/electron-browser/terminalConfigHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts index 9aee7905251..10bb8f9723e 100644 --- a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts @@ -199,7 +199,7 @@ export class TerminalConfigHelper implements ITerminalConfigHelper { } let envString: string | undefined; if (envConfigValue.workspace) { - envString = `env: {${Object.keys(envConfigValue.workspace).map(k => `${k}:${envConfigValue.workspace[k]}`).join(', ')}}`; + envString = `env: {${Object.keys(envConfigValue.workspace).map(k => `${k}:${envConfigValue.workspace![k]}`).join(', ')}}`; } // Should not be localized as it's json-like syntax referencing settings keys const workspaceConfigStrings: string[] = []; From 8446e3fb19cc38dee87a718052960fcb5cecb4c6 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 14:28:27 -0800 Subject: [PATCH 347/429] Strict null check more quick open files --- src/tsconfig.strictNullChecks.json | 4 ++ .../standalone/browser/quickOpen/gotoLine.ts | 23 +++++----- .../browser/parts/editor/editorPicker.ts | 11 +++-- .../quickopen/browser/gotoSymbolHandler.ts | 45 ++++++++++--------- .../search/browser/openAnythingHandler.ts | 6 +-- .../parts/search/browser/openFileHandler.ts | 4 +- 6 files changed, 51 insertions(+), 42 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 298d66413ce..9c4563e91f7 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -155,6 +155,7 @@ "./vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts", "./vs/editor/standalone/browser/inspectTokens/inspectTokens.ts", "./vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts", + "./vs/editor/standalone/browser/quickOpen/gotoLine.ts", "./vs/editor/standalone/browser/quickOpen/quickCommand.ts", "./vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts", "./vs/editor/standalone/browser/quickOpen/quickOutline.ts", @@ -434,6 +435,7 @@ "./vs/workbench/browser/parts/editor/breadcrumbsModel.ts", "./vs/workbench/browser/parts/editor/editor.ts", "./vs/workbench/browser/parts/editor/editorControl.ts", + "./vs/workbench/browser/parts/editor/editorPicker.ts", "./vs/workbench/browser/parts/editor/editorWidgets.ts", "./vs/workbench/browser/parts/editor/rangeDecorations.ts", "./vs/workbench/browser/parts/editor/resourceViewer.ts", @@ -567,6 +569,7 @@ "./vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts", "./vs/workbench/parts/quickopen/browser/commandsHandler.ts", "./vs/workbench/parts/quickopen/browser/gotoLineHandler.ts", + "./vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts", "./vs/workbench/parts/quickopen/browser/helpHandler.ts", "./vs/workbench/parts/quickopen/browser/viewPickerHandler.ts", "./vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts", @@ -575,6 +578,7 @@ "./vs/workbench/parts/scm/electron-browser/scmActivity.ts", "./vs/workbench/parts/scm/electron-browser/scmMenus.ts", "./vs/workbench/parts/scm/electron-browser/scmUtil.ts", + "./vs/workbench/parts/search/browser/openAnythingHandler.ts", "./vs/workbench/parts/search/browser/openFileHandler.ts", "./vs/workbench/parts/search/browser/openSymbolHandler.ts", "./vs/workbench/parts/search/browser/patternInputWidget.ts", diff --git a/src/vs/editor/standalone/browser/quickOpen/gotoLine.ts b/src/vs/editor/standalone/browser/quickOpen/gotoLine.ts index 7c55710e9a2..47cc1ea540d 100644 --- a/src/vs/editor/standalone/browser/quickOpen/gotoLine.ts +++ b/src/vs/editor/standalone/browser/quickOpen/gotoLine.ts @@ -6,8 +6,8 @@ import 'vs/css!./gotoLine'; import * as nls from 'vs/nls'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; -import { IContext, QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; -import { IAutoFocus, Mode } from 'vs/base/parts/quickopen/common/quickOpen'; +import { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; +import { IAutoFocus, Mode, IEntryRunContext } from 'vs/base/parts/quickopen/common/quickOpen'; import { ICodeEditor, IDiffEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser'; import { ServicesAccessor, registerEditorAction } from 'vs/editor/browser/editorExtensions'; import { Position } from 'vs/editor/common/core/position'; @@ -49,14 +49,15 @@ export class GotoLineEntry extends QuickOpenEntry { position = new Position(numbers[0], numbers[1]); } - let model: ITextModel; + let model: ITextModel | null; if (isCodeEditor(this.editor)) { model = this.editor.getModel(); } else { - model = (this.editor).getModel().modified; + const diffModel = (this.editor).getModel(); + model = diffModel ? diffModel.modified : null; } - const isValid = model.validatePosition(position).equals(position); + const isValid = model ? model.validatePosition(position).equals(position) : false; let label: string; if (isValid) { @@ -65,10 +66,10 @@ export class GotoLineEntry extends QuickOpenEntry { } else { label = nls.localize('gotoLineLabelValidLine', "Go to line {0}", position.lineNumber, position.column); } - } else if (position.lineNumber < 1 || position.lineNumber > model.getLineCount()) { - label = nls.localize('gotoLineLabelEmptyWithLineLimit', "Type a line number between 1 and {0} to navigate to", model.getLineCount()); + } else if (position.lineNumber < 1 || position.lineNumber > (model ? model.getLineCount() : 0)) { + label = nls.localize('gotoLineLabelEmptyWithLineLimit', "Type a line number between 1 and {0} to navigate to", model ? model.getLineCount() : 0); } else { - label = nls.localize('gotoLineLabelEmptyWithLineAndColumnLimit', "Type a character between 1 and {0} to navigate to", model.getLineMaxColumn(position.lineNumber)); + label = nls.localize('gotoLineLabelEmptyWithLineAndColumnLimit', "Type a character between 1 and {0} to navigate to", model ? model.getLineMaxColumn(position.lineNumber) : 0); } return { @@ -83,12 +84,12 @@ export class GotoLineEntry extends QuickOpenEntry { } getAriaLabel(): string { - const currentLine = this.editor.getPosition().lineNumber; - + const position = this.editor.getPosition(); + const currentLine = position ? position.lineNumber : 0; return nls.localize('gotoLineAriaLabel', "Current Line: {0}. Go to line {0}.", currentLine, this.parseResult.label); } - run(mode: Mode, context: IContext): boolean { + run(mode: Mode, _context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { return this.runOpen(); } diff --git a/src/vs/workbench/browser/parts/editor/editorPicker.ts b/src/vs/workbench/browser/parts/editor/editorPicker.ts index fbbf6c9ef05..bdb719d39c0 100644 --- a/src/vs/workbench/browser/parts/editor/editorPicker.ts +++ b/src/vs/workbench/browser/parts/editor/editorPicker.ts @@ -5,7 +5,6 @@ import 'vs/css!./media/editorpicker'; import * as nls from 'vs/nls'; -import { URI } from 'vs/base/common/uri'; import { IIconLabelValueOptions } from 'vs/base/browser/ui/iconLabel/iconLabel'; import { IAutoFocus, Mode, IEntryRunContext, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenModel, QuickOpenEntry, QuickOpenEntryGroup, QuickOpenItemAccessor } from 'vs/base/parts/quickopen/browser/quickOpenModel'; @@ -33,12 +32,12 @@ export class EditorPickerEntry extends QuickOpenEntryGroup { getLabelOptions(): IIconLabelValueOptions { return { - extraClasses: getIconClasses(this.modelService, this.modeService, this.getResource()), + extraClasses: getIconClasses(this.modelService, this.modeService, this.getResource() || undefined), italic: !this._group.isPinned(this.editor) }; } - getLabel(): string { + getLabel() { return this.editor.getName(); } @@ -50,7 +49,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup { return this._group; } - getResource(): URI { + getResource() { return toResource(this.editor, { supportSideBySide: true }); } @@ -58,7 +57,7 @@ export class EditorPickerEntry extends QuickOpenEntryGroup { return nls.localize('entryAriaLabel', "{0}, editor group picker", this.getLabel()); } - getDescription(): string { + getDescription() { return this.editor.getDescription(); } @@ -109,7 +108,7 @@ export abstract class BaseEditorPicker extends QuickOpenHandler { return false; } - e.setHighlights(itemScore.labelMatch, itemScore.descriptionMatch); + e.setHighlights(itemScore.labelMatch || [], itemScore.descriptionMatch); return true; }); diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts index dfab2401a49..d9bc4a3df3f 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts @@ -128,7 +128,7 @@ class OutlineModel extends QuickOpenModel { // Update previous result with count if (currentResult) { - currentResult.setGroupLabel(this.renderGroupLabel(currentType, typeCounter)); + currentResult.setGroupLabel(typeof currentType === 'number' ? this.renderGroupLabel(currentType, typeCounter) : undefined); } currentType = result.getKind(); @@ -146,7 +146,7 @@ class OutlineModel extends QuickOpenModel { // Update previous result with count if (currentResult) { - currentResult.setGroupLabel(this.renderGroupLabel(currentType, typeCounter)); + currentResult.setGroupLabel(typeof currentType === 'number' ? this.renderGroupLabel(currentType, typeCounter) : undefined); } } @@ -338,7 +338,7 @@ class SymbolEntry extends EditorQuickOpenEntryGroup { // Decorate if possible if (types.isFunction(activeTextEditorWidget.changeDecorations)) { - this.handler.decorateOutline(this.range, range, activeTextEditorWidget, this.editorService.activeControl.group); + this.handler.decorateOutline(this.range, range, activeTextEditorWidget, this.editorService.activeControl.group!); } } @@ -365,11 +365,11 @@ export class GotoSymbolHandler extends QuickOpenHandler { static readonly ID = 'workbench.picker.filesymbols'; - private rangeHighlightDecorationId: IEditorLineDecoration; - private lastKnownEditorViewState: IEditorViewState; + private rangeHighlightDecorationId?: IEditorLineDecoration; + private lastKnownEditorViewState: IEditorViewState | null; - private cachedOutlineRequest: Promise; - private pendingOutlineRequest: CancellationTokenSource; + private cachedOutlineRequest?: Promise; + private pendingOutlineRequest?: CancellationTokenSource; constructor( @IEditorService private readonly editorService: IEditorService @@ -386,11 +386,11 @@ export class GotoSymbolHandler extends QuickOpenHandler { private onDidActiveEditorChange(): void { this.clearOutlineRequest(); - this.lastKnownEditorViewState = undefined; + this.lastKnownEditorViewState = null; this.rangeHighlightDecorationId = undefined; } - getResults(searchValue: string, token: CancellationToken): Promise { + getResults(searchValue: string, token: CancellationToken): Promise { searchValue = searchValue.trim(); // Support to cancel pending outline requests @@ -406,6 +406,10 @@ export class GotoSymbolHandler extends QuickOpenHandler { // Resolve Outline Model return this.getOutline().then(outline => { + if (!outline) { + return outline; + } + if (token.isCancellationRequested) { return outline; } @@ -469,20 +473,20 @@ export class GotoSymbolHandler extends QuickOpenHandler { const label = strings.trim(element.name); // Show parent scope as description - const description: string = element.containerName; + const description = element.containerName || ''; const icon = symbolKindToCssClass(element.kind); // Add results.push(new SymbolEntry(i, label, element.kind, description, `symbol-icon ${icon}`, - element.range, element.selectionRange, null, this.editorService, this + element.range, element.selectionRange, [], this.editorService, this )); } return results; } - private getOutline(): Promise { + private getOutline(): Promise { if (!this.cachedOutlineRequest) { this.cachedOutlineRequest = this.doGetActiveOutline(); } @@ -499,7 +503,7 @@ export class GotoSymbolHandler extends QuickOpenHandler { } if (model && types.isFunction((model).getLanguageIdentifier)) { - return Promise.resolve(asPromise(() => getDocumentSymbols(model, true, this.pendingOutlineRequest.token)).then(entries => { + return Promise.resolve(asPromise(() => getDocumentSymbols(model, true, this.pendingOutlineRequest!.token)).then(entries => { return new OutlineModel(this.toQuickOpenEntries(entries)); })); } @@ -515,7 +519,7 @@ export class GotoSymbolHandler extends QuickOpenHandler { if (this.rangeHighlightDecorationId) { deleteDecorations.push(this.rangeHighlightDecorationId.lineDecorationId); deleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId); - this.rangeHighlightDecorationId = null; + this.rangeHighlightDecorationId = undefined; } const newDecorations: IModelDeltaDecoration[] = [ @@ -555,20 +559,21 @@ export class GotoSymbolHandler extends QuickOpenHandler { } private clearDecorations(): void { - if (this.rangeHighlightDecorationId) { + const rangeHighlightDecorationId = this.rangeHighlightDecorationId; + if (rangeHighlightDecorationId) { this.editorService.visibleControls.forEach(editor => { - if (editor.group.id === this.rangeHighlightDecorationId.groupId) { + if (editor.group && editor.group.id === rangeHighlightDecorationId.groupId) { const editorControl = editor.getControl(); editorControl.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => { changeAccessor.deltaDecorations([ - this.rangeHighlightDecorationId.lineDecorationId, - this.rangeHighlightDecorationId.rangeHighlightId + rangeHighlightDecorationId.lineDecorationId, + rangeHighlightDecorationId.rangeHighlightId ], []); }); } }); - this.rangeHighlightDecorationId = null; + this.rangeHighlightDecorationId = undefined; } } @@ -598,6 +603,6 @@ export class GotoSymbolHandler extends QuickOpenHandler { this.pendingOutlineRequest = undefined; } - this.cachedOutlineRequest = null; + this.cachedOutlineRequest = undefined; } } diff --git a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts index 6318be52a6a..a20fe2e6f8b 100644 --- a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts +++ b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts @@ -132,7 +132,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { entry.setRange(searchWithRange ? searchWithRange.range : null); const itemScore = scoreItem(entry, query, true, QuickOpenItemAccessor, this.scorerCache); - entry.setHighlights(itemScore.labelMatch, itemScore.descriptionMatch); + entry.setHighlights(itemScore.labelMatch || [], itemScore.descriptionMatch); } }); @@ -165,7 +165,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { return this.openFileHandler.hasShortResponseTime() && this.openSymbolHandler.hasShortResponseTime(); } - private extractRange(value: string): ISearchWithRange { + private extractRange(value: string): ISearchWithRange | null { if (!value) { return null; } @@ -211,7 +211,7 @@ export class OpenAnythingHandler extends QuickOpenHandler { } } - if (range) { + if (patternMatch && range) { return { search: value.substr(0, patternMatch.index), // clear range suffix from search value range: range diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index 5e5566fd385..2d52f6f68b5 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -43,7 +43,7 @@ export class FileQuickOpenModel extends QuickOpenModel { } export class FileEntry extends EditorQuickOpenEntry { - private range: IRange; + private range: IRange | null; constructor( private resource: URI, @@ -85,7 +85,7 @@ export class FileEntry extends EditorQuickOpenEntry { return this.resource; } - setRange(range: IRange): void { + setRange(range: IRange | null): void { this.range = range; } From f9da04c392096432c53130045e6e57128a7ce534 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 5 Feb 2019 23:39:23 +0100 Subject: [PATCH 348/429] Fix eslint errors --- build/gulpfile.editor.js | 3 ++- src/main.js | 2 +- src/vs/workbench/parts/webview/electron-browser/webview-pre.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 2c68dc74185..4bed8bacb1d 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -276,7 +276,7 @@ const finalEditorResourcesTask = function () { var strContents = data.contents.toString(); var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/'); - strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr); + strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr); data.contents = Buffer.from(strContents); this.emit('data', data); @@ -337,6 +337,7 @@ function createTscCompileTask(watch) { let errors = []; let reporter = createReporter(); let report; + // eslint-disable-next-line no-control-regex let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings child.stdout.on('data', data => { diff --git a/src/main.js b/src/main.js index 5d6dcfca955..791ee7bba48 100644 --- a/src/main.js +++ b/src/main.js @@ -305,7 +305,7 @@ function getNodeCachedDir() { * @returns {string} */ function stripComments(content) { - const regexp = /("(?:[^\\\"]*(?:\\.)?)*")|('(?:[^\\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; + const regexp = /("(?:[^\\"]*(?:\\.)?)*")|('(?:[^\\']*(?:\\.)?)*')|(\/\*(?:\r?\n|.)*?\*\/)|(\/{2,}.*?(?:(?:\r?\n)|$))/g; return content.replace(regexp, function (match, m1, m2, m3, m4) { // Only one of m1, m2, m3, m4 matches diff --git a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js index ebf0555f42f..510e23d5b91 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js +++ b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js @@ -405,7 +405,7 @@ */ function getDefaultCss(styles) { const vars = Object.keys(styles || {}).map(variable => { - return `--${variable}: ${styles[variable].replace(/[^\#\"\'\,\. a-z0-9\-\(\)]/gi, '')};`; + return `--${variable}: ${styles[variable].replace(/[^#"',. a-z0-9\-()]/gi, '')};`; }); return ` :root { ${vars.join('\n')} } From e82d8bb6e6c8fd07ca16eacd16663ebd221187cb Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 14:56:10 -0800 Subject: [PATCH 349/429] Strict null checking goToDefinition --- src/vs/editor/browser/editorExtensions.ts | 6 +-- .../goToDefinition/goToDefinitionCommands.ts | 41 +++++++++++-------- .../goToDefinition/goToDefinitionMouse.ts | 23 ++++++----- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/vs/editor/browser/editorExtensions.ts b/src/vs/editor/browser/editorExtensions.ts index 15365b311a9..b7061803c01 100644 --- a/src/vs/editor/browser/editorExtensions.ts +++ b/src/vs/editor/browser/editorExtensions.ts @@ -184,9 +184,9 @@ export interface IActionOptions extends ICommandOptions { } export abstract class EditorAction extends EditorCommand { - public label: string; - public alias: string; - private menuOpts: IEditorCommandMenuOptions | undefined; + public readonly label: string; + public readonly alias: string; + private readonly menuOpts: IEditorCommandMenuOptions | undefined; constructor(opts: IActionOptions) { super(opts); diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts index 52648d04694..4f99a51c6a6 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionCommands.ts @@ -51,6 +51,9 @@ export class DefinitionAction extends EditorAction { } public run(accessor: ServicesAccessor, editor: ICodeEditor): Promise { + if (!editor.hasModel()) { + return Promise.resolve(undefined); + } const notificationService = accessor.get(INotificationService); const editorService = accessor.get(ICodeEditorService); const progressService = accessor.get(IProgressService); @@ -112,14 +115,14 @@ export class DefinitionAction extends EditorAction { return getDefinitionsAtPosition(model, position, token); } - protected _getNoResultFoundMessage(info?: IWordAtPosition): string { + protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { return info && info.word ? nls.localize('noResultWord', "No definition found for '{0}'", info.word) : nls.localize('generic.noResults', "No definition found"); } protected _getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('meta.title', " – {0} definitions", model.references.length); + return model.references.length > 1 ? nls.localize('meta.title', " – {0} definitions", model.references.length) : ''; } private async _onResult(editorService: ICodeEditorService, editor: ICodeEditor, model: ReferencesModel): Promise { @@ -129,21 +132,23 @@ export class DefinitionAction extends EditorAction { if (this._configuration.openInPeek) { this._openInPeek(editorService, editor, model); - } else { + } else if (editor.hasModel()) { const next = model.nearestReference(editor.getModel().uri, editor.getPosition()); - const targetEditor = await this._openReference(editor, editorService, next, this._configuration.openToSide); - if (targetEditor && model.references.length > 1) { - this._openInPeek(editorService, targetEditor, model); - } else { - model.dispose(); + if (next) { + const targetEditor = await this._openReference(editor, editorService, next, this._configuration.openToSide); + if (targetEditor && model.references.length > 1) { + this._openInPeek(editorService, targetEditor, model); + } else { + model.dispose(); + } } } } - private _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean): Promise { + private _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean): Promise { // range is the target-selection-range when we have one // and the the fallback is the 'full' range - let range: IRange = undefined; + let range: IRange | undefined = undefined; if (isLocationLink(reference)) { range = reference.targetSelectionRange; } @@ -265,14 +270,14 @@ export class DeclarationAction extends DefinitionAction { return getDeclarationsAtPosition(model, position, token); } - protected _getNoResultFoundMessage(info?: IWordAtPosition): string { + protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { return info && info.word ? nls.localize('decl.noResultWord', "No declaration found for '{0}'", info.word) : nls.localize('decl.generic.noResults', "No declaration found"); } protected _getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('decl.meta.title', " – {0} declarations", model.references.length); + return model.references.length > 1 ? nls.localize('decl.meta.title', " – {0} declarations", model.references.length) : ''; } } @@ -295,14 +300,14 @@ export class GoToDeclarationAction extends DeclarationAction { }); } - protected _getNoResultFoundMessage(info?: IWordAtPosition): string { + protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { return info && info.word ? nls.localize('decl.noResultWord', "No declaration found for '{0}'", info.word) : nls.localize('decl.generic.noResults', "No declaration found"); } protected _getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('decl.meta.title', " – {0} declarations", model.references.length); + return model.references.length > 1 ? nls.localize('decl.meta.title', " – {0} declarations", model.references.length) : ''; } } @@ -329,14 +334,14 @@ export class ImplementationAction extends DefinitionAction { return getImplementationsAtPosition(model, position, token); } - protected _getNoResultFoundMessage(info?: IWordAtPosition): string { + protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { return info && info.word ? nls.localize('goToImplementation.noResultWord', "No implementation found for '{0}'", info.word) : nls.localize('goToImplementation.generic.noResults', "No implementation found"); } protected _getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('meta.implementations.title', " – {0} implementations", model.references.length); + return model.references.length > 1 ? nls.localize('meta.implementations.title', " – {0} implementations", model.references.length) : ''; } } @@ -387,14 +392,14 @@ export class TypeDefinitionAction extends DefinitionAction { return getTypeDefinitionsAtPosition(model, position, token); } - protected _getNoResultFoundMessage(info?: IWordAtPosition): string { + protected _getNoResultFoundMessage(info: IWordAtPosition | null): string { return info && info.word ? nls.localize('goToTypeDefinition.noResultWord', "No type definition found for '{0}'", info.word) : nls.localize('goToTypeDefinition.generic.noResults', "No type definition found"); } protected _getMetaTitle(model: ReferencesModel): string { - return model.references.length > 1 && nls.localize('meta.typeDefinitions.title', " – {0} type definitions", model.references.length); + return model.references.length > 1 ? nls.localize('meta.typeDefinitions.title', " – {0} type definitions", model.references.length) : ''; } } diff --git a/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts b/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts index 55e2e6e0047..abb0f9c3575 100644 --- a/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts +++ b/src/vs/editor/contrib/goToDefinition/goToDefinitionMouse.ts @@ -34,8 +34,8 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC private editor: ICodeEditor; private toUnhook: IDisposable[]; private decorations: string[]; - private currentWordUnderMouse: IWordAtPosition; - private previousPromise: CancelablePromise; + private currentWordUnderMouse: IWordAtPosition | null; + private previousPromise: CancelablePromise | null; constructor( editor: ICodeEditor, @@ -51,7 +51,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC this.toUnhook.push(linkGesture); this.toUnhook.push(linkGesture.onMouseMoveOrRelevantKeyDown(([mouseEvent, keyboardEvent]) => { - this.startFindDefinition(mouseEvent, keyboardEvent); + this.startFindDefinition(mouseEvent, keyboardEvent || undefined); })); this.toUnhook.push(linkGesture.onExecute((mouseEvent: ClickLinkMouseEvent) => { @@ -79,20 +79,20 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC return; } - if (!this.isEnabled(mouseEvent, withKey)) { + if (!this.editor.hasModel() || !this.isEnabled(mouseEvent, withKey)) { this.currentWordUnderMouse = null; this.removeDecorations(); return; } // Find word at mouse position - let position = mouseEvent.target.position; - let word = position ? this.editor.getModel().getWordAtPosition(position) : null; + const word = mouseEvent.target.position ? this.editor.getModel().getWordAtPosition(mouseEvent.target.position) : null; if (!word) { this.currentWordUnderMouse = null; this.removeDecorations(); return; } + const position = mouseEvent.target.position!; // Return early if word at position is still the same if (this.currentWordUnderMouse && this.currentWordUnderMouse.startColumn === word.startColumn && this.currentWordUnderMouse.endColumn === word.endColumn && this.currentWordUnderMouse.word === word.word) { @@ -158,9 +158,10 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC wordRange = new Range(position.lineNumber, word.startColumn, position.lineNumber, word.endColumn); } + const modeId = this.modeService.getModeIdByFilepathOrFirstLine(textEditorModel.uri.fsPath); this.addDecoration( wordRange, - new MarkdownString().appendCodeblock(this.modeService.getModeIdByFilepathOrFirstLine(textEditorModel.uri.fsPath), previewValue) + new MarkdownString().appendCodeblock(modeId ? modeId : '', previewValue) ); ref.dispose(); }); @@ -274,10 +275,10 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC } private isEnabled(mouseEvent: ClickLinkMouseEvent, withKey?: ClickLinkKeyboardEvent): boolean { - return this.editor.getModel() && + return this.editor.hasModel() && mouseEvent.isNoneOrSingleMouseDown && (mouseEvent.target.type === MouseTargetType.CONTENT_TEXT) && - (mouseEvent.hasTriggerModifier || (withKey && withKey.keyCodeIsTriggerKey)) && + (mouseEvent.hasTriggerModifier || (withKey ? withKey.keyCodeIsTriggerKey : false)) && DefinitionProviderRegistry.has(this.editor.getModel()); } @@ -287,11 +288,11 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC return Promise.resolve(null); } - return getDefinitionsAtPosition(model, target.position, token); + return getDefinitionsAtPosition(model, target.position!, token); } private gotoDefinition(target: IMouseTarget, sideBySide: boolean): Promise { - this.editor.setPosition(target.position); + this.editor.setPosition(target.position!); const action = new DefinitionAction(new DefinitionActionConfig(sideBySide, false, true, false), { alias: undefined, label: undefined, id: undefined, precondition: undefined }); return this.editor.invokeWithinContext(accessor => action.run(accessor, this.editor)); } From 6551c682edc403bdb27fa31fa5bd519eb6579404 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 15:38:31 -0800 Subject: [PATCH 350/429] Working on strict null checking code/windows --- src/vs/code/electron-main/windows.ts | 45 +++++++++---------- .../platform/driver/electron-main/driver.ts | 10 ++++- .../platform/windows/electron-main/windows.ts | 4 +- 3 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 6b4a7ae736e..59bec7973b6 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -18,7 +18,7 @@ import { IPathWithLineAndColumn, parseLineAndColumnAware } from 'vs/code/node/pa import { ILifecycleService, UnloadReason, IWindowUnloadEvent, LifecycleService } from 'vs/platform/lifecycle/electron-main/lifecycleMain'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ILogService } from 'vs/platform/log/common/log'; -import { IWindowSettings, OpenContext, IPath, IWindowConfiguration, INativeOpenDialogOptions, IPathsToWaitFor, IEnterWorkspaceResult, IMessageBoxResult, INewWindowOptions } from 'vs/platform/windows/common/windows'; +import { IWindowSettings, OpenContext, IPath, IWindowConfiguration, INativeOpenDialogOptions, IPathsToWaitFor, IEnterWorkspaceResult, IMessageBoxResult, INewWindowOptions, OpenDialogOptions } from 'vs/platform/windows/common/windows'; import { getLastActiveWindow, findBestWindowOrFolderForFile, findWindowOnWorkspace, findWindowOnExtensionDevelopmentPath, findWindowOnWorkspaceOrFolderUri } from 'vs/code/node/windowsFinder'; import { Event as CommonEvent, Emitter } from 'vs/base/common/event'; import product from 'vs/platform/node/product'; @@ -50,7 +50,7 @@ interface INewWindowState extends ISingleWindowState { interface IWindowState { workspace?: IWorkspaceIdentifier; folderUri?: URI; - backupPath: string; + backupPath?: string; remoteAuthority?: string; uiState: ISingleWindowState; } @@ -131,7 +131,7 @@ export class WindowsManager implements IWindowsMainService { private initialUserEnv: IProcessEnvironment; private windowsState: IWindowsState; - private lastClosedWindowState: IWindowState; + private lastClosedWindowState?: IWindowState; private dialogs: Dialogs; private workspacesManager: WorkspacesManager; @@ -188,8 +188,9 @@ export class WindowsManager implements IWindowsMainService { if (windowState.folderUri) { windowState.folderUri = URI.revive(windowState.folderUri); } - if ((windowState).folderPath) { - windowState.folderUri = URI.file((windowState).folderPath); + const folderPath = (windowState as IBackwardCompatibleWindowState).folderPath; + if (folderPath) { + windowState.folderUri = URI.file(folderPath); } return windowState; } @@ -403,12 +404,12 @@ export class WindowsManager implements IWindowsMainService { // // These are windows to open to show workspaces // - const workspacesToOpen = arrays.distinct(pathsToOpen.filter(win => !!win.workspace).map(win => win.workspace), workspace => workspace.id); // prevent duplicates + const workspacesToOpen = arrays.distinct(arrays.coalesce(pathsToOpen.map(win => win.workspace)), workspace => workspace.id); // prevent duplicates // // These are windows to open to show either folders or files (including diffing files or creating them) // - const foldersToOpen = arrays.distinct(pathsToOpen.filter(win => win.folderUri && !win.fileUri).map(win => win.folderUri), folder => getComparisonKey(folder)); // prevent duplicates + const foldersToOpen = arrays.distinct(arrays.coalesce(pathsToOpen.filter(win => win.folderUri && !win.fileUri).map(win => win.folderUri)), folder => getComparisonKey(folder)); // prevent duplicates // // These are windows to restore because of hot-exit or from previous session (only performed once on startup!) @@ -423,7 +424,7 @@ export class WindowsManager implements IWindowsMainService { workspacesToRestore.push(...this.workspacesMainService.getUntitledWorkspacesSync()); // collect from previous window session emptyToRestore = this.backupMainService.getEmptyWindowBackupPaths(); - emptyToRestore.push(...pathsToOpen.filter(w => !w.workspace && !w.folderUri && w.backupPath).map(w => ({ backupFolder: basename(w.backupPath), remoteAuthority: w.remoteAuthority }))); // add empty windows with backupPath + emptyToRestore.push(...pathsToOpen.filter(w => !w.workspace && !w.folderUri && w.backupPath).map(w => ({ backupFolder: basename(w.backupPath!), remoteAuthority: w.remoteAuthority }))); // add empty windows with backupPath emptyToRestore = arrays.distinct(emptyToRestore, info => info.backupFolder); // prevent duplicates } @@ -444,9 +445,9 @@ export class WindowsManager implements IWindowsMainService { // 1.) focus last active window if we are not instructed to open any paths if (focusLastActive) { - const lastActiveWindw = usedWindows.filter(w => w.backupPath === this.windowsState.lastActiveWindow.backupPath); - if (lastActiveWindw.length) { - lastActiveWindw[0].focus(); + const lastActiveWindow = usedWindows.filter(w => w.backupPath === this.windowsState.lastActiveWindow!.backupPath); + if (lastActiveWindow.length) { + lastActiveWindow[0].focus(); focusLastOpened = false; focusLastWindow = false; } @@ -1593,7 +1594,7 @@ export class WindowsManager implements IWindowsMainService { }); } - getFocusedWindow(): ICodeWindow { + getFocusedWindow(): ICodeWindow | null { const win = BrowserWindow.getFocusedWindow(); if (win) { return this.getWindowById(win.id); @@ -1602,7 +1603,7 @@ export class WindowsManager implements IWindowsMainService { return null; } - getWindowById(windowId: number): ICodeWindow { + getWindowById(windowId: number): ICodeWindow | null { const res = WindowsManager.WINDOWS.filter(w => w.id === windowId); if (res && res.length === 1) { return res[0]; @@ -1719,9 +1720,8 @@ export class WindowsManager implements IWindowsMainService { internalOptions.pickFolders = pickFolders; internalOptions.pickFiles = pickFiles; - if (!internalOptions.dialogOptions) { - internalOptions.dialogOptions = Object.create(null); - } + const dialogOptions: OpenDialogOptions = internalOptions.dialogOptions || Object.create(null); + internalOptions.dialogOptions = dialogOptions; if (!internalOptions.dialogOptions.title) { if (pickFolders && pickFiles) { @@ -1952,13 +1952,12 @@ class Dialogs { class WorkspacesManager { constructor( - private workspacesMainService: IWorkspacesMainService, - private backupMainService: IBackupMainService, - private environmentService: IEnvironmentService, - private historyMainService: IHistoryMainService, - private windowsMainService: IWindowsMainService, - ) { - } + private readonly workspacesMainService: IWorkspacesMainService, + private readonly backupMainService: IBackupMainService, + private readonly environmentService: IEnvironmentService, + private readonly historyMainService: IHistoryMainService, + private readonly windowsMainService: IWindowsMainService, + ) { } enterWorkspace(window: ICodeWindow, path: URI): Promise { if (!window || !window.win || !window.isReady) { diff --git a/src/vs/platform/driver/electron-main/driver.ts b/src/vs/platform/driver/electron-main/driver.ts index cc6eecc1819..deab8063bb3 100644 --- a/src/vs/platform/driver/electron-main/driver.ts +++ b/src/vs/platform/driver/electron-main/driver.ts @@ -57,9 +57,11 @@ export class Driver implements IDriver, IWindowDriverRegistry { await this.whenUnfrozen(windowId); const window = this.windowsService.getWindowById(windowId); + if (!window) { + throw new Error('Invalid window'); + } const webContents = window.win.webContents; const image = await new Promise(c => webContents.capturePage(c)); - return image.toPNG().toString('base64'); } @@ -67,6 +69,9 @@ export class Driver implements IDriver, IWindowDriverRegistry { await this.whenUnfrozen(windowId); const window = this.windowsService.getWindowById(windowId); + if (!window) { + throw new Error('Invalid window'); + } this.reloadingWindowIds.add(windowId); this.windowsService.reload(window); } @@ -97,6 +102,9 @@ export class Driver implements IDriver, IWindowDriverRegistry { } const window = this.windowsService.getWindowById(windowId); + if (!window) { + throw new Error('Invalid window'); + } const webContents = window.win.webContents; const noModifiedKeybinding = new SimpleKeybinding(false, false, false, false, keybinding.keyCode); const resolvedKeybinding = new USLayoutResolvedKeybinding(noModifiedKeybinding, OS); diff --git a/src/vs/platform/windows/electron-main/windows.ts b/src/vs/platform/windows/electron-main/windows.ts index 19219a64149..d8b43f4c13b 100644 --- a/src/vs/platform/windows/electron-main/windows.ts +++ b/src/vs/platform/windows/electron-main/windows.ts @@ -112,8 +112,8 @@ export interface IWindowsMainService { openNewTabbedWindow(context: OpenContext): ICodeWindow[]; sendToFocused(channel: string, ...args: any[]): void; sendToAll(channel: string, payload: any, windowIdsToIgnore?: number[]): void; - getFocusedWindow(): ICodeWindow; - getWindowById(windowId: number): ICodeWindow; + getFocusedWindow(): ICodeWindow | null; + getWindowById(windowId: number): ICodeWindow | null; getWindows(): ICodeWindow[]; getWindowCount(): number; quit(): void; From 7842634a387b9d127ba188faabd1b69219caa72a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 15:50:53 -0800 Subject: [PATCH 351/429] Strict null supression in some test files --- .../test/common/editor/editor.test.ts | 26 +++--- .../api/extHostApiCommands.test.ts | 80 +++++++++---------- .../api/extHostConfiguration.test.ts | 52 ++++++------ .../api/extHostLanguageFeatures.test.ts | 4 +- 4 files changed, 81 insertions(+), 81 deletions(-) diff --git a/src/vs/workbench/test/common/editor/editor.test.ts b/src/vs/workbench/test/common/editor/editor.test.ts index 1e88e3763c0..35cf8cc38b9 100644 --- a/src/vs/workbench/test/common/editor/editor.test.ts +++ b/src/vs/workbench/test/common/editor/editor.test.ts @@ -32,7 +32,7 @@ class FileEditorInput extends EditorInput { return this.resource; } - resolve(): Promise { + resolve(): Promise { return Promise.resolve(null); } } @@ -55,22 +55,22 @@ suite('Workbench editor', () => { test('toResource', () => { const service = accessor.untitledEditorService; - assert.ok(!toResource(null)); + assert.ok(!toResource(null!)); const untitled = service.createOrGet(); - assert.equal(toResource(untitled).toString(), untitled.getResource().toString()); - assert.equal(toResource(untitled, { supportSideBySide: true }).toString(), untitled.getResource().toString()); - assert.equal(toResource(untitled, { filter: Schemas.untitled }).toString(), untitled.getResource().toString()); - assert.equal(toResource(untitled, { filter: [Schemas.file, Schemas.untitled] }).toString(), untitled.getResource().toString()); + assert.equal(toResource(untitled)!.toString(), untitled.getResource().toString()); + assert.equal(toResource(untitled, { supportSideBySide: true })!.toString(), untitled.getResource().toString()); + assert.equal(toResource(untitled, { filter: Schemas.untitled })!.toString(), untitled.getResource().toString()); + assert.equal(toResource(untitled, { filter: [Schemas.file, Schemas.untitled] })!.toString(), untitled.getResource().toString()); assert.ok(!toResource(untitled, { filter: Schemas.file })); const file = new FileEditorInput(URI.file('/some/path.txt')); - assert.equal(toResource(file).toString(), file.getResource().toString()); - assert.equal(toResource(file, { supportSideBySide: true }).toString(), file.getResource().toString()); - assert.equal(toResource(file, { filter: Schemas.file }).toString(), file.getResource().toString()); - assert.equal(toResource(file, { filter: [Schemas.file, Schemas.untitled] }).toString(), file.getResource().toString()); + assert.equal(toResource(file)!.toString(), file.getResource().toString()); + assert.equal(toResource(file, { supportSideBySide: true })!.toString(), file.getResource().toString()); + assert.equal(toResource(file, { filter: Schemas.file })!.toString(), file.getResource().toString()); + assert.equal(toResource(file, { filter: [Schemas.file, Schemas.untitled] })!.toString(), file.getResource().toString()); assert.ok(!toResource(file, { filter: Schemas.untitled })); const diffEditorInput = new DiffEditorInput('name', 'description', untitled, file); @@ -79,8 +79,8 @@ suite('Workbench editor', () => { assert.ok(!toResource(diffEditorInput, { filter: Schemas.file })); assert.ok(!toResource(diffEditorInput, { supportSideBySide: false })); - assert.equal(toResource(file, { supportSideBySide: true }).toString(), file.getResource().toString()); - assert.equal(toResource(file, { supportSideBySide: true, filter: Schemas.file }).toString(), file.getResource().toString()); - assert.equal(toResource(file, { supportSideBySide: true, filter: [Schemas.file, Schemas.untitled] }).toString(), file.getResource().toString()); + assert.equal(toResource(file, { supportSideBySide: true })!.toString(), file.getResource().toString()); + assert.equal(toResource(file, { supportSideBySide: true, filter: Schemas.file })!.toString(), file.getResource().toString()); + assert.equal(toResource(file, { supportSideBySide: true, filter: [Schemas.file, Schemas.untitled] })!.toString(), file.getResource().toString()); }); }); \ No newline at end of file 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 83cbe12ea65..3d51de87db9 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -423,32 +423,32 @@ suite('ExtHostLanguageFeatureCommands', function () { assert.equal(values.length, 4); let [first, second, third, fourth] = values; assert.equal(first.label, 'item1'); - assert.equal(first.textEdit.newText, 'item1'); - assert.equal(first.textEdit.range.start.line, 0); - assert.equal(first.textEdit.range.start.character, 0); - assert.equal(first.textEdit.range.end.line, 0); - assert.equal(first.textEdit.range.end.character, 4); + assert.equal(first.textEdit!.newText, 'item1'); + assert.equal(first.textEdit!.range.start.line, 0); + assert.equal(first.textEdit!.range.start.character, 0); + assert.equal(first.textEdit!.range.end.line, 0); + assert.equal(first.textEdit!.range.end.character, 4); assert.equal(second.label, 'item2'); - assert.equal(second.textEdit.newText, 'foo'); - assert.equal(second.textEdit.range.start.line, 0); - assert.equal(second.textEdit.range.start.character, 4); - assert.equal(second.textEdit.range.end.line, 0); - assert.equal(second.textEdit.range.end.character, 8); + assert.equal(second.textEdit!.newText, 'foo'); + assert.equal(second.textEdit!.range.start.line, 0); + assert.equal(second.textEdit!.range.start.character, 4); + assert.equal(second.textEdit!.range.end.line, 0); + assert.equal(second.textEdit!.range.end.character, 8); assert.equal(third.label, 'item3'); - assert.equal(third.textEdit.newText, 'foobar'); - assert.equal(third.textEdit.range.start.line, 0); - assert.equal(third.textEdit.range.start.character, 1); - assert.equal(third.textEdit.range.end.line, 0); - assert.equal(third.textEdit.range.end.character, 6); + assert.equal(third.textEdit!.newText, 'foobar'); + assert.equal(third.textEdit!.range.start.line, 0); + assert.equal(third.textEdit!.range.start.character, 1); + assert.equal(third.textEdit!.range.end.line, 0); + assert.equal(third.textEdit!.range.end.character, 6); assert.equal(fourth.label, 'item4'); assert.equal(fourth.textEdit, undefined); - assert.equal(fourth.range.start.line, 0); - assert.equal(fourth.range.start.character, 1); - assert.equal(fourth.range.end.line, 0); - assert.equal(fourth.range.end.character, 4); + assert.equal(fourth.range!.start.line, 0); + assert.equal(fourth.range!.start.character, 1); + assert.equal(fourth.range!.end.line, 0); + assert.equal(fourth.range!.end.character, 4); assert.ok(fourth.insertText instanceof types.SnippetString); assert.equal((fourth.insertText).value, 'foo$0bar'); }); @@ -631,11 +631,11 @@ suite('ExtHostLanguageFeatureCommands', function () { return rpcProtocol.sync().then(() => { return commands.executeCommand('vscode.executeCodeActionProvider', model.uri, new types.Range(0, 0, 1, 1)).then(value => { assert.equal(value.length, 1); - let [first] = value; + const [first] = value; assert.ok(first.command); - assert.equal(first.command.command, 'command'); - assert.equal(first.command.title, 'command_title'); - assert.equal(first.kind.value, 'foo'); + assert.equal(first.command!.command, 'command'); + assert.equal(first.command!.title, 'command_title'); + assert.equal(first.kind!.value, 'foo'); assert.equal(first.title, 'title'); }); @@ -661,13 +661,13 @@ suite('ExtHostLanguageFeatureCommands', function () { return rpcProtocol.sync().then(() => { return commands.executeCommand('vscode.executeCodeLensProvider', model.uri).then(value => { assert.equal(value.length, 1); - let [first] = value; + const [first] = value; - assert.equal(first.command.title, 'Title'); - assert.equal(first.command.command, 'cmd'); - assert.equal(first.command.arguments[0], 1); - assert.equal(first.command.arguments[1], true); - assert.equal(first.command.arguments[2], complexArg); + assert.equal(first.command!.title, 'Title'); + assert.equal(first.command!.command, 'cmd'); + assert.equal(first.command!.arguments[0], 1); + assert.equal(first.command!.arguments[1], true); + assert.equal(first.command!.arguments[2], complexArg); }); }); }); @@ -719,7 +719,7 @@ suite('ExtHostLanguageFeatureCommands', function () { assert.equal(value.length, 1); let [first] = value; - assert.equal(first.target.toString(), 'foo:bar'); + assert.equal(first.target + '', 'foo:bar'); assert.equal(first.range.start.line, 0); assert.equal(first.range.start.character, 0); assert.equal(first.range.end.line, 0); @@ -765,16 +765,16 @@ suite('ExtHostLanguageFeatureCommands', function () { let [first] = value; assert.equal(first.label, '#ABC'); - assert.equal(first.textEdit.newText, '#ABC'); - assert.equal(first.textEdit.range.start.line, 1); - assert.equal(first.textEdit.range.start.character, 0); - assert.equal(first.textEdit.range.end.line, 1); - assert.equal(first.textEdit.range.end.character, 20); - assert.equal(first.additionalTextEdits.length, 1); - assert.equal(first.additionalTextEdits[0].range.start.line, 2); - assert.equal(first.additionalTextEdits[0].range.start.character, 20); - assert.equal(first.additionalTextEdits[0].range.end.line, 2); - assert.equal(first.additionalTextEdits[0].range.end.character, 20); + assert.equal(first.textEdit!.newText, '#ABC'); + assert.equal(first.textEdit!.range.start.line, 1); + assert.equal(first.textEdit!.range.start.character, 0); + assert.equal(first.textEdit!.range.end.line, 1); + assert.equal(first.textEdit!.range.end.character, 20); + assert.equal(first.additionalTextEdits!.length, 1); + assert.equal(first.additionalTextEdits![0].range.start.line, 2); + assert.equal(first.additionalTextEdits![0].range.start.character, 20); + assert.equal(first.additionalTextEdits![0].range.end.line, 2); + assert.equal(first.additionalTextEdits![0].range.end.character, 20); }); }); }); diff --git a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts index 995f762f4b4..75ebe01221d 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts @@ -111,38 +111,38 @@ suite('ExtHostConfiguration', function () { }); let testObject = all.getConfiguration(); - let actual = testObject.get('farboo'); + let actual = testObject.get('farboo')!; actual['nested']['config1'] = 41; assert.equal(41, actual['nested']['config1']); actual['farboo1'] = 'newValue'; assert.equal('newValue', actual['farboo1']); testObject = all.getConfiguration(); - actual = testObject.get('farboo'); + actual = testObject.get('farboo')!; assert.equal(actual['nested']['config1'], 42); assert.equal(actual['farboo1'], undefined); testObject = all.getConfiguration(); - actual = testObject.get('farboo'); + actual = testObject.get('farboo')!; assert.equal(actual['config0'], true); actual['config0'] = false; assert.equal(actual['config0'], false); testObject = all.getConfiguration(); - actual = testObject.get('farboo'); + actual = testObject.get('farboo')!; assert.equal(actual['config0'], true); testObject = all.getConfiguration(); - actual = testObject.inspect('farboo'); + actual = testObject.inspect('farboo')!; actual['value'] = 'effectiveValue'; assert.equal('effectiveValue', actual['value']); testObject = all.getConfiguration('workbench'); - actual = testObject.get('colorCustomizations'); + actual = testObject.get('colorCustomizations')!; delete actual['statusBar.foreground']; assert.equal(actual['statusBar.foreground'], undefined); testObject = all.getConfiguration('workbench'); - actual = testObject.get('colorCustomizations'); + actual = testObject.get('colorCustomizations')!; assert.equal(actual['statusBar.foreground'], 'somevalue'); }); @@ -166,7 +166,7 @@ suite('ExtHostConfiguration', function () { } }); - let testObject = all.getConfiguration(); + const testObject = all.getConfiguration(); let actual = testObject.get('farboo'); assert.deepEqual(JSON.stringify({ 'config0': true, @@ -179,7 +179,7 @@ suite('ExtHostConfiguration', function () { assert.deepEqual(undefined, JSON.stringify(testObject.get('unknownkey'))); - actual = testObject.get('farboo'); + actual = testObject.get('farboo')!; actual['config0'] = false; assert.deepEqual(JSON.stringify({ 'config0': false, @@ -190,7 +190,7 @@ suite('ExtHostConfiguration', function () { 'config4': '' }), JSON.stringify(actual)); - actual = testObject.get('workbench')['colorCustomizations']; + actual = testObject.get('workbench')['colorCustomizations']!; actual['statusBar.background'] = 'anothervalue'; assert.deepEqual(JSON.stringify({ 'statusBar.foreground': 'somevalue', @@ -284,13 +284,13 @@ suite('ExtHostConfiguration', function () { } ); - let actual = testObject.getConfiguration().inspect('editor.wordWrap'); + let actual = testObject.getConfiguration().inspect('editor.wordWrap')!; assert.equal(actual.defaultValue, 'off'); assert.equal(actual.globalValue, 'on'); assert.equal(actual.workspaceValue, undefined); assert.equal(actual.workspaceFolderValue, undefined); - actual = testObject.getConfiguration('editor').inspect('wordWrap'); + actual = testObject.getConfiguration('editor').inspect('wordWrap')!; assert.equal(actual.defaultValue, 'off'); assert.equal(actual.globalValue, 'on'); assert.equal(actual.workspaceValue, undefined); @@ -331,25 +331,25 @@ suite('ExtHostConfiguration', function () { } ); - let actual1 = testObject.getConfiguration().inspect('editor.wordWrap'); + let actual1 = testObject.getConfiguration().inspect('editor.wordWrap')!; assert.equal(actual1.defaultValue, 'off'); assert.equal(actual1.globalValue, 'on'); assert.equal(actual1.workspaceValue, 'bounded'); assert.equal(actual1.workspaceFolderValue, undefined); - actual1 = testObject.getConfiguration('editor').inspect('wordWrap'); + actual1 = testObject.getConfiguration('editor').inspect('wordWrap')!; assert.equal(actual1.defaultValue, 'off'); assert.equal(actual1.globalValue, 'on'); assert.equal(actual1.workspaceValue, 'bounded'); assert.equal(actual1.workspaceFolderValue, undefined); - let actual2 = testObject.getConfiguration(null, workspaceUri).inspect('editor.wordWrap'); + let actual2 = testObject.getConfiguration(undefined, workspaceUri).inspect('editor.wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); assert.equal(actual2.workspaceFolderValue, 'bounded'); - actual2 = testObject.getConfiguration('editor', workspaceUri).inspect('wordWrap'); + actual2 = testObject.getConfiguration('editor', workspaceUri).inspect('wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); @@ -406,62 +406,62 @@ suite('ExtHostConfiguration', function () { } ); - let actual1 = testObject.getConfiguration().inspect('editor.wordWrap'); + let actual1 = testObject.getConfiguration().inspect('editor.wordWrap')!; assert.equal(actual1.defaultValue, 'off'); assert.equal(actual1.globalValue, 'on'); assert.equal(actual1.workspaceValue, 'bounded'); assert.equal(actual1.workspaceFolderValue, undefined); - actual1 = testObject.getConfiguration('editor').inspect('wordWrap'); + actual1 = testObject.getConfiguration('editor').inspect('wordWrap')!; assert.equal(actual1.defaultValue, 'off'); assert.equal(actual1.globalValue, 'on'); assert.equal(actual1.workspaceValue, 'bounded'); assert.equal(actual1.workspaceFolderValue, undefined); - actual1 = testObject.getConfiguration('editor').inspect('lineNumbers'); + actual1 = testObject.getConfiguration('editor').inspect('lineNumbers')!; assert.equal(actual1.defaultValue, 'on'); assert.equal(actual1.globalValue, undefined); assert.equal(actual1.workspaceValue, undefined); assert.equal(actual1.workspaceFolderValue, undefined); - let actual2 = testObject.getConfiguration(null, firstRoot).inspect('editor.wordWrap'); + let actual2 = testObject.getConfiguration(undefined, firstRoot).inspect('editor.wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); assert.equal(actual2.workspaceFolderValue, 'off'); - actual2 = testObject.getConfiguration('editor', firstRoot).inspect('wordWrap'); + actual2 = testObject.getConfiguration('editor', firstRoot).inspect('wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); assert.equal(actual2.workspaceFolderValue, 'off'); - actual2 = testObject.getConfiguration('editor', firstRoot).inspect('lineNumbers'); + actual2 = testObject.getConfiguration('editor', firstRoot).inspect('lineNumbers')!; assert.equal(actual2.defaultValue, 'on'); assert.equal(actual2.globalValue, undefined); assert.equal(actual2.workspaceValue, undefined); assert.equal(actual2.workspaceFolderValue, 'relative'); - actual2 = testObject.getConfiguration(null, secondRoot).inspect('editor.wordWrap'); + actual2 = testObject.getConfiguration(undefined, secondRoot).inspect('editor.wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); assert.equal(actual2.workspaceFolderValue, 'on'); - actual2 = testObject.getConfiguration('editor', secondRoot).inspect('wordWrap'); + actual2 = testObject.getConfiguration('editor', secondRoot).inspect('wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); assert.equal(actual2.workspaceFolderValue, 'on'); - actual2 = testObject.getConfiguration(null, thirdRoot).inspect('editor.wordWrap'); + actual2 = testObject.getConfiguration(undefined, thirdRoot).inspect('editor.wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); assert.ok(Object.keys(actual2).indexOf('workspaceFolderValue') !== -1); assert.equal(actual2.workspaceFolderValue, undefined); - actual2 = testObject.getConfiguration('editor', thirdRoot).inspect('wordWrap'); + actual2 = testObject.getConfiguration('editor', thirdRoot).inspect('wordWrap')!; assert.equal(actual2.defaultValue, 'off'); assert.equal(actual2.globalValue, 'on'); assert.equal(actual2.workspaceValue, 'bounded'); diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index 18053e12bf7..225cc4abbb5 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -499,9 +499,9 @@ suite('ExtHostLanguageFeatures', function () { })); await rpcProtocol.sync(); - let value = await getOccurrencesAtPosition(model, new EditorPosition(1, 2), CancellationToken.None); + const value = (await getOccurrencesAtPosition(model, new EditorPosition(1, 2), CancellationToken.None))!; assert.equal(value.length, 1); - let [entry] = value; + const [entry] = value; assert.deepEqual(entry.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 3 }); assert.equal(entry.kind, modes.DocumentHighlightKind.Text); }); From ffe09d3642b36f5dae20450c9c6d671484f36b6a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 15:52:26 -0800 Subject: [PATCH 352/429] Strict null work for webview --- .../electron-browser/html.contribution.ts | 4 ++-- .../html/electron-browser/htmlPreviewPart.ts | 17 ++++++++-------- .../webview/electron-browser/webviewEditor.ts | 20 ++++++++++--------- .../electron-browser/webviewEditorInput.ts | 9 ++++++--- .../electron-browser/webviewElement.ts | 4 ++-- .../electron-browser/webviewFindWidget.ts | 14 ++++++++++--- 6 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/vs/workbench/parts/html/electron-browser/html.contribution.ts b/src/vs/workbench/parts/html/electron-browser/html.contribution.ts index 73eea401555..4e4c738e8c0 100644 --- a/src/vs/workbench/parts/html/electron-browser/html.contribution.ts +++ b/src/vs/workbench/parts/html/electron-browser/html.contribution.ts @@ -23,7 +23,7 @@ function getActivePreviewsForResource(accessor: ServicesAccessor, resource: URI return accessor.get(IEditorService).visibleControls .filter(c => c instanceof HtmlPreviewPart && c.model) .map(e => e as HtmlPreviewPart) - .filter(e => e.model.uri.scheme === uri.scheme && e.model.uri.toString() === uri.toString()); + .filter(e => e.model!.uri.scheme === uri.scheme && e.model!.uri.toString() === uri.toString()); } // --- Register Editor @@ -45,7 +45,7 @@ CommandsRegistry.registerCommand('_workbench.previewHtml', function ( const uri = resource instanceof URI ? resource : URI.parse(resource); label = label || uri.fsPath; - let input: HtmlInput; + let input: HtmlInput | undefined; const editorGroupService = accessor.get(IEditorGroupsService); diff --git a/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts b/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts index 1c33d07ae78..bc5959209a4 100644 --- a/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts +++ b/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts @@ -4,7 +4,6 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { ITextModel } from 'vs/editor/common/model'; import { Disposable, IDisposable, dispose, IReference } from 'vs/base/common/lifecycle'; import { EditorOptions, EditorInput, IEditorMemento } from 'vs/workbench/common/editor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -38,8 +37,8 @@ export class HtmlPreviewPart extends BaseWebviewEditor { private _webviewDisposables: IDisposable[]; - private _modelRef: IReference; - public get model(): ITextModel { return this._modelRef && this._modelRef.object.textEditorModel; } + private _modelRef?: IReference; + public get model() { return this._modelRef ? this._modelRef.object.textEditorModel : undefined; } private _modelChangeSubscription = Disposable.None; private _themeChangeSubscription = Disposable.None; @@ -138,14 +137,14 @@ export class HtmlPreviewPart extends BaseWebviewEditor { this._themeChangeSubscription = this.themeService.onThemeChange(this.onThemeChange.bind(this)); if (this._hasValidModel()) { - this._modelChangeSubscription = this.model.onDidChangeContent(() => this.webview.contents = this.model.getLinesContent().join('\n')); - this.webview.contents = this.model.getLinesContent().join('\n'); + this._modelChangeSubscription = this.model!.onDidChangeContent(() => this.webview.contents = this.model!.getLinesContent().join('\n')); + this.webview.contents = this.model!.getLinesContent().join('\n'); } } } private _hasValidModel(): boolean { - return this._modelRef && this.model && !this.model.isDisposed(); + return !!(this._modelRef && this.model && !this.model.isDisposed()); } public layout(dimension: Dimension): void { @@ -248,10 +247,10 @@ export class HtmlPreviewPart extends BaseWebviewEditor { } private saveHTMLPreviewViewState(input: HtmlInput, editorViewState: HtmlPreviewEditorViewState): void { - this.editorMemento.saveEditorState(this.group, input, editorViewState); + this.editorMemento.saveEditorState(this.group!, input, editorViewState); } - private loadHTMLPreviewViewState(input: HtmlInput): HtmlPreviewEditorViewState { - return this.editorMemento.loadEditorState(this.group, input); + private loadHTMLPreviewViewState(input: HtmlInput): HtmlPreviewEditorViewState | undefined { + return this.editorMemento.loadEditorState(this.group!, input); } } diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts b/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts index 40896f71e7f..f5b40e19e0d 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts @@ -28,7 +28,7 @@ export class WebviewEditor extends BaseWebviewEditor { public static readonly ID = 'WebviewEditor'; private _editorFrame: HTMLElement; - private _content: HTMLElement; + private _content?: HTMLElement; private _webviewContent: HTMLElement | undefined; private _webviewFocusTrackerDisposables: IDisposable[] = []; @@ -171,8 +171,9 @@ export class WebviewEditor extends BaseWebviewEditor { if (token.isCancellationRequested) { return; } - - input.updateGroup(this.group.id); + if (this.group) { + input.updateGroup(this.group.id); + } this.updateWebview(input); }); } @@ -187,7 +188,7 @@ export class WebviewEditor extends BaseWebviewEditor { useSameOriginForRoot: false, localResourceRoots: input.options.localResourceRoots || this.getDefaultLocalResourceRoots(), extensionLocation: input.extensionLocation - }, input.options.retainContextWhenHidden); + }, !!input.options.retainContextWhenHidden); if (this._webviewContent) { this._webviewContent.style.visibility = 'visible'; @@ -198,8 +199,9 @@ export class WebviewEditor extends BaseWebviewEditor { private getDefaultLocalResourceRoots(): URI[] { const rootPaths = this._contextService.getWorkspace().folders.map(x => x.uri); - if ((this.input as WebviewEditorInput).extensionLocation) { - rootPaths.push((this.input as WebviewEditorInput).extensionLocation); + const extensionLocation = (this.input as WebviewEditorInput).extensionLocation; + if (extensionLocation) { + rootPaths.push(extensionLocation); } return rootPaths; } @@ -235,7 +237,7 @@ export class WebviewEditor extends BaseWebviewEditor { this._webview.state = input.webviewState; - this._content.setAttribute('aria-flowto', this._webviewContent.id); + this._content!.setAttribute('aria-flowto', this._webviewContent.id); this.doUpdateContainer(); } @@ -254,11 +256,11 @@ export class WebviewEditor extends BaseWebviewEditor { this._webviewFocusTrackerDisposables = dispose(this._webviewFocusTrackerDisposables); // Track focus in webview content - const webviewContentFocusTracker = DOM.trackFocus(this._webviewContent); + const webviewContentFocusTracker = DOM.trackFocus(this._webviewContent!); this._webviewFocusTrackerDisposables.push(webviewContentFocusTracker); this._webviewFocusTrackerDisposables.push(webviewContentFocusTracker.onDidFocus(() => this._onDidFocusWebview.fire())); // Track focus in webview element - this._webviewFocusTrackerDisposables.push(this._webview.onDidFocus(() => this._onDidFocusWebview.fire())); + this._webviewFocusTrackerDisposables.push(this._webview!.onDidFocus(() => this._onDidFocusWebview.fire())); } } diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts b/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts index 4da45eee721..5039c05d598 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts @@ -56,7 +56,7 @@ export class WebviewEditorInput extends EditorInput { private _html: string = ''; private _currentWebviewHtml: string = ''; public _events: WebviewEvents | undefined; - private _container: HTMLElement; + private _container?: HTMLElement; private _webview: WebviewElement | undefined; private _webviewOwner: any; private _webviewDisposables: IDisposable[] = []; @@ -139,7 +139,7 @@ export class WebviewEditorInput extends EditorInput { return this.getName(); } - public getDescription(): string { + public getDescription() { return null; } @@ -240,10 +240,13 @@ export class WebviewEditorInput extends EditorInput { return this._webview; } - public set webview(value: WebviewElement) { + public set webview(value: WebviewElement | undefined) { this._webviewDisposables = dispose(this._webviewDisposables); this._webview = value; + if (!this._webview) { + return; + } this._webview.onDidClickLink(link => { if (this._events && this._events.onDidClickLink) { diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts index d65d118c5bb..04aa723faa8 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts @@ -44,7 +44,7 @@ interface IKeydownEvent { class WebviewProtocolProvider extends Disposable { constructor( webview: Electron.WebviewTag, - private readonly _extensionLocation: URI, + private readonly _extensionLocation: URI | undefined, private readonly _getLocalResourceRoots: () => ReadonlyArray, private readonly _environmentService: IEnvironmentService, private readonly _fileService: IFileService, @@ -356,7 +356,7 @@ export class WebviewElement extends Disposable { } public mountTo(parent: HTMLElement) { - parent.appendChild(this._webviewFindWidget.getDomNode()); + parent.appendChild(this._webviewFindWidget.getDomNode()!); parent.appendChild(this._webview); } diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts b/src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts index 3c881b1ba09..deffccbdfa6 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts @@ -11,7 +11,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; export class WebviewFindWidget extends SimpleFindWidget { constructor( - private _webview: WebviewElement, + private _webview: WebviewElement | undefined, @IContextViewService contextViewService: IContextViewService, @IContextKeyService contextKeyService: IContextKeyService ) { @@ -24,6 +24,9 @@ export class WebviewFindWidget extends SimpleFindWidget { } public find(previous: boolean) { + if (!this._webview) { + return; + } const val = this.inputValue; if (val) { this._webview.find(val, { findNext: true, forward: !previous }); @@ -32,11 +35,16 @@ export class WebviewFindWidget extends SimpleFindWidget { public hide() { super.hide(); - this._webview.stopFind(true); - this._webview.focus(); + if (this._webview) { + this._webview.stopFind(true); + this._webview.focus(); + } } public onInputChanged() { + if (!this._webview) { + return; + } const val = this.inputValue; if (val) { this._webview.startFind(val); From 197a916fcb7a1af805c6d5bab697e259d35a7878 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 15:58:47 -0800 Subject: [PATCH 353/429] Fixing some strict null errors in mainThread --- .../workbench/api/electron-browser/mainThreadClipboard.ts | 2 +- .../workbench/api/electron-browser/mainThreadCommands.ts | 7 ++++--- .../workbench/api/electron-browser/mainThreadFileSystem.ts | 6 +++++- .../electron-browser/mainThreadFileSystemEventService.ts | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadClipboard.ts b/src/vs/workbench/api/electron-browser/mainThreadClipboard.ts index 6497256226e..80c0f71bf9e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadClipboard.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadClipboard.ts @@ -20,6 +20,6 @@ export class MainThreadCommands implements MainThreadClipboardShape { $writeText(value: string): Promise { clipboard.writeText(value); - return undefined; + return Promise.resolve(); } } diff --git a/src/vs/workbench/api/electron-browser/mainThreadCommands.ts b/src/vs/workbench/api/electron-browser/mainThreadCommands.ts index ebfc4171ae3..061034039c1 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadCommands.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadCommands.ts @@ -64,13 +64,14 @@ export class MainThreadCommands implements MainThreadCommandsShape { } $unregisterCommand(id: string): void { - if (this._disposables.has(id)) { - this._disposables.get(id).dispose(); + const command = this._disposables.get(id); + if (command) { + command.dispose(); this._disposables.delete(id); } } - $executeCommand(id: string, args: any[]): Promise { + $executeCommand(id: string, args: any[]): Promise { for (let i = 0; i < args.length; i++) { args[i] = revive(args[i], 0); } diff --git a/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts b/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts index caea6c69d7f..df3fac179a9 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadFileSystem.ts @@ -44,7 +44,11 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape { } $onFileSystemChange(handle: number, changes: IFileChangeDto[]): void { - this._fileProvider.get(handle).$onFileSystemChange(changes); + const fileProvider = this._fileProvider.get(handle); + if (!fileProvider) { + throw new Error('Unknown file provider'); + } + fileProvider.$onFileSystemChange(changes); } } diff --git a/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts b/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts index 2a492bf0f7a..08e4c2fd7a0 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts @@ -52,7 +52,7 @@ export class MainThreadFileSystemEventService { // file operation events - (changes the editor makes) fileService.onAfterOperation(e => { if (e.operation === FileOperation.MOVE) { - proxy.$onFileRename(e.resource, e.target.resource); + proxy.$onFileRename(e.resource, e.target.resource!); } }, undefined, this._listener); From b6087b202131fccbb431229932d7a0cdfc5d05a3 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 15:59:38 -0800 Subject: [PATCH 354/429] Fixing more strict null errros in extHost and related files --- src/vs/workbench/api/browser/viewsExtensionPoint.ts | 10 +++++----- src/vs/workbench/api/node/apiCommands.ts | 6 +++--- src/vs/workbench/api/node/extHost.protocol.ts | 2 +- src/vs/workbench/api/node/extHostConfiguration.ts | 12 ++++++------ .../api/node/extHostFileSystemEventService.ts | 2 +- src/vs/workbench/api/node/extHostMessageService.ts | 2 +- src/vs/workbench/api/node/extHostStorage.ts | 2 +- src/vs/workbench/api/node/extHostWebview.ts | 2 +- .../workbench/common/editor/textDiffEditorModel.ts | 4 ++-- src/vs/workbench/electron-browser/main.ts | 6 +++--- .../test/electron-browser/api/testRPCProtocol.ts | 8 ++++---- 11 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index fbffb5d002f..4674ec350c6 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -358,11 +358,11 @@ class ViewsExtensionHandler implements IWorkbenchContribution { return; } - let container = this.getViewContainer(entry.key); - if (!container) { + const viewContainer = this.getViewContainer(entry.key); + if (!viewContainer) { collector.warn(localize('ViewContainerDoesnotExist', "View container '{0}' does not exist and all views registered to it will be added to 'Explorer'.", entry.key)); - container = this.getDefaultViewContainer(); } + const container = viewContainer || this.getDefaultViewContainer(); const registeredViews = ViewsRegistry.getViews(container); const viewIds: string[] = []; const viewDescriptors = coalesce(entry.value.map((item, index) => { @@ -398,7 +398,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution { } private getDefaultViewContainer(): ViewContainer { - return this.viewContainersRegistry.get(EXPLORER); + return this.viewContainersRegistry.get(EXPLORER)!; } private removeViews(extensions: IExtensionPointUser[]): void { @@ -435,7 +435,7 @@ class ViewsExtensionHandler implements IWorkbenchContribution { return true; } - private getViewContainer(value: string): ViewContainer { + private getViewContainer(value: string): ViewContainer | undefined { switch (value) { case 'explorer': return this.viewContainersRegistry.get(EXPLORER); case 'debug': return this.viewContainersRegistry.get(DEBUG); diff --git a/src/vs/workbench/api/node/apiCommands.ts b/src/vs/workbench/api/node/apiCommands.ts index 0e808dbfed4..b6691b812d1 100644 --- a/src/vs/workbench/api/node/apiCommands.ts +++ b/src/vs/workbench/api/node/apiCommands.ts @@ -27,7 +27,7 @@ import { generateUuid } from 'vs/base/common/uuid'; // ----------------------------------------------------------------- export interface ICommandsExecutor { - executeCommand(id: string, ...args: any[]): Promise; + executeCommand(id: string, ...args: any[]): Promise; } function adjustHandler(handler: (executor: ICommandsExecutor, ...args: any[]) => any): ICommandHandler { @@ -84,8 +84,8 @@ CommandsRegistry.registerCommand(DiffAPICommand.ID, adjustHandler(DiffAPICommand export class OpenAPICommand { public static ID = 'vscode.open'; public static execute(executor: ICommandsExecutor, resource: URI, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions, label?: string): Promise { - let options: ITextEditorOptions; - let position: EditorViewColumn; + let options: ITextEditorOptions | undefined; + let position: EditorViewColumn | undefined; if (columnOrOptions) { if (typeof columnOrOptions === 'number') { diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 93bf62e21a9..a66f695c65c 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -102,7 +102,7 @@ export interface MainThreadClipboardShape extends IDisposable { export interface MainThreadCommandsShape extends IDisposable { $registerCommand(id: string): void; $unregisterCommand(id: string): void; - $executeCommand(id: string, args: any[]): Promise; + $executeCommand(id: string, args: any[]): Promise; $getCommands(): Promise; } diff --git a/src/vs/workbench/api/node/extHostConfiguration.ts b/src/vs/workbench/api/node/extHostConfiguration.ts index 3e73209ffbb..b65cdf1f2bf 100644 --- a/src/vs/workbench/api/node/extHostConfiguration.ts +++ b/src/vs/workbench/api/node/extHostConfiguration.ts @@ -43,7 +43,7 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { private readonly _proxy: MainThreadConfigurationShape; private readonly _extHostWorkspace: ExtHostWorkspace; private readonly _barrier: Barrier; - private _actual: ExtHostConfigProvider; + private _actual: ExtHostConfigProvider | null; constructor(proxy: MainThreadConfigurationShape, extHostWorkspace: ExtHostWorkspace) { this._proxy = proxy; @@ -53,7 +53,7 @@ export class ExtHostConfiguration implements ExtHostConfigurationShape { } public getConfigProvider(): Promise { - return this._barrier.wait().then(_ => this._actual); + return this._barrier.wait().then(_ => this._actual!); } $initializeConfiguration(data: IConfigurationInitData): void { @@ -93,14 +93,14 @@ export class ExtHostConfigProvider { getConfiguration(section?: string, resource?: URI, extensionId?: ExtensionIdentifier): vscode.WorkspaceConfiguration { const config = this._toReadonlyValue(section - ? lookUp(this._configuration.getValue(null, { resource }, this._extHostWorkspace.workspace), section) - : this._configuration.getValue(null, { resource }, this._extHostWorkspace.workspace)); + ? lookUp(this._configuration.getValue(undefined, { resource }, this._extHostWorkspace.workspace), section) + : this._configuration.getValue(undefined, { resource }, this._extHostWorkspace.workspace)); if (section) { this._validateConfigurationAccess(section, resource, extensionId); } - function parseConfigurationTarget(arg: boolean | ExtHostConfigurationTarget): ConfigurationTarget { + function parseConfigurationTarget(arg: boolean | ExtHostConfigurationTarget): ConfigurationTarget | null { if (arg === undefined || arg === null) { return null; } @@ -218,7 +218,7 @@ export class ExtHostConfigProvider { return readonlyProxy(result); } - private _validateConfigurationAccess(key: string, resource: URI, extensionId: ExtensionIdentifier): void { + private _validateConfigurationAccess(key: string, resource: URI | undefined, extensionId: ExtensionIdentifier): void { const scope = OVERRIDE_PROPERTY_PATTERN.test(key) ? ConfigurationScope.RESOURCE : this._configurationScopes[key]; const extensionIdText = extensionId ? `[${extensionId.value}] ` : ''; if (ConfigurationScope.RESOURCE === scope) { diff --git a/src/vs/workbench/api/node/extHostFileSystemEventService.ts b/src/vs/workbench/api/node/extHostFileSystemEventService.ts index c42b36dd383..f7f682b6281 100644 --- a/src/vs/workbench/api/node/extHostFileSystemEventService.ts +++ b/src/vs/workbench/api/node/extHostFileSystemEventService.ts @@ -163,7 +163,7 @@ export class ExtHostFileSystemEventService implements ExtHostFileSystemEventServ bucket.push(wrappedThenable); } }; - }).then(() => { + }).then((): any => { if (edits.length === 0) { return undefined; } diff --git a/src/vs/workbench/api/node/extHostMessageService.ts b/src/vs/workbench/api/node/extHostMessageService.ts index f24be5f48b0..ea85d1d6d99 100644 --- a/src/vs/workbench/api/node/extHostMessageService.ts +++ b/src/vs/workbench/api/node/extHostMessageService.ts @@ -42,7 +42,7 @@ export class ExtHostMessageService { commands.push({ title: command, handle, isCloseAffordance: false }); } else if (typeof command === 'object') { let { title, isCloseAffordance } = command; - commands.push({ title, isCloseAffordance, handle }); + commands.push({ title, isCloseAffordance: !!isCloseAffordance, handle }); } else { console.warn('Invalid message item:', command); } diff --git a/src/vs/workbench/api/node/extHostStorage.ts b/src/vs/workbench/api/node/extHostStorage.ts index 8925cdbb4d0..32df5a99877 100644 --- a/src/vs/workbench/api/node/extHostStorage.ts +++ b/src/vs/workbench/api/node/extHostStorage.ts @@ -23,7 +23,7 @@ export class ExtHostStorage implements ExtHostStorageShape { this._proxy = mainContext.getProxy(MainContext.MainThreadStorage); } - getValue(shared: boolean, key: string, defaultValue?: T): Promise { + getValue(shared: boolean, key: string, defaultValue?: T): Promise { return this._proxy.$getValue(shared, key).then(value => value || defaultValue); } diff --git a/src/vs/workbench/api/node/extHostWebview.ts b/src/vs/workbench/api/node/extHostWebview.ts index a39904bd0ff..0906dd92aad 100644 --- a/src/vs/workbench/api/node/extHostWebview.ts +++ b/src/vs/workbench/api/node/extHostWebview.ts @@ -80,7 +80,7 @@ export class ExtHostWebviewPanel implements vscode.WebviewPanel { private readonly _proxy: MainThreadWebviewsShape; private readonly _viewType: string; private _title: string; - private _iconPath: IconPath; + private _iconPath?: IconPath; private readonly _options: vscode.WebviewPanelOptions; private readonly _webview: ExtHostWebview; diff --git a/src/vs/workbench/common/editor/textDiffEditorModel.ts b/src/vs/workbench/common/editor/textDiffEditorModel.ts index fda5a788dd6..3b9c750f528 100644 --- a/src/vs/workbench/common/editor/textDiffEditorModel.ts +++ b/src/vs/workbench/common/editor/textDiffEditorModel.ts @@ -13,7 +13,7 @@ import { DiffEditorModel } from 'vs/workbench/common/editor/diffEditorModel'; * and the modified version. */ export class TextDiffEditorModel extends DiffEditorModel { - private _textDiffEditorModel: IDiffEditorModel; + private _textDiffEditorModel: IDiffEditorModel | null; constructor(originalModel: BaseTextEditorModel, modifiedModel: BaseTextEditorModel) { super(originalModel, modifiedModel); @@ -56,7 +56,7 @@ export class TextDiffEditorModel extends DiffEditorModel { } } - get textDiffEditorModel(): IDiffEditorModel { + get textDiffEditorModel(): IDiffEditorModel | null { return this._textDiffEditorModel; } diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 1e6333c7314..1a7ba1c6ca0 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -164,7 +164,7 @@ function createWorkspaceInitializationPayload(configuration: IWindowConfiguratio } // Single-folder workspace - let workspaceInitializationPayload: Promise = Promise.resolve(); + let workspaceInitializationPayload: Promise = Promise.resolve(); if (configuration.folderUri) { workspaceInitializationPayload = resolveSingleFolderWorkspaceInitializationPayload(configuration.folderUri); } @@ -189,7 +189,7 @@ function createWorkspaceInitializationPayload(configuration: IWindowConfiguratio }); } -function resolveSingleFolderWorkspaceInitializationPayload(folderUri: ISingleFolderWorkspaceIdentifier): Promise { +function resolveSingleFolderWorkspaceInitializationPayload(folderUri: ISingleFolderWorkspaceIdentifier): Promise { // Return early the folder is not local if (folderUri.scheme !== Schemas.file) { @@ -197,7 +197,7 @@ function resolveSingleFolderWorkspaceInitializationPayload(folderUri: ISingleFol } function computeLocalDiskFolderId(folder: uri, stat: fs.Stats): string { - let ctime: number; + let ctime: number | undefined; if (platform.isLinux) { ctime = stat.ino; // Linux: birthtime is ctime, so we cannot use it! We use the ino instead! } else if (platform.isMacintosh) { diff --git a/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts b/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts index 4bd240bee45..9e5f7c57d9e 100644 --- a/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts +++ b/src/vs/workbench/test/electron-browser/api/testRPCProtocol.ts @@ -10,23 +10,23 @@ import { isThenable } from 'vs/base/common/async'; export function SingleProxyRPCProtocol(thing: any): IExtHostContext { return { - remoteAuthority: null, + remoteAuthority: null!, getProxy(): T { return thing; }, set(identifier: ProxyIdentifier, value: R): R { return value; }, - assertRegistered: undefined + assertRegistered: undefined! }; } export class TestRPCProtocol implements IExtHostContext { - public remoteAuthority = null; + public remoteAuthority = null!; private _callCountValue: number = 0; - private _idle: Promise; + private _idle?: Promise; private _completeIdle: Function; private readonly _locals: { [id: string]: any; }; From a118203d7262210f4497c82859476503ce5c6c21 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 16:04:21 -0800 Subject: [PATCH 355/429] Remove old html post message logic This internal command has been replaced by the webview api's `postMessage` command. --- .../electron-browser/html.contribution.ts | 20 ------------------- .../webview/electron-browser/webview-pre.js | 8 ++------ .../webview/electron-browser/webviewEditor.ts | 2 -- .../electron-browser/webviewEditorInput.ts | 1 - .../electron-browser/webviewElement.ts | 3 +-- 5 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/vs/workbench/parts/html/electron-browser/html.contribution.ts b/src/vs/workbench/parts/html/electron-browser/html.contribution.ts index 4e4c738e8c0..52d81834f51 100644 --- a/src/vs/workbench/parts/html/electron-browser/html.contribution.ts +++ b/src/vs/workbench/parts/html/electron-browser/html.contribution.ts @@ -18,14 +18,6 @@ import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/commo import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; import { registerWebViewCommands } from 'vs/workbench/parts/webview/electron-browser/webview.contribution'; -function getActivePreviewsForResource(accessor: ServicesAccessor, resource: URI | string) { - const uri = resource instanceof URI ? resource : URI.parse(resource); - return accessor.get(IEditorService).visibleControls - .filter(c => c instanceof HtmlPreviewPart && c.model) - .map(e => e as HtmlPreviewPart) - .filter(e => e.model!.uri.scheme === uri.scheme && e.model!.uri.toString() === uri.toString()); -} - // --- Register Editor (Registry.as(EditorExtensions.Editors)).registerEditor(new EditorDescriptor( @@ -86,16 +78,4 @@ CommandsRegistry.registerCommand('_workbench.previewHtml', function ( .then(editor => true); }); -CommandsRegistry.registerCommand('_workbench.htmlPreview.postMessage', function ( - accessor: ServicesAccessor, - resource: URI | string, - message: any -) { - const activePreviews = getActivePreviewsForResource(accessor, resource); - for (const preview of activePreviews) { - preview.sendMessage(message); - } - return activePreviews.length > 0; -}); - registerWebViewCommands(HtmlPreviewPart.ID); \ No newline at end of file diff --git a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js index ebf0555f42f..19b27d86af7 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js +++ b/src/vs/workbench/parts/webview/electron-browser/webview-pre.js @@ -57,7 +57,6 @@ let firstLoad = true; let loadTimeout; let pendingMessages = []; - let enableWrappedPostMessage = false; let isInDevelopmentMode = false; const initData = { @@ -190,11 +189,8 @@ // update iframe-contents ipcRenderer.on('content', (_event, data) => { const options = data.options; - enableWrappedPostMessage = options && options.enableWrappedPostMessage; - if (enableWrappedPostMessage) { - registerVscodeResourceScheme(); - } + registerVscodeResourceScheme(); const text = data.contents; const newDocument = new DOMParser().parseFromString(text, 'text/html'); @@ -213,7 +209,7 @@ } // apply default script - if (enableWrappedPostMessage && options.allowScripts) { + if (options.allowScripts) { const defaultScript = newDocument.createElement('script'); defaultScript.textContent = ` const acquireVsCodeApi = (function() { diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts b/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts index f5b40e19e0d..dbf7c661978 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts @@ -184,7 +184,6 @@ export class WebviewEditor extends BaseWebviewEditor { webview.update(input.html, { allowScripts: input.options.enableScripts, allowSvgs: true, - enableWrappedPostMessage: true, useSameOriginForRoot: false, localResourceRoots: input.options.localResourceRoots || this.getDefaultLocalResourceRoots(), extensionLocation: input.extensionLocation @@ -224,7 +223,6 @@ export class WebviewEditor extends BaseWebviewEditor { this._webview = this._instantiationService.createInstance(WebviewElement, this._partService.getContainer(Parts.EDITOR_PART), { - enableWrappedPostMessage: true, useSameOriginForRoot: false, extensionLocation: input.extensionLocation }); diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts b/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts index 5039c05d598..d07c498efd5 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts @@ -208,7 +208,6 @@ export class WebviewEditorInput extends EditorInput { this._webview.options = { allowScripts: this._options.enableScripts, allowSvgs: true, - enableWrappedPostMessage: true, useSameOriginForRoot: false, localResourceRoots: this._options.localResourceRoots }; diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts index 04aa723faa8..1727708a5c2 100644 --- a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts @@ -24,7 +24,6 @@ export interface WebviewOptions { readonly allowScripts?: boolean; readonly allowSvgs?: boolean; readonly svgWhiteList?: string[]; - readonly enableWrappedPostMessage?: boolean; readonly useSameOriginForRoot?: boolean; readonly localResourceRoots?: ReadonlyArray; readonly extensionLocation?: URI; @@ -304,7 +303,7 @@ export class WebviewElement extends Disposable { this._register(addDisposableListener(this._webview, 'ipc-message', (event) => { switch (event.channel) { case 'onmessage': - if (this._options.enableWrappedPostMessage && event.args && event.args.length) { + if (event.args && event.args.length) { this._onMessage.fire(event.args[0]); } return; From c39efd9a2e380fc3ea5ef8a9998a415816be7d4f Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 16:10:48 -0800 Subject: [PATCH 356/429] Move the SignatureContext.activeSignatureHelp api out of proposed #67940 --- src/vs/vscode.d.ts | 8 ++++++++ src/vs/vscode.proposed.d.ts | 12 ------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index e68bdf1b04f..7fa1945c4b2 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -3184,6 +3184,14 @@ declare module 'vscode' { * typing a trigger character, a cursor move, or document content changes. */ readonly isRetrigger: boolean; + + /** + * The currently active [`SignatureHelp`](#SignatureHelp). + * + * The `activeSignatureHelp` has its [`SignatureHelp.activeSignature`] field updated based on + * the user arrowing through available signatures. + */ + readonly activeSignatureHelp?: SignatureHelp; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 6192f6b1bbc..7bc245848d0 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1126,18 +1126,6 @@ declare module 'vscode' { } //#endregion - //#region SignatureHelpContext active parameters - mjbvz - export interface SignatureHelpContext { - /** - * The currently active [`SignatureHelp`](#SignatureHelp). - * - * The `activeSignatureHelp` has its [`SignatureHelp.activeSignature`] field updated based on - * the user arrowing through available signatures. - */ - readonly activeSignatureHelp?: SignatureHelp; - } - //#endregion - //#region CodeAction.isPreferred - mjbvz export interface CodeAction { /** From 476d7fe0abd3c680eb642856911f86ada26aa087 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 16:56:45 -0800 Subject: [PATCH 357/429] Refactor markdown contributions Reducing code duplication and reducing state --- .../src/features/preview.ts | 22 +-- .../src/features/previewContentProvider.ts | 8 +- .../src/features/previewManager.ts | 4 +- .../src/markdownEngine.ts | 6 +- .../src/markdownExtensions.ts | 169 +++++++++--------- .../src/test/engine.ts | 10 +- 6 files changed, 112 insertions(+), 107 deletions(-) diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index c82cee6c7d7..4c0d0911296 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -13,7 +13,7 @@ import { disposeAll } from '../util/dispose'; import * as nls from 'vscode-nls'; import { getVisibleLine, MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor'; import { MarkdownPreviewConfigurationManager } from './previewConfig'; -import { MarkdownContributions } from '../markdownExtensions'; +import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions'; import { isMarkdownFile } from '../util/file'; import { resolveLinkToMarkdownFile } from '../commands/openDocumentLink'; const localize = nls.loadMessageBundle(); @@ -85,7 +85,7 @@ export class MarkdownPreview { previewConfigurations: MarkdownPreviewConfigurationManager, logger: Logger, topmostLineMonitor: MarkdownFileTopmostLineMonitor, - contributions: MarkdownContributions, + contributionProvider: MarkdownContributionProvider, ): Promise { const resource = vscode.Uri.parse(state.resource); const locked = state.locked; @@ -99,9 +99,9 @@ export class MarkdownPreview { previewConfigurations, logger, topmostLineMonitor, - contributions); + contributionProvider); - preview.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, contributions); + preview.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, contributionProvider.contributions); if (!isNaN(line)) { preview.line = line; @@ -118,14 +118,14 @@ export class MarkdownPreview { previewConfigurations: MarkdownPreviewConfigurationManager, logger: Logger, topmostLineMonitor: MarkdownFileTopmostLineMonitor, - contributions: MarkdownContributions + contributionProvider: MarkdownContributionProvider ): MarkdownPreview { const webview = vscode.window.createWebviewPanel( MarkdownPreview.viewType, MarkdownPreview.getPreviewTitle(resource, locked), previewColumn, { enableFindWidget: true, - ...MarkdownPreview.getWebviewOptions(resource, contributions) + ...MarkdownPreview.getWebviewOptions(resource, contributionProvider.contributions) }); return new MarkdownPreview( @@ -136,7 +136,7 @@ export class MarkdownPreview { previewConfigurations, logger, topmostLineMonitor, - contributions); + contributionProvider); } private constructor( @@ -147,7 +147,7 @@ export class MarkdownPreview { private readonly _previewConfigurations: MarkdownPreviewConfigurationManager, private readonly _logger: Logger, topmostLineMonitor: MarkdownFileTopmostLineMonitor, - private readonly _contributions: MarkdownContributions, + private readonly _contributionProvider: MarkdownContributionProvider, ) { this._resource = resource; this._locked = locked; @@ -328,7 +328,7 @@ export class MarkdownPreview { } private get iconPath() { - const root = path.join(this._contributions.extensionPath, 'media'); + const root = path.join(this._contributionProvider.extensionPath, 'media'); return { light: vscode.Uri.file(path.join(root, 'Preview.svg')), dark: vscode.Uri.file(path.join(root, 'Preview_inverse.svg')) @@ -392,7 +392,7 @@ export class MarkdownPreview { if (this._resource === resource) { this.editor.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked); this.editor.iconPath = this.iconPath; - this.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, this._contributions); + this.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, this._contributionProvider.contributions); this.editor.webview.html = content; } } @@ -410,7 +410,7 @@ export class MarkdownPreview { private static getLocalResourceRoots( resource: vscode.Uri, contributions: MarkdownContributions - ): vscode.Uri[] { + ): ReadonlyArray { const baseRoots = contributions.previewResourceRoots; const folder = vscode.workspace.getWorkspaceFolder(resource); diff --git a/extensions/markdown-language-features/src/features/previewContentProvider.ts b/extensions/markdown-language-features/src/features/previewContentProvider.ts index c5efa00ac3c..88e9cea04f9 100644 --- a/extensions/markdown-language-features/src/features/previewContentProvider.ts +++ b/extensions/markdown-language-features/src/features/previewContentProvider.ts @@ -13,7 +13,7 @@ const localize = nls.loadMessageBundle(); import { Logger } from '../logger'; import { ContentSecurityPolicyArbiter, MarkdownPreviewSecurityLevel } from '../security'; import { MarkdownPreviewConfigurationManager, MarkdownPreviewConfiguration } from './previewConfig'; -import { MarkdownContributions } from '../markdownExtensions'; +import { MarkdownContributionProvider } from '../markdownExtensions'; /** * Strings used inside the markdown preview. @@ -40,7 +40,7 @@ export class MarkdownContentProvider { private readonly engine: MarkdownEngine, private readonly context: vscode.ExtensionContext, private readonly cspArbiter: ContentSecurityPolicyArbiter, - private readonly contributions: MarkdownContributions, + private readonly contributionProvider: MarkdownContributionProvider, private readonly logger: Logger ) { } @@ -163,7 +163,7 @@ export class MarkdownContentProvider { } private getStyles(resource: vscode.Uri, nonce: string, config: MarkdownPreviewConfiguration, state?: any): string { - const baseStyles = this.contributions.previewStyles + const baseStyles = this.contributionProvider.contributions.previewStyles .map(resource => ``) .join('\n'); @@ -174,7 +174,7 @@ export class MarkdownContentProvider { } private getScripts(nonce: string): string { - return this.contributions.previewScripts + return this.contributionProvider.contributions.previewScripts .map(resource => ``) .join('\n'); } diff --git a/extensions/markdown-language-features/src/features/previewManager.ts b/extensions/markdown-language-features/src/features/previewManager.ts index 15e414f762e..aed62942826 100644 --- a/extensions/markdown-language-features/src/features/previewManager.ts +++ b/extensions/markdown-language-features/src/features/previewManager.ts @@ -5,7 +5,7 @@ import * as vscode from 'vscode'; import { Logger } from '../logger'; -import { MarkdownContributions } from '../markdownExtensions'; +import { MarkdownContributionProvider } from '../markdownExtensions'; import { disposeAll } from '../util/dispose'; import { MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor'; import { MarkdownPreview, PreviewSettings } from './preview'; @@ -25,7 +25,7 @@ export class MarkdownPreviewManager implements vscode.WebviewPanelSerializer { public constructor( private readonly _contentProvider: MarkdownContentProvider, private readonly _logger: Logger, - private readonly _contributions: MarkdownContributions + private readonly _contributions: MarkdownContributionProvider ) { this._disposables.push(vscode.window.registerWebviewPanelSerializer(MarkdownPreview.viewType, this)); } diff --git a/extensions/markdown-language-features/src/markdownEngine.ts b/extensions/markdown-language-features/src/markdownEngine.ts index 25ac8f33b09..090c8ab0da4 100644 --- a/extensions/markdown-language-features/src/markdownEngine.ts +++ b/extensions/markdown-language-features/src/markdownEngine.ts @@ -7,7 +7,7 @@ import * as crypto from 'crypto'; import { MarkdownIt, Token } from 'markdown-it'; import * as path from 'path'; import * as vscode from 'vscode'; -import { MarkdownContributions } from './markdownExtensions'; +import { MarkdownContributionProvider as MarkdownContributionProvider } from './markdownExtensions'; import { Slugifier } from './slugify'; import { SkinnyTextDocument } from './tableOfContentsProvider'; import { getUriForLinkWithKnownExternalScheme } from './util/links'; @@ -57,7 +57,7 @@ export class MarkdownEngine { private _tokenCache = new TokenCache(); public constructor( - private readonly extensionPreviewResourceProvider: MarkdownContributions, + private readonly contributionProvider: MarkdownContributionProvider, private readonly slugifier: Slugifier, ) { } @@ -66,7 +66,7 @@ export class MarkdownEngine { this.md = import('markdown-it').then(async markdownIt => { let md: MarkdownIt = markdownIt(await getMarkdownOptions(() => md)); - for (const plugin of this.extensionPreviewResourceProvider.markdownItPlugins) { + for (const plugin of this.contributionProvider.contributions.markdownItPlugins) { try { md = (await plugin)(md); } catch { diff --git a/extensions/markdown-language-features/src/markdownExtensions.ts b/extensions/markdown-language-features/src/markdownExtensions.ts index 55c8d76e7a4..4ca972f5c70 100644 --- a/extensions/markdown-language-features/src/markdownExtensions.ts +++ b/extensions/markdown-language-features/src/markdownExtensions.ts @@ -26,96 +26,105 @@ const resolveExtensionResources = (extension: vscode.Extension, resourcePat }; export interface MarkdownContributions { - readonly extensionPath: string; - readonly previewScripts: vscode.Uri[]; - readonly previewStyles: vscode.Uri[]; - readonly markdownItPlugins: Thenable<(md: any) => any>[]; - readonly previewResourceRoots: vscode.Uri[]; + readonly previewScripts: ReadonlyArray; + readonly previewStyles: ReadonlyArray; + readonly previewResourceRoots: ReadonlyArray; + readonly markdownItPlugins: ReadonlyArray any>>; } -class MarkdownExtensionContributions implements MarkdownContributions { - private readonly _scripts: vscode.Uri[] = []; - private readonly _styles: vscode.Uri[] = []; - private readonly _previewResourceRoots: vscode.Uri[] = []; - private readonly _plugins: Thenable<(md: any) => any>[] = []; +export namespace MarkdownContributions { + export const Empty: MarkdownContributions = { + previewScripts: [], + previewStyles: [], + previewResourceRoots: [], + markdownItPlugins: [] + }; - private _loaded = false; + export function merge(a: MarkdownContributions, b: MarkdownContributions): MarkdownContributions { + return { + previewScripts: [...a.previewScripts, ...b.previewScripts], + previewStyles: [...a.previewStyles, ...b.previewStyles], + previewResourceRoots: [...a.previewResourceRoots, ...b.previewResourceRoots], + markdownItPlugins: [...a.markdownItPlugins, ...b.markdownItPlugins], + }; + } + + export function fromExtension( + extension: vscode.Extension + ): MarkdownContributions { + const contributes = extension.packageJSON && extension.packageJSON.contributes; + if (!contributes) { + return MarkdownContributions.Empty; + } + + const styles = tryLoadPreviewStyles(contributes, extension); + const scripts = tryLoadPreviewScripts(contributes, extension); + const previewResourceRoots: vscode.Uri[] = []; + if (styles.length || scripts.length) { + previewResourceRoots.push(vscode.Uri.file(extension.extensionPath)); + } + + const plugins = tryLoadMarkdownItPlugins(contributes, extension); + return { + previewScripts: scripts, + previewStyles: styles, + previewResourceRoots, + markdownItPlugins: plugins ? [plugins] : [] + }; + } + + function tryLoadMarkdownItPlugins( + contributes: any, + extension: vscode.Extension + ): Thenable<(md: any) => any> | undefined { + if (contributes['markdown.markdownItPlugins']) { + return extension.activate().then(() => { + if (extension.exports && extension.exports.extendMarkdownIt) { + return (md: any) => extension.exports.extendMarkdownIt(md); + } + return (md: any) => md; + }); + } + return undefined; + } + + function tryLoadPreviewScripts( + contributes: any, + extension: vscode.Extension + ) { + return resolveExtensionResources(extension, contributes['markdown.previewScripts']); + } + + function tryLoadPreviewStyles( + contributes: any, + extension: vscode.Extension + ) { + return resolveExtensionResources(extension, contributes['markdown.previewStyles']); + } +} + +export interface MarkdownContributionProvider { + readonly extensionPath: string; + readonly contributions: MarkdownContributions; +} + +class VSCodeExtensionMarkdownContributionProvider implements MarkdownContributionProvider { + private _contributions?: MarkdownContributions; public constructor( public readonly extensionPath: string, ) { } - public get previewScripts(): vscode.Uri[] { - this.ensureLoaded(); - return this._scripts; - } - - public get previewStyles(): vscode.Uri[] { - this.ensureLoaded(); - return this._styles; - } - - public get previewResourceRoots(): vscode.Uri[] { - this.ensureLoaded(); - return this._previewResourceRoots; - } - - public get markdownItPlugins(): Thenable<(md: any) => any>[] { - this.ensureLoaded(); - return this._plugins; - } - - private ensureLoaded() { - if (this._loaded) { - return; + public get contributions(): MarkdownContributions { + if (!this._contributions) { + this._contributions = vscode.extensions.all.reduce( + (contributions, extension) => MarkdownContributions.merge(contributions, MarkdownContributions.fromExtension(extension)), + MarkdownContributions.Empty); } - - this._loaded = true; - for (const extension of vscode.extensions.all) { - const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (!contributes) { - continue; - } - - this.tryLoadPreviewStyles(contributes, extension); - this.tryLoadPreviewScripts(contributes, extension); - this.tryLoadMarkdownItPlugins(contributes, extension); - - if (contributes['markdown.previewScripts'] || contributes['markdown.previewStyles']) { - this._previewResourceRoots.push(vscode.Uri.file(extension.extensionPath)); - } - } - } - - private tryLoadMarkdownItPlugins( - contributes: any, - extension: vscode.Extension - ) { - if (contributes['markdown.markdownItPlugins']) { - this._plugins.push(extension.activate().then(() => { - if (extension.exports && extension.exports.extendMarkdownIt) { - return (md: any) => extension.exports.extendMarkdownIt(md); - } - return (md: any) => md; - })); - } - } - - private tryLoadPreviewScripts( - contributes: any, - extension: vscode.Extension - ) { - this._scripts.push(...resolveExtensionResources(extension, contributes['markdown.previewScripts'])); - } - - private tryLoadPreviewStyles( - contributes: any, - extension: vscode.Extension - ) { - this._styles.push(...resolveExtensionResources(extension, contributes['markdown.previewStyles'])); + return this._contributions; } } -export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownContributions { - return new MarkdownExtensionContributions(context.extensionPath); +export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownContributionProvider { + return new VSCodeExtensionMarkdownContributionProvider(context.extensionPath); } \ No newline at end of file diff --git a/extensions/markdown-language-features/src/test/engine.ts b/extensions/markdown-language-features/src/test/engine.ts index a1834e057a2..1a674c8a509 100644 --- a/extensions/markdown-language-features/src/test/engine.ts +++ b/extensions/markdown-language-features/src/test/engine.ts @@ -3,17 +3,13 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; import { MarkdownEngine } from '../markdownEngine'; -import { MarkdownContributions } from '../markdownExtensions'; +import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions'; import { githubSlugifier } from '../slugify'; -const emptyContributions = new class implements MarkdownContributions { +const emptyContributions = new class implements MarkdownContributionProvider { readonly extensionPath = ''; - readonly previewScripts: vscode.Uri[] = []; - readonly previewStyles: vscode.Uri[] = []; - readonly previewResourceRoots: vscode.Uri[] = []; - readonly markdownItPlugins: Promise<(md: any) => any>[] = []; + readonly contributions = MarkdownContributions.Empty; }; export function createNewMarkdownEngine(): MarkdownEngine { From 68df4365cea420f7c391782bbdd4d834b6156c52 Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Tue, 5 Feb 2019 17:03:28 -0800 Subject: [PATCH 358/429] adding telemtetry to detect machine id guids (#67955) * adding telemtetry to detect machine id guids * better condition * stricter * fix for regex --- src/vs/platform/telemetry/common/telemetryService.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index 7f300844819..3ed960f6a6b 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -61,6 +61,17 @@ export class TelemetryService implements ITelemetryService { */ this.publicLog('optInStatus', { optIn: this._userOptIn }); } + + this._commonProperties.then(values => { + const isHashedId = /^[a-f0-9]+$/i.test(values['common.machineId']); + + /* __GDPR__ + "machineIdFallback" : { + "usingFallbackGuid" : { "classification": "SystemMetaData", "purpose": "BusinessInsight", "isMeasurement": true } + } + */ + this.publicLog('machineIdFallback', { usingFallbackGuid: !isHashedId }); + }); } private _updateUserOptIn(): void { From 8f10101dd42298e42e9de40b2c0f8d0da8c46c2d Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 17:08:57 -0800 Subject: [PATCH 359/429] Create base class for disposable objects --- .../src/features/preview.ts | 25 +++++++------ .../src/features/workspaceSymbolProvider.ts | 35 ++++++------------- .../src/util/dispose.ts | 26 ++++++++++++++ 3 files changed, 48 insertions(+), 38 deletions(-) diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 4c0d0911296..4ecef4ac7b6 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -8,7 +8,7 @@ import * as path from 'path'; import { Logger } from '../logger'; import { MarkdownContentProvider } from './previewContentProvider'; -import { disposeAll } from '../util/dispose'; +import { Disposable } from '../util/dispose'; import * as nls from 'vscode-nls'; import { getVisibleLine, MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor'; @@ -60,7 +60,7 @@ interface PreviewStyleLoadErrorMessage extends WebviewMessage { }; } -export class MarkdownPreview { +export class MarkdownPreview extends Disposable { public static viewType = 'markdown.preview'; @@ -70,7 +70,6 @@ export class MarkdownPreview { private readonly editor: vscode.WebviewPanel; private throttleTimer: any; private line: number | undefined = undefined; - private readonly disposables: vscode.Disposable[] = []; private firstUpdate = true; private currentVersion?: { resource: vscode.Uri, version: number }; private forceUpdate = false; @@ -149,17 +148,18 @@ export class MarkdownPreview { topmostLineMonitor: MarkdownFileTopmostLineMonitor, private readonly _contributionProvider: MarkdownContributionProvider, ) { + super(); this._resource = resource; this._locked = locked; this.editor = webview; this.editor.onDidDispose(() => { this.dispose(); - }, null, this.disposables); + }, null, this._disposables); this.editor.onDidChangeViewState(e => { this._onDidChangeViewStateEmitter.fire(e); - }, null, this.disposables); + }, null, this._disposables); this.editor.webview.onDidReceiveMessage((e: CacheImageSizesMessage | RevealLineMessage | DidClickMessage | ClickLinkMessage | ShowPreviewSecuritySelectorMessage | PreviewStyleLoadErrorMessage) => { if (e.source !== this._resource.toString()) { @@ -191,19 +191,19 @@ export class MarkdownPreview { vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'markdown.styles': {0}", e.body.unloadedStyles.join(', '))); break; } - }, null, this.disposables); + }, null, this._disposables); vscode.workspace.onDidChangeTextDocument(event => { if (this.isPreviewOf(event.document.uri)) { this.refresh(); } - }, null, this.disposables); + }, null, this._disposables); topmostLineMonitor.onDidChangeTopmostLine(event => { if (this.isPreviewOf(event.resource)) { this.updateForView(event.resource, event.line); } - }, null, this.disposables); + }, null, this._disposables); vscode.window.onDidChangeTextEditorSelection(event => { if (this.isPreviewOf(event.textEditor.document.uri)) { @@ -213,13 +213,13 @@ export class MarkdownPreview { source: this.resource.toString() }); } - }, null, this.disposables); + }, null, this._disposables); vscode.window.onDidChangeActiveTextEditor(editor => { if (editor && isMarkdownFile(editor.document) && !this._locked) { this.update(editor.document.uri); } - }, null, this.disposables); + }, null, this._disposables); } private readonly _onDisposeEmitter = new vscode.EventEmitter(); @@ -242,18 +242,17 @@ export class MarkdownPreview { } public dispose() { + super.dispose(); if (this._disposed) { return; } this._disposed = true; this._onDisposeEmitter.fire(); - this._onDisposeEmitter.dispose(); + this._onDidChangeViewStateEmitter.dispose(); this.editor.dispose(); - - disposeAll(this.disposables); } public update(resource: vscode.Uri) { diff --git a/extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts b/extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts index 12e51c75d76..73e04269fce 100644 --- a/extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts +++ b/extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; -import { disposeAll } from '../util/dispose'; +import { Disposable } from '../util/dispose'; import { isMarkdownFile } from '../util/file'; import { Lazy, lazy } from '../util/lazy'; import MDDocumentSymbolProvider from './documentSymbolProvider'; @@ -18,25 +18,13 @@ export interface WorkspaceMarkdownDocumentProvider { readonly onDidDeleteMarkdownDocument: vscode.Event; } -class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocumentProvider { +class VSCodeWorkspaceMarkdownDocumentProvider extends Disposable implements WorkspaceMarkdownDocumentProvider { - private readonly _onDidChangeMarkdownDocumentEmitter = new vscode.EventEmitter(); - private readonly _onDidCreateMarkdownDocumentEmitter = new vscode.EventEmitter(); - private readonly _onDidDeleteMarkdownDocumentEmitter = new vscode.EventEmitter(); + private readonly _onDidChangeMarkdownDocumentEmitter = this._register(new vscode.EventEmitter()); + private readonly _onDidCreateMarkdownDocumentEmitter = this._register(new vscode.EventEmitter()); + private readonly _onDidDeleteMarkdownDocumentEmitter = this._register(new vscode.EventEmitter()); private _watcher: vscode.FileSystemWatcher | undefined; - private _disposables: vscode.Disposable[] = []; - - public dispose() { - this._onDidChangeMarkdownDocumentEmitter.dispose(); - this._onDidDeleteMarkdownDocumentEmitter.dispose(); - - if (this._watcher) { - this._watcher.dispose(); - } - - disposeAll(this._disposables); - } async getAllMarkdownDocuments() { const resources = await vscode.workspace.findFiles('**/*.md', '**/node_modules/**'); @@ -64,7 +52,7 @@ class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocume return; } - this._watcher = vscode.workspace.createFileSystemWatcher('**/*.md'); + this._watcher = this._register(vscode.workspace.createFileSystemWatcher('**/*.md')); this._watcher.onDidChange(async resource => { const document = await this.getMarkdownDocument(resource); @@ -98,15 +86,16 @@ class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocume } -export default class MarkdownWorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider { +export default class MarkdownWorkspaceSymbolProvider extends Disposable implements vscode.WorkspaceSymbolProvider { private _symbolCache = new Map>>(); private _symbolCachePopulated: boolean = false; - private _disposables: vscode.Disposable[] = []; public constructor( private _symbolProvider: MDDocumentSymbolProvider, private _workspaceMarkdownDocumentProvider: WorkspaceMarkdownDocumentProvider = new VSCodeWorkspaceMarkdownDocumentProvider() - ) { } + ) { + super(); + } public async provideWorkspaceSymbols(query: string): Promise { if (!this._symbolCachePopulated) { @@ -130,10 +119,6 @@ export default class MarkdownWorkspaceSymbolProvider implements vscode.Workspace } } - public dispose(): void { - disposeAll(this._disposables); - } - private getSymbols(document: SkinnyTextDocument): Lazy> { return lazy(async () => { return this._symbolProvider.provideDocumentSymbolInformation(document); diff --git a/extensions/markdown-language-features/src/util/dispose.ts b/extensions/markdown-language-features/src/util/dispose.ts index 19b3b3f4f19..548094c28e5 100644 --- a/extensions/markdown-language-features/src/util/dispose.ts +++ b/extensions/markdown-language-features/src/util/dispose.ts @@ -14,3 +14,29 @@ export function disposeAll(disposables: vscode.Disposable[]) { } } +export abstract class Disposable { + private _isDisposed = false; + + protected _disposables: vscode.Disposable[] = []; + + public dispose(): any { + if (this._isDisposed) { + return; + } + this._isDisposed = true; + disposeAll(this._disposables); + } + + protected _register(value: T): T { + if (this._isDisposed) { + value.dispose(); + } else { + this._disposables.push(value); + } + return value; + } + + protected get isDisposed() { + return this._isDisposed; + } +} \ No newline at end of file From 038e8d39046fd93923785f9bcfe9d8073fe6a4f1 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 17:44:57 -0800 Subject: [PATCH 360/429] Make markdown extension points dynamic For #67574 Blocked by #67958 --- .../src/features/preview.ts | 4 ++ .../src/markdownEngine.ts | 9 +++- .../src/markdownExtensions.ts | 50 +++++++++++++++---- .../src/test/engine.ts | 2 + .../src/util/arrays.ts | 18 +++++++ 5 files changed, 72 insertions(+), 11 deletions(-) create mode 100644 extensions/markdown-language-features/src/util/arrays.ts diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index 4ecef4ac7b6..d9bcd0bb00d 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -161,6 +161,10 @@ export class MarkdownPreview extends Disposable { this._onDidChangeViewStateEmitter.fire(e); }, null, this._disposables); + _contributionProvider.onContributionsChanged(() => { + setImmediate(() => this.refresh()); + }, null, this._disposables); + this.editor.webview.onDidReceiveMessage((e: CacheImageSizesMessage | RevealLineMessage | DidClickMessage | ClickLinkMessage | ShowPreviewSecuritySelectorMessage | PreviewStyleLoadErrorMessage) => { if (e.source !== this._resource.toString()) { return; diff --git a/extensions/markdown-language-features/src/markdownEngine.ts b/extensions/markdown-language-features/src/markdownEngine.ts index 090c8ab0da4..c26eb4834b8 100644 --- a/extensions/markdown-language-features/src/markdownEngine.ts +++ b/extensions/markdown-language-features/src/markdownEngine.ts @@ -59,14 +59,19 @@ export class MarkdownEngine { public constructor( private readonly contributionProvider: MarkdownContributionProvider, private readonly slugifier: Slugifier, - ) { } + ) { + contributionProvider.onContributionsChanged(() => { + // Markdown plugin contributions may have changed + this.md = undefined; + }); + } private async getEngine(config: MarkdownItConfig): Promise { if (!this.md) { this.md = import('markdown-it').then(async markdownIt => { let md: MarkdownIt = markdownIt(await getMarkdownOptions(() => md)); - for (const plugin of this.contributionProvider.contributions.markdownItPlugins) { + for (const plugin of this.contributionProvider.contributions.markdownItPlugins.values()) { try { md = (await plugin)(md); } catch { diff --git a/extensions/markdown-language-features/src/markdownExtensions.ts b/extensions/markdown-language-features/src/markdownExtensions.ts index 4ca972f5c70..567ee946b9d 100644 --- a/extensions/markdown-language-features/src/markdownExtensions.ts +++ b/extensions/markdown-language-features/src/markdownExtensions.ts @@ -5,6 +5,8 @@ import * as vscode from 'vscode'; import * as path from 'path'; +import { Disposable } from './util/dispose'; +import * as arrays from './util/arrays'; const resolveExtensionResource = (extension: vscode.Extension, resourcePath: string): vscode.Uri => { return vscode.Uri.file(path.join(extension.extensionPath, resourcePath)) @@ -29,7 +31,7 @@ export interface MarkdownContributions { readonly previewScripts: ReadonlyArray; readonly previewStyles: ReadonlyArray; readonly previewResourceRoots: ReadonlyArray; - readonly markdownItPlugins: ReadonlyArray any>>; + readonly markdownItPlugins: Map any>>; } export namespace MarkdownContributions { @@ -37,7 +39,7 @@ export namespace MarkdownContributions { previewScripts: [], previewStyles: [], previewResourceRoots: [], - markdownItPlugins: [] + markdownItPlugins: new Map() }; export function merge(a: MarkdownContributions, b: MarkdownContributions): MarkdownContributions { @@ -45,10 +47,21 @@ export namespace MarkdownContributions { previewScripts: [...a.previewScripts, ...b.previewScripts], previewStyles: [...a.previewStyles, ...b.previewStyles], previewResourceRoots: [...a.previewResourceRoots, ...b.previewResourceRoots], - markdownItPlugins: [...a.markdownItPlugins, ...b.markdownItPlugins], + markdownItPlugins: new Map([...a.markdownItPlugins.entries(), ...b.markdownItPlugins.entries()]), }; } + function uriEqual(a: vscode.Uri, b: vscode.Uri): boolean { + return a.toString() === b.toString(); + } + + export function equal(a: MarkdownContributions, b: MarkdownContributions): boolean { + return arrays.equals(a.previewScripts, b.previewScripts, uriEqual) + && arrays.equals(a.previewStyles, b.previewStyles, uriEqual) + && arrays.equals(a.previewResourceRoots, b.previewResourceRoots, uriEqual) + && arrays.equals(Array.from(a.markdownItPlugins.keys()), Array.from(b.markdownItPlugins.keys())); + } + export function fromExtension( extension: vscode.Extension ): MarkdownContributions { @@ -69,7 +82,7 @@ export namespace MarkdownContributions { previewScripts: scripts, previewStyles: styles, previewResourceRoots, - markdownItPlugins: plugins ? [plugins] : [] + markdownItPlugins: plugins ? new Map([[extension.id, plugins]]) : new Map() }; } @@ -106,23 +119,42 @@ export namespace MarkdownContributions { export interface MarkdownContributionProvider { readonly extensionPath: string; readonly contributions: MarkdownContributions; + readonly onContributionsChanged: vscode.Event; } -class VSCodeExtensionMarkdownContributionProvider implements MarkdownContributionProvider { +class VSCodeExtensionMarkdownContributionProvider extends Disposable implements MarkdownContributionProvider { private _contributions?: MarkdownContributions; public constructor( public readonly extensionPath: string, - ) { } + ) { + super(); + + vscode.extensions.onDidChange(() => { + const currentContributions = this.getCurrentContributions(); + const existingContributions = this._contributions || MarkdownContributions.Empty; + if (!MarkdownContributions.equal(existingContributions, currentContributions)) { + this._contributions = currentContributions; + this._onContributionsChanged.fire(this); + } + }, undefined, this._disposables); + } + + private readonly _onContributionsChanged = new vscode.EventEmitter(); + public readonly onContributionsChanged = this._onContributionsChanged.event; public get contributions(): MarkdownContributions { if (!this._contributions) { - this._contributions = vscode.extensions.all.reduce( - (contributions, extension) => MarkdownContributions.merge(contributions, MarkdownContributions.fromExtension(extension)), - MarkdownContributions.Empty); + this._contributions = this.getCurrentContributions(); } return this._contributions; } + + private getCurrentContributions(): MarkdownContributions { + return vscode.extensions.all + .map(MarkdownContributions.fromExtension) + .reduce(MarkdownContributions.merge, MarkdownContributions.Empty); + } } export function getMarkdownExtensionContributions(context: vscode.ExtensionContext): MarkdownContributionProvider { diff --git a/extensions/markdown-language-features/src/test/engine.ts b/extensions/markdown-language-features/src/test/engine.ts index 1a674c8a509..fef334b4cf5 100644 --- a/extensions/markdown-language-features/src/test/engine.ts +++ b/extensions/markdown-language-features/src/test/engine.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ +import * as vscode from 'vscode'; import { MarkdownEngine } from '../markdownEngine'; import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions'; import { githubSlugifier } from '../slugify'; @@ -10,6 +11,7 @@ import { githubSlugifier } from '../slugify'; const emptyContributions = new class implements MarkdownContributionProvider { readonly extensionPath = ''; readonly contributions = MarkdownContributions.Empty; + readonly onContributionsChanged = new vscode.EventEmitter().event; }; export function createNewMarkdownEngine(): MarkdownEngine { diff --git a/extensions/markdown-language-features/src/util/arrays.ts b/extensions/markdown-language-features/src/util/arrays.ts new file mode 100644 index 00000000000..10599259901 --- /dev/null +++ b/extensions/markdown-language-features/src/util/arrays.ts @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +export function equals(one: ReadonlyArray, other: ReadonlyArray, itemEquals: (a: T, b: T) => boolean = (a, b) => a === b): boolean { + if (one.length !== other.length) { + return false; + } + + for (let i = 0, len = one.length; i < len; i++) { + if (!itemEquals(one[i], other[i])) { + return false; + } + } + + return true; +} From 97680b78e4f246601d52836c04704608fae2a148 Mon Sep 17 00:00:00 2001 From: SteVen Batten Date: Tue, 5 Feb 2019 18:53:23 -0800 Subject: [PATCH 361/429] fixes unit tests --- .../telemetry/common/telemetryService.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vs/platform/telemetry/common/telemetryService.ts b/src/vs/platform/telemetry/common/telemetryService.ts index 3ed960f6a6b..87e94be9834 100644 --- a/src/vs/platform/telemetry/common/telemetryService.ts +++ b/src/vs/platform/telemetry/common/telemetryService.ts @@ -60,18 +60,18 @@ export class TelemetryService implements ITelemetryService { } */ this.publicLog('optInStatus', { optIn: this._userOptIn }); + + this._commonProperties.then(values => { + const isHashedId = /^[a-f0-9]+$/i.test(values['common.machineId']); + + /* __GDPR__ + "machineIdFallback" : { + "usingFallbackGuid" : { "classification": "SystemMetaData", "purpose": "BusinessInsight", "isMeasurement": true } + } + */ + this.publicLog('machineIdFallback', { usingFallbackGuid: !isHashedId }); + }); } - - this._commonProperties.then(values => { - const isHashedId = /^[a-f0-9]+$/i.test(values['common.machineId']); - - /* __GDPR__ - "machineIdFallback" : { - "usingFallbackGuid" : { "classification": "SystemMetaData", "purpose": "BusinessInsight", "isMeasurement": true } - } - */ - this.publicLog('machineIdFallback', { usingFallbackGuid: !isHashedId }); - }); } private _updateUserOptIn(): void { From ec081573ed2e53669932b64db167997364ada54e Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Tue, 5 Feb 2019 17:44:49 -0800 Subject: [PATCH 362/429] Restore settings editor focus sinks --- .../electron-browser/settingsEditor2.ts | 120 ++++++++++-------- 1 file changed, 68 insertions(+), 52 deletions(-) diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts index ea9a1420deb..bee9a940ba4 100644 --- a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts @@ -488,57 +488,81 @@ export class SettingsEditor2 extends BaseEditor { this.createTOC(bodyContainer); - // this.createFocusSink( - // bodyContainer, - // e => { - // if (DOM.findParentWithClass(e.relatedTarget, 'settings-editor-tree')) { - // if (this.settingsTree.getScrollPosition() > 0) { - // const firstElement = this.settingsTree.getFirstVisibleElement(); - // this.settingsTree.reveal(firstElement, 0.1); - // return true; - // } - // } else { - // const firstControl = this.settingsTree.getHTMLElement().querySelector(SettingsRenderer.CONTROL_SELECTOR); - // if (firstControl) { - // (firstControl).focus(); - // } - // } + this.createFocusSink( + bodyContainer, + e => { + if (DOM.findParentWithClass(e.relatedTarget, 'settings-editor-tree')) { + if (this.settingsTree.scrollTop > 0) { + const firstElement = this.getFirstVisibleElement(); + this.settingsTree.reveal(firstElement, 0.1); + return true; + } + } else { + const firstControl = this.settingsTree.getHTMLElement().querySelector(AbstractSettingRenderer.CONTROL_SELECTOR); + if (firstControl) { + (firstControl).focus(); + } + } - // return false; - // }, - // 'settings list focus helper'); + return false; + }, + 'settings list focus helper'); this.createSettingsTree(bodyContainer); - // this.createFocusSink( - // bodyContainer, - // e => { - // if (DOM.findParentWithClass(e.relatedTarget, 'settings-editor-tree')) { - // if (this.settingsTree.getScrollPosition() < 1) { - // const lastElement = this.settingsTree.getLastVisibleElement(); - // this.settingsTree.reveal(lastElement, 0.9); - // return true; - // } - // } + this.createFocusSink( + bodyContainer, + e => { + if (DOM.findParentWithClass(e.relatedTarget, 'settings-editor-tree')) { + if (this.settingsTree.scrollTop < this.settingsTree.scrollHeight) { + const lastElement = this.getLastVisibleElement(); + this.settingsTree.reveal(lastElement, 0.9); + return true; + } + } - // return false; - // }, - // 'settings list focus helper' - // ); + return false; + }, + 'settings list focus helper' + ); } - // private createFocusSink(container: HTMLElement, callback: (e: any) => boolean, label: string): HTMLElement { - // const listFocusSink = DOM.append(container, $('.settings-tree-focus-sink')); - // listFocusSink.setAttribute('aria-label', label); - // listFocusSink.tabIndex = 0; - // this._register(DOM.addDisposableListener(listFocusSink, 'focus', (e: any) => { - // if (e.relatedTarget && callback(e)) { - // e.relatedTarget.focus(); - // } - // })); + private getFirstVisibleElement(nth = 0): SettingsTreeElement | null { + // Hack, see https://github.com/Microsoft/vscode/issues/64749 + const settingItems = this.settingsTree.getHTMLElement().querySelectorAll(AbstractSettingRenderer.CONTENTS_SELECTOR); + const firstEl = settingItems[nth] || settingItems[0]; + if (!firstEl) { + return null; + } - // return listFocusSink; - // } + const firstSettingId = this.settingRenderers.getIdForDOMElementInSetting(firstEl); + return this.settingsTreeModel.getElementById(firstSettingId); + } + + private getLastVisibleElement(): SettingsTreeElement | null { + // Hack, see https://github.com/Microsoft/vscode/issues/64749 + const settingItems = this.settingsTree.getHTMLElement().querySelectorAll(AbstractSettingRenderer.CONTENTS_SELECTOR); + const firstEl = settingItems[settingItems.length - 1]; + if (!firstEl) { + return null; + } + + const firstSettingId = this.settingRenderers.getIdForDOMElementInSetting(firstEl); + return this.settingsTreeModel.getElementById(firstSettingId); + } + + private createFocusSink(container: HTMLElement, callback: (e: any) => boolean, label: string): HTMLElement { + const listFocusSink = DOM.append(container, $('.settings-tree-focus-sink')); + listFocusSink.setAttribute('aria-label', label); + listFocusSink.tabIndex = 0; + this._register(DOM.addDisposableListener(listFocusSink, 'focus', (e: any) => { + if (e.relatedTarget && callback(e)) { + e.relatedTarget.focus(); + } + })); + + return listFocusSink; + } private createTOC(parent: HTMLElement): void { this.tocTreeModel = new TOCTreeModel(this.viewState); @@ -663,15 +687,7 @@ export class SettingsEditor2 extends BaseEditor { return; } - // Hack, see https://github.com/Microsoft/vscode/issues/64749 - const settingItems = this.settingsTree.getHTMLElement().querySelectorAll(AbstractSettingRenderer.CONTENTS_SELECTOR); - const firstEl = settingItems[1] || settingItems[0]; - if (!firstEl) { - return; - } - - const firstSettingId = this.settingRenderers.getIdForDOMElementInSetting(firstEl); - const elementToSync = this.settingsTreeModel.getElementById(firstSettingId); + const elementToSync = this.getFirstVisibleElement(1); const element = elementToSync instanceof SettingsTreeSettingElement ? elementToSync.parent : elementToSync instanceof SettingsTreeGroupElement ? elementToSync : null; From 00436419c7f9f17668a30f18dbfe24e0c559b810 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 08:43:47 +0100 Subject: [PATCH 363/429] fix panel drag image --- src/vs/base/browser/ui/list/list.css | 2 +- src/vs/base/browser/ui/list/listView.ts | 2 +- src/vs/base/browser/ui/list/listWidget.ts | 6 +++--- src/vs/base/browser/ui/splitview/panelview.ts | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/vs/base/browser/ui/list/list.css b/src/vs/base/browser/ui/list/list.css index 666bdaa9167..73756ce7811 100644 --- a/src/vs/base/browser/ui/list/list.css +++ b/src/vs/base/browser/ui/list/list.css @@ -60,7 +60,7 @@ } /* Dnd */ -.monaco-list-drag-image { +.monaco-drag-image { display: inline-block; padding: 1px 7px; border-radius: 10px; diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index 40c16806df2..a70fe3c8c84 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -729,7 +729,7 @@ export class ListView implements ISpliceable, IDisposable { label = String(elements.length); } - const dragImage = DOM.$('.monaco-list-drag-image'); + const dragImage = DOM.$('.monaco-drag-image'); dragImage.textContent = label; document.body.appendChild(dragImage); event.dataTransfer.setDragImage(dragImage, -10, -10); diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 4724ca6224d..ec06bc2dcb5 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -695,14 +695,14 @@ export class DefaultStyleController implements IStyleController { if (styles.listFocusAndSelectionBackground) { content.push(` - .monaco-list-drag-image, + .monaco-drag-image, .monaco-list${suffix}:focus .monaco-list-row.selected.focused { background-color: ${styles.listFocusAndSelectionBackground}; } `); } if (styles.listFocusAndSelectionForeground) { content.push(` - .monaco-list-drag-image, + .monaco-drag-image, .monaco-list${suffix}:focus .monaco-list-row.selected.focused { color: ${styles.listFocusAndSelectionForeground}; } `); } @@ -735,7 +735,7 @@ export class DefaultStyleController implements IStyleController { if (styles.listFocusOutline) { content.push(` - .monaco-list-drag-image, + .monaco-drag-image, .monaco-list${suffix}:focus .monaco-list-row.focused { outline: 1px solid ${styles.listFocusOutline}; outline-offset: -1px; } `); } diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index 18fecbbaafa..22736a15504 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -268,7 +268,7 @@ class PanelDraggable extends Disposable { e.dataTransfer.effectAllowed = 'move'; - const dragImage = append(document.body, $('.monaco-panel-drag-image', {}, this.panel.draggableElement.textContent || '')); + const dragImage = append(document.body, $('.monaco-drag-image', {}, this.panel.draggableElement.textContent || '')); e.dataTransfer.setDragImage(dragImage, -10, -10); setTimeout(() => document.body.removeChild(dragImage), 0); @@ -336,6 +336,7 @@ class PanelDraggable extends Disposable { backgroundColor = (this.panel.dropBackground || PanelDraggable.DefaultDragOverBackgroundColor).toString(); } + console.log(backgroundColor); this.panel.dropTargetElement.style.backgroundColor = backgroundColor; } } From 4fb6b7093afc09c52cafff60f3125d253ab4473b Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 08:47:03 +0100 Subject: [PATCH 364/429] remove console.log --- src/vs/base/browser/ui/splitview/panelview.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index 22736a15504..bc375e34a37 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -336,7 +336,6 @@ class PanelDraggable extends Disposable { backgroundColor = (this.panel.dropBackground || PanelDraggable.DefaultDragOverBackgroundColor).toString(); } - console.log(backgroundColor); this.panel.dropTargetElement.style.backgroundColor = backgroundColor; } } From d04106a7807f81e2ee2b6476aadb1e71fef5bef0 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 08:57:29 +0100 Subject: [PATCH 365/429] open editors shouldn't accept every drag and drop --- .../electron-browser/views/openEditorsView.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index dedd674663a..58e99c7a4e0 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -34,12 +34,12 @@ import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemAc import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions'; import { DirtyEditorContext, OpenEditorsGroupContext } from 'vs/workbench/parts/files/electron-browser/fileCommands'; import { ResourceContextKey } from 'vs/workbench/common/resources'; -import { ResourcesDropHandler, fillResourceDataTransfers } from 'vs/workbench/browser/dnd'; +import { ResourcesDropHandler, fillResourceDataTransfers, CodeDataTransfers } from 'vs/workbench/browser/dnd'; import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; -import { IDragAndDropData } from 'vs/base/browser/dnd'; +import { IDragAndDropData, DataTransfers } from 'vs/base/browser/dnd'; import { memoize } from 'vs/base/common/decorators'; -import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; +import { ElementsDragAndDropData, DesktopDragAndDropData } from 'vs/base/browser/ui/list/listView'; import { URI } from 'vs/base/common/uri'; const $ = dom.$; @@ -645,6 +645,18 @@ class OpenEditorsDragAndDrop implements IListDragAndDrop Date: Wed, 6 Feb 2019 09:05:48 +0100 Subject: [PATCH 366/429] electron@3.1.3 --- .yarnrc | 2 +- cgmanifest.json | 4 ++-- src/typings/electron.d.ts | 7 ++++++- test/smoke/package.json | 2 +- test/smoke/yarn.lock | 8 ++++---- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.yarnrc b/.yarnrc index 190252d15da..fe7090fa356 100644 --- a/.yarnrc +++ b/.yarnrc @@ -1,3 +1,3 @@ disturl "https://atom.io/download/electron" -target "3.1.2" +target "3.1.3" runtime "electron" diff --git a/cgmanifest.json b/cgmanifest.json index b7e74e39456..21d78500903 100644 --- a/cgmanifest.json +++ b/cgmanifest.json @@ -73,12 +73,12 @@ "git": { "name": "electron", "repositoryUrl": "https://github.com/electron/electron", - "commitHash": "bb28fa8e8e797db249a66405146ad0501eaf411a" + "commitHash": "72ff292302f95bfe5b4e02085a7be56254b42b0e" } }, "isOnlyProductionDependency": true, "license": "MIT", - "version": "3.1.2" + "version": "3.1.3" }, { "component": { diff --git a/src/typings/electron.d.ts b/src/typings/electron.d.ts index 8f72a1bc565..50fb0d3e4f4 100644 --- a/src/typings/electron.d.ts +++ b/src/typings/electron.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Electron 3.1.2 +// Type definitions for Electron 3.1.3 // Project: http://electronjs.org/ // Definitions by: The Electron Team // Definitions: https://github.com/electron/electron-typescript-definitions @@ -7869,6 +7869,11 @@ declare namespace Electron { * Should only be specified for checkbox or radio type menu items. */ checked?: boolean; + /** + * If false, the accelerator won't be registered with the system, but it will still + * be displayed. Defaults to true. + */ + registerAccelerator?: boolean; /** * Should be specified for submenu type menu items. If submenu is specified, the * type: 'submenu' can be omitted. If the value is not a then it will be diff --git a/test/smoke/package.json b/test/smoke/package.json index fe5adc19357..80351281340 100644 --- a/test/smoke/package.json +++ b/test/smoke/package.json @@ -22,7 +22,7 @@ "@types/webdriverio": "4.6.1", "concurrently": "^3.5.1", "cpx": "^1.5.0", - "electron": "3.1.2", + "electron": "3.1.3", "htmlparser2": "^3.9.2", "mkdirp": "^0.5.1", "mocha": "^5.2.0", diff --git a/test/smoke/yarn.lock b/test/smoke/yarn.lock index 6ca02b80baf..d1e614c487a 100644 --- a/test/smoke/yarn.lock +++ b/test/smoke/yarn.lock @@ -596,10 +596,10 @@ electron-download@^4.1.0: semver "^5.4.1" sumchecker "^2.0.2" -electron@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/electron/-/electron-3.1.2.tgz#e410b976c56fc2f783c3b0fb6d757e02eaeab902" - integrity sha512-B/mXRCN8jGBBx8dvtIgLyW+nE8i9y7K9G6wijU+cLoneqF5al9BgZA1l5xgZEiUrwTtt0cgXIWNwhStt7EDoQQ== +electron@3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/electron/-/electron-3.1.3.tgz#848fa0fc62d131978cde15ec04ce195a08dc4155" + integrity sha512-Y1TbV5py2O0br0JVYh+ew1cW4cIOOgRNRMzwTwWuZNMZ9fK/XLlqsbZr1GpYHdiN2yIU1koO+g4Cw8VuW86NXQ== dependencies: "@types/node" "^8.0.24" electron-download "^4.1.0" From 65f4cd7f35c4a89268cd7c2a8c31a1daa6c9df86 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 09:02:43 +0100 Subject: [PATCH 367/429] fix panel drop feedback in light and hc themes related to #67880 --- src/vs/workbench/common/theme.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/common/theme.ts b/src/vs/workbench/common/theme.ts index c5fc0beab31..7ca06839625 100644 --- a/src/vs/workbench/common/theme.ts +++ b/src/vs/workbench/common/theme.ts @@ -378,8 +378,8 @@ export const SIDE_BAR_TITLE_FOREGROUND = registerColor('sideBarTitle.foreground' export const SIDE_BAR_DRAG_AND_DROP_BACKGROUND = registerColor('sideBar.dropBackground', { dark: Color.white.transparent(0.12), - light: Color.white.transparent(0.12), - hc: Color.white.transparent(0.12), + light: Color.black.transparent(0.1), + hc: Color.white.transparent(0.3), }, nls.localize('sideBarDragAndDropBackground', "Drag and drop feedback color for the side bar sections. The color should have transparency so that the side bar sections can still shine through. The side bar is the container for views like explorer and search.")); export const SIDE_BAR_SECTION_HEADER_BACKGROUND = registerColor('sideBarSectionHeader.background', { From 987e4f929dcf89b5bb609ebee7b254cf94e1ab71 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 6 Feb 2019 09:12:24 +0100 Subject: [PATCH 368/429] argv: bring back deprecated ids (fixes #67937) --- src/vs/platform/environment/node/argv.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index d7e62cbfd82..10b166c3e01 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -22,6 +22,7 @@ export interface Option { id: string; type: 'boolean' | 'string'; alias?: string; + deprecates?: string; // old deprecated id args?: string | string[]; description?: string; cat?: keyof HelpCategories; @@ -41,7 +42,7 @@ export const options: Option[] = [ { id: 'folder-uri', type: 'string', cat: 'o', args: 'uri', description: localize('folderUri', "Opens a window with given folder uri(s)") }, { id: 'file-uri', type: 'string', cat: 'o', args: 'uri', description: localize('fileUri', "Opens a window with given file uri(s)") }, - { id: 'extensions-dir', type: 'string', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") }, + { id: 'extensions-dir', type: 'string', deprecates: 'extensionHomePath', cat: 'e', args: 'dir', description: localize('extensionHomePath', "Set the root path for extensions.") }, { id: 'list-extensions', type: 'boolean', cat: 'e', description: localize('listExtensions', "List the installed extensions.") }, { id: 'show-versions', type: 'boolean', cat: 'e', description: localize('showVersions', "Show versions of installed extensions, when using --list-extension.") }, { id: 'install-extension', type: 'string', cat: 'e', args: 'extension-id', description: localize('installExtension', "Installs or updates the extension. Use `--force` argument to avoid prompts.") }, @@ -53,7 +54,7 @@ export const options: Option[] = [ { id: 'status', type: 'boolean', alias: 's', cat: 't', description: localize('status', "Print process usage and diagnostics information.") }, { id: 'prof-modules', type: 'boolean', alias: 'p', cat: 't', description: localize('prof-modules', "Capture performance markers while loading JS modules and print them with 'F1 > Developer: Startup Performance") }, { id: 'prof-startup', type: 'boolean', cat: 't', description: localize('prof-startup', "Run CPU profiler during startup") }, - { id: 'disable-extensions', type: 'boolean', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") }, + { id: 'disable-extensions', type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") }, { id: 'disable-extension', type: 'string', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") }, { id: 'inspect-extensions', type: 'string', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") }, @@ -66,8 +67,8 @@ export const options: Option[] = [ { id: 'extensionDevelopmentPath', type: 'string' }, { id: 'extensionTestsPath', type: 'string' }, { id: 'debugId', type: 'string' }, - { id: 'inspect-search', type: 'string' }, - { id: 'inspect-brk-extensions', type: 'string' }, + { id: 'inspect-search', type: 'string', deprecates: 'debugSearch' }, + { id: 'inspect-brk-extensions', type: 'string', deprecates: 'debugBrkSearch' }, { id: 'export-default-configuration', type: 'string' }, { id: 'install-source', type: 'string' }, { id: 'driver', type: 'string' }, @@ -101,9 +102,12 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru const string: string[] = []; const boolean: string[] = []; for (let o of options) { - if (o.alias && isOptionSupported(o)) { - alias[o.id] = o.alias; + if (isOptionSupported(o)) { + if (o.alias) { + alias[o.id] = o.alias; + } } + if (o.type === 'string') { string.push(o.id); } else if (o.type === 'boolean') { @@ -116,6 +120,10 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru if (o.alias) { delete parsedArgs[o.alias]; } + if (o.deprecates && parsedArgs[o.deprecates] && !parsedArgs[o.id]) { + parsedArgs[o.id] = parsedArgs[o.deprecates]; + delete parsedArgs[o.deprecates]; + } } return parsedArgs; } From b81b84ff639af8de8df7c53a67874c2aee83adfa Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 08:16:57 +0100 Subject: [PATCH 369/429] use rtf licenses --- build/win32/code.iss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/win32/code.iss b/build/win32/code.iss index 43572199eb5..ea31a50c9bf 100644 --- a/build/win32/code.iss +++ b/build/win32/code.iss @@ -1,7 +1,7 @@ #define LocalizedLanguageFile(Language = "") \ DirExists(RepoDir + "\licenses") && Language != "" \ - ? ('; LicenseFile: "' + RepoDir + '\licenses\LICENSE-' + Language + '.txt"') \ - : '; LicenseFile: "' + RepoDir + '\LICENSE.txt"' + ? ('; LicenseFile: "' + RepoDir + '\licenses\LICENSE-' + Language + '.rtf"') \ + : '; LicenseFile: "' + RepoDir + '\LICENSE.rtf"' [Setup] AppId={#AppId} From fad6ab69481bb19bad811adc24a78cb55acc1313 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 08:19:55 +0100 Subject: [PATCH 370/429] update distro --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 21e96b6c067..57926e29003 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "code-oss-dev", "version": "1.32.0", - "distro": "d274a23e463c080a0a3ba6278d43431d187e05f5", + "distro": "310c6547347fcd3b799dc67e048b7e010339211f", "author": { "name": "Microsoft Corporation" }, @@ -150,4 +150,4 @@ "windows-mutex": "0.2.1", "windows-process-tree": "0.2.3" } -} +} \ No newline at end of file From f88e4f457a750f48876f7846a468bc745e6485a1 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 6 Feb 2019 10:15:36 +0100 Subject: [PATCH 371/429] Adopt changes in gulp.src --- build/gulpfile.editor.js | 4 ---- build/gulpfile.vscode.js | 5 ++--- build/lib/optimize.js | 18 ++---------------- build/lib/optimize.ts | 22 +--------------------- 4 files changed, 5 insertions(+), 44 deletions(-) diff --git a/build/gulpfile.editor.js b/build/gulpfile.editor.js index 4bed8bacb1d..f1aa8e77ff1 100644 --- a/build/gulpfile.editor.js +++ b/build/gulpfile.editor.js @@ -48,9 +48,6 @@ var editorResources = [ '!**/test/**' ]; -var editorOtherSources = [ -]; - var BUNDLED_FILE_HEADER = [ '/*!-----------------------------------------------------------', ' * Copyright (c) Microsoft Corporation. All rights reserved.', @@ -107,7 +104,6 @@ compileEditorAMDTask.displayName = 'compile-editor-amd'; const optimizeEditorAMDTask = common.optimizeTask({ src: 'out-editor-build', entryPoints: editorEntryPoints, - otherSources: editorOtherSources, resources: editorResources, loaderConfig: { paths: { diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 1cbd189b79e..a7ca09844cd 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -95,7 +95,6 @@ const optimizeVSCodeTask = util.task.series( common.optimizeTask({ src: 'out-build', entryPoints: vscodeEntryPoints, - otherSources: [], resources: vscodeResources, loaderConfig: common.loaderConfig(nodeModules), header: BUNDLED_FILE_HEADER, @@ -311,7 +310,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op const productJsonStream = gulp.src(['product.json'], { base: '.' }) .pipe(json(productJsonUpdate)); - const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' }); + const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true }); const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' }); @@ -404,7 +403,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op // result = es.merge(result, gulp.src('resources/completions/**', { base: '.' })); if (platform === 'win32') { - result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' })); + result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true })); result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' }) .pipe(replace('@@NAME@@', product.nameShort)) diff --git a/build/lib/optimize.js b/build/lib/optimize.js index 3756d01f538..bc2b5b12aea 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -114,7 +114,6 @@ function toBundleStream(src, bundledFileHeader, bundles) { function optimizeTask(opts) { const src = opts.src; const entryPoints = opts.entryPoints; - const otherSources = opts.otherSources; const resources = opts.resources; const loaderConfig = opts.loaderConfig; const bundledFileHeader = opts.header; @@ -137,7 +136,7 @@ function optimizeTask(opts) { } filteredResources.push('!' + resource); }); - gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream); + gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream); const bundleInfoArray = []; if (opts.bundleInfo) { bundleInfoArray.push(new VinylFile({ @@ -148,20 +147,7 @@ function optimizeTask(opts) { } es.readArray(bundleInfoArray).pipe(bundleInfoStream); }); - const otherSourcesStream = es.through(); - const otherSourcesStreamArr = []; - gulp.src(otherSources, { base: `${src}` }) - .pipe(es.through(function (data) { - otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative)); - }, function () { - if (!otherSourcesStreamArr.length) { - setTimeout(function () { otherSourcesStream.emit('end'); }, 0); - } - else { - es.merge(otherSourcesStreamArr).pipe(otherSourcesStream); - } - })); - const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream); + const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream); return result .pipe(sourcemaps.write('./', { sourceRoot: undefined, diff --git a/build/lib/optimize.ts b/build/lib/optimize.ts index 12b633b3ac9..cb26dac7c2e 100644 --- a/build/lib/optimize.ts +++ b/build/lib/optimize.ts @@ -142,10 +142,6 @@ export interface IOptimizeTaskOpts { * (for AMD files, will get bundled and get Copyright treatment) */ entryPoints: bundle.IEntryPoint[]; - /** - * (for non-AMD files that should get Copyright treatment) - */ - otherSources: string[]; /** * (svg, etc.) */ @@ -176,7 +172,6 @@ export interface IOptimizeTaskOpts { export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream { const src = opts.src; const entryPoints = opts.entryPoints; - const otherSources = opts.otherSources; const resources = opts.resources; const loaderConfig = opts.loaderConfig; const bundledFileHeader = opts.header; @@ -201,7 +196,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr } filteredResources.push('!' + resource); }); - gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream); + gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream); const bundleInfoArray: VinylFile[] = []; if (opts.bundleInfo) { @@ -214,24 +209,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr es.readArray(bundleInfoArray).pipe(bundleInfoStream); }); - const otherSourcesStream = es.through(); - const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = []; - - gulp.src(otherSources, { base: `${src}` }) - .pipe(es.through(function (data) { - otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative)); - }, function () { - if (!otherSourcesStreamArr.length) { - setTimeout(function () { otherSourcesStream.emit('end'); }, 0); - } else { - es.merge(otherSourcesStreamArr).pipe(otherSourcesStream); - } - })); - const result = es.merge( loader(src, bundledFileHeader, bundleLoader), bundlesStream, - otherSourcesStream, resourcesStream, bundleInfoStream ); From 20040a71b26129240e3c2baaf9e717410a7bbfaf Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Wed, 6 Feb 2019 11:02:29 +0100 Subject: [PATCH 372/429] argv: use 'deprecates' for debug(Brk)PluginHost and debug(Brk)Search --- src/vs/code/electron-main/window.ts | 4 ++-- src/vs/code/electron-main/windows.ts | 4 ++-- .../environment/common/environment.ts | 8 ++++---- src/vs/platform/environment/node/argv.ts | 19 +++++++++++-------- .../environment/node/environmentService.ts | 4 ++-- .../test/node/environmentService.test.ts | 12 ++++++++++++ 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index af7b8265a45..03d22708966 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -545,8 +545,8 @@ export class CodeWindow extends Disposable implements ICodeWindow { // in extension development mode. These options are all development related. if (this.isExtensionDevelopmentHost && cli) { configuration.verbose = cli.verbose; - configuration.debugPluginHost = cli.debugPluginHost; - configuration.debugBrkPluginHost = cli.debugBrkPluginHost; + configuration['inspect-extensions'] = cli['inspect-extensions']; + configuration['inspect-brk-extensions'] = cli['inspect-brk-extensions']; configuration.debugId = cli.debugId; configuration['extensions-dir'] = cli['extensions-dir']; } diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 59bec7973b6..f51a81ec7db 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -1282,9 +1282,9 @@ export class WindowsManager implements IWindowsMainService { if (!configuration.extensionDevelopmentPath && currentWindowConfig && !!currentWindowConfig.extensionDevelopmentPath) { configuration.extensionDevelopmentPath = currentWindowConfig.extensionDevelopmentPath; configuration.verbose = currentWindowConfig.verbose; - configuration.debugBrkPluginHost = currentWindowConfig.debugBrkPluginHost; + configuration['inspect-brk-extensions'] = currentWindowConfig['inspect-brk-extensions']; configuration.debugId = currentWindowConfig.debugId; - configuration.debugPluginHost = currentWindowConfig.debugPluginHost; + configuration['inspect-extensions'] = currentWindowConfig['inspect-extensions']; configuration['extensions-dir'] = currentWindowConfig['extensions-dir']; } } diff --git a/src/vs/platform/environment/common/environment.ts b/src/vs/platform/environment/common/environment.ts index 23e84ca2f83..93f117ad29e 100644 --- a/src/vs/platform/environment/common/environment.ts +++ b/src/vs/platform/environment/common/environment.ts @@ -39,11 +39,11 @@ export interface ParsedArgs { 'builtin-extensions-dir'?: string; extensionDevelopmentPath?: string; extensionTestsPath?: string; - debugPluginHost?: string; - debugBrkPluginHost?: string; + 'inspect-extensions'?: string; + 'inspect-brk-extensions'?: string; debugId?: string; - debugSearch?: string; - debugBrkSearch?: string; + 'inspect-search'?: string; + 'inspect-brk-search'?: string; 'disable-extensions'?: boolean; 'disable-extension'?: string | string[]; 'list-extensions'?: boolean; diff --git a/src/vs/platform/environment/node/argv.ts b/src/vs/platform/environment/node/argv.ts index 10b166c3e01..054a7fe2c61 100644 --- a/src/vs/platform/environment/node/argv.ts +++ b/src/vs/platform/environment/node/argv.ts @@ -57,8 +57,8 @@ export const options: Option[] = [ { id: 'disable-extensions', type: 'boolean', deprecates: 'disableExtensions', cat: 't', description: localize('disableExtensions', "Disable all installed extensions.") }, { id: 'disable-extension', type: 'string', cat: 't', args: 'extension-id', description: localize('disableExtension', "Disable an extension.") }, - { id: 'inspect-extensions', type: 'string', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") }, - { id: 'inspect-brk-search', type: 'string', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") }, + { id: 'inspect-extensions', type: 'string', deprecates: 'debugPluginHost', args: 'port', cat: 't', description: localize('inspect-extensions', "Allow debugging and profiling of extensions. Check the developer tools for the connection URI.") }, + { id: 'inspect-brk-extensions', type: 'string', deprecates: 'debugBrkPluginHost', args: 'port', cat: 't', description: localize('inspect-brk-extensions', "Allow debugging and profiling of extensions with the extension host being paused after start. Check the developer tools for the connection URI.") }, { id: 'disable-gpu', type: 'boolean', cat: 't', description: localize('disableGPU', "Disable GPU hardware acceleration.") }, { id: 'upload-logs', type: 'string', cat: 't', description: localize('uploadLogs', "Uploads logs from current session to a secure endpoint.") }, { id: 'max-memory', type: 'boolean', cat: 't', description: localize('maxMemory', "Max memory size for a window (in Mbytes).") }, @@ -68,7 +68,7 @@ export const options: Option[] = [ { id: 'extensionTestsPath', type: 'string' }, { id: 'debugId', type: 'string' }, { id: 'inspect-search', type: 'string', deprecates: 'debugSearch' }, - { id: 'inspect-brk-extensions', type: 'string', deprecates: 'debugBrkSearch' }, + { id: 'inspect-brk-search', type: 'string', deprecates: 'debugBrkSearch' }, { id: 'export-default-configuration', type: 'string' }, { id: 'install-source', type: 'string' }, { id: 'driver', type: 'string' }, @@ -91,10 +91,7 @@ export const options: Option[] = [ { id: 'force', type: 'boolean' }, { id: 'trace-category-filter', type: 'string' }, { id: 'trace-options', type: 'string' }, - { id: 'prof-code-loading', type: 'boolean' }, - - { id: 'debugPluginHost', type: 'string', alias: 'inspect-extensions' }, - { id: 'debugBrkPluginHost', type: 'string', alias: 'inspect-brk-extensions' } + { id: 'prof-code-loading', type: 'boolean' } ]; export function parseArgs(args: string[], isOptionSupported = (_: Option) => true): ParsedArgs { @@ -110,8 +107,14 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru if (o.type === 'string') { string.push(o.id); + if (o.deprecates) { + string.push(o.deprecates); + } } else if (o.type === 'boolean') { boolean.push(o.id); + if (o.deprecates) { + boolean.push(o.deprecates); + } } } // remote aliases to avoid confusion @@ -120,7 +123,7 @@ export function parseArgs(args: string[], isOptionSupported = (_: Option) => tru if (o.alias) { delete parsedArgs[o.alias]; } - if (o.deprecates && parsedArgs[o.deprecates] && !parsedArgs[o.id]) { + if (o.deprecates && parsedArgs.hasOwnProperty(o.deprecates) && !parsedArgs[o.id]) { parsedArgs[o.id] = parsedArgs[o.deprecates]; delete parsedArgs[o.deprecates]; } diff --git a/src/vs/platform/environment/node/environmentService.ts b/src/vs/platform/environment/node/environmentService.ts index 5ecf265cdbd..8c33dbaec1e 100644 --- a/src/vs/platform/environment/node/environmentService.ts +++ b/src/vs/platform/environment/node/environmentService.ts @@ -250,11 +250,11 @@ export class EnvironmentService implements IEnvironmentService { } export function parseExtensionHostPort(args: ParsedArgs, isBuild: boolean): IExtensionHostDebugParams { - return parseDebugPort(args.debugPluginHost, args.debugBrkPluginHost, 5870, isBuild, args.debugId); + return parseDebugPort(args['inspect-extensions'], args['inspect-brk-extensions'], 5870, isBuild, args.debugId); } export function parseSearchPort(args: ParsedArgs, isBuild: boolean): IDebugParams { - return parseDebugPort(args.debugSearch, args.debugBrkSearch, 5876, isBuild); + return parseDebugPort(args['inspect-search'], args['inspect-brk-search'], 5876, isBuild); } export function parseDebugPort(debugArg: string | undefined, debugBrkArg: string | undefined, defaultBuildPort: number, isBuild: boolean, debugId?: string): IExtensionHostDebugParams { diff --git a/src/vs/platform/environment/test/node/environmentService.test.ts b/src/vs/platform/environment/test/node/environmentService.test.ts index b29c8629002..fc1faf3fff7 100644 --- a/src/vs/platform/environment/test/node/environmentService.test.ts +++ b/src/vs/platform/environment/test/node/environmentService.test.ts @@ -19,6 +19,12 @@ suite('EnvironmentService', () => { assert.deepEqual(parse(['--debugBrkPluginHost']), { port: null, break: false, debugId: undefined }); assert.deepEqual(parse(['--debugBrkPluginHost=5678']), { port: 5678, break: true, debugId: undefined }); assert.deepEqual(parse(['--debugPluginHost=1234', '--debugBrkPluginHost=5678', '--debugId=7']), { port: 5678, break: true, debugId: '7' }); + + assert.deepEqual(parse(['--inspect-extensions']), { port: null, break: false, debugId: undefined }); + assert.deepEqual(parse(['--inspect-extensions=1234']), { port: 1234, break: false, debugId: undefined }); + assert.deepEqual(parse(['--inspect-brk-extensions']), { port: null, break: false, debugId: undefined }); + assert.deepEqual(parse(['--inspect-brk-extensions=5678']), { port: 5678, break: true, debugId: undefined }); + assert.deepEqual(parse(['--inspect-extensions=1234', '--inspect-brk-extensions=5678', '--debugId=7']), { port: 5678, break: true, debugId: '7' }); }); test('parseExtensionHostPort when unbuilt', () => { @@ -30,6 +36,12 @@ suite('EnvironmentService', () => { assert.deepEqual(parse(['--debugBrkPluginHost']), { port: 5870, break: false, debugId: undefined }); assert.deepEqual(parse(['--debugBrkPluginHost=5678']), { port: 5678, break: true, debugId: undefined }); assert.deepEqual(parse(['--debugPluginHost=1234', '--debugBrkPluginHost=5678', '--debugId=7']), { port: 5678, break: true, debugId: '7' }); + + assert.deepEqual(parse(['--inspect-extensions']), { port: 5870, break: false, debugId: undefined }); + assert.deepEqual(parse(['--inspect-extensions=1234']), { port: 1234, break: false, debugId: undefined }); + assert.deepEqual(parse(['--inspect-brk-extensions']), { port: 5870, break: false, debugId: undefined }); + assert.deepEqual(parse(['--inspect-brk-extensions=5678']), { port: 5678, break: true, debugId: undefined }); + assert.deepEqual(parse(['--inspect-extensions=1234', '--inspect-brk-extensions=5678', '--debugId=7']), { port: 5678, break: true, debugId: '7' }); }); test('userDataPath', () => { From 07180523d60ba9d12f3b0a38203ce7f5f8ef0850 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 11:06:42 +0100 Subject: [PATCH 373/429] fix abstract tree trait changes when splicing fixes #67890 --- src/vs/base/browser/ui/tree/abstractTree.ts | 97 ++++++++++----------- 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 5e947eb2052..5a777136756 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -6,12 +6,12 @@ import 'vs/css!./media/tree'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { IListOptions, List, IListStyles, mightProducePrintableCharacter, MouseController } from 'vs/base/browser/ui/list/listWidget'; -import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider } from 'vs/base/browser/ui/list/list'; +import { IListVirtualDelegate, IListRenderer, IListMouseEvent, IListEvent, IListContextMenuEvent, IListDragAndDrop, IListDragOverReaction, IKeyboardNavigationLabelProvider, IIdentityProvider } from 'vs/base/browser/ui/list/list'; import { append, $, toggleClass, getDomNodePagePosition, removeClass, addClass, hasClass } from 'vs/base/browser/dom'; import { Event, Relay, Emitter, EventBufferer } from 'vs/base/common/event'; import { StandardKeyboardEvent, IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { ITreeModel, ITreeNode, ITreeRenderer, ITreeEvent, ITreeMouseEvent, ITreeContextMenuEvent, ITreeFilter, ITreeNavigator, ICollapseStateChangeEvent, ITreeDragAndDrop, TreeDragOverBubble, TreeVisibility, TreeFilterResult } from 'vs/base/browser/ui/tree/tree'; +import { ITreeModel, ITreeNode, ITreeRenderer, ITreeEvent, ITreeMouseEvent, ITreeContextMenuEvent, ITreeFilter, ITreeNavigator, ICollapseStateChangeEvent, ITreeDragAndDrop, TreeDragOverBubble, TreeVisibility, TreeFilterResult, ITreeModelSpliceEvent } from 'vs/base/browser/ui/tree/tree'; import { ISpliceable } from 'vs/base/common/sequence'; import { IDragAndDropData, StaticDND, DragAndDropData } from 'vs/base/browser/dnd'; import { range } from 'vs/base/common/arrays'; @@ -700,6 +700,11 @@ export interface IAbstractTreeOptions extends IAbstractTr readonly expandOnlyOnTwistieClick?: boolean; } +function dfs(node: ITreeNode, fn: (node: ITreeNode) => void): void { + fn(node); + node.children.forEach(child => dfs(child, fn)); +} + /** * The trait concept needs to exist at the tree level, because collapsed * tree nodes will not be known by the list. @@ -715,16 +720,14 @@ class Trait { private _nodeSet: Set> | undefined; private get nodeSet(): Set> { if (!this._nodeSet) { - this._nodeSet = new Set(); - - for (const node of this.nodes) { - this._nodeSet.add(node); - } + this._nodeSet = this.createNodeSet(); } return this._nodeSet; } + constructor(private identityProvider?: IIdentityProvider) { } + set(nodes: ITreeNode[], browserEvent?: UIEvent): void { this.nodes = [...nodes]; this.elements = undefined; @@ -746,19 +749,37 @@ class Trait { return this.nodeSet.has(node); } - remove(nodes: ITreeNode[]): void { - if (nodes.length === 0) { + onDidModelSplice({ insertedNodes, deletedNodes }: ITreeModelSpliceEvent): void { + if (!this.identityProvider) { + const set = this.createNodeSet(); + const visit = node => set.delete(node); + deletedNodes.forEach(node => dfs(node, visit)); + this.set(values(set)); return; } - const set = this.nodeSet; - const visit = (node: ITreeNode) => { - set.delete(node); - node.children.forEach(visit); - }; + const identityProvider = this.identityProvider; + const nodesByIdentity = new Map>(); + this.nodes.forEach(node => nodesByIdentity.set(identityProvider.getId(node.element).toString(), node)); - nodes.forEach(visit); - this.set(values(set)); + const toDeleteByIdentity = new Map>(); + const toRemoveSetter = node => toDeleteByIdentity.set(identityProvider.getId(node.element).toString(), node); + const toRemoveDeleter = node => toDeleteByIdentity.delete(identityProvider.getId(node.element).toString()); + deletedNodes.forEach(node => dfs(node, toRemoveSetter)); + insertedNodes.forEach(node => dfs(node, toRemoveDeleter)); + + toDeleteByIdentity.forEach((_, id) => nodesByIdentity.delete(id)); + this.set(values(nodesByIdentity)); + } + + private createNodeSet(): Set> { + const set = new Set>(); + + for (const node of this.nodes) { + set.add(node); + } + + return set; } } @@ -879,16 +900,16 @@ export abstract class AbstractTree implements IDisposable private renderers: TreeRenderer[]; private focusNavigationFilter: ((node: ITreeNode) => boolean) | undefined; protected model: ITreeModel; - private focus = new Trait(); - private selection = new Trait(); + private focus: Trait; + private selection: Trait; private eventBufferer = new EventBufferer(); private typeFilterController?: TypeFilterController; protected disposables: IDisposable[] = []; get onDidScroll(): Event { return this.view.onDidScroll; } - readonly onDidChangeFocus: Event> = this.eventBufferer.wrapEvent(this.focus.onDidChange); - readonly onDidChangeSelection: Event> = this.eventBufferer.wrapEvent(this.selection.onDidChange); + get onDidChangeFocus(): Event> { return this.eventBufferer.wrapEvent(this.focus.onDidChange); } + get onDidChangeSelection(): Event> { return this.eventBufferer.wrapEvent(this.selection.onDidChange); } get onDidOpen(): Event> { return Event.map(this.view.onDidOpen, asTreeEvent); } get onMouseClick(): Event> { return Event.map(this.view.onMouseClick, asTreeMouseEvent); } @@ -936,41 +957,17 @@ export abstract class AbstractTree implements IDisposable this.disposables.push(filter); } + this.focus = new Trait(_options.identityProvider); + this.selection = new Trait(_options.identityProvider); this.view = new TreeNodeList(container, treeDelegate, this.renderers, this.focus, this.selection, { ...asListOptions(() => this.model, _options), tree: this }); this.model = this.createModel(this.view, _options); onDidChangeCollapseStateRelay.input = this.model.onDidChangeCollapseState; - if (this.options.identityProvider) { - const identityProvider = this.options.identityProvider; - - this.model.onDidSplice(e => { - if (e.deletedNodes.length === 0) { - return; - } - - this.eventBufferer.bufferEvents(() => { - const map = new Map>(); - - for (const node of e.deletedNodes) { - map.set(identityProvider.getId(node.element).toString(), node); - } - - for (const node of e.insertedNodes) { - map.delete(identityProvider.getId(node.element).toString()); - } - - if (map.size === 0) { - return; - } - - const deletedNodes = values(map); - - this.focus.remove(deletedNodes); - this.selection.remove(deletedNodes); - }); - }, null, this.disposables); - } + this.model.onDidSplice(e => { + this.focus.onDidModelSplice(e); + this.selection.onDidModelSplice(e); + }, null, this.disposables); if (_options.keyboardSupport !== false) { const onKeyDown = Event.chain(this.view.onKeyDown) From 1cb6e26ab275bea397ba955c192a0ad972e38fd6 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 6 Feb 2019 11:39:19 +0100 Subject: [PATCH 374/429] es6 compile attempts --- src/vs/base/browser/ui/tree/abstractTree.ts | 2 +- src/vs/base/parts/ipc/node/ipc.ts | 4 ++-- src/vs/code/node/shellEnv.ts | 4 ++-- src/vs/code/node/wait.ts | 4 ++-- src/vs/editor/contrib/suggest/suggest.ts | 2 +- .../node/extensionGalleryService.ts | 4 ++-- .../keybinding/common/keybindingResolver.ts | 2 +- .../lifecycle/electron-main/lifecycleMain.ts | 2 +- src/vs/platform/node/zip.ts | 2 +- .../storage/node/storageMainService.ts | 4 ++-- .../api/electron-browser/mainThreadTask.ts | 2 +- .../workbench/api/node/extHostApiCommands.ts | 2 +- .../api/node/extHostLanguageFeatures.ts | 2 +- .../common/editor/resourceEditorInput.ts | 2 +- .../electron-browser/actions/helpActions.ts | 8 +++---- src/vs/workbench/electron-browser/main.ts | 4 ++-- .../workbench/electron-browser/workbench.ts | 4 ++-- .../parts/extensions/common/extensions.ts | 2 +- .../electron-browser/extensionEditor.ts | 2 +- .../electron-browser/extensionsActions.ts | 16 ++++++------- .../node/extensionsWorkbenchService.ts | 2 +- .../files/browser/editors/textFileEditor.ts | 2 +- .../output/electron-browser/outputServices.ts | 2 +- .../parts/search/browser/searchView.ts | 4 ++-- .../services/backup/node/backupFileService.ts | 6 ++--- .../files/electron-browser/fileService.ts | 2 +- .../electron-browser/remoteFileService.ts | 2 +- .../watcher/unix/chokidarWatcherService.ts | 2 +- .../test/browser/editorGroupsService.test.ts | 4 ++-- .../keybinding/common/keybindingEditing.ts | 4 ++-- .../textfile/common/textFileEditorModel.ts | 2 +- .../common/textModelResolverService.ts | 2 +- .../workbench/test/workbenchTestServices.ts | 24 +++++++++---------- 33 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 5a777136756..d3eb4876738 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -241,7 +241,7 @@ class TreeRenderer implements IListRenderer): void { diff --git a/src/vs/base/parts/ipc/node/ipc.ts b/src/vs/base/parts/ipc/node/ipc.ts index efda16899f0..e0e7b9ad3ac 100644 --- a/src/vs/base/parts/ipc/node/ipc.ts +++ b/src/vs/base/parts/ipc/node/ipc.ts @@ -690,7 +690,7 @@ export class IPCClient implements IChannelClient, IChannelSer export function getDelayedChannel(promise: Promise): T { return { call(command: string, arg?: any, cancellationToken?: CancellationToken): Promise { - return promise.then(c => c.call(command, arg, cancellationToken)); + return promise.then(c => c.call(command, arg, cancellationToken)); }, listen(event: string, arg?: any): Event { @@ -752,4 +752,4 @@ export class StaticRouter implements IClientRouter await Event.toPromise(hub.onDidChangeConnections); return await this.route(hub); } -} \ No newline at end of file +} diff --git a/src/vs/code/node/shellEnv.ts b/src/vs/code/node/shellEnv.ts index 5ea15be5ecf..4f3f8022f46 100644 --- a/src/vs/code/node/shellEnv.ts +++ b/src/vs/code/node/shellEnv.ts @@ -9,7 +9,7 @@ import { generateUuid } from 'vs/base/common/uuid'; import { isWindows } from 'vs/base/common/platform'; function getUnixShellEnvironment(): Promise { - const promise = new Promise((resolve, reject) => { + const promise = new Promise((resolve, reject) => { const runAsNode = process.env['ELECTRON_RUN_AS_NODE']; const noAttach = process.env['ELECTRON_NO_ATTACH_CONSOLE']; const mark = generateUuid().replace(/-/g, '').substr(0, 12); @@ -66,7 +66,7 @@ function getUnixShellEnvironment(): Promise { }); // swallow errors - return promise.then(undefined, () => ({})); + return promise.catch(() => ({})); } diff --git a/src/vs/code/node/wait.ts b/src/vs/code/node/wait.ts index 3b1f1d0750e..6245e052a73 100644 --- a/src/vs/code/node/wait.ts +++ b/src/vs/code/node/wait.ts @@ -21,6 +21,6 @@ export function createWaitMarkerFile(verbose?: boolean): Promise { console.error(`Failed to create marker file for --wait: ${error}`); } - return Promise.resolve(); + return Promise.resolve(undefined); }); -} \ No newline at end of file +} diff --git a/src/vs/editor/contrib/suggest/suggest.ts b/src/vs/editor/contrib/suggest/suggest.ts index 3d7e3b008cd..b068415b791 100644 --- a/src/vs/editor/contrib/suggest/suggest.ts +++ b/src/vs/editor/contrib/suggest/suggest.ts @@ -170,7 +170,7 @@ export function provideSuggestionItems( return hasResult || token.isCancellationRequested; }).then(() => { if (token.isCancellationRequested) { - return Promise.reject(canceled()); + return Promise.reject(canceled()); } return allSuggestions.sort(getSuggestionComparator(snippetConfig)); }); diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index a72c577218f..d4f636b463f 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -774,7 +774,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { const headers = { 'Accept-Encoding': 'gzip' }; return this.getAsset(manifest, { headers }) .then(context => asJson(context)) - .then(manifest => manifest ? manifest.engines.vscode : Promise.reject('Error while reading manifest')); + .then(manifest => manifest ? manifest.engines.vscode : Promise.reject('Error while reading manifest')); } private getLastValidExtensionVersionReccursively(extension: IRawGalleryExtension, versions: IRawGalleryExtensionVersion[]): Promise { @@ -839,7 +839,7 @@ export function resolveMarketplaceHeaders(environmentService: IEnvironmentServic const marketplaceMachineIdFile = path.join(environmentService.userDataPath, 'machineid'); return readFile(marketplaceMachineIdFile, 'utf8') - .then(contents => isUUID(contents) ? contents : Promise.resolve(null), () => Promise.resolve(null) /* error reading ID file */) + .then(contents => isUUID(contents) ? contents : null, () => null /* error reading ID file */) .then(uuid => { if (!uuid) { uuid = generateUuid(); diff --git a/src/vs/platform/keybinding/common/keybindingResolver.ts b/src/vs/platform/keybinding/common/keybindingResolver.ts index 4e2ee339287..0d631c3a4de 100644 --- a/src/vs/platform/keybinding/common/keybindingResolver.ts +++ b/src/vs/platform/keybinding/common/keybindingResolver.ts @@ -311,7 +311,7 @@ export class KeybindingResolver { if (seenMap.has(id)) { return; } - seenMap.set(id); + seenMap.set(id, true); if (id[0] === '_' || id.indexOf('vscode.') === 0) { // private command return; } diff --git a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts index 28697f4c745..587c31f584e 100644 --- a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts @@ -233,7 +233,7 @@ export class LifecycleService extends Disposable implements ILifecycleService { } }); - this.pendingWillShutdownPromise = Promise.all(joiners).then(undefined, err => this.logService.error(err)); + this.pendingWillShutdownPromise = Promise.all(joiners).then(() => undefined, err => this.logService.error(err)); return this.pendingWillShutdownPromise; } diff --git a/src/vs/platform/node/zip.ts b/src/vs/platform/node/zip.ts index be8629a236a..5696d1dec62 100644 --- a/src/vs/platform/node/zip.ts +++ b/src/vs/platform/node/zip.ts @@ -87,7 +87,7 @@ function extractEntry(stream: Readable, fileName: string, mode: number, targetPa } }); - return Promise.resolve(mkdirp(targetDirName, undefined, token)).then(() => new Promise((c, e) => { + return Promise.resolve(mkdirp(targetDirName, undefined, token)).then(() => new Promise((c, e) => { if (token.isCancellationRequested) { return; } diff --git a/src/vs/platform/storage/node/storageMainService.ts b/src/vs/platform/storage/node/storageMainService.ts index 72ae2f3222b..03653e4f891 100644 --- a/src/vs/platform/storage/node/storageMainService.ts +++ b/src/vs/platform/storage/node/storageMainService.ts @@ -236,7 +236,7 @@ export class StorageMainService extends Disposable implements IStorageMainServic return import('vscode-sqlite3').then(sqlite3 => { - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const handleSuffixKey = (row, key: string, suffix: string) => { if (endsWith(key, suffix.toLowerCase())) { const value: string = row.value.toString('utf16le'); @@ -366,4 +366,4 @@ export class StorageMainService extends Disposable implements IStorageMainServic checkIntegrity(full: boolean): Promise { return this.storage.checkIntegrity(full); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/api/electron-browser/mainThreadTask.ts b/src/vs/workbench/api/electron-browser/mainThreadTask.ts index e4d3db05dfe..cbd8ea073e5 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTask.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTask.ts @@ -532,7 +532,7 @@ export class MainThreadTask implements MainThreadTaskShape { forEach(values.variables, (entry) => { partiallyResolvedVars.push(entry.value); }); - return new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { this._configurationResolverService.resolveWithInteraction(workspaceFolder, partiallyResolvedVars, 'tasks').then(resolvedVars => { let result = { process: undefined as string, diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts index 9b5931a4bac..9565fbc108c 100644 --- a/src/vs/workbench/api/node/extHostApiCommands.ts +++ b/src/vs/workbench/api/node/extHostApiCommands.ts @@ -372,7 +372,7 @@ export class ExtHostApiCommands { return undefined; } if (value.rejectReason) { - return Promise.reject(new Error(value.rejectReason)); + return Promise.reject(new Error(value.rejectReason)); } return typeConverters.WorkspaceEdit.to(value); }); diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index 76b8b1fbe00..df50261a1e6 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -553,7 +553,7 @@ class RenameAdapter { if (rejectReason) { return { rejectReason, range: undefined, text: undefined }; } else { - return Promise.reject(err); + return Promise.reject(err); } }); } diff --git a/src/vs/workbench/common/editor/resourceEditorInput.ts b/src/vs/workbench/common/editor/resourceEditorInput.ts index 8e9061c79ec..d61b126f22f 100644 --- a/src/vs/workbench/common/editor/resourceEditorInput.ts +++ b/src/vs/workbench/common/editor/resourceEditorInput.ts @@ -92,7 +92,7 @@ export class ResourceEditorInput extends EditorInput { ref.dispose(); this.modelReference = null; - return Promise.reject(new Error(`Unexpected model for ResourceInput: ${this.resource}`)); + return Promise.reject(new Error(`Unexpected model for ResourceInput: ${this.resource}`)); } return model; diff --git a/src/vs/workbench/electron-browser/actions/helpActions.ts b/src/vs/workbench/electron-browser/actions/helpActions.ts index 85d39d64d7b..009ef59e1b0 100644 --- a/src/vs/workbench/electron-browser/actions/helpActions.ts +++ b/src/vs/workbench/electron-browser/actions/helpActions.ts @@ -161,7 +161,7 @@ export class OpenTwitterUrlAction extends Action { super(id, label); } - run(): Promise { + run(): Promise { if (product.twitterUrl) { window.open(product.twitterUrl); } @@ -182,7 +182,7 @@ export class OpenRequestFeatureUrlAction extends Action { super(id, label); } - run(): Promise { + run(): Promise { if (product.requestFeatureUrl) { window.open(product.requestFeatureUrl); } @@ -203,7 +203,7 @@ export class OpenLicenseUrlAction extends Action { super(id, label); } - run(): Promise { + run(): Promise { if (product.licenseUrl) { if (language) { const queryArgChar = product.licenseUrl.indexOf('?') > 0 ? '&' : '?'; @@ -229,7 +229,7 @@ export class OpenPrivacyStatementUrlAction extends Action { super(id, label); } - run(): Promise { + run(): Promise { if (product.privacyStatementUrl) { if (language) { const queryArgChar = product.privacyStatementUrl.indexOf('?') > 0 ? '&' : '?'; diff --git a/src/vs/workbench/electron-browser/main.ts b/src/vs/workbench/electron-browser/main.ts index 1a7ba1c6ca0..f97c9e7afdd 100644 --- a/src/vs/workbench/electron-browser/main.ts +++ b/src/vs/workbench/electron-browser/main.ts @@ -164,7 +164,7 @@ function createWorkspaceInitializationPayload(configuration: IWindowConfiguratio } // Single-folder workspace - let workspaceInitializationPayload: Promise = Promise.resolve(); + let workspaceInitializationPayload: Promise = Promise.resolve(undefined); if (configuration.folderUri) { workspaceInitializationPayload = resolveSingleFolderWorkspaceInitializationPayload(configuration.folderUri); } @@ -179,7 +179,7 @@ function createWorkspaceInitializationPayload(configuration: IWindowConfiguratio } else if (environmentService.isExtensionDevelopment) { id = 'ext-dev'; // extension development window never stores backups and is a singleton } else { - return Promise.reject(new Error('Unexpected window configuration without backupPath')); + return Promise.reject(new Error('Unexpected window configuration without backupPath')); } payload = { id } as IEmptyWorkspaceInitializationPayload; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index d82db96296d..54405b2aa0f 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -743,7 +743,7 @@ export class Workbench extends Disposable implements IPartService { return editorService.openEditors(editors); } - return Promise.resolve(); + return Promise.resolve(undefined); } const editorsToOpen = this.resolveEditorsToOpen(); @@ -1814,4 +1814,4 @@ export class Workbench extends Disposable implements IPartService { this.workbenchGrid.layout(); } } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/extensions/common/extensions.ts b/src/vs/workbench/parts/extensions/common/extensions.ts index 4684950b9a0..3d3ec28b199 100644 --- a/src/vs/workbench/parts/extensions/common/extensions.ts +++ b/src/vs/workbench/parts/extensions/common/extensions.ts @@ -139,4 +139,4 @@ export class ExtensionContainers extends Disposable { } } } -} \ No newline at end of file +} diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts index 65574224a7d..826a108b8c5 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts @@ -604,7 +604,7 @@ export class ExtensionEditor extends BaseEditor { } return this.loadContents(() => this.extensionDependencies.get()) - .then(extensionDependencies => { + .then(extensionDependencies => { if (extensionDependencies) { const content = $('div', { class: 'subcontent' }); const scrollableContent = new DomScrollableElement(content, {}); diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts index 33ff76a0343..2998e2f0086 100644 --- a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts @@ -180,7 +180,7 @@ export class InstallAction extends ExtensionAction { return this.install(this.extension); } - private install(extension: IExtension): Promise { + private install(extension: IExtension): Promise { return this.extensionsWorkbenchService.install(extension).then(null, err => { if (!extension.gallery) { return this.notificationService.error(err); @@ -940,7 +940,7 @@ export class UpdateAllAction extends Action { return Promise.all(this.outdated.map(e => this.install(e))); } - private install(extension: IExtension): Promise { + private install(extension: IExtension): Promise { return this.extensionsWorkbenchService.install(extension).then(undefined, err => { if (!extension.gallery) { return this.notificationService.error(err); @@ -984,16 +984,16 @@ export class ReloadAction extends ExtensionAction { this.enabled = false; this.tooltip = ''; if (!this.extension) { - return Promise.resolve(); + return Promise.resolve(undefined); } const state = this.extension.state; if (state === ExtensionState.Installing || state === ExtensionState.Uninstalling) { - return Promise.resolve(); + return Promise.resolve(undefined); } const installed = this.extensionsWorkbenchService.local.filter(e => areSameExtensions(e.identifier, this.extension.identifier))[0]; const local = this.extension.local || (installed && installed.local); if (local && local.manifest && local.manifest.contributes && local.manifest.contributes.localizations && local.manifest.contributes.localizations.length > 0) { - return Promise.resolve(); + return Promise.resolve(undefined); } return this.extensionService.getExtensions() .then(runningExtensions => this.computeReloadState(runningExtensions, installed)); @@ -1312,7 +1312,7 @@ export class InstallWorkspaceRecommendedExtensionsAction extends Action { viewlet.focus(); const names = this.recommendations.map(({ extensionId }) => extensionId); return this.extensionWorkbenchService.queryGallery({ names, source: 'install-all-workspace-recommendations' }).then(pager => { - let installPromises: Promise[] = []; + let installPromises: Promise[] = []; let model = new PagedModel(pager); for (let i = 0; i < pager.total; i++) { installPromises.push(model.resolve(i, CancellationToken.None).then(e => { @@ -1779,7 +1779,7 @@ export abstract class AbstractConfigureRecommendedExtensionsAction extends Actio }); } - private getSelectionPosition(content: string, resource: URI, path: json.JSONPath): Promise { + private getSelectionPosition(content: string, resource: URI, path: json.JSONPath): Promise { const tree = json.parseTree(content); const node = json.findNodeAtLocation(tree, path); if (node && node.parent && node.parent.children) { @@ -1798,7 +1798,7 @@ export abstract class AbstractConfigureRecommendedExtensionsAction extends Actio }; }); } - return Promise.resolve(); + return Promise.resolve(undefined); } private getOrCreateExtensionsFile(extensionsFileResource: URI): Promise<{ created: boolean, extensionsFileResource: URI, content: string }> { diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index 6d25977a663..3a5c4e528c9 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -673,7 +673,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService, installVersion(extension: IExtension, version: string): Promise { if (!(extension instanceof Extension)) { - return Promise.resolve(); + return Promise.resolve(extension); } if (!extension.gallery) { diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts index dceca11ee4d..acc992e3cae 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts @@ -177,7 +177,7 @@ export class TextFileEditor extends BaseTextEditor { if ((error).fileOperationResult === FileOperationResult.FILE_IS_DIRECTORY) { this.openAsFolder(input); - return Promise.reject(new Error(nls.localize('openFolderError', "File is a directory"))); + return Promise.reject(new Error(nls.localize('openFolderError', "File is a directory"))); } // Offer to create a file from the error if we have a file not found and the name is valid diff --git a/src/vs/workbench/parts/output/electron-browser/outputServices.ts b/src/vs/workbench/parts/output/electron-browser/outputServices.ts index e83e6fe759d..586a275ebbc 100644 --- a/src/vs/workbench/parts/output/electron-browser/outputServices.ts +++ b/src/vs/workbench/parts/output/electron-browser/outputServices.ts @@ -340,7 +340,7 @@ class FileOutputChannel extends AbstractFileOutputChannel implements OutputChann private updateInProgress: boolean = false; private etag: string = ''; - private loadModelPromise: Promise = Promise.resolve(); + private loadModelPromise: Promise = Promise.resolve(undefined); constructor( outputChannelDescriptor: IOutputChannelDescriptor, diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/parts/search/browser/searchView.ts index b492c49c74f..2c616389d02 100644 --- a/src/vs/workbench/parts/search/browser/searchView.ts +++ b/src/vs/workbench/parts/search/browser/searchView.ts @@ -122,7 +122,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { private searchWithoutFolderMessageElement: HTMLElement; - private currentSearchQ = Promise.resolve(); + private currentSearchQ = Promise.resolve(); constructor( @IPartService partService: IPartService, @@ -1228,7 +1228,7 @@ export class SearchView extends Viewlet implements IViewlet, IPanel { this.currentSearchQ = this.currentSearchQ .then(() => this.doSearch(query, options, excludePatternText, includePatternText)) - .then(() => { }, () => { }); + .then(() => undefined, () => undefined); } private doSearch(query: ITextQuery, options: ITextQueryBuilderOptions, excludePatternText: string, includePatternText: string): Thenable { diff --git a/src/vs/workbench/services/backup/node/backupFileService.ts b/src/vs/workbench/services/backup/node/backupFileService.ts index f0e28bc0975..3783534ba58 100644 --- a/src/vs/workbench/services/backup/node/backupFileService.ts +++ b/src/vs/workbench/services/backup/node/backupFileService.ts @@ -257,7 +257,7 @@ export class InMemoryBackupFileService implements IBackupFileService { return Promise.resolve(backupResource); } - return Promise.resolve(); + return Promise.resolve(undefined); } backupResource(resource: Uri, content: ITextSnapshot, versionId?: number): Promise { @@ -273,7 +273,7 @@ export class InMemoryBackupFileService implements IBackupFileService { return Promise.resolve(createTextBufferFactoryFromSnapshot(snapshot)); } - return Promise.resolve(); + return Promise.resolve(undefined); } getWorkspaceFileBackups(): Promise { @@ -299,4 +299,4 @@ export class InMemoryBackupFileService implements IBackupFileService { private hashPath(resource: Uri): string { return crypto.createHash('md5').update(resource.fsPath).digest('hex'); } -} \ No newline at end of file +} diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index f6419c6094f..1a66c56808e 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -555,7 +555,7 @@ export class FileService extends Disposable implements IFileService { // 1.) check file for writing return this.checkFileBeforeWriting(absolutePath, options).then(exists => { - let createParentsPromise: Promise; + let createParentsPromise: Promise; if (exists) { createParentsPromise = Promise.resolve(); } else { diff --git a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts index 80078b6cade..7d58f3f5694 100644 --- a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts +++ b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts @@ -386,7 +386,7 @@ export class RemoteFileService extends FileService { return toDecodeStream(readable, decodeStreamOpts).then(data => { if (options.acceptTextOnly && data.detected.seemsBinary) { - return Promise.reject(new FileOperationError( + return Promise.reject(new FileOperationError( localize('fileBinaryError', "File seems to be binary and cannot be opened as text"), FileOperationResult.FILE_IS_BINARY, options diff --git a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts index ba4ada4cd68..4ea2032f5a6 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts @@ -242,7 +242,7 @@ export class ChokidarWatcherService implements IWatcherService { }); } - return Promise.resolve(); + return Promise.resolve(undefined); }); } }); diff --git a/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts b/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts index 806b62a5e55..445826f891b 100644 --- a/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts +++ b/src/vs/workbench/services/group/test/browser/editorGroupsService.test.ts @@ -41,7 +41,7 @@ export class TestEditorInput extends EditorInput implements IFileEditorInput { constructor(private resource: URI) { super(); } getTypeId() { return 'testEditorInputForEditorGroupService'; } - resolve(): Promise { return Promise.resolve(); } + resolve(): Promise { return Promise.resolve(undefined); } matches(other: TestEditorInput): boolean { return other && this.resource.toString() === other.resource.toString() && other instanceof TestEditorInput; } setEncoding(encoding: string) { } getEncoding(): string { return null!; } @@ -751,4 +751,4 @@ suite('Editor groups service', () => { part.dispose(); }); -}); \ No newline at end of file +}); diff --git a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts index 354a3b44f43..e832b4a11b0 100644 --- a/src/vs/workbench/services/keybinding/common/keybindingEditing.ts +++ b/src/vs/workbench/services/keybinding/common/keybindingEditing.ts @@ -220,11 +220,11 @@ export class KeybindingsEditingService extends Disposable implements IKeybinding if (model.getValue()) { const parsed = this.parse(model); if (parsed.parseErrors.length) { - return Promise.reject(new Error(localize('parseErrors', "Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again."))); + return Promise.reject(new Error(localize('parseErrors', "Unable to write to the keybindings configuration file. Please open it to correct errors/warnings in the file and try again."))); } if (parsed.result) { if (!isArray(parsed.result)) { - return Promise.reject(new Error(localize('errorInvalidConfiguration', "Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again."))); + return Promise.reject(new Error(localize('errorInvalidConfiguration', "Unable to write to the keybindings configuration file. It has an object which is not of type Array. Please open the file to clean up and try again."))); } } else { const content = EOL + '[]'; diff --git a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts index 9537d48d1f2..248ba255f0e 100644 --- a/src/vs/workbench/services/textfile/common/textFileEditorModel.ts +++ b/src/vs/workbench/services/textfile/common/textFileEditorModel.ts @@ -215,7 +215,7 @@ export class TextFileEditorModel extends BaseTextEditorModel implements ITextFil // Unset flags const undo = this.setDirty(false); - let loadPromise: Promise; + let loadPromise: Promise; if (soft) { loadPromise = Promise.resolve(); } else { diff --git a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts index e274fce62fa..3b011295c08 100644 --- a/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts +++ b/src/vs/workbench/services/textmodelResolver/common/textModelResolverService.ts @@ -107,7 +107,7 @@ class ResourceModelCollection extends ReferenceCollection { if (!model) { - return Promise.reject(new Error('resource is not available')); + return Promise.reject(new Error('resource is not available')); } return model; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index f902c08b46c..a28b4952f26 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -429,10 +429,10 @@ export class TestFileDialogService implements IFileDialogService { return Promise.resolve(0); } public showSaveDialog(_options: ISaveDialogOptions): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } public showOpenDialog(_options: IOpenDialogOptions): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } } @@ -1002,7 +1002,7 @@ export class TestCodeEditorService implements ICodeEditorService { setTransientModelProperty(_model: ITextModel, _key: string, _value: any): void { } getTransientModelProperty(_model: ITextModel, _key: string) { } getActiveCodeEditor(): ICodeEditor { return null; } - openCodeEditor(_input: IResourceInput, _source: ICodeEditor, _sideBySide?: boolean): Promise { return Promise.resolve(); } + openCodeEditor(_input: IResourceInput, _source: ICodeEditor, _sideBySide?: boolean): Promise { return Promise.resolve(undefined); } } export class TestWindowService implements IWindowService { @@ -1063,7 +1063,7 @@ export class TestWindowService implements IWindowService { } enterWorkspace(_path: URI): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } toggleFullScreen(): Promise { @@ -1075,7 +1075,7 @@ export class TestWindowService implements IWindowService { } getRecentlyOpened(): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } focusWindow(): Promise { @@ -1224,7 +1224,7 @@ export class TestWindowsService implements IWindowsService { } enterWorkspace(_windowId: number, _path: URI): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } toggleFullScreen(_windowId: number): Promise { @@ -1248,7 +1248,7 @@ export class TestWindowsService implements IWindowsService { } getRecentlyOpened(_windowId: number): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } focusWindow(_windowId: number): Promise { @@ -1260,7 +1260,7 @@ export class TestWindowsService implements IWindowsService { } isMaximized(_windowId: number): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } maximizeWindow(_windowId: number): Promise { @@ -1313,7 +1313,7 @@ export class TestWindowsService implements IWindowsService { } getWindows(): Promise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]> { - return Promise.resolve(); + return Promise.resolve(undefined); } getWindowCount(): Promise { @@ -1372,15 +1372,15 @@ export class TestWindowsService implements IWindowsService { } showMessageBox(_windowId: number, _options: Electron.MessageBoxOptions): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } showSaveDialog(_windowId: number, _options: Electron.SaveDialogOptions): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } showOpenDialog(_windowId: number, _options: Electron.OpenDialogOptions): Promise { - return Promise.resolve(); + return Promise.resolve(undefined); } openAboutDialog(): Promise { From e63c7d08601b98fc48b90f08054cee6a1df85f3f Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 6 Feb 2019 11:51:18 +0100 Subject: [PATCH 375/429] Promise.resolve() -> Promise --- src/typings/es6-promise.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/typings/es6-promise.d.ts b/src/typings/es6-promise.d.ts index f674baa6a87..2d3271e2848 100644 --- a/src/typings/es6-promise.d.ts +++ b/src/typings/es6-promise.d.ts @@ -44,7 +44,12 @@ declare namespace Promise { * Make a new promise from the thenable. * A thenable is promise-like in as far as it has a "then" method. */ - function resolve(value?: T | Thenable): Promise; + function resolve(value: T | Thenable): Promise; + + /** + * + */ + function resolve(): Promise; /** * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error From e18eda4d683e085690bdb77d3ae74edc5a76750b Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 6 Feb 2019 11:54:34 +0100 Subject: [PATCH 376/429] strict null trouble --- src/vs/platform/commands/common/commands.ts | 4 ++-- .../services/themes/electron-browser/fileIconThemeData.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/platform/commands/common/commands.ts b/src/vs/platform/commands/common/commands.ts index 5a5bf2ca121..16c3a764a02 100644 --- a/src/vs/platform/commands/common/commands.ts +++ b/src/vs/platform/commands/common/commands.ts @@ -132,7 +132,7 @@ export const CommandsRegistry: ICommandRegistry = new class implements ICommandR export const NullCommandService: ICommandService = { _serviceBrand: undefined, onWillExecuteCommand: () => ({ dispose: () => { } }), - executeCommand() { - return Promise.resolve(undefined); + executeCommand() { + return Promise.resolve(undefined); } }; diff --git a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts index 12655d450e1..7694bf4c616 100644 --- a/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/fileIconThemeData.ts @@ -29,15 +29,15 @@ export class FileIconThemeData implements IFileIconTheme { private constructor() { } - public ensureLoaded(fileService: IFileService): Promise { + public ensureLoaded(fileService: IFileService): Promise { return !this.isLoaded ? this.load(fileService) : Promise.resolve(this.styleSheetContent); } - public reload(fileService: IFileService): Promise { + public reload(fileService: IFileService): Promise { return this.load(fileService); } - private load(fileService: IFileService): Promise { + private load(fileService: IFileService): Promise { if (!this.location) { return Promise.resolve(this.styleSheetContent); } From 9175a0612c3c183c06988e197d4639d4b5b0742d Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 6 Feb 2019 11:57:06 +0100 Subject: [PATCH 377/429] no snippets when intellisense is triggered via space-character, #67714 --- .../electron-browser/snippetCompletionProvider.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts b/src/vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts index f2abc6ac957..8e8456fb85a 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts @@ -8,7 +8,7 @@ import { compare } from 'vs/base/common/strings'; import { Position } from 'vs/editor/common/core/position'; import { IRange, Range } from 'vs/editor/common/core/range'; import { ITextModel } from 'vs/editor/common/model'; -import { CompletionItem, CompletionItemKind, CompletionItemProvider, CompletionList, LanguageId, CompletionItemInsertTextRule } from 'vs/editor/common/modes'; +import { CompletionItem, CompletionItemKind, CompletionItemProvider, CompletionList, LanguageId, CompletionItemInsertTextRule, CompletionContext, CompletionTriggerKind } from 'vs/editor/common/modes'; import { IModeService } from 'vs/editor/common/services/modeService'; import { SnippetParser } from 'vs/editor/contrib/snippet/snippetParser'; import { localize } from 'vs/nls'; @@ -73,12 +73,17 @@ export class SnippetCompletionProvider implements CompletionItemProvider { // } - provideCompletionItems(model: ITextModel, position: Position): Promise | undefined { + provideCompletionItems(model: ITextModel, position: Position, context: CompletionContext): Promise | undefined { if (position.column >= SnippetCompletionProvider._maxPrefix) { return undefined; } + if (context.triggerKind === CompletionTriggerKind.TriggerCharacter && context.triggerCharacter === ' ') { + // no snippets when suggestions have been triggered by space + return undefined; + } + const languageId = this._getLanguageIdAtPosition(model, position); return this._snippets.getSnippets(languageId).then(snippets => { From 2dcae22d7eae27290c10b96d24c19f2f9e3ddf07 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Wed, 6 Feb 2019 12:00:33 +0100 Subject: [PATCH 378/429] fix compilos --- .../electron-browser/snippetsService.test.ts | 46 ++++++++++--------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts b/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts index 873bd9fd020..2986d7a5e2e 100644 --- a/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts +++ b/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts @@ -12,6 +12,7 @@ import { TextModel } from 'vs/editor/common/model/textModel'; import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; import { Snippet, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; +import { CompletionContext, CompletionTriggerKind } from 'vs/editor/common/modes'; class SimpleSnippetService implements ISnippetsService { _serviceBrand: any; @@ -39,6 +40,7 @@ suite('SnippetsService', function () { let modeService: ModeServiceImpl; let snippetService: ISnippetsService; + let context: CompletionContext = { triggerKind: CompletionTriggerKind.Invoke }; setup(function () { modeService = new ModeServiceImpl(); @@ -67,7 +69,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); const model = TextModel.createFromString('', undefined, modeService.getLanguageIdentifier('fooLang')); - return provider.provideCompletionItems(model, new Position(1, 1))!.then(result => { + return provider.provideCompletionItems(model, new Position(1, 1), context)!.then(result => { assert.equal(result.incomplete, undefined); assert.equal(result.suggestions.length, 2); }); @@ -78,7 +80,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); const model = TextModel.createFromString('bar', undefined, modeService.getLanguageIdentifier('fooLang')); - return provider.provideCompletionItems(model, new Position(1, 4))!.then(result => { + return provider.provideCompletionItems(model, new Position(1, 4), context)!.then(result => { assert.equal(result.incomplete, undefined); assert.equal(result.suggestions.length, 1); assert.equal(result.suggestions[0].label, 'bar'); @@ -110,7 +112,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); const model = TextModel.createFromString('bar-bar', undefined, modeService.getLanguageIdentifier('fooLang')); - await provider.provideCompletionItems(model, new Position(1, 3))!.then(result => { + await provider.provideCompletionItems(model, new Position(1, 3), context)!.then(result => { assert.equal(result.incomplete, undefined); assert.equal(result.suggestions.length, 2); assert.equal(result.suggestions[0].label, 'bar'); @@ -121,7 +123,7 @@ suite('SnippetsService', function () { assert.equal(result.suggestions[1].range.startColumn, 1); }); - await provider.provideCompletionItems(model, new Position(1, 5))!.then(result => { + await provider.provideCompletionItems(model, new Position(1, 5), context)!.then(result => { assert.equal(result.incomplete, undefined); assert.equal(result.suggestions.length, 1); assert.equal(result.suggestions[0].label, 'bar-bar'); @@ -129,7 +131,7 @@ suite('SnippetsService', function () { assert.equal(result.suggestions[0].range.startColumn, 1); }); - await provider.provideCompletionItems(model, new Position(1, 6))!.then(result => { + await provider.provideCompletionItems(model, new Position(1, 6), context)!.then(result => { assert.equal(result.incomplete, undefined); assert.equal(result.suggestions.length, 2); assert.equal(result.suggestions[0].label, 'bar'); @@ -155,19 +157,19 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('\t { + return provider.provideCompletionItems(model, new Position(1, 7), context)!.then(result => { assert.equal(result.suggestions.length, 1); model.dispose(); model = TextModel.createFromString('\t { assert.equal(result.suggestions.length, 1); assert.equal(result.suggestions[0].range.startColumn, 2); model.dispose(); model = TextModel.createFromString('a { assert.equal(result.suggestions.length, 1); assert.equal(result.suggestions[0].range.startColumn, 2); @@ -190,9 +192,9 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('\n\t\n>/head>', undefined, modeService.getLanguageIdentifier('fooLang')); - return provider.provideCompletionItems(model, new Position(1, 1))!.then(result => { + return provider.provideCompletionItems(model, new Position(1, 1), context)!.then(result => { assert.equal(result.suggestions.length, 1); - return provider.provideCompletionItems(model, new Position(2, 2))!; + return provider.provideCompletionItems(model, new Position(2, 2), context)!; }).then(result => { assert.equal(result.suggestions.length, 1); }); @@ -220,7 +222,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('', undefined, modeService.getLanguageIdentifier('fooLang')); - return provider.provideCompletionItems(model, new Position(1, 1))!.then(result => { + return provider.provideCompletionItems(model, new Position(1, 1), context)!.then(result => { assert.equal(result.suggestions.length, 2); let [first, second] = result.suggestions; assert.equal(first.label, 'first'); @@ -242,13 +244,13 @@ suite('SnippetsService', function () { let model = TextModel.createFromString('p-', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 2))!; + let result = await provider.provideCompletionItems(model, new Position(1, 2), context)!; assert.equal(result.suggestions.length, 1); - result = await provider.provideCompletionItems(model, new Position(1, 3))!; + result = await provider.provideCompletionItems(model, new Position(1, 3), context)!; assert.equal(result.suggestions.length, 1); - result = await provider.provideCompletionItems(model, new Position(1, 3))!; + result = await provider.provideCompletionItems(model, new Position(1, 3), context)!; assert.equal(result.suggestions.length, 1); }); @@ -266,7 +268,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea b', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 158))!; + let result = await provider.provideCompletionItems(model, new Position(1, 158), context)!; assert.equal(result.suggestions.length, 1); }); @@ -285,7 +287,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString(':', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 2))!; + let result = await provider.provideCompletionItems(model, new Position(1, 2), context)!; assert.equal(result.suggestions.length, 0); }); @@ -304,7 +306,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('template', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 9))!; + let result = await provider.provideCompletionItems(model, new Position(1, 9), context)!; assert.equal(result.suggestions.length, 1); assert.equal(result.suggestions[0].label, 'mytemplate'); @@ -324,7 +326,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea Thisisaverylonglinegoingwithmore100bcharactersandthismakesintellisensebecomea b text_after_b', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 158))!; + let result = await provider.provideCompletionItems(model, new Position(1, 158), context)!; assert.equal(result.suggestions.length, 1); }); @@ -346,7 +348,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('.🐷-a-b', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 8))!; + let result = await provider.provideCompletionItems(model, new Position(1, 8), context)!; assert.equal(result.suggestions.length, 1); @@ -367,7 +369,7 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString('a ', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 3))!; + let result = await provider.provideCompletionItems(model, new Position(1, 3), context)!; assert.equal(result.suggestions.length, 1); }); @@ -394,14 +396,14 @@ suite('SnippetsService', function () { const provider = new SnippetCompletionProvider(modeService, snippetService); let model = TextModel.createFromString(' <', undefined, modeService.getLanguageIdentifier('fooLang')); - let result = await provider.provideCompletionItems(model, new Position(1, 3))!; + let result = await provider.provideCompletionItems(model, new Position(1, 3), context)!; assert.equal(result.suggestions.length, 1); let [first] = result.suggestions; assert.equal(first.range.startColumn, 2); model = TextModel.createFromString('1', undefined, modeService.getLanguageIdentifier('fooLang')); - result = await provider.provideCompletionItems(model, new Position(1, 2))!; + result = await provider.provideCompletionItems(model, new Position(1, 2), context)!; assert.equal(result.suggestions.length, 1); [first] = result.suggestions; From 9f479b17dee7eb4ec522ffbf6196c144c349ab71 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 6 Feb 2019 12:33:36 +0100 Subject: [PATCH 379/429] debt - extract a reusable NullExtensionService --- src/vs/workbench/electron-browser/shell.ts | 1 - .../test/common/commandService.test.ts | 61 ++----------------- .../services/extensions/common/extensions.ts | 24 ++++++++ .../workbench/test/workbenchTestServices.ts | 27 +------- 4 files changed, 32 insertions(+), 81 deletions(-) diff --git a/src/vs/workbench/electron-browser/shell.ts b/src/vs/workbench/electron-browser/shell.ts index ddd6d5862c7..593c56b37ca 100644 --- a/src/vs/workbench/electron-browser/shell.ts +++ b/src/vs/workbench/electron-browser/shell.ts @@ -369,7 +369,6 @@ export class Shell extends Disposable { serviceCollection.set(IMarkerService, new SyncDescriptor(MarkerService, undefined, true)); - serviceCollection.set(IModeService, new SyncDescriptor(WorkbenchModeServiceImpl)); serviceCollection.set(ITextResourceConfigurationService, new SyncDescriptor(TextResourceConfigurationService)); diff --git a/src/vs/workbench/services/commands/test/common/commandService.test.ts b/src/vs/workbench/services/commands/test/common/commandService.test.ts index b686e562f1b..4eef877efd0 100644 --- a/src/vs/workbench/services/commands/test/common/commandService.test.ts +++ b/src/vs/workbench/services/commands/test/common/commandService.test.ts @@ -6,59 +6,10 @@ import * as assert from 'assert'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { CommandService } from 'vs/workbench/services/commands/common/commandService'; -import { IExtensionService, ExtensionPointContribution, IExtensionDescription, ProfileSession } from 'vs/workbench/services/extensions/common/extensions'; +import { NullExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService'; -import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -import { Event, Emitter } from 'vs/base/common/event'; import { NullLogService } from 'vs/platform/log/common/log'; -class SimpleExtensionService implements IExtensionService { - _serviceBrand: any; - private _onDidRegisterExtensions = new Emitter(); - get onDidRegisterExtensions(): Event { - return this._onDidRegisterExtensions.event; - } - onDidChangeExtensionsStatus = null!; - onDidChangeExtensions = null!; - onWillActivateByEvent = null!; - onDidChangeResponsiveChange = null!; - activateByEvent(activationEvent: string): Promise { - return this.whenInstalledExtensionsRegistered().then(() => { }); - } - whenInstalledExtensionsRegistered(): Promise { - return Promise.resolve(true); - } - readExtensionPointContributions(extPoint: IExtensionPoint): Promise[]> { - return Promise.resolve([]); - } - getExtensionsStatus() { - return undefined!; - } - getExtensions(): Promise { - return Promise.resolve([]); - } - getExtension() { - return Promise.resolve(undefined); - } - canProfileExtensionHost() { - return false; - } - startExtensionHostProfile(): Promise { - throw new Error('Not implemented'); - } - getInspectPort(): number { - return 0; - } - restartExtensionHost(): void { - } - startExtensionHost(): void { - } - stopExtensionHost(): void { - } - canAddExtension(): boolean { return false; } - canRemoveExtension(): boolean { return false; } -} - suite('CommandService', function () { let commandRegistration: IDisposable; @@ -75,7 +26,7 @@ suite('CommandService', function () { let lastEvent: string; - let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService { + let service = new CommandService(new InstantiationService(), new class extends NullExtensionService { activateByEvent(activationEvent: string): Promise { lastEvent = activationEvent; return super.activateByEvent(activationEvent); @@ -94,7 +45,7 @@ suite('CommandService', function () { test('fwd activation error', async function () { - const extensionService = new class extends SimpleExtensionService { + const extensionService = new class extends NullExtensionService { activateByEvent(activationEvent: string): Promise { return Promise.reject(new Error('bad_activate')); } @@ -114,7 +65,7 @@ suite('CommandService', function () { let callCounter = 0; let reg = CommandsRegistry.registerCommand('bar', () => callCounter += 1); - let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService { + let service = new CommandService(new InstantiationService(), new class extends NullExtensionService { whenInstalledExtensionsRegistered() { return new Promise(_resolve => { /*ignore*/ }); } @@ -131,7 +82,7 @@ suite('CommandService', function () { let resolveFunc: Function; const whenInstalledExtensionsRegistered = new Promise(_resolve => { resolveFunc = _resolve; }); - let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService { + let service = new CommandService(new InstantiationService(), new class extends NullExtensionService { whenInstalledExtensionsRegistered() { return whenInstalledExtensionsRegistered; } @@ -154,7 +105,7 @@ suite('CommandService', function () { let callCounter = 0; let dispoables: IDisposable[] = []; let events: string[] = []; - let service = new CommandService(new InstantiationService(), new class extends SimpleExtensionService { + let service = new CommandService(new InstantiationService(), new class extends NullExtensionService { activateByEvent(event: string): Promise { events.push(event); diff --git a/src/vs/workbench/services/extensions/common/extensions.ts b/src/vs/workbench/services/extensions/common/extensions.ts index 4a7f1019f4a..fabecb6b379 100644 --- a/src/vs/workbench/services/extensions/common/extensions.ts +++ b/src/vs/workbench/services/extensions/common/extensions.ts @@ -259,3 +259,27 @@ export function toExtension(extensionDescription: IExtensionDescription): IExten location: extensionDescription.extensionLocation, }; } + + +export class NullExtensionService implements IExtensionService { + _serviceBrand: any; + onDidRegisterExtensions: Event = Event.None; + onDidChangeExtensionsStatus: Event = Event.None; + onDidChangeExtensions: Event = Event.None; + onWillActivateByEvent: Event = Event.None; + onDidChangeResponsiveChange: Event = Event.None; + activateByEvent(_activationEvent: string): Promise { return Promise.resolve(undefined); } + whenInstalledExtensionsRegistered(): Promise { return Promise.resolve(true); } + getExtensions(): Promise { return Promise.resolve([]); } + getExtension() { return Promise.resolve(undefined); } + readExtensionPointContributions(_extPoint: IExtensionPoint): Promise[]> { return Promise.resolve(Object.create(null)); } + getExtensionsStatus(): { [id: string]: IExtensionsStatus; } { return Object.create(null); } + canProfileExtensionHost(): boolean { return false; } + getInspectPort(): number { return 0; } + startExtensionHostProfile(): Promise { return Promise.resolve(Object.create(null)); } + restartExtensionHost(): void { } + startExtensionHost(): void { } + stopExtensionHost(): void { } + canAddExtension(): boolean { return false; } + canRemoveExtension(): boolean { return false; } +} \ No newline at end of file diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index a28b4952f26..9e56b9e2685 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -57,8 +57,7 @@ import { Range } from 'vs/editor/common/core/range'; import { IConfirmation, IConfirmationResult, IDialogService, IDialogOptions, IPickAndOpenOptions, ISaveDialogOptions, IOpenDialogOptions, IFileDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { TestNotificationService } from 'vs/platform/notification/test/common/testNotificationService'; -import { IExtensionService, ProfileSession, IExtensionsStatus, ExtensionPointContribution, IExtensionDescription, IWillActivateEvent, IResponsiveStateChangeEvent } from '../services/extensions/common/extensions'; -import { IExtensionPoint } from 'vs/workbench/services/extensions/common/extensionsRegistry'; +import { IExtensionService, NullExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IDecorationsService, IResourceDecorationChangeEvent, IDecoration, IDecorationData, IDecorationsProvider } from 'vs/workbench/services/decorations/browser/decorations'; import { IDisposable, toDisposable, Disposable } from 'vs/base/common/lifecycle'; @@ -78,7 +77,6 @@ import { IViewlet } from 'vs/workbench/common/viewlet'; import { IProgressService } from 'vs/platform/progress/common/progress'; import { IStorageService, InMemoryStorageService } from 'vs/platform/storage/common/storage'; import { isLinux, isMacintosh } from 'vs/base/common/platform'; -import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { LabelService } from 'vs/workbench/services/label/common/labelService'; export function createFileInput(instantiationService: IInstantiationService, resource: URI): FileEditorInput { @@ -310,28 +308,7 @@ export class TestDecorationsService implements IDecorationsService { getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration { return undefined; } } -export class TestExtensionService implements IExtensionService { - _serviceBrand: any; - onDidRegisterExtensions: Event = Event.None; - onDidChangeExtensionsStatus: Event = Event.None; - onDidChangeExtensions: Event = Event.None; - onWillActivateByEvent: Event = Event.None; - onDidChangeResponsiveChange: Event = Event.None; - activateByEvent(_activationEvent: string): Promise { return Promise.resolve(undefined); } - whenInstalledExtensionsRegistered(): Promise { return Promise.resolve(true); } - getExtensions(): Promise { return Promise.resolve([]); } - getExtension() { return Promise.resolve(undefined); } - readExtensionPointContributions(_extPoint: IExtensionPoint): Promise[]> { return Promise.resolve(Object.create(null)); } - getExtensionsStatus(): { [id: string]: IExtensionsStatus; } { return Object.create(null); } - canProfileExtensionHost(): boolean { return false; } - getInspectPort(): number { return 0; } - startExtensionHostProfile(): Promise { return Promise.resolve(Object.create(null)); } - restartExtensionHost(): void { } - startExtensionHost(): void { } - stopExtensionHost(): void { } - canAddExtension(): boolean { return false; } - canRemoveExtension(): boolean { return false; } -} +export class TestExtensionService extends NullExtensionService { } export class TestMenuService implements IMenuService { From 13e506e5d51b0946597031048639a35f4f1fd32a Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 6 Feb 2019 12:39:41 +0100 Subject: [PATCH 380/429] debt - group extension service related things in one place --- src/tsconfig.strictNullChecks.json | 2 +- .../{ => services/extensions}/common/extensionHostProtocol.ts | 0 .../services/extensions/electron-browser/extensionHost.ts | 2 +- .../workbench/services/extensions/node/extensionHostProcess.ts | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/vs/workbench/{ => services/extensions}/common/extensionHostProtocol.ts (100%) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 9c4563e91f7..62d2c63d749 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -472,7 +472,6 @@ "./vs/workbench/common/editor/dataUriEditorInput.ts", "./vs/workbench/common/editor/diffEditorModel.ts", "./vs/workbench/common/editor/editorGroup.ts", - "./vs/workbench/common/extensionHostProtocol.ts", "./vs/workbench/common/memento.ts", "./vs/workbench/common/notifications.ts", "./vs/workbench/common/panel.ts", @@ -696,6 +695,7 @@ "./vs/workbench/services/editor/common/editorService.ts", "./vs/workbench/services/extensions/common/extensions.ts", "./vs/workbench/services/extensions/common/extensionsRegistry.ts", + "./vs/workbench/services/extensions/common/extensionHostProtocol.ts", "./vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts", "./vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts", "./vs/workbench/services/extensions/electron-browser/inactiveExtensionUrlHandler.ts", diff --git a/src/vs/workbench/common/extensionHostProtocol.ts b/src/vs/workbench/services/extensions/common/extensionHostProtocol.ts similarity index 100% rename from src/vs/workbench/common/extensionHostProtocol.ts rename to src/vs/workbench/services/extensions/common/extensionHostProtocol.ts diff --git a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts index 1749a27e1a6..a898b22b164 100644 --- a/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts +++ b/src/vs/workbench/services/extensions/electron-browser/extensionHost.ts @@ -33,7 +33,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IInitData } from 'vs/workbench/api/node/extHost.protocol'; -import { MessageType, createMessageOfType, isMessageOfType } from 'vs/workbench/common/extensionHostProtocol'; +import { MessageType, createMessageOfType, isMessageOfType } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; import { ICrashReporterService } from 'vs/workbench/services/crashReporter/electron-browser/crashReporterService'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts index 40f22930a7e..fb3190e3c74 100644 --- a/src/vs/workbench/services/extensions/node/extensionHostProcess.ts +++ b/src/vs/workbench/services/extensions/node/extensionHostProcess.ts @@ -11,7 +11,7 @@ import { IMessagePassingProtocol } from 'vs/base/parts/ipc/node/ipc'; import { Protocol } from 'vs/base/parts/ipc/node/ipc.net'; import product from 'vs/platform/node/product'; import { IInitData } from 'vs/workbench/api/node/extHost.protocol'; -import { MessageType, createMessageOfType, isMessageOfType } from 'vs/workbench/common/extensionHostProtocol'; +import { MessageType, createMessageOfType, isMessageOfType } from 'vs/workbench/services/extensions/common/extensionHostProtocol'; import { exit, ExtensionHostMain } from 'vs/workbench/services/extensions/node/extensionHostMain'; // With Electron 2.x and node.js 8.x the "natives" module From b0b6dc6c2eea0f587cb060af074b91af89ad7e11 Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 6 Feb 2019 15:16:49 +0100 Subject: [PATCH 381/429] Update grammars to pick up make changes and fix hashes. --- build/npm/update-grammar.js | 39 +++++++++++-------- extensions/cpp/cgmanifest.json | 4 +- extensions/git/cgmanifest.json | 2 +- extensions/html/cgmanifest.json | 2 +- extensions/make/cgmanifest.json | 2 +- extensions/make/syntaxes/make.tmLanguage.json | 9 ++++- extensions/php/cgmanifest.json | 4 +- extensions/scss/cgmanifest.json | 2 +- extensions/sql/cgmanifest.json | 2 +- extensions/sql/syntaxes/sql.tmLanguage.json | 4 +- 10 files changed, 41 insertions(+), 29 deletions(-) diff --git a/build/npm/update-grammar.js b/build/npm/update-grammar.js index b4f94044419..522b2941218 100644 --- a/build/npm/update-grammar.js +++ b/build/npm/update-grammar.js @@ -12,6 +12,8 @@ var cson = require('cson-parser'); var https = require('https'); var url = require('url'); +let commitDate = '0000-00-00'; + /** * @param {string} urlString */ @@ -120,30 +122,35 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas try { fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n')); - // Add commit sha to cgmanifest let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString()); let promises = new Array(); - let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`; - for (let i = 0; i < cgmanifestRead.registrations.length; i++) { - if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) { - cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha; - promises.push(download(packageJsonPath).then(function (packageJson) { - if (packageJson) { - try { - cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version; - } catch (e) { - console.log('File does not exist at' + packageJsonPath); - } - } - })); - break; + const currentCommitDate = info.commitDate.substr(0, 10); + + // Add commit sha to cgmanifest. + if (currentCommitDate > commitDate) { + let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`; + for (let i = 0; i < cgmanifestRead.registrations.length; i++) { + if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) { + cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha; + commitDate = currentCommitDate; + promises.push(download(packageJsonPath).then(function (packageJson) { + if (packageJson) { + try { + cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version; + } catch (e) { + console.log('Cannot get version. File does not exist at ' + packageJsonPath); + } + } + })); + break; + } } } Promise.all(promises).then(function (allResult) { fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n')); }); if (info) { - console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')'); + console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + currentCommitDate + ')'); } else { console.log('Updated ' + path.basename(dest)); } diff --git a/extensions/cpp/cgmanifest.json b/extensions/cpp/cgmanifest.json index 7bab26bfa11..e6666933f61 100644 --- a/extensions/cpp/cgmanifest.json +++ b/extensions/cpp/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "atom/language-c", "repositoryUrl": "https://github.com/atom/language-c", - "commitHash": "3a269f88b12e512fb9495dc006a1dabf325d3d7f" + "commitHash": "9c0c5f202741a5647025db8d5df5fefba47b036c" } }, "license": "MIT", - "version": "0.58.0", + "version": "0.58.1", "description": "The files syntaxes/c.json and syntaxes/c++.json were derived from the Atom package https://atom.io/packages/language-c which was originally converted from the C TextMate bundle https://github.com/textmate/c.tmbundle." }, { diff --git a/extensions/git/cgmanifest.json b/extensions/git/cgmanifest.json index 8b62f6fbb0c..d0bdb9ac443 100644 --- a/extensions/git/cgmanifest.json +++ b/extensions/git/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "textmate/git.tmbundle", "repositoryUrl": "https://github.com/textmate/git.tmbundle", - "commitHash": "93897a78c6e52bef13dadc0d4091d203c5facb40" + "commitHash": "3f6ad2138200db14b57a090ecb2d2e733275ca3e" } }, "licenseDetail": [ diff --git a/extensions/html/cgmanifest.json b/extensions/html/cgmanifest.json index fb7007ddb31..78125476f1e 100644 --- a/extensions/html/cgmanifest.json +++ b/extensions/html/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "textmate/html.tmbundle", "repositoryUrl": "https://github.com/textmate/html.tmbundle", - "commitHash": "390c8870273a2ae80244dae6db6ba064a802f407" + "commitHash": "0c3d5ee54de3a993f747f54186b73a4d2d3c44a2" } }, "licenseDetail": [ diff --git a/extensions/make/cgmanifest.json b/extensions/make/cgmanifest.json index e575c65097b..6f4432b66da 100644 --- a/extensions/make/cgmanifest.json +++ b/extensions/make/cgmanifest.json @@ -6,7 +6,7 @@ "git": { "name": "fadeevab/make.tmbundle", "repositoryUrl": "https://github.com/fadeevab/make.tmbundle", - "commitHash": "d01ce3404f9e2eed0fd4d07b5e24094c03599241" + "commitHash": "21e9108e9dce13b798667806bb105d852ac0a58c" } }, "licenseDetail": [ diff --git a/extensions/make/syntaxes/make.tmLanguage.json b/extensions/make/syntaxes/make.tmLanguage.json index 79a3082a0bb..878e78767e8 100644 --- a/extensions/make/syntaxes/make.tmLanguage.json +++ b/extensions/make/syntaxes/make.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/fadeevab/make.tmbundle/commit/d01ce3404f9e2eed0fd4d07b5e24094c03599241", + "version": "https://github.com/fadeevab/make.tmbundle/commit/21e9108e9dce13b798667806bb105d852ac0a58c", "name": "Makefile", "scopeName": "source.makefile", "patterns": [ @@ -342,7 +342,12 @@ "begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*((? Date: Wed, 6 Feb 2019 16:03:33 +0100 Subject: [PATCH 382/429] localize snippet scope names --- .../electron-browser/configureSnippets.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts b/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts index 57964993e2d..9875977f27d 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts @@ -202,17 +202,17 @@ CommandsRegistry.registerCommand(id, async (accessor): Promise => { const picks = await computePicks(snippetService, envService, modeService); const existing: QuickPickInput[] = picks.existing; - type GlobalSnippetPick = IQuickPickItem & { uri: URI }; - const globalSnippetPicks: GlobalSnippetPick[] = [{ + type SnippetPick = IQuickPickItem & { uri: URI } & { scope: string }; + const globalSnippetPicks: SnippetPick[] = [{ + scope: nls.localize('new.global_scope', 'global'), label: nls.localize('new.global', "New Global Snippets file..."), uri: URI.file(join(envService.appSettingsHome, 'snippets')) }]; - type WorkspaceSnippetPick = IQuickPickItem & { uri: URI } & { name: string }; - const workspaceSnippetPicks: WorkspaceSnippetPick[] = []; + const workspaceSnippetPicks: SnippetPick[] = []; for (const folder of workspaceService.getWorkspace().folders) { workspaceSnippetPicks.push({ - name: folder.name, + scope: nls.localize('new.workspace_scope', "{0} workspace", folder.name), label: nls.localize('new.folder', "New Snippets file for '{0}'...", folder.name), uri: folder.toResource('.vscode') }); @@ -230,10 +230,10 @@ CommandsRegistry.registerCommand(id, async (accessor): Promise => { matchOnDescription: true }); - if (globalSnippetPicks.indexOf(pick as GlobalSnippetPick) >= 0) { - return createSnippetFile('global', (pick as GlobalSnippetPick).uri, windowService, notificationService, fileService, opener); - } else if (workspaceSnippetPicks.indexOf(pick as WorkspaceSnippetPick) >= 0) { - return createSnippetFile((pick as WorkspaceSnippetPick).name + ' workspace', (pick as WorkspaceSnippetPick).uri, windowService, notificationService, fileService, opener); + if (globalSnippetPicks.indexOf(pick as SnippetPick) >= 0) { + return createSnippetFile((pick as SnippetPick).scope, (pick as SnippetPick).uri, windowService, notificationService, fileService, opener); + } else if (workspaceSnippetPicks.indexOf(pick as SnippetPick) >= 0) { + return createSnippetFile((pick as SnippetPick).scope, (pick as SnippetPick).uri, windowService, notificationService, fileService, opener); } else if (ISnippetPick.is(pick)) { if (pick.hint) { await createLanguageSnippetFile(pick, fileService); From 159617a378944943c809cd8ed3219dc91e8e3c5d Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 16:04:59 +0100 Subject: [PATCH 383/429] fixes #67938 --- src/vs/base/browser/ui/list/listWidget.ts | 4 ++-- src/vs/base/browser/ui/tree/abstractTree.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index ec06bc2dcb5..0f4c0798f67 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -527,7 +527,7 @@ export class MouseController implements IDisposable { Gesture.addTarget(list.getHTMLElement()); } - private isSelectionSingleChangeEvent(event: IListMouseEvent | IListTouchEvent): boolean { + protected isSelectionSingleChangeEvent(event: IListMouseEvent | IListTouchEvent): boolean { if (this.multipleSelectionController) { return this.multipleSelectionController.isSelectionSingleChangeEvent(event); } @@ -535,7 +535,7 @@ export class MouseController implements IDisposable { return platform.isMacintosh ? event.browserEvent.metaKey : event.browserEvent.ctrlKey; } - private isSelectionRangeChangeEvent(event: IListMouseEvent | IListTouchEvent): boolean { + protected isSelectionRangeChangeEvent(event: IListMouseEvent | IListTouchEvent): boolean { if (this.multipleSelectionController) { return this.multipleSelectionController.isSelectionRangeChangeEvent(event); } diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index d3eb4876738..4a71df669e8 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -796,7 +796,7 @@ class TreeNodeListMouseController extends MouseController< return super.onPointer(e); } - if (this.multipleSelectionController.isSelectionRangeChangeEvent(e) || this.multipleSelectionController.isSelectionSingleChangeEvent(e)) { + if (this.isSelectionRangeChangeEvent(e) || this.isSelectionSingleChangeEvent(e)) { return super.onPointer(e); } From 4172bc6a898536f520f6da438b7b9d528f749233 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 16:36:45 +0100 Subject: [PATCH 384/429] fixes #67936 --- src/vs/base/browser/ui/tree/abstractTree.ts | 55 +++++++++++---------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 4a71df669e8..ee09be38112 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -531,7 +531,10 @@ class TypeFilterController implements IDisposable { this._pattern = pattern; this.filter.pattern = pattern; this.tree.refilter(); - this.tree.focusNext(0, true); + + if (pattern) { + this.tree.focusNext(0, true, undefined, node => !FuzzyScore.isDefault(node.filterData as any as FuzzyScore)); + } const focus = this.tree.getFocus(); @@ -648,6 +651,18 @@ class TypeFilterController implements IDisposable { this.labelDomNode.textContent = this.pattern.length > 16 ? '…' + this.pattern.substr(this.pattern.length - 16) : this.pattern; } + shouldAllowFocus(node: ITreeNode): boolean { + if (!this.enabled || !this.pattern || this.filterOnType) { + return true; + } + + if (this.filter.totalCount > 0 && this.filter.matchCount <= 1) { + return true; + } + + return !FuzzyScore.isDefault(node.filterData as any as FuzzyScore); + } + dispose() { this.disable(); this.disposables = dispose(this.disposables); @@ -898,12 +913,12 @@ export abstract class AbstractTree implements IDisposable private view: TreeNodeList; private renderers: TreeRenderer[]; - private focusNavigationFilter: ((node: ITreeNode) => boolean) | undefined; protected model: ITreeModel; private focus: Trait; private selection: Trait; private eventBufferer = new EventBufferer(); private typeFilterController?: TypeFilterController; + private focusNavigationFilter: ((node: ITreeNode) => boolean) | undefined; protected disposables: IDisposable[] = []; get onDidScroll(): Event { return this.view.onDidScroll; } @@ -981,17 +996,7 @@ export abstract class AbstractTree implements IDisposable if (_options.keyboardNavigationLabelProvider) { this.typeFilterController = new TypeFilterController(this, this.model, this.view, filter!, _options.keyboardNavigationLabelProvider); - this.focusNavigationFilter = node => { - if (!this.typeFilterController!.enabled || !this.typeFilterController!.pattern || this.typeFilterController!.filterOnType) { - return true; - } - - if (filter!.totalCount > 0 && filter!.matchCount <= 1) { - return true; - } - - return !FuzzyScore.isDefault(node.filterData as any as FuzzyScore); - }; + this.focusNavigationFilter = node => this.typeFilterController!.shouldAllowFocus(node); this.disposables.push(this.typeFilterController!); } } @@ -1147,28 +1152,28 @@ export abstract class AbstractTree implements IDisposable this.view.setFocus(indexes, browserEvent, true); } - focusNext(n = 1, loop = false, browserEvent?: UIEvent): void { - this.view.focusNext(n, loop, browserEvent, this.focusNavigationFilter); + focusNext(n = 1, loop = false, browserEvent?: UIEvent, filter = this.focusNavigationFilter): void { + this.view.focusNext(n, loop, browserEvent, filter); } - focusPrevious(n = 1, loop = false, browserEvent?: UIEvent): void { - this.view.focusPrevious(n, loop, browserEvent, this.focusNavigationFilter); + focusPrevious(n = 1, loop = false, browserEvent?: UIEvent, filter = this.focusNavigationFilter): void { + this.view.focusPrevious(n, loop, browserEvent, filter); } - focusNextPage(browserEvent?: UIEvent): void { - this.view.focusNextPage(browserEvent, this.focusNavigationFilter); + focusNextPage(browserEvent?: UIEvent, filter = this.focusNavigationFilter): void { + this.view.focusNextPage(browserEvent, filter); } - focusPreviousPage(browserEvent?: UIEvent): void { - this.view.focusPreviousPage(browserEvent, this.focusNavigationFilter); + focusPreviousPage(browserEvent?: UIEvent, filter = this.focusNavigationFilter): void { + this.view.focusPreviousPage(browserEvent, filter); } - focusLast(browserEvent?: UIEvent): void { - this.view.focusLast(browserEvent, this.focusNavigationFilter); + focusLast(browserEvent?: UIEvent, filter = this.focusNavigationFilter): void { + this.view.focusLast(browserEvent, filter); } - focusFirst(browserEvent?: UIEvent): void { - this.view.focusFirst(browserEvent, this.focusNavigationFilter); + focusFirst(browserEvent?: UIEvent, filter = this.focusNavigationFilter): void { + this.view.focusFirst(browserEvent, filter); } getFocus(): T[] { From 58a4013f82ff7f0ef3cdc9b1bba4066decb5a7da Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Wed, 6 Feb 2019 16:57:27 +0100 Subject: [PATCH 385/429] Empty string task pick inputs should resolve to empty string value Fixes #67927 --- .../workbench/parts/tasks/electron-browser/task.contribution.ts | 1 + .../parts/tasks/electron-browser/terminalTaskSystem.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 07a32bc0a65..4e1cccf03be 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -1824,6 +1824,7 @@ class TaskService extends Disposable implements ITaskService { } else if (err instanceof Error) { let error = err; this.notificationService.error(error.message); + showOutput = false; } else if (Types.isString(err)) { this.notificationService.error(err); } else { diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts index 305d2c05c46..a0b4c778c8d 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts @@ -59,7 +59,7 @@ class VariableResolver { return value.replace(/\$\{(.*?)\}/g, (match: string, variable: string) => { // Strip out the ${} because the map contains them variables without those characters. let result = this._values.get(match.substring(2, match.length - 1)); - if (result) { + if ((result !== undefined) && (result !== null)) { return result; } if (this._service) { From f5dacc5bf3566015d0082b6d575a122298dd1ea4 Mon Sep 17 00:00:00 2001 From: SteVen Batten <6561887+sbatten@users.noreply.github.com> Date: Wed, 6 Feb 2019 08:42:10 -0800 Subject: [PATCH 386/429] remove duplicate font declarations for menu (#67942) * remove font declarations from menu.css * remove decalarations from shell.css --- src/vs/base/browser/ui/menu/menu.css | 2 - .../electron-browser/media/shell.css | 45 +++++++------------ 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/vs/base/browser/ui/menu/menu.css b/src/vs/base/browser/ui/menu/menu.css index 14ced9b853a..f1cdb6f3e45 100644 --- a/src/vs/base/browser/ui/menu/menu.css +++ b/src/vs/base/browser/ui/menu/menu.css @@ -117,7 +117,6 @@ /* Context Menu */ .context-view.monaco-menu-container { - font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif; outline: 0; border: none; -webkit-animation: fadeIn 0.083s linear; @@ -182,7 +181,6 @@ } .menubar .menubar-menu-items-holder.monaco-menu-container { - font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif; outline: 0; border: none; } diff --git a/src/vs/workbench/electron-browser/media/shell.css b/src/vs/workbench/electron-browser/media/shell.css index e3e3172eafe..1162363e9f8 100644 --- a/src/vs/workbench/electron-browser/media/shell.css +++ b/src/vs/workbench/electron-browser/media/shell.css @@ -16,38 +16,23 @@ /* Font Families (with CJK support) */ /* mac */ -.monaco-shell.mac, -.monaco-shell.mac .monaco-menu-container .monaco-menu { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } -.monaco-shell.mac:lang(zh-Hans), -.monaco-shell.mac:lang(zh-Hans) .monaco-menu-container .monaco-menu { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } -.monaco-shell.mac:lang(zh-Hant), -.monaco-shell.mac:lang(zh-Hant) .monaco-menu-container .monaco-menu { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } -.monaco-shell.mac:lang(ja), -.monaco-shell.mac:lang(ja) .monaco-menu-container .monaco-menu { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } -.monaco-shell.mac:lang(ko), -.monaco-shell.mac:lang(ko) .monaco-menu-container .monaco-menu { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } +.monaco-shell.mac { font-family: -apple-system, BlinkMacSystemFont, sans-serif; } +.monaco-shell.mac:lang(zh-Hans) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; } +.monaco-shell.mac:lang(zh-Hant) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; } +.monaco-shell.mac:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; } +.monaco-shell.mac:lang(ko) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; } /* windows */ -.monaco-shell.windows, -.monaco-shell.windows .monaco-menu-container .monaco-menu { font-family: "Segoe WPC", "Segoe UI", sans-serif; } -.monaco-shell.windows:lang(zh-Hans), -.monaco-shell.windows:lang(zh-Hans) .monaco-menu-container .monaco-menu { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } -.monaco-shell.windows:lang(zh-Hant), -.monaco-shell.windows:lang(zh-Hant) .monaco-menu-container .monaco-menu { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } -.monaco-shell.windows:lang(ja), -.monaco-shell.windows:lang(ja) .monaco-menu-container .monaco-menu { font-family: "Segoe WPC", "Segoe UI", "Meiryo", sans-serif; } -.monaco-shell.windows:lang(ko), -.monaco-shell.windows:lang(ko) .monaco-menu-container .monaco-menu { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } +.monaco-shell.windows { font-family: "Segoe WPC", "Segoe UI", sans-serif; } +.monaco-shell.windows:lang(zh-Hans) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; } +.monaco-shell.windows:lang(zh-Hant) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; } +.monaco-shell.windows:lang(ja) { font-family: "Segoe WPC", "Segoe UI", "Meiryo", sans-serif; } +.monaco-shell.windows:lang(ko) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; } /* linux */ -.monaco-shell.linux, -.monaco-shell.linux .monaco-menu-container .monaco-menu { font-family: "Ubuntu", "Droid Sans", sans-serif; } -.monaco-shell.linux:lang(zh-Hans), -.monaco-shell.linux:lang(zh-Hans) .monaco-menu-container .monaco-menu { font-family: "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } -.monaco-shell.linux:lang(zh-Hant), -.monaco-shell.linux:lang(zh-Hant) .monaco-menu-container .monaco-menu { font-family: "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } -.monaco-shell.linux:lang(ja), -.monaco-shell.linux:lang(ja) .monaco-menu-container .monaco-menu { font-family: "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } -.monaco-shell.linux:lang(ko), -.monaco-shell.linux:lang(ko) .monaco-menu-container .monaco-menu { font-family: "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } +.monaco-shell.linux { font-family: "Ubuntu", "Droid Sans", sans-serif; } +.monaco-shell.linux:lang(zh-Hans) { font-family: "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; } +.monaco-shell.linux:lang(zh-Hant) { font-family: "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } +.monaco-shell.linux:lang(ja) { font-family: "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } +.monaco-shell.linux:lang(ko) { font-family: "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } From 6d35d18ea1f0e8b3f5048fb2226c346f76d07558 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 17:46:25 +0100 Subject: [PATCH 387/429] fixes #67912 --- src/vs/base/browser/ui/tree/dataTree.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/vs/base/browser/ui/tree/dataTree.ts b/src/vs/base/browser/ui/tree/dataTree.ts index 99fcac4edb5..72a192a8bc6 100644 --- a/src/vs/base/browser/ui/tree/dataTree.ts +++ b/src/vs/base/browser/ui/tree/dataTree.ts @@ -95,17 +95,19 @@ export class DataTree extends AbstractTree boolean): void { - this.model.setChildren((element === this.input ? null : element) as T, this.createIterator(element, isCollapsed)); + this.model.setChildren((element === this.input ? null : element) as T, this.iterate(element, isCollapsed).elements); } - private createIterator(element: TInput | T, isCollapsed?: (el: T) => boolean): Iterator> { - const children = Iterator.fromArray(this.dataSource.getChildren(element)); + private iterate(element: TInput | T, isCollapsed?: (el: T) => boolean): { elements: Iterator>, size: number } { + const children = this.dataSource.getChildren(element); + const elements = Iterator.map>(Iterator.fromArray(children), element => { + const { elements: children, size } = this.iterate(element, isCollapsed); + const collapsed = size === 0 ? undefined : (isCollapsed && isCollapsed(element)); - return Iterator.map>(children, element => ({ - element, - children: this.createIterator(element), - collapsed: isCollapsed && isCollapsed(element) - })); + return { element, children, collapsed }; + }); + + return { elements, size: children.length }; } protected createModel(view: ISpliceable>, options: IDataTreeOptions): ITreeModel { From 7211af200486cb2ea58f4c7999d22b55d48c911b Mon Sep 17 00:00:00 2001 From: Rob Lourens Date: Wed, 6 Feb 2019 10:04:59 -0800 Subject: [PATCH 388/429] #66884 - add setting to prevent shutting down the searchService --- src/vs/platform/search/common/search.ts | 1 + .../electron-browser/search.contribution.ts | 5 +++++ .../services/search/node/searchService.ts | 17 ++++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/search/common/search.ts b/src/vs/platform/search/common/search.ts index fa46ccc8958..5fc96984e21 100644 --- a/src/vs/platform/search/common/search.ts +++ b/src/vs/platform/search/common/search.ts @@ -327,6 +327,7 @@ export interface ISearchConfigurationProperties { showLineNumbers: boolean; usePCRE2: boolean; actionsPosition: 'auto' | 'right'; + maintainFileSearchCache: boolean; collapseResults: 'auto' | 'alwaysCollapse' | 'alwaysExpand'; } diff --git a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts index a299f18b82a..f02e746e251 100644 --- a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts +++ b/src/vs/workbench/parts/search/electron-browser/search.contribution.ts @@ -618,6 +618,11 @@ configurationRegistry.registerConfiguration({ deprecationMessage: nls.localize('useRipgrepDeprecated', "Deprecated. Consider \"search.usePCRE2\" for advanced regex feature support."), default: true }, + 'search.maintainFileSearchCache': { + type: 'boolean', + description: nls.localize('search.maintainFileSearchCache', "When enabled, the searchService process will be kept alive instead of being shut down after an hour of inactivity. This will keep the file search cache in memory."), + default: false + }, 'search.useIgnoreFiles': { type: 'boolean', markdownDescription: nls.localize('useIgnoreFiles', "Controls whether to use `.gitignore` and `.ignore` files when searching for files."), diff --git a/src/vs/workbench/services/search/node/searchService.ts b/src/vs/workbench/services/search/node/searchService.ts index 394c74fdc2c..08bb261385c 100644 --- a/src/vs/workbench/services/search/node/searchService.ts +++ b/src/vs/workbench/services/search/node/searchService.ts @@ -20,7 +20,7 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IDebugParams, IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ILogService } from 'vs/platform/log/common/log'; -import { deserializeSearchError, FileMatch, ICachedSearchStats, IFileMatch, IFileQuery, IFileSearchStats, IFolderQuery, IProgress, ISearchComplete, ISearchEngineStats, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, ITextQuery, pathIncludedInQuery, QueryType, SearchError, SearchErrorCode, SearchProviderType } from 'vs/platform/search/common/search'; +import { deserializeSearchError, FileMatch, ICachedSearchStats, IFileMatch, IFileQuery, IFileSearchStats, IFolderQuery, IProgress, ISearchComplete, ISearchEngineStats, ISearchProgressItem, ISearchQuery, ISearchResultProvider, ISearchService, ITextQuery, pathIncludedInQuery, QueryType, SearchError, SearchErrorCode, SearchProviderType, ISearchConfiguration } from 'vs/platform/search/common/search'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; @@ -28,6 +28,7 @@ import { addContextToEditorMatches, editorMatchesToTextSearchResults } from 'vs/ import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IRawSearchService, ISerializedFileMatch, ISerializedSearchComplete, ISerializedSearchProgressItem, isSerializedSearchComplete, isSerializedSearchSuccess } from './search'; import { SearchChannelClient } from './searchIpc'; +import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; export class SearchService extends Disposable implements ISearchService { _serviceBrand: any; @@ -48,7 +49,7 @@ export class SearchService extends Disposable implements ISearchService { @IExtensionService private readonly extensionService: IExtensionService ) { super(); - this.diskSearch = this.instantiationService.createInstance(DiskSearch, !environmentService.isBuilt || environmentService.verbose, /*timeout=*/undefined, environmentService.debugSearch); + this.diskSearch = this.instantiationService.createInstance(DiskSearch, !environmentService.isBuilt || environmentService.verbose, environmentService.debugSearch); } registerSearchResultProvider(scheme: string, type: SearchProviderType, provider: ISearchResultProvider): IDisposable { @@ -427,19 +428,21 @@ export class SearchService extends Disposable implements ISearchService { } export class DiskSearch implements ISearchResultProvider { - _serviceBrand: any; - private raw: IRawSearchService; constructor( verboseLogging: boolean, - timeout: number = 60 * 60 * 1000, searchDebug: IDebugParams | undefined, - @ILogService private readonly logService: ILogService + @ILogService private readonly logService: ILogService, + @IConfigurationService private readonly configService: IConfigurationService, ) { + const timeout = this.configService.getValue().search.maintainFileSearchCache ? + Number.MAX_VALUE : + 60 * 60 * 1000; + const opts: IIPCOptions = { serverName: 'Search', - timeout: timeout, + timeout, args: ['--type=searchService'], // See https://github.com/Microsoft/vscode/issues/27665 // Pass in fresh execArgv to the forked process such that it doesn't inherit them from `process.execArgv`. From 64c6cb2174ef7fe544bf0f8ea39169965b2e8e5f Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 6 Feb 2019 21:23:33 +0100 Subject: [PATCH 389/429] Update dependencies, remove workaround --- build/gulpfile.extensions.js | 1 - build/lib/compilation.js | 1 - build/lib/compilation.ts | 1 - build/lib/util.js | 12 -- build/lib/util.ts | 12 -- package.json | 8 +- yarn.lock | 234 ++++------------------------------- 7 files changed, 29 insertions(+), 240 deletions(-) diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index d45a12af6eb..3a780a22e8d 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -80,7 +80,6 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(compilation()) - .pipe(util.toLatestVinylFile()) .pipe(build ? nlsDev.rewriteLocalizeCalls() : es.through()) .pipe(build ? util.stripSourceMappingURL() : es.through()) .pipe(sourcemaps.write('.', { diff --git a/build/lib/compilation.js b/build/lib/compilation.js index af6b3daea03..592a5d087ce 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -58,7 +58,6 @@ function createCompile(src, build, emitError) { .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(ts(token)) - .pipe(util.toLatestVinylFile()) .pipe(noDeclarationsFilter) .pipe(build ? nls() : es.through()) .pipe(noDeclarationsFilter.restore) diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index 68920f3dd84..b431a134f6c 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -66,7 +66,6 @@ function createCompile(src: string, build: boolean, emitError?: boolean): (token .pipe(tsFilter) .pipe(util.loadSourcemaps()) .pipe(ts(token)) - .pipe(util.toLatestVinylFile()) .pipe(noDeclarationsFilter) .pipe(build ? nls() : es.through()) .pipe(noDeclarationsFilter.restore) diff --git a/build/lib/util.js b/build/lib/util.js index 96deabf747b..b6228ad4cf9 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -98,18 +98,6 @@ function skipDirectories() { }); } exports.skipDirectories = skipDirectories; -/** - * gulp does not like anything except the latest VinylFile (it checks for VinylFile.isVinyl) - */ -function toLatestVinylFile() { - return es.mapSync(f => { - if (VinylFile.isVinyl(f)) { - return f; - } - return new VinylFile(f); - }); -} -exports.toLatestVinylFile = toLatestVinylFile; function cleanNodeModule(name, excludes, includes) { const toGlob = (path) => '**/node_modules/' + name + (path ? '/' + path : ''); const negate = (str) => '!' + str; diff --git a/build/lib/util.ts b/build/lib/util.ts index 7415d0d0e0c..42d3aba2fee 100644 --- a/build/lib/util.ts +++ b/build/lib/util.ts @@ -129,18 +129,6 @@ export function skipDirectories(): NodeJS.ReadWriteStream { }); } -/** - * gulp does not like anything except the latest VinylFile (it checks for VinylFile.isVinyl) - */ -export function toLatestVinylFile(): NodeJS.ReadWriteStream { - return es.mapSync(f => { - if (VinylFile.isVinyl(f)) { - return f; - } - return new VinylFile(f); - }); -} - export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream { const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : ''); const negate = (str: string) => '!' + str; diff --git a/package.json b/package.json index 0862e82a93c..d8d8e668d60 100644 --- a/package.json +++ b/package.json @@ -84,8 +84,8 @@ "fancy-log": "^1.3.3", "glob": "^5.0.13", "gulp": "^4.0.0", - "gulp-atom-electron": "^1.19.2", - "gulp-azure-storage": "^0.9.0", + "gulp-atom-electron": "^1.20.0", + "gulp-azure-storage": "^0.10.0", "gulp-buffer": "0.0.2", "gulp-concat": "^2.6.1", "gulp-cssnano": "^2.1.3", @@ -98,7 +98,7 @@ "gulp-rename": "^1.2.0", "gulp-replace": "^0.5.4", "gulp-shell": "^0.6.5", - "gulp-tsb": "2.0.5", + "gulp-tsb": "2.0.6", "gulp-tslint": "^8.1.3", "gulp-uglify": "^3.0.0", "gulp-vinyl-zip": "^2.1.2", @@ -133,7 +133,7 @@ "vinyl": "^2.0.0", "vinyl-fs": "^3.0.0", "vsce": "1.48.0", - "vscode-nls-dev": "3.2.2", + "vscode-nls-dev": "3.2.4", "webpack": "^4.16.5", "webpack-cli": "^3.1.0", "webpack-stream": "^5.1.1" diff --git a/yarn.lock b/yarn.lock index 6d53114fe17..4a5b178d8c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -655,7 +655,7 @@ array-union@^1.0.1: dependencies: array-uniq "^1.0.1" -array-uniq@^1.0.1, array-uniq@^1.0.2: +array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" integrity sha1-r2rId6Jcx/dOBYiUdThY39sk/bY= @@ -887,11 +887,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -beeper@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/beeper/-/beeper-1.1.1.tgz#e6d5ea8c5dad001304a70b22638447f69cb2f809" - integrity sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak= - big-integer@^1.6.25: version "1.6.25" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.25.tgz#1de45a9f57542ac20121c682f8d642220a34e823" @@ -1533,11 +1528,6 @@ clone-stats@^1.0.0: resolved "https://registry.yarnpkg.com/clone-stats/-/clone-stats-1.0.0.tgz#b3782dff8bb5474e18b9b6bf0fdfe782f8777680" integrity sha1-s3gt/4u1R04Yuba/D9/ngvh3doA= -clone@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/clone/-/clone-0.2.0.tgz#c6126a90ad4f72dbf5acdb243cc37724fe93fc1f" - integrity sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8= - clone@^1.0.0, clone@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.3.tgz#298d7e2231660f40c003c2ed3140decf3f53085f" @@ -2072,11 +2062,6 @@ date-now@^0.1.4: resolved "https://registry.yarnpkg.com/date-now/-/date-now-0.1.4.tgz#eaf439fd4d4848ad74e5cc7dbef200672b9e345b" integrity sha1-6vQ5/U1ISK105cx9vvIAZyueNFs= -dateformat@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062" - integrity sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI= - debounce@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.1.0.tgz#6a1a4ee2a9dc4b7c24bb012558dbcdb05b37f408" @@ -2391,13 +2376,6 @@ domutils@^1.5.1: dom-serializer "0" domelementtype "1" -duplexer2@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.0.2.tgz#c614dcf67e2fb14995a91711e5a617e8a60a31db" - integrity sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds= - dependencies: - readable-stream "~1.1.9" - duplexer@~0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -3101,14 +3079,6 @@ fancy-log@1.3.2, fancy-log@^1.3.2: color-support "^1.1.3" time-stamp "^1.0.0" -fancy-log@^1.1.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.0.tgz#45be17d02bb9917d60ccffd4995c999e6c8c9948" - integrity sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg= - dependencies: - chalk "^1.1.1" - time-stamp "^1.0.0" - fancy-log@^1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.3.tgz#dbc19154f558690150a23953a0adbd035be45fc7" @@ -3779,14 +3749,14 @@ growl@1.9.2: resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" integrity sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8= -gulp-atom-electron@^1.19.2: - version "1.19.2" - resolved "https://registry.yarnpkg.com/gulp-atom-electron/-/gulp-atom-electron-1.19.2.tgz#e61e0278b77d3bbc78603e3564cebfce0a224d79" - integrity sha512-fARwXJmKRAjtYlBw3u4GltNAtnvAp+Mj9d/jWJFEw/kbRzAZuwd7N359tz2HA99NA7Z8cVW2kTW0IutQDoifWA== +gulp-atom-electron@^1.20.0: + version "1.20.0" + resolved "https://registry.yarnpkg.com/gulp-atom-electron/-/gulp-atom-electron-1.20.0.tgz#10b01f6a4c0257a8468c4da4ec9c67ecb28a32ed" + integrity sha512-gs7xvZvq8Mq60+DmbfCeXZnhqhOaJa/wrctix0RP/lCfSgusJnBTBssC6er1JIiqdHmQ8zFiYaYZh41mdG36kQ== dependencies: event-stream "3.3.4" github-releases-ms "^0.5.0" - gulp-filter "^4.0.0" + gulp-filter "^5.1.0" gulp-rename "1.2.2" gulp-symdest "^1.1.1" gulp-vinyl-zip "^2.1.2" @@ -3801,10 +3771,10 @@ gulp-atom-electron@^1.19.2: vinyl "^2.2.0" vinyl-fs "^3.0.3" -gulp-azure-storage@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/gulp-azure-storage/-/gulp-azure-storage-0.9.0.tgz#f076aebdd478015d7a6863681b2fc32709535878" - integrity sha512-b6CfmmEtyLDT3afv7wvNin3FJh3eAJy9N26HIXQTbQFP3LzP8XLJrvDe+G9lxFzJt943xgoYFNWUZz3wiJTZdQ== +gulp-azure-storage@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/gulp-azure-storage/-/gulp-azure-storage-0.10.0.tgz#7c3669b62c0e84002fd7539b231fba76bd8c1cf1" + integrity sha512-rrAUz3gpjgpiKanz+ahFIjVWoKTcjFQFqSHosI+RLkZUCh6WBS68g7Uj0hU92mk26xV1e7zC6ZcePpNUlShT3w== dependencies: azure-storage "^2.10.2" delayed-stream "0.0.6" @@ -3814,7 +3784,7 @@ gulp-azure-storage@^0.9.0: progress "^1.1.8" queue "^3.0.10" streamifier "^0.1.1" - vinyl "^0.4.5" + vinyl "^2.2.0" vinyl-fs "^3.0.3" gulp-buffer@0.0.2: @@ -3877,15 +3847,6 @@ gulp-eslint@^5.0.0: fancy-log "^1.3.2" plugin-error "^1.0.1" -gulp-filter@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/gulp-filter/-/gulp-filter-4.0.0.tgz#395f58a256c559cdb9e0d157f1caaf5248a38dcb" - integrity sha1-OV9YolbFWc254NFX8cqvUkijjcs= - dependencies: - gulp-util "^3.0.6" - multimatch "^2.0.0" - streamfilter "^1.0.5" - gulp-filter@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/gulp-filter/-/gulp-filter-5.1.0.tgz#a05e11affb07cf7dcf41a7de1cb7b63ac3783e73" @@ -3983,14 +3944,15 @@ gulp-symdest@^1.1.1: queue "^3.1.0" vinyl-fs "^2.4.3" -gulp-tsb@2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/gulp-tsb/-/gulp-tsb-2.0.5.tgz#7f7791f7f54ce41c406382360a21f5d8f1198d04" - integrity sha1-f3eR9/VM5BxAY4I2CiH12PEZjQQ= +gulp-tsb@2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/gulp-tsb/-/gulp-tsb-2.0.6.tgz#2f8fbee9a81cf0da088744d6da2bca457f2893d1" + integrity sha512-tSIAPfU9rhbtwMgRWopipWFx3NZg943bCLPcP3LxQJ4KUkSdPVc2ZivCibMojw/7HwJUMjLWQ2NCN0yStTQP0g== dependencies: - gulp-util "^3.0.1" + ansi-colors "^1.0.1" + fancy-log "^1.3.2" through "^2.3.6" - vinyl "^0.4.3" + vinyl "^2.1.0" gulp-tslint@^8.1.3: version "8.1.3" @@ -4017,30 +3979,6 @@ gulp-uglify@^3.0.0: uglify-js "^3.0.5" vinyl-sourcemaps-apply "^0.2.0" -gulp-util@^3.0.1, gulp-util@^3.0.6, gulp-util@^3.0.8: - version "3.0.8" - resolved "https://registry.yarnpkg.com/gulp-util/-/gulp-util-3.0.8.tgz#0054e1e744502e27c04c187c3ecc505dd54bbb4f" - integrity sha1-AFTh50RQLifATBh8PsxQXdVLu08= - dependencies: - array-differ "^1.0.0" - array-uniq "^1.0.2" - beeper "^1.0.0" - chalk "^1.0.0" - dateformat "^2.0.0" - fancy-log "^1.1.0" - gulplog "^1.0.0" - has-gulplog "^0.1.0" - lodash._reescape "^3.0.0" - lodash._reevaluate "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.template "^3.0.0" - minimist "^1.1.0" - multipipe "^0.1.2" - object-assign "^3.0.0" - replace-ext "0.0.1" - through2 "^2.0.0" - vinyl "^0.5.0" - gulp-vinyl-zip@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/gulp-vinyl-zip/-/gulp-vinyl-zip-2.1.2.tgz#b79cc1a0e2c3b158ffee294590ade1e9caaf5e7b" @@ -5318,51 +5256,11 @@ locate-path@^3.0.0: p-locate "^3.0.0" path-exists "^3.0.0" -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - integrity sha1-jaDmqHbPNEwK2KVIghEd08XHyjY= - -lodash._basetostring@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz#d1861d877f824a52f669832dcaf3ee15566a07d5" - integrity sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U= - -lodash._basevalues@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz#5b775762802bde3d3297503e26300820fdf661b7" - integrity sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc= - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U= - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - integrity sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw= - -lodash._reescape@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reescape/-/lodash._reescape-3.0.0.tgz#2b1d6f5dfe07c8a355753e5f27fac7f1cde1616a" - integrity sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo= - -lodash._reevaluate@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz#58bc74c40664953ae0b124d806996daca431e2ed" - integrity sha1-WLx0xAZklTrgsSTYBpltrKQx4u0= - -lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0: +lodash._reinterpolate@~3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= -lodash._root@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" - integrity sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI= - lodash.clone@^4.3.2: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" @@ -5373,23 +5271,6 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.escape@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-3.2.0.tgz#995ee0dc18c1b48cc92effae71a10aab5b487698" - integrity sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg= - dependencies: - lodash._root "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - integrity sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo= - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - integrity sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U= - lodash.isequal@^4.0.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" @@ -5405,45 +5286,16 @@ lodash.isundefined@^3.0.1: resolved "https://registry.yarnpkg.com/lodash.isundefined/-/lodash.isundefined-3.0.1.tgz#23ef3d9535565203a66cefd5b830f848911afb48" integrity sha1-I+89lTVWUgOmbO/VuDD4SJEa+0g= -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - integrity sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo= - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.restparam@^3.0.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" - integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU= - lodash.some@^4.2.2: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= -lodash.template@^3.0.0: - version "3.6.2" - resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-3.6.2.tgz#f8cdecc6169a255be9098ae8b0c53d378931d14f" - integrity sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8= - dependencies: - lodash._basecopy "^3.0.0" - lodash._basetostring "^3.0.0" - lodash._basevalues "^3.0.0" - lodash._isiterateecall "^3.0.0" - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.keys "^3.0.0" - lodash.restparam "^3.0.0" - lodash.templatesettings "^3.0.0" - lodash.template@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.template/-/lodash.template-4.4.0.tgz#e73a0385c8355591746e020b99679c690e68fba0" @@ -5452,14 +5304,6 @@ lodash.template@^4.4.0: lodash._reinterpolate "~3.0.0" lodash.templatesettings "^4.0.0" -lodash.templatesettings@^3.0.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz#fb307844753b66b9f1afa54e262c745307dba8e5" - integrity sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU= - dependencies: - lodash._reinterpolate "^3.0.0" - lodash.escape "^3.0.0" - lodash.templatesettings@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/lodash.templatesettings/-/lodash.templatesettings-4.1.0.tgz#2b4d4e95ba440d915ff08bc899e4553666713316" @@ -5993,13 +5837,6 @@ multimatch@^2.0.0: arrify "^1.0.0" minimatch "^3.0.0" -multipipe@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" - integrity sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s= - dependencies: - duplexer2 "0.0.2" - mute-stdout@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/mute-stdout/-/mute-stdout-1.0.1.tgz#acb0300eb4de23a7ddeec014e3e96044b3472331" @@ -6318,11 +6155,6 @@ oauth-sign@~0.9.0: resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== -object-assign@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" - integrity sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I= - object-assign@^4.0.0, object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -9410,23 +9242,6 @@ vinyl-sourcemaps-apply@^0.2.0, vinyl-sourcemaps-apply@^0.2.1: dependencies: source-map "^0.5.1" -vinyl@^0.4.3, vinyl@^0.4.5: - version "0.4.6" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.4.6.tgz#2f356c87a550a255461f36bbeb2a5ba8bf784847" - integrity sha1-LzVsh6VQolVGHza76ypbqL94SEc= - dependencies: - clone "^0.2.0" - clone-stats "^0.0.1" - -vinyl@^0.5.0: - version "0.5.3" - resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-0.5.3.tgz#b0455b38fc5e0cf30d4325132e461970c2091cde" - integrity sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4= - dependencies: - clone "^1.0.0" - clone-stats "^0.0.1" - replace-ext "0.0.1" - vinyl@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/vinyl/-/vinyl-1.2.0.tgz#5c88036cf565e5df05558bfc911f8656df218884" @@ -9565,15 +9380,16 @@ vscode-languageserver@^5.1.0: vscode-languageserver-protocol "3.13.0" vscode-uri "^1.0.6" -vscode-nls-dev@3.2.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/vscode-nls-dev/-/vscode-nls-dev-3.2.2.tgz#5855c9b3e566dd00fd6108f9c2e1bd02c925c153" - integrity sha512-6XyESZOyNowLza/fV6Kfmwx0+0iNwa4OkTsBRepwP+eaR7JYnf/ohPaFDX7Egqe4330swtRDCbqr+7i3Q9/TvA== +vscode-nls-dev@3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/vscode-nls-dev/-/vscode-nls-dev-3.2.4.tgz#9eb92a539fb1ee675836b6aeab8a2846c281c8d9" + integrity sha512-mWERxHbifhuNZomuL3iRyw2LTwKnoKoA8fjWJrlfnbOUF9EN/tbDT0ly2GnOEvLRq0hzEzZNqKLWu0jXPDs7UA== dependencies: + ansi-colors "^3.2.3" clone "^2.1.1" event-stream "^3.3.4" + fancy-log "^1.3.3" glob "^7.1.2" - gulp-util "^3.0.8" iconv-lite "^0.4.19" is "^3.2.1" source-map "^0.6.1" From 9dc75e92e7407141a10c5499a8f5854c5aa8ef38 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 6 Feb 2019 21:26:32 +0100 Subject: [PATCH 390/429] Remove no longer used static method --- build/lib/typings/vinyl.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/build/lib/typings/vinyl.d.ts b/build/lib/typings/vinyl.d.ts index 7ebeea84f8e..a85632e172b 100644 --- a/build/lib/typings/vinyl.d.ts +++ b/build/lib/typings/vinyl.d.ts @@ -11,9 +11,6 @@ declare module "vinyl" { * A virtual file format. */ class File { - - public static isVinyl(t: any): t is File; - constructor(options?: { /** * Default: process.cwd() From d9f81c831c6e97cd9423ca7c85b7b6bf6e3d58cf Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Wed, 6 Feb 2019 21:39:44 +0100 Subject: [PATCH 391/429] fix datatree tests --- src/vs/base/browser/ui/tree/dataTree.ts | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/vs/base/browser/ui/tree/dataTree.ts b/src/vs/base/browser/ui/tree/dataTree.ts index 72a192a8bc6..d0379e7b612 100644 --- a/src/vs/base/browser/ui/tree/dataTree.ts +++ b/src/vs/base/browser/ui/tree/dataTree.ts @@ -61,19 +61,22 @@ export class DataTree extends AbstractTree { const id = this.identityProvider!.getId(element).toString(); - - if (viewState.focus.indexOf(id) > -1) { - focus.push(element); - } - - if (viewState.selection.indexOf(id) > -1) { - selection.push(element); - } - return viewState.expanded.indexOf(id) === -1; }; - this._refresh(input, isCollapsed); + const onDidCreateNode = (node: ITreeNode) => { + const id = this.identityProvider!.getId(node.element).toString(); + + if (viewState.focus.indexOf(id) > -1) { + focus.push(node.element); + } + + if (viewState.selection.indexOf(id) > -1) { + selection.push(node.element); + } + }; + + this._refresh(input, isCollapsed, onDidCreateNode); this.setFocus(focus); this.setSelection(selection); } @@ -94,8 +97,8 @@ export class DataTree extends AbstractTree boolean): void { - this.model.setChildren((element === this.input ? null : element) as T, this.iterate(element, isCollapsed).elements); + private _refresh(element: TInput | T, isCollapsed?: (el: T) => boolean, onDidCreateNode?: (node: ITreeNode) => void): void { + this.model.setChildren((element === this.input ? null : element) as T, this.iterate(element, isCollapsed).elements, onDidCreateNode); } private iterate(element: TInput | T, isCollapsed?: (el: T) => boolean): { elements: Iterator>, size: number } { From 984a3a17a749925b3e19fedbd93222d1ccbc13c4 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 6 Feb 2019 22:13:44 +0100 Subject: [PATCH 392/429] Fix #67983 --- .../parts/markers/electron-browser/markersPanelActions.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts index 43090745bbb..8d820e557d9 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts @@ -20,7 +20,7 @@ import { attachInputBoxStyler, attachStylerCallback, attachCheckboxStyler } from import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/electron-browser/markers'; import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { BaseActionItem, ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; -import { badgeBackground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; +import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { localize } from 'vs/nls'; import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -197,8 +197,9 @@ export class MarkersFilterActionItem extends BaseActionItem { private createBadge(container: HTMLElement): void { this.filterBadge = DOM.append(container, DOM.$('.markers-panel-filter-badge')); - this._register(attachStylerCallback(this.themeService, { badgeBackground, contrastBorder }, colors => { + this._register(attachStylerCallback(this.themeService, { badgeBackground, badgeForeground, contrastBorder }, colors => { const background = colors.badgeBackground ? colors.badgeBackground.toString() : null; + const foreground = colors.badgeForeground ? colors.badgeForeground.toString() : null; const border = colors.contrastBorder ? colors.contrastBorder.toString() : null; this.filterBadge.style.backgroundColor = background; @@ -206,6 +207,7 @@ export class MarkersFilterActionItem extends BaseActionItem { this.filterBadge.style.borderWidth = border ? '1px' : null; this.filterBadge.style.borderStyle = border ? 'solid' : null; this.filterBadge.style.borderColor = border; + this.filterBadge.style.color = foreground; })); this.updateBadge(); this._register(this.filterController.onDidFilter(() => this.updateBadge())); From 6b8b1b7bea88280313a3cbadb6ae383911a0447a Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 18:07:40 -0800 Subject: [PATCH 393/429] Improve naming --- .../src/markdownExtensions.ts | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/extensions/markdown-language-features/src/markdownExtensions.ts b/extensions/markdown-language-features/src/markdownExtensions.ts index 567ee946b9d..4cdc8d1cfd1 100644 --- a/extensions/markdown-language-features/src/markdownExtensions.ts +++ b/extensions/markdown-language-features/src/markdownExtensions.ts @@ -13,7 +13,7 @@ const resolveExtensionResource = (extension: vscode.Extension, resourcePath .with({ scheme: 'vscode-resource' }); }; -const resolveExtensionResources = (extension: vscode.Extension, resourcePaths: any): vscode.Uri[] => { +const resolveExtensionResources = (extension: vscode.Extension, resourcePaths: unknown): vscode.Uri[] => { const result: vscode.Uri[] = []; if (Array.isArray(resourcePaths)) { for (const resource of resourcePaths) { @@ -65,50 +65,48 @@ export namespace MarkdownContributions { export function fromExtension( extension: vscode.Extension ): MarkdownContributions { - const contributes = extension.packageJSON && extension.packageJSON.contributes; - if (!contributes) { + const contributions = extension.packageJSON && extension.packageJSON.contributes; + if (!contributions) { return MarkdownContributions.Empty; } - const styles = tryLoadPreviewStyles(contributes, extension); - const scripts = tryLoadPreviewScripts(contributes, extension); - const previewResourceRoots: vscode.Uri[] = []; - if (styles.length || scripts.length) { - previewResourceRoots.push(vscode.Uri.file(extension.extensionPath)); - } + const previewStyles = getContributedStyles(contributions, extension); + const previewScripts = getContributedScripts(contributions, extension); + const previewResourceRoots = previewStyles.length || previewScripts.length ? [vscode.Uri.file(extension.extensionPath)] : []; + const markdownItPlugins = getContributedMarkdownItPlugins(contributions, extension); - const plugins = tryLoadMarkdownItPlugins(contributes, extension); return { - previewScripts: scripts, - previewStyles: styles, + previewScripts, + previewStyles, previewResourceRoots, - markdownItPlugins: plugins ? new Map([[extension.id, plugins]]) : new Map() + markdownItPlugins }; } - function tryLoadMarkdownItPlugins( + function getContributedMarkdownItPlugins( contributes: any, extension: vscode.Extension - ): Thenable<(md: any) => any> | undefined { + ): Map any>> { + const map = new Map any>>(); if (contributes['markdown.markdownItPlugins']) { - return extension.activate().then(() => { + map.set(extension.id, extension.activate().then(() => { if (extension.exports && extension.exports.extendMarkdownIt) { return (md: any) => extension.exports.extendMarkdownIt(md); } return (md: any) => md; - }); + })); } - return undefined; + return map; } - function tryLoadPreviewScripts( + function getContributedScripts( contributes: any, extension: vscode.Extension ) { return resolveExtensionResources(extension, contributes['markdown.previewScripts']); } - function tryLoadPreviewStyles( + function getContributedStyles( contributes: any, extension: vscode.Extension ) { From 198e6a55e7a50eeef19965f1165c294a117809a2 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 5 Feb 2019 18:10:16 -0800 Subject: [PATCH 394/429] Make sure we dispose of event emitters properly --- extensions/markdown-language-features/src/extension.ts | 1 + .../markdown-language-features/src/markdownExtensions.ts | 4 +++- extensions/markdown-language-features/src/test/engine.ts | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/extensions/markdown-language-features/src/extension.ts b/extensions/markdown-language-features/src/extension.ts index a90a0124843..bd6f3eb4035 100644 --- a/extensions/markdown-language-features/src/extension.ts +++ b/extensions/markdown-language-features/src/extension.ts @@ -25,6 +25,7 @@ export function activate(context: vscode.ExtensionContext) { context.subscriptions.push(telemetryReporter); const contributions = getMarkdownExtensionContributions(context); + context.subscriptions.push(contributions); const cspArbiter = new ExtensionContentSecurityPolicyArbiter(context.globalState, context.workspaceState); const engine = new MarkdownEngine(contributions, githubSlugifier); diff --git a/extensions/markdown-language-features/src/markdownExtensions.ts b/extensions/markdown-language-features/src/markdownExtensions.ts index 4cdc8d1cfd1..65899874f5a 100644 --- a/extensions/markdown-language-features/src/markdownExtensions.ts +++ b/extensions/markdown-language-features/src/markdownExtensions.ts @@ -118,6 +118,8 @@ export interface MarkdownContributionProvider { readonly extensionPath: string; readonly contributions: MarkdownContributions; readonly onContributionsChanged: vscode.Event; + + dispose(): void; } class VSCodeExtensionMarkdownContributionProvider extends Disposable implements MarkdownContributionProvider { @@ -138,7 +140,7 @@ class VSCodeExtensionMarkdownContributionProvider extends Disposable implements }, undefined, this._disposables); } - private readonly _onContributionsChanged = new vscode.EventEmitter(); + private readonly _onContributionsChanged = this._register(new vscode.EventEmitter()); public readonly onContributionsChanged = this._onContributionsChanged.event; public get contributions(): MarkdownContributions { diff --git a/extensions/markdown-language-features/src/test/engine.ts b/extensions/markdown-language-features/src/test/engine.ts index fef334b4cf5..cb74a5b695f 100644 --- a/extensions/markdown-language-features/src/test/engine.ts +++ b/extensions/markdown-language-features/src/test/engine.ts @@ -7,11 +7,12 @@ import * as vscode from 'vscode'; import { MarkdownEngine } from '../markdownEngine'; import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions'; import { githubSlugifier } from '../slugify'; +import { Disposable } from '../util/dispose'; -const emptyContributions = new class implements MarkdownContributionProvider { +const emptyContributions = new class extends Disposable implements MarkdownContributionProvider { readonly extensionPath = ''; readonly contributions = MarkdownContributions.Empty; - readonly onContributionsChanged = new vscode.EventEmitter().event; + readonly onContributionsChanged = this._register(new vscode.EventEmitter()).event; }; export function createNewMarkdownEngine(): MarkdownEngine { From 6ca137730bd498e0469fb8c647e5fe7677304701 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 11:43:48 -0800 Subject: [PATCH 395/429] Extract --- .../src/extension.ts | 58 ++++++++++++------- 1 file changed, 38 insertions(+), 20 deletions(-) diff --git a/extensions/markdown-language-features/src/extension.ts b/extensions/markdown-language-features/src/extension.ts index bd6f3eb4035..544c67be193 100644 --- a/extensions/markdown-language-features/src/extension.ts +++ b/extensions/markdown-language-features/src/extension.ts @@ -15,8 +15,8 @@ import MarkdownWorkspaceSymbolProvider from './features/workspaceSymbolProvider' import { Logger } from './logger'; import { MarkdownEngine } from './markdownEngine'; import { getMarkdownExtensionContributions } from './markdownExtensions'; -import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector } from './security'; -import { loadDefaultTelemetryReporter } from './telemetryReporter'; +import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector, ContentSecurityPolicyArbiter } from './security'; +import { loadDefaultTelemetryReporter, TelemetryReporter } from './telemetryReporter'; import { githubSlugifier } from './slugify'; @@ -31,28 +31,49 @@ export function activate(context: vscode.ExtensionContext) { const engine = new MarkdownEngine(contributions, githubSlugifier); const logger = new Logger(); - const selector: vscode.DocumentSelector = [ - { language: 'markdown', scheme: 'file' }, - { language: 'markdown', scheme: 'untitled' } - ]; - const contentProvider = new MarkdownContentProvider(engine, context, cspArbiter, contributions, logger); const symbolProvider = new MDDocumentSymbolProvider(engine); const previewManager = new MarkdownPreviewManager(contentProvider, logger, contributions); context.subscriptions.push(previewManager); - context.subscriptions.push(vscode.languages.setLanguageConfiguration('markdown', { - wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'), - })); - context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider)); - context.subscriptions.push(vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider())); - context.subscriptions.push(vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine))); - context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(new MarkdownWorkspaceSymbolProvider(symbolProvider))); + context.subscriptions.push(registerMarkdownLanguageFeatures(symbolProvider, engine)); + context.subscriptions.push(registerMarkdownCommands(previewManager, telemetryReporter, cspArbiter, engine)); + context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => { + logger.updateConfiguration(); + previewManager.updateConfiguration(); + })); +} + +function registerMarkdownLanguageFeatures( + symbolProvider: MDDocumentSymbolProvider, + engine: MarkdownEngine +): vscode.Disposable { + const selector: vscode.DocumentSelector = [ + { language: 'markdown', scheme: 'file' }, + { language: 'markdown', scheme: 'untitled' } + ]; + + return vscode.Disposable.from( + vscode.languages.setLanguageConfiguration('markdown', { + wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'), + }), + vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider), + vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()), + vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine)), + vscode.languages.registerWorkspaceSymbolProvider(new MarkdownWorkspaceSymbolProvider(symbolProvider)) + ); +} + +function registerMarkdownCommands( + previewManager: MarkdownPreviewManager, + telemetryReporter: TelemetryReporter, + cspArbiter: ContentSecurityPolicyArbiter, + engine: MarkdownEngine +): vscode.Disposable { const previewSecuritySelector = new PreviewSecuritySelector(cspArbiter, previewManager); const commandManager = new CommandManager(); - context.subscriptions.push(commandManager); commandManager.register(new commands.ShowPreviewCommand(previewManager, telemetryReporter)); commandManager.register(new commands.ShowPreviewToSideCommand(previewManager, telemetryReporter)); commandManager.register(new commands.ShowLockedPreviewToSideCommand(previewManager, telemetryReporter)); @@ -62,9 +83,6 @@ export function activate(context: vscode.ExtensionContext) { commandManager.register(new commands.ShowPreviewSecuritySelectorCommand(previewSecuritySelector, previewManager)); commandManager.register(new commands.OpenDocumentLinkCommand(engine)); commandManager.register(new commands.ToggleLockCommand(previewManager)); - - context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => { - logger.updateConfiguration(); - previewManager.updateConfiguration(); - })); + return commandManager; } + From eef33ddf1a8db22a0e7cc309e9b3521eddf49563 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 11:51:39 -0800 Subject: [PATCH 396/429] Strict null check quickOpen.contribution --- src/tsconfig.strictNullChecks.json | 3 ++- src/vs/workbench/browser/quickopen.ts | 8 ++++---- .../parts/quickopen/browser/quickopen.contribution.ts | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 62d2c63d749..9733d478b67 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -570,6 +570,7 @@ "./vs/workbench/parts/quickopen/browser/gotoLineHandler.ts", "./vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts", "./vs/workbench/parts/quickopen/browser/helpHandler.ts", + "./vs/workbench/parts/quickopen/browser/quickopen.contribution.ts", "./vs/workbench/parts/quickopen/browser/viewPickerHandler.ts", "./vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts", "./vs/workbench/parts/scm/common/scm.ts", @@ -693,9 +694,9 @@ "./vs/workbench/services/decorations/test/browser/decorationsService.test.ts", "./vs/workbench/services/dialogs/electron-browser/dialogService.ts", "./vs/workbench/services/editor/common/editorService.ts", + "./vs/workbench/services/extensions/common/extensionHostProtocol.ts", "./vs/workbench/services/extensions/common/extensions.ts", "./vs/workbench/services/extensions/common/extensionsRegistry.ts", - "./vs/workbench/services/extensions/common/extensionHostProtocol.ts", "./vs/workbench/services/extensions/electron-browser/cachedExtensionScanner.ts", "./vs/workbench/services/extensions/electron-browser/extensionHostProfiler.ts", "./vs/workbench/services/extensions/electron-browser/inactiveExtensionUrlHandler.ts", diff --git a/src/vs/workbench/browser/quickopen.ts b/src/vs/workbench/browser/quickopen.ts index 843dce6d80f..0e06fe52a83 100644 --- a/src/vs/workbench/browser/quickopen.ts +++ b/src/vs/workbench/browser/quickopen.ts @@ -129,16 +129,16 @@ export interface QuickOpenHandlerHelpEntry { export class QuickOpenHandlerDescriptor { prefix: string; description: string; - contextKey: string; + contextKey?: string; helpEntries: QuickOpenHandlerHelpEntry[]; instantProgress: boolean; private id: string; private ctor: IConstructorSignature0; - constructor(ctor: IConstructorSignature0, id: string, prefix: string, contextKey: string, description: string, instantProgress?: boolean); - constructor(ctor: IConstructorSignature0, id: string, prefix: string, contextKey: string, helpEntries: QuickOpenHandlerHelpEntry[], instantProgress?: boolean); - constructor(ctor: IConstructorSignature0, id: string, prefix: string, contextKey: string, param: any, instantProgress: boolean = false) { + constructor(ctor: IConstructorSignature0, id: string, prefix: string, contextKey: string | undefined, description: string, instantProgress?: boolean); + constructor(ctor: IConstructorSignature0, id: string, prefix: string, contextKey: string | undefined, helpEntries: QuickOpenHandlerHelpEntry[], instantProgress?: boolean); + constructor(ctor: IConstructorSignature0, id: string, prefix: string, contextKey: string | undefined, param: any, instantProgress: boolean = false) { this.ctor = ctor; this.id = id; this.prefix = prefix; diff --git a/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts b/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts index e6ffdb918bb..967300cbf23 100644 --- a/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts +++ b/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts @@ -86,7 +86,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen GotoLineHandler, GotoLineHandler.ID, GOTO_LINE_PREFIX, - null, + undefined, [ { prefix: GOTO_LINE_PREFIX, @@ -123,7 +123,7 @@ Registry.as(QuickOpenExtensions.Quickopen).registerQuickOpen HelpHandler, HelpHandler.ID, HELP_PREFIX, - null, + undefined, nls.localize('helpDescription', "Show Help") ) ); From 61fc467ad70b4d6d8ab09d4098b063384fc93926 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 13:44:54 -0800 Subject: [PATCH 397/429] Strict null check vs/code/** Fixing errors and adding some null supressions in code/windows --- src/tsconfig.strictNullChecks.json | 28 +--- src/vs/code/electron-main/windows.ts | 125 +++++++++--------- src/vs/code/node/windowsFinder.ts | 8 +- src/vs/platform/backup/common/backup.ts | 2 +- .../backup/electron-main/backupMainService.ts | 8 +- .../platform/menubar/electron-main/menubar.ts | 4 +- src/vs/platform/windows/common/windows.ts | 2 +- .../platform/windows/electron-main/windows.ts | 8 +- .../windows/electron-main/windowsService.ts | 2 +- .../workbench/test/workbenchTestServices.ts | 2 +- 10 files changed, 84 insertions(+), 105 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 9733d478b67..d8d6b315a0f 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -7,6 +7,7 @@ "include": [ "./typings", "./vs/base/**/*.ts", + "./vs/code/**/*.ts", "./vs/editor/browser/**/*.ts", "./vs/editor/common/**/*.ts", "./vs/editor/contrib/codeAction/**/*.ts", @@ -19,33 +20,6 @@ "./vs/editor/test/**/*.ts" ], "files": [ - "./vs/code/code.main.ts", - "./vs/code/electron-browser/issue/issueReporterMain.ts", - "./vs/code/electron-browser/issue/issueReporterModel.ts", - "./vs/code/electron-browser/issue/issueReporterPage.ts", - "./vs/code/electron-browser/issue/issueReporterUtil.ts", - "./vs/code/electron-browser/issue/test/testReporterModel.test.ts", - "./vs/code/electron-browser/processExplorer/processExplorerMain.ts", - "./vs/code/electron-browser/sharedProcess/contrib/contributions.ts", - "./vs/code/electron-browser/sharedProcess/contrib/languagePackCachedDataCleaner.ts", - "./vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner.ts", - "./vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts", - "./vs/code/electron-browser/sharedProcess/contrib/storageDataCleaner.ts", - "./vs/code/electron-browser/sharedProcess/sharedProcessMain.ts", - "./vs/code/electron-main/auth.ts", - "./vs/code/electron-main/keyboard.ts", - "./vs/code/electron-main/logUploader.ts", - "./vs/code/electron-main/sharedProcess.ts", - "./vs/code/electron-main/theme.ts", - "./vs/code/electron-main/window.ts", - "./vs/code/node/cli.ts", - "./vs/code/node/cliProcessMain.ts", - "./vs/code/node/paths.ts", - "./vs/code/node/shellEnv.ts", - "./vs/code/node/wait.ts", - "./vs/code/node/windowsFinder.ts", - "./vs/code/test/node/argv.test.ts", - "./vs/code/test/node/windowsFinder.test.ts", "./vs/editor/contrib/bracketMatching/bracketMatching.ts", "./vs/editor/contrib/bracketMatching/test/bracketMatching.test.ts", "./vs/editor/contrib/caretOperations/caretOperations.ts", diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index f51a81ec7db..033523ff178 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -74,7 +74,7 @@ interface IOpenBrowserWindowOptions { workspace?: IWorkspaceIdentifier; folderUri?: URI; - remoteAuthority: string; + remoteAuthority?: string; initialStartup?: boolean; @@ -425,7 +425,7 @@ export class WindowsManager implements IWindowsMainService { emptyToRestore = this.backupMainService.getEmptyWindowBackupPaths(); emptyToRestore.push(...pathsToOpen.filter(w => !w.workspace && !w.folderUri && w.backupPath).map(w => ({ backupFolder: basename(w.backupPath!), remoteAuthority: w.remoteAuthority }))); // add empty windows with backupPath - emptyToRestore = arrays.distinct(emptyToRestore, info => info.backupFolder); // prevent duplicates + emptyToRestore = arrays.distinct(emptyToRestore, info => info.backupFolder!); // prevent duplicates } // @@ -458,9 +458,9 @@ export class WindowsManager implements IWindowsMainService { for (let i = usedWindows.length - 1; i >= 0; i--) { const usedWindow = usedWindows[i]; if ( - (usedWindow.openedWorkspace && workspacesToRestore.some(workspace => workspace.id === usedWindow.openedWorkspace.id)) || // skip over restored workspace + (usedWindow.openedWorkspace && workspacesToRestore.some(workspace => workspace.id === usedWindow.openedWorkspace!.id)) || // skip over restored workspace (usedWindow.openedFolderUri && foldersToRestore.some(folder => isEqual(folder, usedWindow.openedFolderUri))) || // skip over restored folder - (usedWindow.backupPath && emptyToRestore.some(empty => empty.backupFolder === basename(usedWindow.backupPath))) // skip over restored empty window + (usedWindow.backupPath && emptyToRestore.some(empty => empty.backupFolder === basename(usedWindow.backupPath!))) // skip over restored empty window ) { continue; } @@ -484,8 +484,10 @@ export class WindowsManager implements IWindowsMainService { const recentlyOpenedFiles: URI[] = []; pathsToOpen.forEach(win => { - if (win.workspace || win.folderUri) { - recentlyOpenedWorkspaces.push(win.workspace || win.folderUri); + if (win.workspace) { + recentlyOpenedWorkspaces.push(win.workspace); + } else if (win.folderUri) { + recentlyOpenedWorkspaces.push(win.folderUri); } else if (win.fileUri) { recentlyOpenedFiles.push(win.fileUri); } @@ -500,7 +502,7 @@ export class WindowsManager implements IWindowsMainService { // used for the edit operation is closed or loaded to a different folder so that the waiting // process can continue. We do this by deleting the waitMarkerFilePath. if (openConfig.context === OpenContext.CLI && openConfig.cli.wait && openConfig.cli.waitMarkerFilePath && usedWindows.length === 1 && usedWindows[0]) { - this.waitForWindowCloseOrLoad(usedWindows[0].id).then(() => fs.unlink(openConfig.cli.waitMarkerFilePath, error => undefined)); + this.waitForWindowCloseOrLoad(usedWindows[0].id).then(() => fs.unlink(openConfig.cli.waitMarkerFilePath!, _error => undefined)); } return usedWindows; @@ -535,7 +537,7 @@ export class WindowsManager implements IWindowsMainService { // Handle folders to add by looking for the last active workspace (not on initial startup) if (!openConfig.initialStartup && foldersToAdd.length > 0) { const authority = getRemoteAuthority(foldersToAdd[0]); - const lastActiveWindow = this.getLastActiveWindowForAuthority(authority); + const lastActiveWindow = authority ? this.getLastActiveWindowForAuthority(authority) : undefined; if (lastActiveWindow) { usedWindows.push(this.doAddFoldersToExistingWindow(lastActiveWindow, foldersToAdd)); } @@ -548,12 +550,12 @@ export class WindowsManager implements IWindowsMainService { // Find suitable window or folder path to open files in const fileToCheck = fileInputs.filesToOpen[0] || fileInputs.filesToCreate[0] || fileInputs.filesToDiff[0]; // only look at the windows with correct authority - const windows = WindowsManager.WINDOWS.filter(w => w.remoteAuthority === fileInputs.remoteAuthority); + const windows = WindowsManager.WINDOWS.filter(w => w.remoteAuthority === fileInputs!.remoteAuthority); let bestWindowOrFolder = findBestWindowOrFolderForFile({ windows, newWindow: openFilesInNewWindow, - reuseWindow: openConfig.forceReuseWindow, + reuseWindow: !!openConfig.forceReuseWindow, context: openConfig.context, fileUri: fileToCheck && fileToCheck.fileUri, workspaceResolver: workspace => this.workspacesMainService.resolveWorkspaceSync(workspace.configPath) @@ -623,7 +625,7 @@ export class WindowsManager implements IWindowsMainService { // Open remaining ones allWorkspacesToOpen.forEach(workspaceToOpen => { - if (windowsOnWorkspace.some(win => win.openedWorkspace.id === workspaceToOpen.id)) { + if (windowsOnWorkspace.some(win => win.openedWorkspace!.id === workspaceToOpen.id)) { return; // ignore folders that are already open } @@ -765,7 +767,7 @@ export class WindowsManager implements IWindowsMainService { return window; } - private doOpenFolderOrWorkspace(openConfig: IOpenConfiguration, folderOrWorkspace: IPathToOpen, forceNewWindow: boolean, fileInputs: IFileInputs, windowToUse?: ICodeWindow): ICodeWindow { + private doOpenFolderOrWorkspace(openConfig: IOpenConfiguration, folderOrWorkspace: IPathToOpen, forceNewWindow: boolean, fileInputs: IFileInputs | undefined, windowToUse?: ICodeWindow): ICodeWindow { if (!forceNewWindow && !windowToUse && typeof openConfig.contextWindowId === 'number') { windowToUse = this.getWindowById(openConfig.contextWindowId); // fix for https://github.com/Microsoft/vscode/issues/49587 } @@ -818,8 +820,8 @@ export class WindowsManager implements IWindowsMainService { // folders should be added to the existing window. if (!openConfig.addMode && isCommandLineOrAPICall) { const foldersToOpen = windowsToOpen.filter(path => !!path.folderUri); - if (foldersToOpen.length > 1 && foldersToOpen.every(f => f.folderUri.scheme === Schemas.file)) { - const workspace = this.workspacesMainService.createUntitledWorkspaceSync(foldersToOpen.map(folder => ({ uri: folder.folderUri }))); + if (foldersToOpen.length > 1 && foldersToOpen.every(f => f.folderUri!.scheme === Schemas.file)) { + const workspace = this.workspacesMainService.createUntitledWorkspaceSync(foldersToOpen.map(folder => ({ uri: folder.folderUri! }))); // Add workspace and remove folders thereby windowsToOpen.push({ workspace, remoteAuthority: foldersToOpen[0].remoteAuthority }); @@ -834,12 +836,12 @@ export class WindowsManager implements IWindowsMainService { const pathsToOpen: IPathToOpen[] = []; const cli = openConfig.cli; let parseOptions: IPathParseOptions = { gotoLineMode: cli && cli.goto, forceOpenWorkspaceAsFile: openConfig.forceOpenWorkspaceAsFile }; - for (const pathToOpen of openConfig.urisToOpen) { + for (const pathToOpen of openConfig.urisToOpen || []) { if (!pathToOpen) { continue; } - const path = this.parseUri(pathToOpen, openConfig.forceOpenWorkspaceAsFile, parseOptions); + const path = this.parseUri(pathToOpen, !!openConfig.forceOpenWorkspaceAsFile, parseOptions); if (path) { pathsToOpen.push(path); } else { @@ -988,7 +990,7 @@ export class WindowsManager implements IWindowsMainService { return null; } - private parseUri(uri: URI, isFile: boolean, options?: IPathParseOptions): IPathToOpen | null { + private parseUri(uri: URI | null, isFile: boolean, options?: IPathParseOptions): IPathToOpen | null { if (!uri || !uri.scheme) { return null; } @@ -1059,8 +1061,8 @@ export class WindowsManager implements IWindowsMainService { // File return { fileUri: URI.file(candidate), - lineNumber: gotoLineMode ? parsedPath.line : undefined, - columnNumber: gotoLineMode ? parsedPath.column : undefined, + lineNumber: gotoLineMode ? parsedPath!.line : undefined, + columnNumber: gotoLineMode ? parsedPath!.column : undefined, remoteAuthority }; } @@ -1100,9 +1102,9 @@ export class WindowsManager implements IWindowsMainService { } // let the user settings override how files are open in a new window or same window unless we are forced (not for extension development though) - let openFilesInNewWindow: boolean; + let openFilesInNewWindow: boolean = false; if (openConfig.forceNewWindow || openConfig.forceReuseWindow) { - openFilesInNewWindow = openConfig.forceNewWindow && !openConfig.forceReuseWindow; + openFilesInNewWindow = !!openConfig.forceNewWindow && !openConfig.forceReuseWindow; } else { // macOS: by default we open files in a new window if this is triggered via DOCK context @@ -1125,7 +1127,7 @@ export class WindowsManager implements IWindowsMainService { } } - return { openFolderInNewWindow, openFilesInNewWindow }; + return { openFolderInNewWindow: !!openFolderInNewWindow, openFilesInNewWindow }; } openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void { @@ -1133,7 +1135,7 @@ export class WindowsManager implements IWindowsMainService { // Reload an existing extension development host window on the same path // We currently do not allow more than one extension development window // on the same extension path. - const existingWindow = findWindowOnExtensionDevelopmentPath(WindowsManager.WINDOWS, openConfig.cli.extensionDevelopmentPath); + const existingWindow = openConfig.cli.extensionDevelopmentPath && findWindowOnExtensionDevelopmentPath(WindowsManager.WINDOWS, openConfig.cli.extensionDevelopmentPath); if (existingWindow) { this.reload(existingWindow, openConfig.cli); existingWindow.focus(); // make sure it gets focus and is restored @@ -1210,7 +1212,7 @@ export class WindowsManager implements IWindowsMainService { // For all other cases we first call into registerEmptyWindowBackupSync() to set it before // loading the window. if (options.emptyWindowBackupInfo) { - configuration.backupPath = join(this.environmentService.backupHome, options.emptyWindowBackupInfo.backupFolder); + configuration.backupPath = join(this.environmentService.backupHome, options.emptyWindowBackupInfo.backupFolder!); } let window: ICodeWindow | undefined; @@ -1264,10 +1266,10 @@ export class WindowsManager implements IWindowsMainService { // Window Events window.win.webContents.removeAllListeners('devtools-reload-page'); // remove built in listener so we can handle this on our own - window.win.webContents.on('devtools-reload-page', () => this.reload(window)); - window.win.webContents.on('crashed', () => this.onWindowError(window, WindowError.CRASHED)); - window.win.on('unresponsive', () => this.onWindowError(window, WindowError.UNRESPONSIVE)); - window.win.on('closed', () => this.onWindowClosed(window)); + window.win.webContents.on('devtools-reload-page', () => this.reload(window!)); + window.win.webContents.on('crashed', () => this.onWindowError(window!, WindowError.CRASHED)); + window.win.on('unresponsive', () => this.onWindowError(window!, WindowError.UNRESPONSIVE)); + window.win.on('closed', () => this.onWindowClosed(window!)); // Lifecycle (this.lifecycleService as LifecycleService).registerWindow(window); @@ -1295,7 +1297,7 @@ export class WindowsManager implements IWindowsMainService { if (window.isReady) { this.lifecycleService.unload(window, UnloadReason.LOAD).then(veto => { if (!veto) { - this.doOpenInBrowserWindow(window, configuration, options); + this.doOpenInBrowserWindow(window!, configuration, options); } }); } else { @@ -1338,8 +1340,9 @@ export class WindowsManager implements IWindowsMainService { } // Known Workspace - load from stored settings - if (configuration.workspace) { - const stateForWorkspace = this.windowsState.openedWindows.filter(o => o.workspace && o.workspace.id === configuration.workspace.id).map(o => o.uiState); + const workspace = configuration.workspace; + if (workspace) { + const stateForWorkspace = this.windowsState.openedWindows.filter(o => o.workspace && o.workspace.id === workspace.id).map(o => o.uiState); if (stateForWorkspace.length) { return stateForWorkspace[0]; } @@ -1405,8 +1408,8 @@ export class WindowsManager implements IWindowsMainService { // Note: important to use Math.round() because Electron does not seem to be too happy about // display coordinates that are not absolute numbers. let state = defaultWindowState() as INewWindowState; - state.x = Math.round(displayToUse.bounds.x + (displayToUse.bounds.width / 2) - (state.width / 2)); - state.y = Math.round(displayToUse.bounds.y + (displayToUse.bounds.height / 2) - (state.height / 2)); + state.x = Math.round(displayToUse.bounds.x + (displayToUse.bounds.width / 2) - (state.width! / 2)); + state.y = Math.round(displayToUse.bounds.y + (displayToUse.bounds.height / 2) - (state.height! / 2)); // Check for newWindowDimensions setting and adjust accordingly const windowConfig = this.configurationService.getValue('window'); @@ -1444,6 +1447,9 @@ export class WindowsManager implements IWindowsMainService { return state; } + state.x = typeof state.x === 'number' ? state.x : 0; + state.y = typeof state.y === 'number' ? state.y : 0; + const existingWindowBounds = WindowsManager.WINDOWS.map(win => win.getBounds()); while (existingWindowBounds.some(b => b.x === state.x || b.y === state.y)) { state.x += 30; @@ -1471,8 +1477,8 @@ export class WindowsManager implements IWindowsMainService { }); } - enterWorkspace(win: ICodeWindow, path: URI): Promise { - return this.workspacesManager.enterWorkspace(win, path).then(result => this.doEnterWorkspace(win, result)); + enterWorkspace(win: ICodeWindow, path: URI): Promise { + return this.workspacesManager.enterWorkspace(win, path).then(result => result ? this.doEnterWorkspace(win, result) : undefined); } private doEnterWorkspace(win: ICodeWindow, result: IEnterWorkspaceResult): IEnterWorkspaceResult { @@ -1514,7 +1520,7 @@ export class WindowsManager implements IWindowsMainService { } // Handle untitled workspaces with prompt as needed - e.veto(this.workspacesManager.promptToSaveUntitledWorkspace(this.getWindowById(e.window.id), workspace).then(veto => { + e.veto(this.workspacesManager.promptToSaveUntitledWorkspace(this.getWindowById(e.window.id), workspace).then((veto): boolean | Promise => { if (veto) { return veto; } @@ -1539,11 +1545,11 @@ export class WindowsManager implements IWindowsMainService { return this.open({ context, cli, forceEmpty: true })[0]; } - getLastActiveWindow(): ICodeWindow { + getLastActiveWindow(): ICodeWindow | undefined { return getLastActiveWindow(WindowsManager.WINDOWS); } - getLastActiveWindowForAuthority(remoteAuthority: string): ICodeWindow { + getLastActiveWindowForAuthority(remoteAuthority: string): ICodeWindow | undefined { return getLastActiveWindow(WindowsManager.WINDOWS.filter(w => w.remoteAuthority === remoteAuthority)); } @@ -1594,22 +1600,22 @@ export class WindowsManager implements IWindowsMainService { }); } - getFocusedWindow(): ICodeWindow | null { + getFocusedWindow(): ICodeWindow | undefined { const win = BrowserWindow.getFocusedWindow(); if (win) { return this.getWindowById(win.id); } - return null; + return undefined; } - getWindowById(windowId: number): ICodeWindow | null { + getWindowById(windowId: number): ICodeWindow | undefined { const res = WindowsManager.WINDOWS.filter(w => w.id === windowId); if (res && res.length === 1) { return res[0]; } - return null; + return undefined; } getWindows(): ICodeWindow[] { @@ -1827,39 +1833,38 @@ class Dialogs { }); } - private getFileOrFolderUris(options: IInternalNativeOpenDialogOptions): Promise { + private getFileOrFolderUris(options: IInternalNativeOpenDialogOptions): Promise { // Ensure dialog options - if (!options.dialogOptions) { - options.dialogOptions = Object.create(null); - } + const dialogOptions = options.dialogOptions || Object.create(null); + options.dialogOptions = dialogOptions; // Ensure defaultPath - if (!options.dialogOptions.defaultPath) { - options.dialogOptions.defaultPath = this.stateService.getItem(Dialogs.workingDirPickerStorageKey); + if (!dialogOptions.defaultPath) { + dialogOptions.defaultPath = this.stateService.getItem(Dialogs.workingDirPickerStorageKey); } // Ensure properties if (typeof options.pickFiles === 'boolean' || typeof options.pickFolders === 'boolean') { - options.dialogOptions.properties = undefined; // let it override based on the booleans + dialogOptions.properties = undefined; // let it override based on the booleans if (options.pickFiles && options.pickFolders) { - options.dialogOptions.properties = ['multiSelections', 'openDirectory', 'openFile', 'createDirectory']; + dialogOptions.properties = ['multiSelections', 'openDirectory', 'openFile', 'createDirectory']; } } - if (!options.dialogOptions.properties) { - options.dialogOptions.properties = ['multiSelections', options.pickFolders ? 'openDirectory' : 'openFile', 'createDirectory']; + if (!dialogOptions.properties) { + dialogOptions.properties = ['multiSelections', options.pickFolders ? 'openDirectory' : 'openFile', 'createDirectory']; } if (isMacintosh) { - options.dialogOptions.properties.push('treatPackageAsDirectory'); // always drill into .app files + dialogOptions.properties.push('treatPackageAsDirectory'); // always drill into .app files } // Show Dialog - const focusedWindow = this.windowsMainService.getWindowById(options.windowId) || this.windowsMainService.getFocusedWindow(); + const focusedWindow = (typeof options.windowId === 'number' ? this.windowsMainService.getWindowById(options.windowId) : undefined) || this.windowsMainService.getFocusedWindow(); - return this.showOpenDialog(options.dialogOptions, focusedWindow).then(paths => { + return this.showOpenDialog(dialogOptions, focusedWindow).then(paths => { if (paths && paths.length > 0) { // Remember path in storage for next time @@ -1889,7 +1894,7 @@ class Dialogs { showMessageBox(options: Electron.MessageBoxOptions, window?: ICodeWindow): Promise { return this.getDialogQueue(window).queue(() => { return new Promise(resolve => { - dialog.showMessageBox(window ? window.win : undefined, options, (response: number, checkboxChecked: boolean) => { + dialog.showMessageBox(window ? window.win : undefined!, options, (response: number, checkboxChecked: boolean) => { resolve({ button: response, checkboxChecked }); }); }); @@ -1908,7 +1913,7 @@ class Dialogs { return this.getDialogQueue(window).queue(() => { return new Promise(resolve => { - dialog.showSaveDialog(window ? window.win : undefined, options, path => { + dialog.showSaveDialog(window ? window.win : undefined!, options, path => { resolve(normalizePath(path)); }); }); @@ -1940,7 +1945,7 @@ class Dialogs { // Show dialog and wrap as promise validatePathPromise.then(() => { - dialog.showOpenDialog(window ? window.win : undefined, options, paths => { + dialog.showOpenDialog(window ? window.win : undefined!, options, paths => { resolve(normalizePaths(paths)); }); }); @@ -2023,7 +2028,7 @@ class WorkspacesManager { } pickWorkspaceAndOpen(options: INativeOpenDialogOptions): void { - const window = this.windowsMainService.getWindowById(options.windowId) || this.windowsMainService.getFocusedWindow() || this.windowsMainService.getLastActiveWindow(); + const window = (typeof options.windowId === 'number' ? this.windowsMainService.getWindowById(options.windowId) : undefined) || this.windowsMainService.getFocusedWindow() || this.windowsMainService.getLastActiveWindow(); this.windowsMainService.pickFileAndOpen({ windowId: window ? window.id : undefined, @@ -2040,7 +2045,7 @@ class WorkspacesManager { }); } - promptToSaveUntitledWorkspace(window: ICodeWindow, workspace: IWorkspaceIdentifier): Promise { + promptToSaveUntitledWorkspace(window: ICodeWindow | undefined, workspace: IWorkspaceIdentifier): Promise { enum ConfirmResult { SAVE, DONT_SAVE, diff --git a/src/vs/code/node/windowsFinder.ts b/src/vs/code/node/windowsFinder.ts index 607e68dd163..bb04f92562d 100644 --- a/src/vs/code/node/windowsFinder.ts +++ b/src/vs/code/node/windowsFinder.ts @@ -29,14 +29,14 @@ export interface IBestWindowOrFolderOptions { workspaceResolver: (workspace: IWorkspaceIdentifier) => IResolvedWorkspace | null; } -export function findBestWindowOrFolderForFile({ windows, newWindow, reuseWindow, context, fileUri, workspaceResolver }: IBestWindowOrFolderOptions): W | null { +export function findBestWindowOrFolderForFile({ windows, newWindow, reuseWindow, context, fileUri, workspaceResolver }: IBestWindowOrFolderOptions): W | undefined { if (!newWindow && fileUri && (context === OpenContext.DESKTOP || context === OpenContext.CLI || context === OpenContext.DOCK)) { const windowOnFilePath = findWindowOnFilePath(windows, fileUri, workspaceResolver); if (windowOnFilePath) { return windowOnFilePath; } } - return !newWindow ? getLastActiveWindow(windows) : null; + return !newWindow ? getLastActiveWindow(windows) : undefined; } function findWindowOnFilePath(windows: W[], fileUri: URI, workspaceResolver: (workspace: IWorkspaceIdentifier) => IResolvedWorkspace | null): W | null { @@ -59,7 +59,7 @@ function findWindowOnFilePath(windows: W[], fileUri: UR return null; } -export function getLastActiveWindow(windows: W[]): W { +export function getLastActiveWindow(windows: W[]): W | undefined { const lastFocusedDate = Math.max.apply(Math, windows.map(window => window.lastFocusTime)); return windows.filter(window => window.lastFocusTime === lastFocusedDate)[0]; @@ -96,7 +96,7 @@ export function findWindowOnExtensionDevelopmentPath(wi return null; } -export function findWindowOnWorkspaceOrFolderUri(windows: W[], uri: URI): W | null { +export function findWindowOnWorkspaceOrFolderUri(windows: W[], uri: URI | null): W | null { if (!uri) { return null; } diff --git a/src/vs/platform/backup/common/backup.ts b/src/vs/platform/backup/common/backup.ts index e1e5392e73a..c5a0c38ee77 100644 --- a/src/vs/platform/backup/common/backup.ts +++ b/src/vs/platform/backup/common/backup.ts @@ -20,7 +20,7 @@ export interface IBackupWorkspacesFormat { export const IBackupMainService = createDecorator('backupMainService'); export interface IEmptyWindowBackupInfo { - backupFolder: string; + backupFolder?: string; remoteAuthority?: string; } diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index 98a462fde33..67c2e42d37e 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -211,7 +211,7 @@ export class BackupMainService implements IBackupMainService { backupFolder = this.getRandomEmptyWindowId(); } - if (!this.emptyWorkspaces.some(w => isEqual(w.backupFolder, backupFolder, !platform.isLinux))) { + if (!this.emptyWorkspaces.some(w => !!w.backupFolder && isEqual(w.backupFolder, backupFolder!, !platform.isLinux))) { this.emptyWorkspaces.push({ backupFolder, remoteAuthority }); this.saveSync(); } @@ -220,7 +220,7 @@ export class BackupMainService implements IBackupMainService { } unregisterEmptyWindowBackupSync(backupFolder: string): void { - let index = arrays.firstIndex(this.emptyWorkspaces, w => isEqual(w.backupFolder, backupFolder, !platform.isLinux)); + let index = arrays.firstIndex(this.emptyWorkspaces, w => !!w.backupFolder && isEqual(w.backupFolder, backupFolder, !platform.isLinux)); if (index !== -1) { this.emptyWorkspaces.splice(index, 1); this.saveSync(); @@ -344,7 +344,7 @@ export class BackupMainService implements IBackupMainService { // New empty window backup let newBackupFolder = this.getRandomEmptyWindowId(); - while (this.emptyWorkspaces.some(w => isEqual(w.backupFolder, newBackupFolder, platform.isLinux))) { + while (this.emptyWorkspaces.some(w => !!w.backupFolder && isEqual(w.backupFolder, newBackupFolder, platform.isLinux))) { newBackupFolder = this.getRandomEmptyWindowId(); } @@ -365,7 +365,7 @@ export class BackupMainService implements IBackupMainService { // New empty window backup let newBackupFolder = this.getRandomEmptyWindowId(); - while (this.emptyWorkspaces.some(w => isEqual(w.backupFolder, newBackupFolder, platform.isLinux))) { + while (this.emptyWorkspaces.some(w => !!w.backupFolder && isEqual(w.backupFolder, newBackupFolder, platform.isLinux))) { newBackupFolder = this.getRandomEmptyWindowId(); } diff --git a/src/vs/platform/menubar/electron-main/menubar.ts b/src/vs/platform/menubar/electron-main/menubar.ts index 7070576c1c1..519a61929b7 100644 --- a/src/vs/platform/menubar/electron-main/menubar.ts +++ b/src/vs/platform/menubar/electron-main/menubar.ts @@ -359,7 +359,7 @@ export class Menubar { if ( this.windowsMainService.getWindowCount() === 0 || // allow to quit when no more windows are open !!this.windowsMainService.getFocusedWindow() || // allow to quit when window has focus (fix for https://github.com/Microsoft/vscode/issues/39191) - this.windowsMainService.getLastActiveWindow().isMinimized() // allow to quit when window has no focus but is minimized (https://github.com/Microsoft/vscode/issues/63000) + this.windowsMainService.getLastActiveWindow()!.isMinimized() // allow to quit when window has no focus but is minimized (https://github.com/Microsoft/vscode/issues/63000) ) { this.windowsMainService.quit(); } @@ -702,7 +702,7 @@ export class Menubar { let activeWindow = this.windowsMainService.getFocusedWindow(); if (!activeWindow) { const lastActiveWindow = this.windowsMainService.getLastActiveWindow(); - if (lastActiveWindow.isMinimized()) { + if (lastActiveWindow && lastActiveWindow.isMinimized()) { activeWindow = lastActiveWindow; } } diff --git a/src/vs/platform/windows/common/windows.ts b/src/vs/platform/windows/common/windows.ts index 8e643286d88..48c91e57829 100644 --- a/src/vs/platform/windows/common/windows.ts +++ b/src/vs/platform/windows/common/windows.ts @@ -373,7 +373,7 @@ export interface IWindowConfiguration extends ParsedArgs { isInitialStartup?: boolean; userEnv: IProcessEnvironment; - nodeCachedDataDir: string; + nodeCachedDataDir?: string; backupPath?: string; diff --git a/src/vs/platform/windows/electron-main/windows.ts b/src/vs/platform/windows/electron-main/windows.ts index d8b43f4c13b..04ce561aeb1 100644 --- a/src/vs/platform/windows/electron-main/windows.ts +++ b/src/vs/platform/windows/electron-main/windows.ts @@ -94,7 +94,7 @@ export interface IWindowsMainService { // methods ready(initialUserEnv: IProcessEnvironment): void; reload(win: ICodeWindow, cli?: ParsedArgs): void; - enterWorkspace(win: ICodeWindow, path: URI): Promise; + enterWorkspace(win: ICodeWindow, path: URI): Promise; closeWorkspace(win: ICodeWindow): void; open(openConfig: IOpenConfiguration): ICodeWindow[]; openExtensionDevelopmentHostWindow(openConfig: IOpenConfiguration): void; @@ -106,14 +106,14 @@ export interface IWindowsMainService { showSaveDialog(options: Electron.SaveDialogOptions, win?: ICodeWindow): Promise; showOpenDialog(options: Electron.OpenDialogOptions, win?: ICodeWindow): Promise; focusLastActive(cli: ParsedArgs, context: OpenContext): ICodeWindow; - getLastActiveWindow(): ICodeWindow; + getLastActiveWindow(): ICodeWindow | undefined; waitForWindowCloseOrLoad(windowId: number): Promise; openNewWindow(context: OpenContext, options?: INewWindowOptions): ICodeWindow[]; openNewTabbedWindow(context: OpenContext): ICodeWindow[]; sendToFocused(channel: string, ...args: any[]): void; sendToAll(channel: string, payload: any, windowIdsToIgnore?: number[]): void; - getFocusedWindow(): ICodeWindow | null; - getWindowById(windowId: number): ICodeWindow | null; + getFocusedWindow(): ICodeWindow | undefined; + getWindowById(windowId: number): ICodeWindow | undefined; getWindows(): ICodeWindow[]; getWindowCount(): number; quit(): void; diff --git a/src/vs/platform/windows/electron-main/windowsService.ts b/src/vs/platform/windows/electron-main/windowsService.ts index 940cbe2d1cd..d993c29f9b6 100644 --- a/src/vs/platform/windows/electron-main/windowsService.ts +++ b/src/vs/platform/windows/electron-main/windowsService.ts @@ -37,7 +37,7 @@ export class WindowsService implements IWindowsService, IURLHandler, IDisposable readonly onWindowMaximize: Event = Event.filter(Event.fromNodeEventEmitter(app, 'browser-window-maximize', (_, w: Electron.BrowserWindow) => w.id), id => !!this.windowsMainService.getWindowById(id)); readonly onWindowUnmaximize: Event = Event.filter(Event.fromNodeEventEmitter(app, 'browser-window-unmaximize', (_, w: Electron.BrowserWindow) => w.id), id => !!this.windowsMainService.getWindowById(id)); readonly onWindowFocus: Event = Event.any( - Event.map(Event.filter(Event.map(this.windowsMainService.onWindowsCountChanged, () => this.windowsMainService.getLastActiveWindow()), w => !!w), w => w.id), + Event.map(Event.filter(Event.map(this.windowsMainService.onWindowsCountChanged, () => this.windowsMainService.getLastActiveWindow()), w => !!w), w => w!.id), Event.filter(Event.fromNodeEventEmitter(app, 'browser-window-focus', (_, w: Electron.BrowserWindow) => w.id), id => !!this.windowsMainService.getWindowById(id)) ); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 9e56b9e2685..1eb0182c12a 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -1039,7 +1039,7 @@ export class TestWindowService implements IWindowService { return Promise.resolve(); } - enterWorkspace(_path: URI): Promise { + enterWorkspace(_path: URI): Promise { return Promise.resolve(undefined); } From 453c77ec218d2a71a95cfead6ad1b7be09218e80 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 14:07:47 -0800 Subject: [PATCH 398/429] Strict null work in workbench --- src/tsconfig.strictNullChecks.json | 25 +++---------------- src/vs/workbench/browser/dnd.ts | 12 +++++---- .../parts/quickopen/quickOpenActions.ts | 4 +-- .../common/editor/diffEditorInput.ts | 2 +- .../common/editor/textEditorModel.ts | 6 ++--- .../common/editor/untitledEditorInput.ts | 4 +-- src/vs/workbench/common/views.ts | 2 +- .../untitled/common/untitledEditorService.ts | 22 ++++++++-------- 8 files changed, 30 insertions(+), 47 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index d8d6b315a0f..a7f9a27adb2 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -17,7 +17,9 @@ "./vs/editor/contrib/smartSelect/**/*.ts", "./vs/editor/contrib/snippet/**/*.ts", "./vs/editor/contrib/suggest/**/*.ts", - "./vs/editor/test/**/*.ts" + "./vs/editor/test/**/*.ts", + "./vs/workbench/parts/snippets/**/*.ts", + "./vs/workbench/services/themes/**/*.ts" ], "files": [ "./vs/editor/contrib/bracketMatching/bracketMatching.ts", @@ -567,17 +569,6 @@ "./vs/workbench/parts/search/test/browser/openFileHandler.test.ts", "./vs/workbench/parts/search/test/common/searchModel.test.ts", "./vs/workbench/parts/search/test/common/searchResult.test.ts", - "./vs/workbench/parts/snippets/electron-browser/configureSnippets.ts", - "./vs/workbench/parts/snippets/electron-browser/insertSnippet.ts", - "./vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts", - "./vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts", - "./vs/workbench/parts/snippets/electron-browser/snippetsFile.ts", - "./vs/workbench/parts/snippets/electron-browser/snippetsService.ts", - "./vs/workbench/parts/snippets/electron-browser/tabCompletion.ts", - "./vs/workbench/parts/snippets/test/electron-browser/snippetFile.test.ts", - "./vs/workbench/parts/snippets/test/electron-browser/snippetsRegistry.test.ts", - "./vs/workbench/parts/snippets/test/electron-browser/snippetsRewrite.test.ts", - "./vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts", "./vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts", "./vs/workbench/parts/stats/node/stats.contribution.ts", "./vs/workbench/parts/stats/node/workspaceStats.ts", @@ -760,16 +751,6 @@ "./vs/workbench/services/textMate/electron-browser/textMateService.ts", "./vs/workbench/services/textfile/common/textfiles.ts", "./vs/workbench/services/textfile/electron-browser/textResourcePropertiesService.ts", - "./vs/workbench/services/themes/common/colorExtensionPoint.ts", - "./vs/workbench/services/themes/common/colorThemeSchema.ts", - "./vs/workbench/services/themes/common/fileIconThemeSchema.ts", - "./vs/workbench/services/themes/common/workbenchThemeService.ts", - "./vs/workbench/services/themes/electron-browser/colorThemeData.ts", - "./vs/workbench/services/themes/electron-browser/colorThemeStore.ts", - "./vs/workbench/services/themes/electron-browser/fileIconThemeData.ts", - "./vs/workbench/services/themes/electron-browser/fileIconThemeStore.ts", - "./vs/workbench/services/themes/electron-browser/themeCompatibility.ts", - "./vs/workbench/services/themes/electron-browser/workbenchThemeService.ts", "./vs/workbench/services/timer/electron-browser/timerService.ts", "./vs/workbench/services/title/common/titleService.ts", "./vs/workbench/services/viewlet/browser/viewlet.ts", diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts index e73acff052b..a7765e76c20 100644 --- a/src/vs/workbench/browser/dnd.ts +++ b/src/vs/workbench/browser/dnd.ts @@ -299,9 +299,11 @@ export class ResourcesDropHandler { } // Open - workspacesToOpen.then(workspaces => { - this.windowService.openWindow(workspaces, { forceReuseWindow: true }); - }); + if (workspacesToOpen) { + workspacesToOpen.then(workspaces => { + this.windowService.openWindow(workspaces, { forceReuseWindow: true }); + }); + } return true; }); @@ -317,7 +319,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { super(); } - getDragURI(tree: ITree, obj: any): string { + getDragURI(tree: ITree, obj: any): string | undefined { const resource = this.toResource(obj); if (resource) { return resource.toString(); @@ -326,7 +328,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { return undefined; } - getDragLabel(tree: ITree, elements: any[]): string { + getDragLabel(tree: ITree, elements: any[]): string | undefined { if (elements.length > 1) { return String(elements.length); } diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenActions.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenActions.ts index 465cc520313..6ff9d1b3496 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenActions.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenActions.ts @@ -54,7 +54,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ const registry = Registry.as(ActionExtensions.WorkbenchActions); -const globalQuickOpenKeybinding = { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: [KeyMod.CtrlCmd | KeyCode.KEY_E], mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: null } }; +const globalQuickOpenKeybinding = { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: [KeyMod.CtrlCmd | KeyCode.KEY_E], mac: { primary: KeyMod.CtrlCmd | KeyCode.KEY_P, secondary: undefined } }; KeybindingsRegistry.registerKeybindingRule({ id: QUICKOPEN_ACTION_ID, @@ -96,6 +96,6 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ secondary: [globalQuickOpenKeybinding.secondary[0] | KeyMod.Shift], mac: { primary: globalQuickOpenKeybinding.mac.primary | KeyMod.Shift, - secondary: null + secondary: undefined } }); \ No newline at end of file diff --git a/src/vs/workbench/common/editor/diffEditorInput.ts b/src/vs/workbench/common/editor/diffEditorInput.ts index 3d534f3f87f..44a8af3658a 100644 --- a/src/vs/workbench/common/editor/diffEditorInput.ts +++ b/src/vs/workbench/common/editor/diffEditorInput.ts @@ -16,7 +16,7 @@ export class DiffEditorInput extends SideBySideEditorInput { static readonly ID = 'workbench.editors.diffEditorInput'; - private cachedModel: DiffEditorModel; + private cachedModel: DiffEditorModel | null; constructor(name: string, description: string, original: EditorInput, modified: EditorInput, private forceOpenAsBinary?: boolean) { super(name, description, original, modified); diff --git a/src/vs/workbench/common/editor/textEditorModel.ts b/src/vs/workbench/common/editor/textEditorModel.ts index 177bd9d249d..b300ee95fb5 100644 --- a/src/vs/workbench/common/editor/textEditorModel.ts +++ b/src/vs/workbench/common/editor/textEditorModel.ts @@ -19,8 +19,8 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd protected createdEditorModel: boolean; - private textEditorModelHandle: URI; - private modelDisposeListener: IDisposable; + private textEditorModelHandle: URI | null; + private modelDisposeListener: IDisposable | null; constructor( @IModelService protected modelService: IModelService, @@ -126,7 +126,7 @@ export abstract class BaseTextEditorModel extends EditorModel implements ITextEd this.modelService.updateModel(this.textEditorModel, newValue); } - createSnapshot(): ITextSnapshot { + createSnapshot(): ITextSnapshot | null { const model = this.textEditorModel; if (model) { return model.createSnapshot(true /* Preserve BOM */); diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index 817ec4eefc4..fd2d2677327 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -27,7 +27,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport private _hasAssociatedFilePath: boolean; private cachedModel: UntitledEditorModel; - private modelResolve: Promise; + private modelResolve?: Promise; private readonly _onDidModelChangeContent: Emitter = this._register(new Emitter()); get onDidModelChangeContent(): Event { return this._onDidModelChangeContent.event; } @@ -90,7 +90,7 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport return this.labelService.getUriLabel(resources.dirname(this.resource)); } - getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string { + getDescription(verbosity: Verbosity = Verbosity.MEDIUM): string | null { if (!this.hasAssociatedFilePath) { return null; } diff --git a/src/vs/workbench/common/views.ts b/src/vs/workbench/common/views.ts index f5effa730ab..0889e56bd06 100644 --- a/src/vs/workbench/common/views.ts +++ b/src/vs/workbench/common/views.ts @@ -300,7 +300,7 @@ export interface ITreeView extends IDisposable { showCollapseAllAction: boolean; - message: string | IMarkdownString; + message?: string | IMarkdownString; readonly visible: boolean; diff --git a/src/vs/workbench/services/untitled/common/untitledEditorService.ts b/src/vs/workbench/services/untitled/common/untitledEditorService.ts index 6c4c8b44f9d..79d22e193a6 100644 --- a/src/vs/workbench/services/untitled/common/untitledEditorService.ts +++ b/src/vs/workbench/services/untitled/common/untitledEditorService.ts @@ -95,12 +95,12 @@ export interface IUntitledEditorService { /** * Suggests a filename for the given untitled resource if it is known. */ - suggestFileName(resource: URI): string; + suggestFileName(resource: URI): string | undefined; /** * Get the configured encoding for the given untitled resource if any. */ - getEncoding(resource: URI): string; + getEncoding(resource: URI): string | undefined; } export class UntitledEditorService extends Disposable implements IUntitledEditorService { @@ -129,7 +129,7 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor super(); } - protected get(resource: URI): UntitledEditorInput { + protected get(resource: URI): UntitledEditorInput | undefined { return this.mapResourceToInput.get(resource); } @@ -164,7 +164,7 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor isDirty(resource: URI): boolean { const input = this.get(resource); - return input && input.isDirty(); + return input ? input.isDirty() : false; } getDirty(resources?: URI[]): URI[] { @@ -200,7 +200,7 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor // Return existing instance if asked for it if (resource && this.mapResourceToInput.has(resource)) { - return this.mapResourceToInput.get(resource); + return this.mapResourceToInput.get(resource)!; } // Create new otherwise @@ -229,19 +229,19 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor const input = this.instantiationService.createInstance(UntitledEditorInput, resource, hasAssociatedFilePath, modeId, initialValue, encoding); const contentListener = input.onDidModelChangeContent(() => { - this._onDidChangeContent.fire(resource); + this._onDidChangeContent.fire(resource!); }); const dirtyListener = input.onDidChangeDirty(() => { - this._onDidChangeDirty.fire(resource); + this._onDidChangeDirty.fire(resource!); }); const encodingListener = input.onDidModelChangeEncoding(() => { - this._onDidChangeEncoding.fire(resource); + this._onDidChangeEncoding.fire(resource!); }); const disposeListener = input.onDispose(() => { - this._onDidDisposeModel.fire(resource); + this._onDidDisposeModel.fire(resource!); }); // Remove from cache on dispose @@ -265,13 +265,13 @@ export class UntitledEditorService extends Disposable implements IUntitledEditor return this.mapResourceToAssociatedFilePath.has(resource); } - suggestFileName(resource: URI): string { + suggestFileName(resource: URI): string | undefined { const input = this.get(resource); return input ? input.suggestFileName() : undefined; } - getEncoding(resource: URI): string { + getEncoding(resource: URI): string | undefined { const input = this.get(resource); return input ? input.getEncoding() : undefined; From 4e0537740332cb432c9a17ed1a7c23f11635612b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 14:27:00 -0800 Subject: [PATCH 399/429] Strict null work in debug --- src/tsconfig.strictNullChecks.json | 1 + src/vs/workbench/browser/labels.ts | 26 +++++++++---------- .../parts/debug/common/debugSource.ts | 10 +++---- .../parts/debug/common/debugUtils.ts | 8 +++--- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index a7f9a27adb2..0a6a8deff96 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -486,6 +486,7 @@ "./vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts", "./vs/workbench/parts/debug/browser/debugANSIHandling.ts", "./vs/workbench/parts/debug/browser/linkDetector.ts", + "./vs/workbench/parts/debug/common/debugProtocol.d.ts", "./vs/workbench/parts/debug/node/telemetryApp.ts", "./vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts", "./vs/workbench/parts/emmet/browser/emmet.browser.contribution.ts", diff --git a/src/vs/workbench/browser/labels.ts b/src/vs/workbench/browser/labels.ts index 7c0a15b86f0..e38e0ce1137 100644 --- a/src/vs/workbench/browser/labels.ts +++ b/src/vs/workbench/browser/labels.ts @@ -27,7 +27,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti export interface IResourceLabelProps { resource?: uri; - name: string; + name?: string; description?: string; } @@ -223,13 +223,13 @@ class ResourceLabelWidget extends IconLabel { private _onDidRender = this._register(new Emitter()); get onDidRender(): Event { return this._onDidRender.event; } - private label: IResourceLabelProps; - private options: IResourceLabelOptions; - private computedIconClasses: string[]; - private lastKnownConfiguredLangId: string; - private computedPathLabel: string; + private label?: IResourceLabelProps; + private options?: IResourceLabelOptions; + private computedIconClasses?: string[]; + private lastKnownConfiguredLangId?: string; + private computedPathLabel?: string; - private needsRedraw: Redraw; + private needsRedraw?: Redraw; private isHidden: boolean = false; constructor( @@ -303,7 +303,7 @@ class ResourceLabelWidget extends IconLabel { this.render(hasResourceChanged); } - private hasResourceChanged(label: IResourceLabelProps, options: IResourceLabelOptions): boolean { + private hasResourceChanged(label: IResourceLabelProps, options?: IResourceLabelOptions): boolean { const newResource = label ? label.resource : undefined; const oldResource = this.label ? this.label.resource : undefined; @@ -331,15 +331,15 @@ class ResourceLabelWidget extends IconLabel { setEditor(editor: IEditorInput, options?: IResourceLabelOptions): void { this.setResource({ - resource: toResource(editor, { supportSideBySide: true }), - name: editor.getName(), - description: editor.getDescription() + resource: toResource(editor, { supportSideBySide: true }) || undefined, + name: editor.getName() || undefined, + description: editor.getDescription() || undefined }, options); } setFile(resource: uri, options?: IFileLabelOptions): void { const hideLabel = options && options.hideLabel; - let name: string; + let name: string | undefined; if (!hideLabel) { if (options && options.fileKind === FileKind.ROOT_FOLDER) { const workspaceFolder = this.contextService.getWorkspaceFolder(resource); @@ -353,7 +353,7 @@ class ResourceLabelWidget extends IconLabel { } } - let description: string; + let description: string | undefined; const hidePath = (options && options.hidePath) || (resource.scheme === Schemas.untitled && !this.untitledEditorService.hasAssociatedFilePath(resource)); if (!hidePath) { description = this.labelService.getUriLabel(resources.dirname(resource), { relative: true }); diff --git a/src/vs/workbench/parts/debug/common/debugSource.ts b/src/vs/workbench/parts/debug/common/debugSource.ts index 35b974baee2..bb4d1a11ea1 100644 --- a/src/vs/workbench/parts/debug/common/debugSource.ts +++ b/src/vs/workbench/parts/debug/common/debugSource.ts @@ -37,7 +37,7 @@ export class Source { constructor(public raw: DebugProtocol.Source, sessionId: string) { let path: string; if (raw) { - path = this.raw.path || this.raw.name; + path = this.raw.path || this.raw.name || ''; this.available = true; } else { this.raw = { name: UNKNOWN_SOURCE_LABEL }; @@ -45,7 +45,7 @@ export class Source { path = `${DEBUG_SCHEME}:${UNKNOWN_SOURCE_LABEL}`; } - if (this.raw.sourceReference > 0) { + if (typeof this.raw.sourceReference === 'number' && this.raw.sourceReference > 0) { this.uri = uri.parse(`${DEBUG_SCHEME}:${encodeURIComponent(path)}?session=${encodeURIComponent(sessionId)}&ref=${this.raw.sourceReference}`); } else { if (isUri(path)) { // path looks like a uri @@ -97,10 +97,10 @@ export class Source { }, sideBySide ? SIDE_GROUP : ACTIVE_GROUP); } - static getEncodedDebugData(modelUri: uri): { name: string, path: string, sessionId: string, sourceReference: number } { + static getEncodedDebugData(modelUri: uri): { name: string, path: string, sessionId?: string, sourceReference?: number } { let path: string; - let sourceReference: number; - let sessionId: string; + let sourceReference: number | undefined; + let sessionId: string | undefined; switch (modelUri.scheme) { case Schemas.file: diff --git a/src/vs/workbench/parts/debug/common/debugUtils.ts b/src/vs/workbench/parts/debug/common/debugUtils.ts index 0d00748fd61..6203b590794 100644 --- a/src/vs/workbench/parts/debug/common/debugUtils.ts +++ b/src/vs/workbench/parts/debug/common/debugUtils.ts @@ -34,7 +34,7 @@ export function getExactExpressionStartAndEnd(lineContent: string, looseStart: n // Some example supported expressions: myVar.prop, a.b.c.d, myVar?.prop, myVar->prop, MyClass::StaticProp, *myVar // Match any character except a set of characters which often break interesting sub-expressions let expression: RegExp = /([^()\[\]{}<>\s+\-/%~#^;=|,`!]|\->)+/g; - let result: RegExpExecArray | undefined = undefined; + let result: RegExpExecArray | null = null; // First find the full expression under the cursor while (result = expression.exec(lineContent)) { @@ -52,7 +52,7 @@ export function getExactExpressionStartAndEnd(lineContent: string, looseStart: n // For example in expression 'a.b.c.d', if the focus was under 'b', 'a.b' would be evaluated. if (matchingExpression) { let subExpression: RegExp = /\w+/g; - let subExpressionResult: RegExpExecArray | undefined = undefined; + let subExpressionResult: RegExpExecArray | null = null; while (subExpressionResult = subExpression.exec(matchingExpression)) { let subEnd = subExpressionResult.index + 1 + startOffset + subExpressionResult[0].length; if (subEnd >= looseEnd) { @@ -122,7 +122,7 @@ export function convertToDAPaths(message: DebugProtocol.ProtocolMessage, toUri: convertPaths(msg, (toDA: boolean, source: PathContainer | undefined) => { if (toDA && source) { - source.path = fixPath(source.path); + source.path = source.path ? fixPath(source.path) : undefined; } }); return msg; @@ -137,7 +137,7 @@ export function convertToVSCPaths(message: DebugProtocol.ProtocolMessage, toUri: convertPaths(msg, (toDA: boolean, source: PathContainer | undefined) => { if (!toDA && source) { - source.path = fixPath(source.path); + source.path = source.path ? fixPath(source.path) : undefined; } }); return msg; From 0b2d6226b1cc1ade6be256230d49745f9c7f3608 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 14:39:46 -0800 Subject: [PATCH 400/429] Strict null check work for workbenchServiceTest --- src/tsconfig.strictNullChecks.json | 18 ++------------- src/vs/platform/workspace/common/workspace.ts | 4 ++-- .../workbench/electron-browser/workbench.ts | 23 +++++++------------ .../partsSplash.contribution.ts | 8 +++---- .../welcome/overlay/browser/welcomeOverlay.ts | 2 +- .../services/part/common/partService.ts | 2 +- .../workbench/test/workbenchTestServices.ts | 22 +++++++++--------- 7 files changed, 29 insertions(+), 50 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 0a6a8deff96..cb527bcfcba 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -19,7 +19,8 @@ "./vs/editor/contrib/suggest/**/*.ts", "./vs/editor/test/**/*.ts", "./vs/workbench/parts/snippets/**/*.ts", - "./vs/workbench/services/themes/**/*.ts" + "./vs/workbench/services/themes/**/*.ts", + "./vs/workbench/parts/welcome/**/*.ts" ], "files": [ "./vs/editor/contrib/bracketMatching/bracketMatching.ts", @@ -623,21 +624,6 @@ "./vs/workbench/parts/themes/electron-browser/themes.contribution.ts", "./vs/workbench/parts/url/electron-browser/url.contribution.ts", "./vs/workbench/parts/webview/electron-browser/webviewProtocols.ts", - "./vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts", - "./vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts", - "./vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts", - "./vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts", - "./vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts", - "./vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts", - "./vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts", - "./vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts", - "./vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts", - "./vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts", - "./vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.ts", - "./vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts", - "./vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts", - "./vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts", - "./vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts", "./vs/workbench/services/activity/common/activity.ts", "./vs/workbench/services/backup/common/backup.ts", "./vs/workbench/services/backup/node/backupFileService.ts", diff --git a/src/vs/platform/workspace/common/workspace.ts b/src/vs/platform/workspace/common/workspace.ts index 9521062c3ac..e2488422d95 100644 --- a/src/vs/platform/workspace/common/workspace.ts +++ b/src/vs/platform/workspace/common/workspace.ts @@ -183,12 +183,12 @@ export class Workspace implements IWorkspace { this._configuration = configuration; } - getFolder(resource: URI): IWorkspaceFolder | null | undefined { + getFolder(resource: URI): IWorkspaceFolder | null { if (!resource) { return null; } - return this._foldersMap.findSubstr(resource.toString()); + return this._foldersMap.findSubstr(resource.toString()) || null; } private updateFoldersMap(): void { diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 54405b2aa0f..5ca6885f858 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -1229,30 +1229,23 @@ export class Workbench extends Disposable implements IPartService { return DOM.isAncestor(activeElement, container); } - getContainer(part: Parts): HTMLElement { - let container: HTMLElement | null = null; + getContainer(part: Parts): HTMLElement | null { switch (part) { case Parts.TITLEBAR_PART: - container = this.titlebarPart.getContainer(); - break; + return this.titlebarPart.getContainer(); case Parts.ACTIVITYBAR_PART: - container = this.activitybarPart.getContainer(); - break; + return this.activitybarPart.getContainer(); case Parts.SIDEBAR_PART: - container = this.sidebarPart.getContainer(); - break; + return this.sidebarPart.getContainer(); case Parts.PANEL_PART: - container = this.panelPart.getContainer(); - break; + return this.panelPart.getContainer(); case Parts.EDITOR_PART: - container = this.editorPart.getContainer(); - break; + return this.editorPart.getContainer(); case Parts.STATUSBAR_PART: - container = this.statusbarPart.getContainer(); - break; + return this.statusbarPart.getContainer(); } - return container; + return null; } isVisible(part: Parts): boolean { diff --git a/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts b/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts index 101253b23b1..018ac5b635d 100644 --- a/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts +++ b/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts @@ -62,10 +62,10 @@ class PartsSplash { const layoutInfo = !this._shouldSaveLayoutInfo() ? undefined : { sideBarSide: this._partService.getSideBarPosition() === Position.RIGHT ? 'right' : 'left', editorPartMinWidth: DEFAULT_EDITOR_MIN_DIMENSIONS.width, - titleBarHeight: getTotalHeight(this._partService.getContainer(Parts.TITLEBAR_PART)), - activityBarWidth: getTotalWidth(this._partService.getContainer(Parts.ACTIVITYBAR_PART)), - sideBarWidth: getTotalWidth(this._partService.getContainer(Parts.SIDEBAR_PART)), - statusBarHeight: getTotalHeight(this._partService.getContainer(Parts.STATUSBAR_PART)), + titleBarHeight: getTotalHeight(this._partService.getContainer(Parts.TITLEBAR_PART)!), + activityBarWidth: getTotalWidth(this._partService.getContainer(Parts.ACTIVITYBAR_PART)!), + sideBarWidth: getTotalWidth(this._partService.getContainer(Parts.SIDEBAR_PART)!), + statusBarHeight: getTotalHeight(this._partService.getContainer(Parts.STATUSBAR_PART)!), }; this._storageService.store('parts-splash-data', JSON.stringify({ id: PartsSplash._splashElementId, diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts index a7a6c4054f5..0a68077357a 100644 --- a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts @@ -168,7 +168,7 @@ class WelcomeOverlay { } private create(): void { - const container = this.partService.getContainer(Parts.EDITOR_PART); + const container = this.partService.getContainer(Parts.EDITOR_PART)!; const offset = this.partService.getTitleBarOffset(); this._overlay = dom.append(container.parentElement!, $('.welcomeOverlay')); diff --git a/src/vs/workbench/services/part/common/partService.ts b/src/vs/workbench/services/part/common/partService.ts index 6c63edf6559..ad8908763f7 100644 --- a/src/vs/workbench/services/part/common/partService.ts +++ b/src/vs/workbench/services/part/common/partService.ts @@ -69,7 +69,7 @@ export interface IPartService { /** * Returns the parts HTML element, if there is one. */ - getContainer(part: Parts): HTMLElement; + getContainer(part: Parts): HTMLElement | null; /** * Returns if the part is visible. diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 1eb0182c12a..11e18d090f2 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -138,7 +138,7 @@ export class TestContextService implements IWorkspaceContextService { return this.workspace; } - public getWorkspaceFolder(resource: URI): IWorkspaceFolder { + public getWorkspaceFolder(resource: URI): IWorkspaceFolder | null { return this.workspace.getFolder(resource); } @@ -176,7 +176,7 @@ export class TestTextFileService extends TextFileService { private promptPath: URI; private confirmResult: ConfirmResult; - private resolveTextContentError: FileOperationError; + private resolveTextContentError: FileOperationError | null; constructor( @ILifecycleService lifecycleService: ILifecycleService, @@ -305,7 +305,7 @@ export class TestDecorationsService implements IDecorationsService { _serviceBrand: any; onDidChangeDecorations: Event = Event.None; registerDecorationsProvider(_provider: IDecorationsProvider): IDisposable { return Disposable.None; } - getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration { return undefined; } + getDecoration(_uri: URI, _includeChildren: boolean, _overwrite?: IDecorationData): IDecoration | undefined { return undefined; } } export class TestExtensionService extends NullExtensionService { } @@ -355,11 +355,11 @@ export class TestHistoryService implements IHistoryService { return []; } - public getLastActiveWorkspaceRoot(_schemeFilter: string): URI { + public getLastActiveWorkspaceRoot(_schemeFilter: string): URI | undefined { return this.root; } - public getLastActiveFile(_schemeFilter: string): URI { + public getLastActiveFile(_schemeFilter: string): URI | undefined { return undefined; } @@ -384,13 +384,13 @@ export class TestFileDialogService implements IFileDialogService { public _serviceBrand: any; - public defaultFilePath(_schemeFilter: string): URI { + public defaultFilePath(_schemeFilter: string): URI | undefined { return undefined; } - public defaultFolderPath(_schemeFilter: string): URI { + public defaultFolderPath(_schemeFilter: string): URI | undefined { return undefined; } - public defaultWorkspacePath(_schemeFilter: string): URI { + public defaultWorkspacePath(_schemeFilter: string): URI | undefined { return undefined; } public pickFileFolderAndOpen(_options: IPickAndOpenOptions): Promise { @@ -405,10 +405,10 @@ export class TestFileDialogService implements IFileDialogService { public pickWorkspaceAndOpen(_options: IPickAndOpenOptions): Promise { return Promise.resolve(0); } - public showSaveDialog(_options: ISaveDialogOptions): Promise { + public showSaveDialog(_options: ISaveDialogOptions): Promise { return Promise.resolve(undefined); } - public showOpenDialog(_options: IOpenDialogOptions): Promise { + public showOpenDialog(_options: IOpenDialogOptions): Promise { return Promise.resolve(undefined); } } @@ -445,7 +445,7 @@ export class TestPartService implements IPartService { return true; } - public getContainer(_part: Parts): HTMLElement { + public getContainer(_part: Parts): HTMLElement | null { return null; } From 3e246720db8aa9e9e150d0f6ae1de1268bc19927 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 14:44:52 -0800 Subject: [PATCH 401/429] Return result directly instead of assigning to var to return --- .../common/editor/untitledEditorInput.ts | 12 +++--------- .../files/electron-browser/remoteFileService.ts | 17 +++++------------ 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/vs/workbench/common/editor/untitledEditorInput.ts b/src/vs/workbench/common/editor/untitledEditorInput.ts index fd2d2677327..85daece3136 100644 --- a/src/vs/workbench/common/editor/untitledEditorInput.ts +++ b/src/vs/workbench/common/editor/untitledEditorInput.ts @@ -95,21 +95,15 @@ export class UntitledEditorInput extends EditorInput implements IEncodingSupport return null; } - let description: string; switch (verbosity) { case Verbosity.SHORT: - description = this.shortDescription; - break; + return this.shortDescription; case Verbosity.LONG: - description = this.longDescription; - break; + return this.longDescription; case Verbosity.MEDIUM: default: - description = this.mediumDescription; - break; + return this.mediumDescription; } - - return description; } @memoize diff --git a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts index 7d58f3f5694..784c2f3880e 100644 --- a/src/vs/workbench/services/files/electron-browser/remoteFileService.ts +++ b/src/vs/workbench/services/files/electron-browser/remoteFileService.ts @@ -221,27 +221,20 @@ export class RemoteFileService extends FileService { if (!match) { return undefined; } - let res: FileOperationResult; switch (match[1]) { case 'EntryNotFound': - res = FileOperationResult.FILE_NOT_FOUND; - break; + return FileOperationResult.FILE_NOT_FOUND; case 'EntryIsADirectory': - res = FileOperationResult.FILE_IS_DIRECTORY; - break; + return FileOperationResult.FILE_IS_DIRECTORY; case 'NoPermissions': - res = FileOperationResult.FILE_PERMISSION_DENIED; - break; + return FileOperationResult.FILE_PERMISSION_DENIED; case 'EntryExists': - res = FileOperationResult.FILE_MOVE_CONFLICT; - break; + return FileOperationResult.FILE_MOVE_CONFLICT; case 'EntryNotADirectory': default: // todo - res = undefined; - break; + return undefined; } - return res; } // --- stat From 3586808377c6c9f70f9bb36b75b6da61bc2e26ea Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 15:00:00 -0800 Subject: [PATCH 402/429] More work strict null checking workbenchTestService --- .../browser/actions/navigationActions.ts | 6 +++- .../browser/parts/editor/editorCommands.ts | 2 +- .../electron-browser/startupTimings.ts | 3 +- .../progress/test/progressService.test.ts | 4 +-- .../timer/electron-browser/timerService.ts | 3 +- .../services/viewlet/browser/viewlet.ts | 4 +-- .../workbench/test/workbenchTestServices.ts | 36 +++++++++---------- 7 files changed, 32 insertions(+), 26 deletions(-) diff --git a/src/vs/workbench/browser/actions/navigationActions.ts b/src/vs/workbench/browser/actions/navigationActions.ts index 6a83374bacb..47d39a573f1 100644 --- a/src/vs/workbench/browser/actions/navigationActions.ts +++ b/src/vs/workbench/browser/actions/navigationActions.ts @@ -78,7 +78,11 @@ abstract class BaseNavigationAction extends Action { return Promise.resolve(false); } - const activeViewletId = this.viewletService.getActiveViewlet().getId(); + const activeViewlet = this.viewletService.getActiveViewlet(); + if (!activeViewlet) { + return Promise.resolve(false); + } + const activeViewletId = activeViewlet.getId(); return this.viewletService.openViewlet(activeViewletId, true) .then(value => value === null ? false : value); diff --git a/src/vs/workbench/browser/parts/editor/editorCommands.ts b/src/vs/workbench/browser/parts/editor/editorCommands.ts index 15a9d7671ee..af411f7dd96 100644 --- a/src/vs/workbench/browser/parts/editor/editorCommands.ts +++ b/src/vs/workbench/browser/parts/editor/editorCommands.ts @@ -146,7 +146,7 @@ function moveActiveEditorToGroup(args: ActiveEditorMoveArguments, control: IEdit const configurationService = accessor.get(IConfigurationService); const sourceGroup = control.group; - let targetGroup: IEditorGroup; + let targetGroup: IEditorGroup | undefined; switch (args.to) { case 'left': diff --git a/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts b/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts index c1a0b9a2a42..7b78b7764aa 100644 --- a/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts +++ b/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts @@ -95,7 +95,8 @@ export class StartupTimings implements IWorkbenchContribution { this._logService.info('no standard startup: not just one window'); return false; } - if (!this._viewletService.getActiveViewlet() || this._viewletService.getActiveViewlet().getId() !== files.VIEWLET_ID) { + const activeViewlet = this._viewletService.getActiveViewlet(); + if (!activeViewlet || activeViewlet.getId() !== files.VIEWLET_ID) { this._logService.info('no standard startup: not the explorer viewlet'); return false; } diff --git a/src/vs/workbench/services/progress/test/progressService.test.ts b/src/vs/workbench/services/progress/test/progressService.test.ts index 5a1073e1c0e..eb7a11a02ce 100644 --- a/src/vs/workbench/services/progress/test/progressService.test.ts +++ b/src/vs/workbench/services/progress/test/progressService.test.ts @@ -52,8 +52,8 @@ class TestViewletService implements IViewletService { return 'workbench.view.explorer'; } - public getViewlet(id: string): ViewletDescriptor { - return null!; + public getViewlet(id: string): ViewletDescriptor | undefined { + return undefined; } public getProgressIndicator(id: string) { diff --git a/src/vs/workbench/services/timer/electron-browser/timerService.ts b/src/vs/workbench/services/timer/electron-browser/timerService.ts index 1a4c78ecfa8..c8a35127665 100644 --- a/src/vs/workbench/services/timer/electron-browser/timerService.ts +++ b/src/vs/workbench/services/timer/electron-browser/timerService.ts @@ -377,6 +377,7 @@ class TimerService implements ITimerService { // ignore, be on the safe side with these hardware method calls } + const activeViewlet = this._viewletService.getActiveViewlet(); return { version: 2, ellapsed: perf.getDuration(startMark, 'didStartWorkbench'), @@ -386,7 +387,7 @@ class TimerService implements ITimerService { didUseCachedData: didUseCachedData(), windowKind: this._lifecycleService.startupKind, windowCount: await this._windowsService.getWindowCount(), - viewletId: this._viewletService.getActiveViewlet() ? this._viewletService.getActiveViewlet().getId() : undefined, + viewletId: activeViewlet ? activeViewlet.getId() : undefined, editorIds: this._editorService.visibleEditors.map(input => input.getTypeId()), panelId: this._panelService.getActivePanel() ? this._panelService.getActivePanel().getId() : undefined, diff --git a/src/vs/workbench/services/viewlet/browser/viewlet.ts b/src/vs/workbench/services/viewlet/browser/viewlet.ts index c3345bae93c..b87357e7630 100644 --- a/src/vs/workbench/services/viewlet/browser/viewlet.ts +++ b/src/vs/workbench/services/viewlet/browser/viewlet.ts @@ -27,7 +27,7 @@ export interface IViewletService { /** * Returns the current active viewlet or null if none. */ - getActiveViewlet(): IViewlet; + getActiveViewlet(): IViewlet | null; /** * Returns the id of the default viewlet. @@ -37,7 +37,7 @@ export interface IViewletService { /** * Returns the viewlet by id. */ - getViewlet(id: string): ViewletDescriptor; + getViewlet(id: string): ViewletDescriptor | undefined; /** * Returns all enabled viewlets diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 11e18d090f2..2ab4c1cd7a7 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -471,15 +471,15 @@ export class TestPartService implements IPartService { return false; } - public setEditorHidden(_hidden: boolean): Promise { return Promise.resolve(null); } + public setEditorHidden(_hidden: boolean): Promise { return Promise.resolve(); } - public setSideBarHidden(_hidden: boolean): Promise { return Promise.resolve(null); } + public setSideBarHidden(_hidden: boolean): Promise { return Promise.resolve(); } public isPanelHidden(): boolean { return false; } - public setPanelHidden(_hidden: boolean): Promise { return Promise.resolve(null); } + public setPanelHidden(_hidden: boolean): Promise { return Promise.resolve(); } public toggleMaximizedPanel(): void { } @@ -500,7 +500,7 @@ export class TestPartService implements IPartService { } public setPanelPosition(_position: PartPosition): Promise { - return Promise.resolve(null); + return Promise.resolve(); } public addClass(_clazz: string): void { } @@ -972,14 +972,14 @@ export class TestCodeEditorService implements ICodeEditorService { addDiffEditor(_editor: IDiffEditor): void { } removeDiffEditor(_editor: IDiffEditor): void { } listDiffEditors(): IDiffEditor[] { return []; } - getFocusedCodeEditor(): ICodeEditor { return null; } + getFocusedCodeEditor(): ICodeEditor | null { return null; } registerDecorationType(_key: string, _options: IDecorationRenderOptions, _parentTypeKey?: string): void { } removeDecorationType(_key: string): void { } resolveDecorationOptions(_typeKey: string, _writable: boolean): IModelDecorationOptions { return Object.create(null); } setTransientModelProperty(_model: ITextModel, _key: string, _value: any): void { } getTransientModelProperty(_model: ITextModel, _key: string) { } - getActiveCodeEditor(): ICodeEditor { return null; } - openCodeEditor(_input: IResourceInput, _source: ICodeEditor, _sideBySide?: boolean): Promise { return Promise.resolve(undefined); } + getActiveCodeEditor(): ICodeEditor | null { return null; } + openCodeEditor(_input: IResourceInput, _source: ICodeEditor, _sideBySide?: boolean): Promise { return Promise.resolve(null); } } export class TestWindowService implements IWindowService { @@ -1200,7 +1200,7 @@ export class TestWindowsService implements IWindowsService { return Promise.resolve(); } - enterWorkspace(_windowId: number, _path: URI): Promise { + enterWorkspace(_windowId: number, _path: URI): Promise { return Promise.resolve(undefined); } @@ -1237,7 +1237,7 @@ export class TestWindowsService implements IWindowsService { } isMaximized(_windowId: number): Promise { - return Promise.resolve(undefined); + return Promise.resolve(false); } maximizeWindow(_windowId: number): Promise { @@ -1381,8 +1381,8 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig } getValue(resource: URI, arg2?: any, arg3?: any): T { - const position: IPosition = EditorPosition.isIPosition(arg2) ? arg2 : null; - const section: string = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined); + const position: IPosition | null = EditorPosition.isIPosition(arg2) ? arg2 : null; + const section: string | undefined = position ? (typeof arg3 === 'string' ? arg3 : undefined) : (typeof arg2 === 'string' ? arg2 : undefined); return this.configurationService.getValue(section, { resource }); } } @@ -1425,19 +1425,19 @@ export class TestViewletService implements IViewletService { onDidViewletOpen: Event = new Emitter().event; onDidViewletClose: Event = new Emitter().event; - openViewlet(_id: string, _focus?: boolean): Promise { return null; } + openViewlet(_id: string, _focus?: boolean): Promise { return Promise.resolve(null); } - getActiveViewlet(): IViewlet { return null; } + getActiveViewlet(): IViewlet | null { return null; } - getDefaultViewletId(): string { return null; } + getDefaultViewletId(): string { return ''; } - getViewlet(_id: string): ViewletDescriptor { return null; } + getViewlet(_id: string): ViewletDescriptor | undefined { return undefined; } - getAllViewlets(): ViewletDescriptor[] { return null; } + getAllViewlets(): ViewletDescriptor[] { return []; } - getViewlets(): ViewletDescriptor[] { return null; } + getViewlets(): ViewletDescriptor[] { return []; } - getProgressIndicator(_id: string): IProgressService { return null; } + getProgressIndicator(_id: string): IProgressService | null { return null; } } From 539c6cc4e1ce4ecb8f7c097e092ea1b7fc0bd9f5 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 15:07:20 -0800 Subject: [PATCH 403/429] Marking more emitters as readonly --- src/vs/base/browser/ui/menu/menubar.ts | 4 ++-- src/vs/base/node/storage.ts | 2 +- src/vs/base/parts/ipc/test/node/ipc.test.ts | 2 +- src/vs/platform/storage/common/storage.ts | 2 +- src/vs/platform/storage/node/storageIpc.ts | 4 ++-- .../platform/storage/node/storageMainService.ts | 4 ++-- src/vs/platform/storage/node/storageService.ts | 4 ++-- .../browser/parts/editor/editorControl.ts | 2 +- .../browser/parts/editor/editorGroupView.ts | 14 +++++++------- .../workbench/browser/parts/editor/editorPart.ts | 16 ++++++++-------- .../browser/parts/editor/editorWidgets.ts | 2 +- .../browser/parts/titlebar/menubarControl.ts | 4 ++-- .../workbench/browser/parts/views/customView.ts | 8 ++++---- src/vs/workbench/electron-browser/workbench.ts | 2 +- .../electron-browser/markersPanelActions.ts | 2 +- .../parts/tasks/common/problemMatcher.ts | 2 +- .../services/editor/browser/editorService.ts | 8 ++++---- 17 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/vs/base/browser/ui/menu/menubar.ts b/src/vs/base/browser/ui/menu/menubar.ts index 0378c58d62f..0369a9baa6e 100644 --- a/src/vs/base/browser/ui/menu/menubar.ts +++ b/src/vs/base/browser/ui/menu/menubar.ts @@ -75,8 +75,8 @@ export class MenuBar extends Disposable { private _focusState: MenubarState; private actionRunner: IActionRunner; - private _onVisibilityChange: Emitter; - private _onFocusStateChange: Emitter; + private readonly _onVisibilityChange: Emitter; + private readonly _onFocusStateChange: Emitter; private numMenusShown: number; private menuStyle: IMenuStyles; diff --git a/src/vs/base/node/storage.ts b/src/vs/base/node/storage.ts index fa14cb70e4e..4ba88e5ffb1 100644 --- a/src/vs/base/node/storage.ts +++ b/src/vs/base/node/storage.ts @@ -83,7 +83,7 @@ export class Storage extends Disposable implements IStorage { private static readonly DEFAULT_FLUSH_DELAY = 100; - private _onDidChangeStorage: Emitter = this._register(new Emitter()); + private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } private state = StorageState.None; diff --git a/src/vs/base/parts/ipc/test/node/ipc.test.ts b/src/vs/base/parts/ipc/test/node/ipc.test.ts index 625f1a65922..f8cd8a0ee83 100644 --- a/src/vs/base/parts/ipc/test/node/ipc.test.ts +++ b/src/vs/base/parts/ipc/test/node/ipc.test.ts @@ -71,7 +71,7 @@ class TestIPCClient extends IPCClient { class TestIPCServer extends IPCServer { - private onDidClientConnect: Emitter; + private readonly onDidClientConnect: Emitter; constructor() { const onDidClientConnect = new Emitter(); diff --git a/src/vs/platform/storage/common/storage.ts b/src/vs/platform/storage/common/storage.ts index 02513305828..13089daf59f 100644 --- a/src/vs/platform/storage/common/storage.ts +++ b/src/vs/platform/storage/common/storage.ts @@ -108,7 +108,7 @@ export interface IWorkspaceStorageChangeEvent { export class InMemoryStorageService extends Disposable implements IStorageService { _serviceBrand = undefined; - private _onDidChangeStorage: Emitter = this._register(new Emitter()); + private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } readonly onWillSaveState = Event.None; diff --git a/src/vs/platform/storage/node/storageIpc.ts b/src/vs/platform/storage/node/storageIpc.ts index 40749376be2..c48b421bb81 100644 --- a/src/vs/platform/storage/node/storageIpc.ts +++ b/src/vs/platform/storage/node/storageIpc.ts @@ -27,7 +27,7 @@ export class GlobalStorageDatabaseChannel extends Disposable implements IServerC private static STORAGE_CHANGE_DEBOUNCE_TIME = 100; - private _onDidChangeItems: Emitter = this._register(new Emitter()); + private readonly _onDidChangeItems: Emitter = this._register(new Emitter()); get onDidChangeItems(): Event { return this._onDidChangeItems.event; } constructor(private storageMainService: StorageMainService) { @@ -104,7 +104,7 @@ export class GlobalStorageDatabaseChannelClient extends Disposable implements IS _serviceBrand: any; - private _onDidChangeItemsExternal: Emitter = this._register(new Emitter()); + private readonly _onDidChangeItemsExternal: Emitter = this._register(new Emitter()); get onDidChangeItemsExternal(): Event { return this._onDidChangeItemsExternal.event; } private onDidChangeItemsOnMainListener: IDisposable; diff --git a/src/vs/platform/storage/node/storageMainService.ts b/src/vs/platform/storage/node/storageMainService.ts index 03653e4f891..d6227c98e36 100644 --- a/src/vs/platform/storage/node/storageMainService.ts +++ b/src/vs/platform/storage/node/storageMainService.ts @@ -78,10 +78,10 @@ export class StorageMainService extends Disposable implements IStorageMainServic private static STORAGE_NAME = 'state.vscdb'; - private _onDidChangeStorage: Emitter = this._register(new Emitter()); + private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } - private _onWillSaveState: Emitter = this._register(new Emitter()); + private readonly _onWillSaveState: Emitter = this._register(new Emitter()); get onWillSaveState(): Event { return this._onWillSaveState.event; } get items(): Map { return this.storage.items; } diff --git a/src/vs/platform/storage/node/storageService.ts b/src/vs/platform/storage/node/storageService.ts index 536a6fcb0a3..79d189e43a6 100644 --- a/src/vs/platform/storage/node/storageService.ts +++ b/src/vs/platform/storage/node/storageService.ts @@ -24,10 +24,10 @@ export class StorageService extends Disposable implements IStorageService { private static WORKSPACE_STORAGE_NAME = 'state.vscdb'; private static WORKSPACE_META_NAME = 'workspace.json'; - private _onDidChangeStorage: Emitter = this._register(new Emitter()); + private readonly _onDidChangeStorage: Emitter = this._register(new Emitter()); get onDidChangeStorage(): Event { return this._onDidChangeStorage.event; } - private _onWillSaveState: Emitter = this._register(new Emitter()); + private readonly _onWillSaveState: Emitter = this._register(new Emitter()); get onWillSaveState(): Event { return this._onWillSaveState.event; } private globalStorage: IStorage; diff --git a/src/vs/workbench/browser/parts/editor/editorControl.ts b/src/vs/workbench/browser/parts/editor/editorControl.ts index 0d6945988f4..a2c347895ff 100644 --- a/src/vs/workbench/browser/parts/editor/editorControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorControl.ts @@ -27,7 +27,7 @@ export class EditorControl extends Disposable { get maximumWidth() { return this._activeControl ? this._activeControl.maximumWidth : DEFAULT_EDITOR_MAX_DIMENSIONS.width; } get maximumHeight() { return this._activeControl ? this._activeControl.maximumHeight : DEFAULT_EDITOR_MAX_DIMENSIONS.height; } - private _onDidFocus: Emitter = this._register(new Emitter()); + private readonly _onDidFocus: Emitter = this._register(new Emitter()); get onDidFocus(): Event { return this._onDidFocus.event; } private _onDidSizeConstraintsChange = this._register(new Emitter<{ width: number; height: number; } | undefined>()); diff --git a/src/vs/workbench/browser/parts/editor/editorGroupView.ts b/src/vs/workbench/browser/parts/editor/editorGroupView.ts index edfd5b9aeb5..f01e6238781 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupView.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupView.ts @@ -66,25 +66,25 @@ export class EditorGroupView extends Themable implements IEditorGroupView { //#region events - private _onDidFocus: Emitter = this._register(new Emitter()); + private readonly _onDidFocus: Emitter = this._register(new Emitter()); get onDidFocus(): Event { return this._onDidFocus.event; } - private _onWillDispose: Emitter = this._register(new Emitter()); + private readonly _onWillDispose: Emitter = this._register(new Emitter()); get onWillDispose(): Event { return this._onWillDispose.event; } - private _onDidGroupChange: Emitter = this._register(new Emitter()); + private readonly _onDidGroupChange: Emitter = this._register(new Emitter()); get onDidGroupChange(): Event { return this._onDidGroupChange.event; } - private _onWillOpenEditor: Emitter = this._register(new Emitter()); + private readonly _onWillOpenEditor: Emitter = this._register(new Emitter()); get onWillOpenEditor(): Event { return this._onWillOpenEditor.event; } - private _onDidOpenEditorFail: Emitter = this._register(new Emitter()); + private readonly _onDidOpenEditorFail: Emitter = this._register(new Emitter()); get onDidOpenEditorFail(): Event { return this._onDidOpenEditorFail.event; } - private _onWillCloseEditor: Emitter = this._register(new Emitter()); + private readonly _onWillCloseEditor: Emitter = this._register(new Emitter()); get onWillCloseEditor(): Event { return this._onWillCloseEditor.event; } - private _onDidCloseEditor: Emitter = this._register(new Emitter()); + private readonly _onDidCloseEditor: Emitter = this._register(new Emitter()); get onDidCloseEditor(): Event { return this._onDidCloseEditor.event; } //#endregion diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index e27bd5db5de..e244b6d686c 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -88,29 +88,29 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor //#region Events - private _onDidLayout: Emitter = this._register(new Emitter()); + private readonly _onDidLayout: Emitter = this._register(new Emitter()); get onDidLayout(): Event { return this._onDidLayout.event; } - private _onDidActiveGroupChange: Emitter = this._register(new Emitter()); + private readonly _onDidActiveGroupChange: Emitter = this._register(new Emitter()); get onDidActiveGroupChange(): Event { return this._onDidActiveGroupChange.event; } - private _onDidAddGroup: Emitter = this._register(new Emitter()); + private readonly _onDidAddGroup: Emitter = this._register(new Emitter()); get onDidAddGroup(): Event { return this._onDidAddGroup.event; } - private _onDidRemoveGroup: Emitter = this._register(new Emitter()); + private readonly _onDidRemoveGroup: Emitter = this._register(new Emitter()); get onDidRemoveGroup(): Event { return this._onDidRemoveGroup.event; } - private _onDidMoveGroup: Emitter = this._register(new Emitter()); + private readonly _onDidMoveGroup: Emitter = this._register(new Emitter()); get onDidMoveGroup(): Event { return this._onDidMoveGroup.event; } private onDidSetGridWidget = this._register(new Emitter<{ width: number; height: number; }>()); private _onDidSizeConstraintsChange = this._register(new Relay<{ width: number; height: number; }>()); get onDidSizeConstraintsChange(): Event<{ width: number; height: number; }> { return Event.any(this.onDidSetGridWidget.event, this._onDidSizeConstraintsChange.event); } - private _onDidPreferredSizeChange: Emitter = this._register(new Emitter()); + private readonly _onDidPreferredSizeChange: Emitter = this._register(new Emitter()); get onDidPreferredSizeChange(): Event { return this._onDidPreferredSizeChange.event; } - private _onDidActivateGroup: Emitter = this._register(new Emitter()); + private readonly _onDidActivateGroup: Emitter = this._register(new Emitter()); get onDidActivateGroup(): Event { return this._onDidActivateGroup.event; } //#endregion @@ -168,7 +168,7 @@ export class EditorPart extends Part implements EditorGroupsServiceImpl, IEditor private enforcedPartOptions: IEditorPartOptions[] = []; - private _onDidEditorPartOptionsChange: Emitter = this._register(new Emitter()); + private readonly _onDidEditorPartOptionsChange: Emitter = this._register(new Emitter()); get onDidEditorPartOptionsChange(): Event { return this._onDidEditorPartOptionsChange.event; } private registerListeners(): void { diff --git a/src/vs/workbench/browser/parts/editor/editorWidgets.ts b/src/vs/workbench/browser/parts/editor/editorWidgets.ts index 9b384758177..c43b7a1773c 100644 --- a/src/vs/workbench/browser/parts/editor/editorWidgets.ts +++ b/src/vs/workbench/browser/parts/editor/editorWidgets.ts @@ -24,7 +24,7 @@ import { isEqual } from 'vs/base/common/resources'; export class FloatingClickWidget extends Widget implements IOverlayWidget { - private _onClick: Emitter = this._register(new Emitter()); + private readonly _onClick: Emitter = this._register(new Emitter()); get onClick(): Event { return this._onClick.event; } private _domNode: HTMLElement; diff --git a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts index 121bf09bb82..5714afeef1c 100644 --- a/src/vs/workbench/browser/parts/titlebar/menubarControl.ts +++ b/src/vs/workbench/browser/parts/titlebar/menubarControl.ts @@ -75,8 +75,8 @@ export class MenubarControl extends Disposable { private container: HTMLElement; private recentlyOpened: IRecentlyOpened; - private _onVisibilityChange: Emitter; - private _onFocusStateChange: Emitter; + private readonly _onVisibilityChange: Emitter; + private readonly _onFocusStateChange: Emitter; private static MAX_MENU_RECENT_ENTRIES = 10; diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index a6568b49c4e..960d8631a52 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -193,19 +193,19 @@ export class CustomTreeView extends Disposable implements ITreeView { private markdownRenderer: MarkdownRenderer; private markdownResult: IMarkdownRenderResult; - private _onDidExpandItem: Emitter = this._register(new Emitter()); + private readonly _onDidExpandItem: Emitter = this._register(new Emitter()); readonly onDidExpandItem: Event = this._onDidExpandItem.event; - private _onDidCollapseItem: Emitter = this._register(new Emitter()); + private readonly _onDidCollapseItem: Emitter = this._register(new Emitter()); readonly onDidCollapseItem: Event = this._onDidCollapseItem.event; private _onDidChangeSelection: Emitter = this._register(new Emitter()); readonly onDidChangeSelection: Event = this._onDidChangeSelection.event; - private _onDidChangeVisibility: Emitter = this._register(new Emitter()); + private readonly _onDidChangeVisibility: Emitter = this._register(new Emitter()); readonly onDidChangeVisibility: Event = this._onDidChangeVisibility.event; - private _onDidChangeActions: Emitter = this._register(new Emitter()); + private readonly _onDidChangeActions: Emitter = this._register(new Emitter()); readonly onDidChangeActions: Event = this._onDidChangeActions.event; constructor( diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index 5ca6885f858..d529263e429 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -1210,7 +1210,7 @@ export class Workbench extends Disposable implements IPartService { //#region IPartService - private _onTitleBarVisibilityChange: Emitter = this._register(new Emitter()); + private readonly _onTitleBarVisibilityChange: Emitter = this._register(new Emitter()); get onTitleBarVisibilityChange(): Event { return this._onTitleBarVisibilityChange.event; } get onEditorLayout(): Event { return this.editorPart.onDidLayout; } diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts index 8d820e557d9..64e32b349b1 100644 --- a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts @@ -299,7 +299,7 @@ export class QuickFixAction extends Action { private updated: boolean = false; private disposables: IDisposable[] = []; - private _onShowQuickFixes: Emitter = new Emitter(); + private readonly _onShowQuickFixes: Emitter = new Emitter(); readonly onShowQuickFixes: Event = this._onShowQuickFixes.event; constructor( diff --git a/src/vs/workbench/parts/tasks/common/problemMatcher.ts b/src/vs/workbench/parts/tasks/common/problemMatcher.ts index a9889946c2e..17f50ff18ed 100644 --- a/src/vs/workbench/parts/tasks/common/problemMatcher.ts +++ b/src/vs/workbench/parts/tasks/common/problemMatcher.ts @@ -1689,7 +1689,7 @@ class ProblemMatcherRegistryImpl implements IProblemMatcherRegistry { private matchers: IStringDictionary; private readyPromise: Promise; - private _onMatchersChanged: Emitter = new Emitter(); + private readonly _onMatchersChanged: Emitter = new Emitter(); public get onMatcherChanged(): Event { return this._onMatchersChanged.event; } diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index e33128bf7f3..1dda242d3d8 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -37,16 +37,16 @@ export class EditorService extends Disposable implements EditorServiceImpl { //#region events - private _onDidActiveEditorChange: Emitter = this._register(new Emitter()); + private readonly _onDidActiveEditorChange: Emitter = this._register(new Emitter()); get onDidActiveEditorChange(): Event { return this._onDidActiveEditorChange.event; } - private _onDidVisibleEditorsChange: Emitter = this._register(new Emitter()); + private readonly _onDidVisibleEditorsChange: Emitter = this._register(new Emitter()); get onDidVisibleEditorsChange(): Event { return this._onDidVisibleEditorsChange.event; } - private _onDidCloseEditor: Emitter = this._register(new Emitter()); + private readonly _onDidCloseEditor: Emitter = this._register(new Emitter()); get onDidCloseEditor(): Event { return this._onDidCloseEditor.event; } - private _onDidOpenEditorFail: Emitter = this._register(new Emitter()); + private readonly _onDidOpenEditorFail: Emitter = this._register(new Emitter()); get onDidOpenEditorFail(): Event { return this._onDidOpenEditorFail.event; } //#endregion From 78fbb8d5f69c594da57d89cb3baa21b32022931f Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Mon, 28 Jan 2019 10:55:50 -0800 Subject: [PATCH 404/429] Added telemetry event to look at fileTypes and config files in project folder for use in better workspace tagging. --- src/vs/base/node/stats.ts | 11 +++-- .../electron-main/diagnosticsService.ts | 15 +++---- .../parts/stats/node/workspaceStats.ts | 43 ++++++++++++++++++- 3 files changed, 55 insertions(+), 14 deletions(-) diff --git a/src/vs/base/node/stats.ts b/src/vs/base/node/stats.ts index ae76a9de218..aedbd13349e 100644 --- a/src/vs/base/node/stats.ts +++ b/src/vs/base/node/stats.ts @@ -17,6 +17,7 @@ export interface WorkspaceStats { configFiles: WorkspaceStatItem[]; fileCount: number; maxFilesReached: boolean; + launchConfigFiles: WorkspaceStatItem[]; } function asSortedItems(map: Map): WorkspaceStatItem[] { @@ -66,7 +67,7 @@ export function collectLaunchConfigs(folder: string): Promise { +export async function collectWorkspaceStats(folder: string, filter: string[]): Promise { const configFilePatterns = [ { 'tag': 'grunt.js', 'pattern': /^gruntfile\.js$/i }, { 'tag': 'gulp.js', 'pattern': /^gulpfile\.js$/i }, @@ -182,15 +183,17 @@ export function collectWorkspaceStats(folder: string, filter: string[]): Promise let token: { count: number, maxReached: boolean } = { count: 0, maxReached: false }; return new Promise((resolve, reject) => { - walk(folder, filter, token, (files) => { + walk(folder, filter, token, async (files) => { files.forEach(acceptFile); + let launchConfigs = await collectLaunchConfigs(folder); + resolve({ configFiles: asSortedItems(configFiles), fileTypes: asSortedItems(fileTypes), fileCount: token.count, - maxFilesReached: token.maxReached - + maxFilesReached: token.maxReached, + launchConfigFiles: launchConfigs }); }); }); diff --git a/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts b/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts index 94cba280d74..9e60ec11d55 100644 --- a/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WorkspaceStats, collectWorkspaceStats, collectLaunchConfigs, WorkspaceStatItem } from 'vs/base/node/stats'; +import { WorkspaceStats, collectWorkspaceStats, WorkspaceStatItem } from 'vs/base/node/stats'; import { IMainProcessInfo } from 'vs/platform/launch/electron-main/launchService'; import { ProcessItem, listProcesses } from 'vs/base/node/ps'; import product from 'vs/platform/node/product'; @@ -110,9 +110,8 @@ export class DiagnosticsService implements IDiagnosticsService { workspaceInfoMessages.push(`| Folder (${basename(folder)}): ${countMessage}`); workspaceInfoMessages.push(this.formatWorkspaceStats(stats)); - const launchConfigs = await collectLaunchConfigs(folder); - if (launchConfigs.length > 0) { - workspaceInfoMessages.push(this.formatLaunchConfigs(launchConfigs)); + if (stats.launchConfigFiles.length > 0) { + workspaceInfoMessages.push(this.formatLaunchConfigs(stats.launchConfigFiles)); } })); } else { @@ -196,11 +195,9 @@ export class DiagnosticsService implements IDiagnosticsService { console.log(`| Folder (${basename(folder)}): ${countMessage}`); console.log(this.formatWorkspaceStats(stats)); - await collectLaunchConfigs(folder).then(launchConfigs => { - if (launchConfigs.length > 0) { - console.log(this.formatLaunchConfigs(launchConfigs)); - } - }); + if (stats.launchConfigFiles.length > 0) { + console.log(this.formatLaunchConfigs(stats.launchConfigFiles)); + } }).catch(error => { console.log(`| Error: Unable to collect workspace stats for folder ${folder} (${error.toString()})`); })); diff --git a/src/vs/workbench/parts/stats/node/workspaceStats.ts b/src/vs/workbench/parts/stats/node/workspaceStats.ts index bed2040b456..633ba9c3df9 100644 --- a/src/vs/workbench/parts/stats/node/workspaceStats.ts +++ b/src/vs/workbench/parts/stats/node/workspaceStats.ts @@ -20,6 +20,7 @@ import { extname, join } from 'path'; import { WORKSPACE_EXTENSION } from 'vs/platform/workspaces/common/workspaces'; import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; +import { collectWorkspaceStats, WorkspaceStats as WorkspaceStatsType } from 'vs/base/node/stats'; const SshProtocolMatcher = /^([^@:]+@)?([^:]+):/; const SshUrlMatcher = /^([^@:]+@)?([^:]+):(.+)$/; @@ -225,10 +226,15 @@ export class WorkspaceStats implements IWorkbenchContribution { private report(): void { - // Workspace Stats + // Workspace Tags this.resolveWorkspaceTags(this.windowService.getConfiguration(), rootFiles => this.handleWorkspaceFiles(rootFiles)) .then(tags => this.reportWorkspaceTags(tags), error => onUnexpectedError(error)); + // Workspace file types, config files, and launch configs + this.getWorkspaceMetadata().then(stats => { + this.reportWorkspaceMetadata(stats); + }); + // Cloud Stats this.reportCloudStats(); @@ -731,4 +737,39 @@ export class WorkspaceStats implements IWorkbenchContribution { this.telemetryService.publicLog('resolveProxy.stats', { type }); }).then(undefined, onUnexpectedError); } + + /* __GDPR__ + "workspace.metadata" : { + "fileTypes" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "configTypes" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }, + "launchConfigs" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true } + } + */ + private reportWorkspaceMetadata(stats: WorkspaceStatsType[]): void { + for (let stat of stats) { // one event for each root folder in the workspace + this.telemetryService.publicLog('workspce.metadata', { + 'fileTypes': stat.fileTypes, + 'configTypes': stat.configFiles, + 'launchConfigs': stat.launchConfigFiles + }); + } + } + + private getWorkspaceMetadata(): Promise { + const workspaceStatPromises: Promise[] = []; + const workspace = this.contextService.getWorkspace(); + workspace.folders.forEach(folder => { + const folderUri = URI.revive(folder.uri); + if (folderUri.scheme === 'file') { + const folder = folderUri.fsPath; + workspaceStatPromises.push(collectWorkspaceStats(folder, ['node_modules', '.git']).then(async stats => { + return stats; + })); + } + }); + + return Promise.all(workspaceStatPromises).then((stats) => { + return stats; + }); + } } From 51ea6111d86866da65dc0edff3bf7b409fe3888c Mon Sep 17 00:00:00 2001 From: Bowden Kelly Date: Wed, 6 Feb 2019 10:22:29 -0800 Subject: [PATCH 405/429] review feedback --- .../electron-main/diagnosticsService.ts | 28 ++++++------------- .../parts/stats/node/workspaceStats.ts | 2 +- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts b/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts index 9e60ec11d55..1eb77972c18 100644 --- a/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts +++ b/src/vs/platform/diagnostics/electron-main/diagnosticsService.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { WorkspaceStats, collectWorkspaceStats, WorkspaceStatItem } from 'vs/base/node/stats'; +import { WorkspaceStats, collectWorkspaceStats } from 'vs/base/node/stats'; import { IMainProcessInfo } from 'vs/platform/launch/electron-main/launchService'; import { ProcessItem, listProcesses } from 'vs/base/node/ps'; import product from 'vs/platform/node/product'; @@ -109,10 +109,6 @@ export class DiagnosticsService implements IDiagnosticsService { } workspaceInfoMessages.push(`| Folder (${basename(folder)}): ${countMessage}`); workspaceInfoMessages.push(this.formatWorkspaceStats(stats)); - - if (stats.launchConfigFiles.length > 0) { - workspaceInfoMessages.push(this.formatLaunchConfigs(stats.launchConfigFiles)); - } })); } else { workspaceInfoMessages.push(`| Folder (${folderUri.toString()}): RPerformance stats not available.`); @@ -195,9 +191,6 @@ export class DiagnosticsService implements IDiagnosticsService { console.log(`| Folder (${basename(folder)}): ${countMessage}`); console.log(this.formatWorkspaceStats(stats)); - if (stats.launchConfigFiles.length > 0) { - console.log(this.formatLaunchConfigs(stats.launchConfigFiles)); - } }).catch(error => { console.log(`| Error: Unable to collect workspace stats for folder ${folder} (${error.toString()})`); })); @@ -254,17 +247,14 @@ export class DiagnosticsService implements IDiagnosticsService { output.push(line); } - return output.join('\n'); - } - - private formatLaunchConfigs(configs: WorkspaceStatItem[]): string { - const output: string[] = []; - let line = '| Launch Configs:'; - configs.forEach(each => { - const item = each.count > 1 ? ` ${each.name}(${each.count})` : ` ${each.name}`; - line += item; - }); - output.push(line); + if (workspaceStats.launchConfigFiles.length > 0) { + let line = '| Launch Configs:'; + workspaceStats.launchConfigFiles.forEach(each => { + const item = each.count > 1 ? ` ${each.name}(${each.count})` : ` ${each.name}`; + line += item; + }); + output.push(line); + } return output.join('\n'); } diff --git a/src/vs/workbench/parts/stats/node/workspaceStats.ts b/src/vs/workbench/parts/stats/node/workspaceStats.ts index 633ba9c3df9..98cbbe5d633 100644 --- a/src/vs/workbench/parts/stats/node/workspaceStats.ts +++ b/src/vs/workbench/parts/stats/node/workspaceStats.ts @@ -747,7 +747,7 @@ export class WorkspaceStats implements IWorkbenchContribution { */ private reportWorkspaceMetadata(stats: WorkspaceStatsType[]): void { for (let stat of stats) { // one event for each root folder in the workspace - this.telemetryService.publicLog('workspce.metadata', { + this.telemetryService.publicLog('workspace.metadata', { 'fileTypes': stat.fileTypes, 'configTypes': stat.configFiles, 'launchConfigs': stat.launchConfigFiles From 9b45cbe5ea465774a6f342f52700cfe9a4effa75 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 15:29:46 -0800 Subject: [PATCH 406/429] Trying to get rid of some cases where we use types of `T | null | undefined` in findWidget --- src/vs/base/browser/ui/findinput/findInput.ts | 36 +++++++------- src/vs/base/browser/ui/inputbox/inputBox.ts | 48 +++++++++---------- src/vs/editor/contrib/find/findWidget.ts | 26 +++++----- .../editor/contrib/find/simpleFindWidget.ts | 30 ++++++------ .../contrib/gotoError/gotoErrorWidget.ts | 4 +- .../contrib/referenceSearch/peekViewWidget.ts | 6 +-- .../referenceSearch/referencesWidget.ts | 4 +- src/vs/platform/theme/common/colorRegistry.ts | 4 +- .../browser/parts/quickinput/quickInputBox.ts | 24 +++++----- .../electron-browser/dirtydiffDecorator.ts | 4 +- 10 files changed, 93 insertions(+), 93 deletions(-) diff --git a/src/vs/base/browser/ui/findinput/findInput.ts b/src/vs/base/browser/ui/findinput/findInput.ts index 8688e319cb7..c0835afdba4 100644 --- a/src/vs/base/browser/ui/findinput/findInput.ts +++ b/src/vs/base/browser/ui/findinput/findInput.ts @@ -32,7 +32,7 @@ export interface IFindInputOptions extends IFindInputStyles { } export interface IFindInputStyles extends IInputBoxStyles { - inputActiveOptionBorder?: Color | null; + inputActiveOptionBorder?: Color; } const NLS_DEFAULT_LABEL = nls.localize('defaultLabel', "input"); @@ -48,20 +48,20 @@ export class FindInput extends Widget { private label: string; private fixFocusOnOptionClickEnabled = true; - private inputActiveOptionBorder?: Color | null; - private inputBackground?: Color | null; - private inputForeground?: Color | null; - private inputBorder?: Color | null; + private inputActiveOptionBorder?: Color; + private inputBackground?: Color; + private inputForeground?: Color; + private inputBorder?: Color; - private inputValidationInfoBorder?: Color | null; - private inputValidationInfoBackground?: Color | null; - private inputValidationInfoForeground?: Color | null; - private inputValidationWarningBorder?: Color | null; - private inputValidationWarningBackground?: Color | null; - private inputValidationWarningForeground?: Color | null; - private inputValidationErrorBorder?: Color | null; - private inputValidationErrorBackground?: Color | null; - private inputValidationErrorForeground?: Color | null; + private inputValidationInfoBorder?: Color; + private inputValidationInfoBackground?: Color; + private inputValidationInfoForeground?: Color; + private inputValidationWarningBorder?: Color; + private inputValidationWarningBackground?: Color; + private inputValidationWarningForeground?: Color; + private inputValidationErrorBorder?: Color; + private inputValidationErrorBackground?: Color; + private inputValidationErrorForeground?: Color; private regex: RegexCheckbox; private wholeWords: WholeWordsCheckbox; @@ -202,7 +202,7 @@ export class FindInput extends Widget { protected applyStyles(): void { if (this.domNode) { const checkBoxStyles: ICheckboxStyles = { - inputActiveOptionBorder: this.inputActiveOptionBorder || undefined, + inputActiveOptionBorder: this.inputActiveOptionBorder, }; this.regex.style(checkBoxStyles); this.wholeWords.style(checkBoxStyles); @@ -313,7 +313,7 @@ export class FindInput extends Widget { this.regex = this._register(new RegexCheckbox({ appendTitle: appendRegexLabel, isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder || undefined + inputActiveOptionBorder: this.inputActiveOptionBorder })); this._register(this.regex.onChange(viaKeyboard => { this._onDidOptionChange.fire(viaKeyboard); @@ -330,7 +330,7 @@ export class FindInput extends Widget { this.wholeWords = this._register(new WholeWordsCheckbox({ appendTitle: appendWholeWordsLabel, isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder || undefined + inputActiveOptionBorder: this.inputActiveOptionBorder })); this._register(this.wholeWords.onChange(viaKeyboard => { this._onDidOptionChange.fire(viaKeyboard); @@ -344,7 +344,7 @@ export class FindInput extends Widget { this.caseSensitive = this._register(new CaseSensitiveCheckbox({ appendTitle: appendCaseSensitiveLabel, isChecked: false, - inputActiveOptionBorder: this.inputActiveOptionBorder || undefined + inputActiveOptionBorder: this.inputActiveOptionBorder })); this._register(this.caseSensitive.onChange(viaKeyboard => { this._onDidOptionChange.fire(viaKeyboard); diff --git a/src/vs/base/browser/ui/inputbox/inputBox.ts b/src/vs/base/browser/ui/inputbox/inputBox.ts index 201cda1388d..01fe9dcaa36 100644 --- a/src/vs/base/browser/ui/inputbox/inputBox.ts +++ b/src/vs/base/browser/ui/inputbox/inputBox.ts @@ -32,18 +32,18 @@ export interface IInputOptions extends IInputBoxStyles { } export interface IInputBoxStyles { - readonly inputBackground?: Color | null; - readonly inputForeground?: Color | null; - readonly inputBorder?: Color | null; - readonly inputValidationInfoBorder?: Color | null; - readonly inputValidationInfoBackground?: Color | null; - readonly inputValidationInfoForeground?: Color | null; - readonly inputValidationWarningBorder?: Color | null; - readonly inputValidationWarningBackground?: Color | null; - readonly inputValidationWarningForeground?: Color | null; - readonly inputValidationErrorBorder?: Color | null; - readonly inputValidationErrorBackground?: Color | null; - readonly inputValidationErrorForeground?: Color | null; + readonly inputBackground?: Color; + readonly inputForeground?: Color; + readonly inputBorder?: Color; + readonly inputValidationInfoBorder?: Color; + readonly inputValidationInfoBackground?: Color; + readonly inputValidationInfoForeground?: Color; + readonly inputValidationWarningBorder?: Color; + readonly inputValidationWarningBackground?: Color; + readonly inputValidationWarningForeground?: Color; + readonly inputValidationErrorBorder?: Color; + readonly inputValidationErrorBackground?: Color; + readonly inputValidationErrorForeground?: Color; } export interface IInputValidator { @@ -96,19 +96,19 @@ export class InputBox extends Widget { private state: string | null = 'idle'; private cachedHeight: number | null; - private inputBackground?: Color | null; - private inputForeground?: Color | null; - private inputBorder?: Color | null; + private inputBackground?: Color; + private inputForeground?: Color; + private inputBorder?: Color; - private inputValidationInfoBorder?: Color | null; - private inputValidationInfoBackground?: Color | null; - private inputValidationInfoForeground?: Color | null; - private inputValidationWarningBorder?: Color | null; - private inputValidationWarningBackground?: Color | null; - private inputValidationWarningForeground?: Color | null; - private inputValidationErrorBorder?: Color | null; - private inputValidationErrorBackground?: Color | null; - private inputValidationErrorForeground?: Color | null; + private inputValidationInfoBorder?: Color; + private inputValidationInfoBackground?: Color; + private inputValidationInfoForeground?: Color; + private inputValidationWarningBorder?: Color; + private inputValidationWarningBackground?: Color; + private inputValidationWarningForeground?: Color; + private inputValidationErrorBorder?: Color; + private inputValidationErrorBackground?: Color; + private inputValidationErrorForeground?: Color; private _onDidChange = this._register(new Emitter()); public readonly onDidChange: Event = this._onDidChange.event; diff --git a/src/vs/editor/contrib/find/findWidget.ts b/src/vs/editor/contrib/find/findWidget.ts index bda8474369d..70a97d62e8b 100644 --- a/src/vs/editor/contrib/find/findWidget.ts +++ b/src/vs/editor/contrib/find/findWidget.ts @@ -530,19 +530,19 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas private _applyTheme(theme: ITheme) { let inputStyles: IFindInputStyles = { - inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder), - inputBackground: theme.getColor(inputBackground), - inputForeground: theme.getColor(inputForeground), - inputBorder: theme.getColor(inputBorder), - inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), - inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground), - inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), - inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), - inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground), - inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), - inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), - inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground), - inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) + inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) || undefined, + inputBackground: theme.getColor(inputBackground) || undefined, + inputForeground: theme.getColor(inputForeground) || undefined, + inputBorder: theme.getColor(inputBorder) || undefined, + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground) || undefined, + inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground) || undefined, + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder) || undefined, + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground) || undefined, + inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground) || undefined, + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder) || undefined, + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground) || undefined, + inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground) || undefined, + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) || undefined, }; this._findInput.style(inputStyles); this._replaceInputBox.style(inputStyles); diff --git a/src/vs/editor/contrib/find/simpleFindWidget.ts b/src/vs/editor/contrib/find/simpleFindWidget.ts index 9b96fbdcd81..28b0b5809ec 100644 --- a/src/vs/editor/contrib/find/simpleFindWidget.ts +++ b/src/vs/editor/contrib/find/simpleFindWidget.ts @@ -6,7 +6,7 @@ import 'vs/css!./simpleFindWidget'; import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; -import { FindInput } from 'vs/base/browser/ui/findinput/findInput'; +import { FindInput, IFindInputStyles } from 'vs/base/browser/ui/findinput/findInput'; import { Widget } from 'vs/base/browser/ui/widget'; import { Delayer } from 'vs/base/common/async'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; @@ -159,20 +159,20 @@ export abstract class SimpleFindWidget extends Widget { } public updateTheme(theme: ITheme): void { - const inputStyles = { - inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder), - inputBackground: theme.getColor(inputBackground), - inputForeground: theme.getColor(inputForeground), - inputBorder: theme.getColor(inputBorder), - inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), - inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground), - inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), - inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), - inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground), - inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), - inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), - inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground), - inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) + const inputStyles: IFindInputStyles = { + inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) || undefined, + inputBackground: theme.getColor(inputBackground) || undefined, + inputForeground: theme.getColor(inputForeground) || undefined, + inputBorder: theme.getColor(inputBorder) || undefined, + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground) || undefined, + inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground) || undefined, + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder) || undefined, + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground) || undefined, + inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground) || undefined, + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder) || undefined, + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground) || undefined, + inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground) || undefined, + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) || undefined }; this._findInput.style(inputStyles); } diff --git a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts index 9b9c0bbe4b1..75f698e2bf9 100644 --- a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts +++ b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts @@ -165,7 +165,7 @@ export class MarkerNavigationWidget extends ZoneWidget { private _message: MessageWidget; private _callOnDispose: IDisposable[] = []; private _severity: MarkerSeverity; - private _backgroundColor: Color | null; + private _backgroundColor?: Color; private _onDidSelectRelatedInformation = new Emitter(); readonly onDidSelectRelatedInformation: Event = this._onDidSelectRelatedInformation.event; @@ -185,7 +185,7 @@ export class MarkerNavigationWidget extends ZoneWidget { } private _applyTheme(theme: ITheme) { - this._backgroundColor = theme.getColor(editorMarkerNavigationBackground); + this._backgroundColor = theme.getColor(editorMarkerNavigationBackground) || undefined; let colorId = editorMarkerNavigationError; if (this._severity === MarkerSeverity.Warning) { colorId = editorMarkerNavigationWarning; diff --git a/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts b/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts index 39429bdf72e..f0481b7ee29 100644 --- a/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/peekViewWidget.ts @@ -34,9 +34,9 @@ export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null { } export interface IPeekViewStyles extends IStyles { - headerBackgroundColor?: Color | null; - primaryHeadingColor?: Color | null; - secondaryHeadingColor?: Color | null; + headerBackgroundColor?: Color; + primaryHeadingColor?: Color; + secondaryHeadingColor?: Color; } export type IPeekViewOptions = IOptions & IPeekViewStyles; diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index 60500684060..cab5f97cdb0 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -279,8 +279,8 @@ export class ReferenceWidget extends PeekViewWidget { arrowColor: borderColor, frameColor: borderColor, headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent, - primaryHeadingColor: theme.getColor(peekViewTitleForeground), - secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) + primaryHeadingColor: theme.getColor(peekViewTitleForeground) || undefined, + secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) || undefined }); } diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 3fb34ab3b6c..9c89a6fdb4f 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -132,9 +132,9 @@ class ColorRegistry implements IColorRegistry { } public resolveDefaultColor(id: ColorIdentifier, theme: ITheme): Color | null { - let colorDesc = this.colorsById[id]; + const colorDesc = this.colorsById[id]; if (colorDesc && colorDesc.defaults) { - let colorValue = colorDesc.defaults[theme.type]; + const colorValue = colorDesc.defaults[theme.type]; return resolveColorValue(colorValue, theme); } return null; diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts index 08ede924c14..0bc7afbd713 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts @@ -100,18 +100,18 @@ export class QuickInputBox { style(theme: ITheme) { this.inputBox.style({ - inputForeground: theme.getColor(inputForeground), - inputBackground: theme.getColor(inputBackground), - inputBorder: theme.getColor(inputBorder), - inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), - inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground), - inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), - inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), - inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground), - inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), - inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), - inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground), - inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder), + inputForeground: theme.getColor(inputForeground) || undefined, + inputBackground: theme.getColor(inputBackground) || undefined, + inputBorder: theme.getColor(inputBorder) || undefined, + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground) || undefined, + inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground) || undefined, + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder) || undefined, + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground) || undefined, + inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground) || undefined, + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder) || undefined, + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground) || undefined, + inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground) || undefined, + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) || undefined, }); } diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts index d0a303be842..7801422a7da 100644 --- a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts @@ -365,8 +365,8 @@ class DirtyDiffWidget extends PeekViewWidget { arrowColor: borderColor, frameColor: borderColor, headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent, - primaryHeadingColor: theme.getColor(peekViewTitleForeground), - secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) + primaryHeadingColor: theme.getColor(peekViewTitleForeground) || undefined, + secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) || undefined }); } From e20970ce05aefa5c228a7b17cfc116717593a665 Mon Sep 17 00:00:00 2001 From: Rachel Macfarlane Date: Wed, 6 Feb 2019 16:59:53 -0800 Subject: [PATCH 407/429] Some strict null checking in comments, #68012 --- .../electron-browser/mainThreadComments.ts | 8 ++-- .../comments/electron-browser/commentNode.ts | 20 +++++----- .../electron-browser/commentService.ts | 37 +++++++++---------- .../electron-browser/commentsPanel.ts | 8 ++-- .../electron-browser/commentsTreeViewer.ts | 11 ++---- 5 files changed, 41 insertions(+), 43 deletions(-) diff --git a/src/vs/workbench/api/electron-browser/mainThreadComments.ts b/src/vs/workbench/api/electron-browser/mainThreadComments.ts index 2eec4b8c85f..f62f4c820f4 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadComments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadComments.ts @@ -27,10 +27,10 @@ export class MainThreadDocumentCommentProvider implements modes.DocumentCommentP private _proxy: ExtHostCommentsShape; private _handle: number; private _features: CommentProviderFeatures; - get startDraftLabel(): string { return this._features.startDraftLabel; } - get deleteDraftLabel(): string { return this._features.deleteDraftLabel; } - get finishDraftLabel(): string { return this._features.finishDraftLabel; } - get reactionGroup(): modes.CommentReaction[] { return this._features.reactionGroup; } + get startDraftLabel(): string | undefined { return this._features.startDraftLabel; } + get deleteDraftLabel(): string | undefined { return this._features.deleteDraftLabel; } + get finishDraftLabel(): string | undefined { return this._features.finishDraftLabel; } + get reactionGroup(): modes.CommentReaction[] | undefined { return this._features.reactionGroup; } constructor(proxy: ExtHostCommentsShape, handle: number, features: CommentProviderFeatures) { this._proxy = proxy; diff --git a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts index 5d1c0b3b434..1dd1703a77b 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentNode.ts @@ -47,7 +47,7 @@ export class CommentNode extends Disposable { private _commentDetailsContainer: HTMLElement; private _reactionsActionBar?: ActionBar; private _actionsContainer?: HTMLElement; - private _commentEditor: SimpleCommentEditor; + private _commentEditor: SimpleCommentEditor | null; private _commentEditorModel: ITextModel; private _updateCommentButton: Button; private _errorEditingContainer: HTMLElement; @@ -140,7 +140,7 @@ export class CommentNode extends Disposable { this.registerActionBarListeners(actionsContainer); - let reactionActions = []; + let reactionActions: Action[] = []; let reactionGroup = this.commentService.getReactionGroup(this.owner); if (reactionGroup && reactionGroup.length) { reactionActions = reactionGroup.map((reaction) => { @@ -179,7 +179,7 @@ export class CommentNode extends Disposable { this._reactionsActionBar = new ActionBar(this._actionsContainer, {}); this._toDispose.push(this._reactionsActionBar); - let reactionActions = this.comment.commentReactions.map(reaction => { + let reactionActions = this.comment.commentReactions!.map(reaction => { return new Action(`reaction.${reaction.label}`, `${reaction.label}`, reaction.hasReacted ? 'active' : '', true, async () => { try { if (reaction.hasReacted) { @@ -204,7 +204,7 @@ export class CommentNode extends Disposable { }); }); - reactionActions.forEach(action => this._reactionsActionBar.push(action, { label: true, icon: true })); + reactionActions.forEach(action => this._reactionsActionBar!.push(action, { label: true, icon: true })); } private createCommentEditor(): void { @@ -237,8 +237,10 @@ export class CommentNode extends Disposable { this._body.classList.remove('hidden'); this._commentEditorModel.dispose(); - this._commentEditor.dispose(); - this._commentEditor = null; + if (this._commentEditor) { + this._commentEditor.dispose(); + this._commentEditor = null; + } this._commentEditContainer.remove(); } @@ -253,7 +255,7 @@ export class CommentNode extends Disposable { this._updateCommentButton.enabled = true; this._updateCommentButton.label = UPDATE_COMMENT_LABEL; - this._commentEditor.getDomNode().style.outline = ''; + this._commentEditor!.getDomNode().style.outline = ''; this.removeCommentEditor(); const editedComment = assign({}, this.comment, { body: new MarkdownString(newBody) }); this.update(editedComment); @@ -321,8 +323,8 @@ export class CommentNode extends Disposable { this.editComment(); })); - this._toDispose.push(this._commentEditor.onDidChangeModelContent(_ => { - this._updateCommentButton.enabled = !!this._commentEditor.getValue(); + this._toDispose.push(this._commentEditor!.onDidChangeModelContent(_ => { + this._updateCommentButton.enabled = !!this._commentEditor!.getValue(); })); this._editAction.enabled = false; diff --git a/src/vs/workbench/parts/comments/electron-browser/commentService.ts b/src/vs/workbench/parts/comments/electron-browser/commentService.ts index 7173a1b02db..6540d310ea2 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentService.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentService.ts @@ -11,7 +11,6 @@ import { URI } from 'vs/base/common/uri'; import { Range } from 'vs/editor/common/core/range'; import { keys } from 'vs/base/common/map'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { MainThreadDocumentCommentProvider } from 'vs/workbench/api/electron-browser/mainThreadComments'; import { assign } from 'vs/base/common/objects'; import { ICommentThreadChangedEvent } from 'vs/workbench/parts/comments/common/commentModel'; @@ -41,23 +40,23 @@ export interface ICommentService { setDocumentComments(resource: URI, commentInfos: ICommentInfo[]): void; setWorkspaceComments(owner: string, commentsByResource: CommentThread[]): void; removeWorkspaceComments(owner: string): void; - registerDataProvider(owner: string, commentProvider: MainThreadDocumentCommentProvider): void; + registerDataProvider(owner: string, commentProvider: DocumentCommentProvider): void; unregisterDataProvider(owner: string): void; updateComments(ownerId: string, event: CommentThreadChangedEvent): void; createNewCommentThread(owner: string, resource: URI, range: Range, text: string): Promise; replyToCommentThread(owner: string, resource: URI, range: Range, thread: CommentThread, text: string): Promise; editComment(owner: string, resource: URI, comment: Comment, text: string): Promise; deleteComment(owner: string, resource: URI, comment: Comment): Promise; - getComments(resource: URI): Promise; + getComments(resource: URI): Promise<(ICommentInfo | null)[]>; startDraft(owner: string, resource: URI): void; deleteDraft(owner: string, resource: URI): void; finishDraft(owner: string, resource: URI): void; - getStartDraftLabel(owner: string): string; - getDeleteDraftLabel(owner: string): string; - getFinishDraftLabel(owner: string): string; + getStartDraftLabel(owner: string): string | undefined; + getDeleteDraftLabel(owner: string): string | undefined; + getFinishDraftLabel(owner: string): string | undefined; addReaction(owner: string, resource: URI, comment: Comment, reaction: CommentReaction): Promise; deleteReaction(owner: string, resource: URI, comment: Comment, reaction: CommentReaction): Promise; - getReactionGroup(owner: string): CommentReaction[]; + getReactionGroup(owner: string): CommentReaction[] | undefined; } export class CommentService extends Disposable implements ICommentService { @@ -96,7 +95,7 @@ export class CommentService extends Disposable implements ICommentService { this._onDidSetAllCommentThreads.fire({ ownerId: owner, commentThreads: [] }); } - registerDataProvider(owner: string, commentProvider: DocumentCommentProvider) { + registerDataProvider(owner: string, commentProvider: DocumentCommentProvider): void { this._commentProviders.set(owner, commentProvider); this._onDidSetDataProvider.fire(); } @@ -201,51 +200,51 @@ export class CommentService extends Disposable implements ICommentService { } } - getReactionGroup(owner: string): CommentReaction[] { + getReactionGroup(owner: string): CommentReaction[] | undefined { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { return commentProvider.reactionGroup; } - return null; + return undefined; } - getStartDraftLabel(owner: string): string | null { + getStartDraftLabel(owner: string): string | undefined { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { return commentProvider.startDraftLabel; } - return null; + return undefined; } - getDeleteDraftLabel(owner: string): string { + getDeleteDraftLabel(owner: string): string | undefined { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { return commentProvider.deleteDraftLabel; } - return null; + return undefined; } - getFinishDraftLabel(owner: string): string { + getFinishDraftLabel(owner: string): string | undefined { const commentProvider = this._commentProviders.get(owner); if (commentProvider) { return commentProvider.finishDraftLabel; } - return null; + return undefined; } - getComments(resource: URI): Promise { - const result: Promise[] = []; + getComments(resource: URI): Promise<(ICommentInfo | null)[]> { + const result: Promise[] = []; for (const owner of keys(this._commentProviders)) { const provider = this._commentProviders.get(owner); - if (provider.provideDocumentComments) { + if (provider && provider.provideDocumentComments) { result.push(provider.provideDocumentComments(resource, CancellationToken.None).then(commentInfo => { if (commentInfo) { return { diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts index 307216ce03d..a366d8c320b 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts @@ -160,7 +160,7 @@ export class CommentsPanel extends Panel { })); } - private openFile(element: any, pinned: boolean, preserveFocus: boolean, sideBySide: boolean): boolean { + private openFile(element: any, pinned?: boolean, preserveFocus?: boolean, sideBySide?: boolean): boolean { if (!element) { return false; } @@ -189,16 +189,16 @@ export class CommentsPanel extends Panel { const commentToReveal = element instanceof ResourceWithCommentThreads ? element.commentThreads[0].comment : element.comment; if (commentToReveal.command) { - this.commandService.executeCommand(commentToReveal.command.id, ...commentToReveal.command.arguments).then(_ => { + this.commandService.executeCommand(commentToReveal.command.id, ...(commentToReveal.command.arguments || [])).then(_ => { let activeWidget = this.editorService.activeTextEditorWidget; if (isDiffEditor(activeWidget)) { const originalEditorWidget = activeWidget.getOriginalEditor(); const modifiedEditorWidget = activeWidget.getModifiedEditor(); let controller; - if (originalEditorWidget.getModel().uri.toString() === element.resource.toString()) { + if (originalEditorWidget.getModel()!.uri.toString() === element.resource.toString()) { controller = ReviewController.get(originalEditorWidget); - } else if (modifiedEditorWidget.getModel().uri.toString() === element.resource.toString()) { + } else if (modifiedEditorWidget.getModel()!.uri.toString() === element.resource.toString()) { controller = ReviewController.get(modifiedEditorWidget); } diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts b/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts index 5989090ec45..f67bfd09039 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts @@ -42,7 +42,7 @@ export class CommentsDataSource implements IDataSource { if (element instanceof CommentNode) { return Promise.resolve(element.replies); } - return null; + return Promise.resolve([]); } public getParent(tree: ITree, element: any): Promise { @@ -148,15 +148,12 @@ export class CommentsModelRenderer implements ITreeRenderer { inline: true, actionHandler: { callback: (content) => { - let uri: URI; try { - uri = URI.parse(content); + const uri = URI.parse(content); + this.openerService.open(uri).catch(onUnexpectedError); } catch (err) { // ignore } - if (uri) { - this.openerService.open(uri).catch(onUnexpectedError); - } }, disposeables: templateData.disposables } @@ -167,7 +164,7 @@ export class CommentsModelRenderer implements ITreeRenderer { const image = images[i]; const textDescription = dom.$(''); textDescription.textContent = image.alt ? nls.localize('imageWithLabel', "Image: {0}", image.alt) : nls.localize('image', "Image"); - image.parentNode.replaceChild(textDescription, image); + image.parentNode!.replaceChild(textDescription, image); } templateData.commentText.appendChild(renderedComment); From 7ab3fd10e49f4d54deb72815a68ec186c1a8f2bf Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 16:47:59 -0800 Subject: [PATCH 408/429] Strict null work in mockDebug throw not implemented errors instead of returning null results --- src/tsconfig.strictNullChecks.json | 1 + .../parts/debug/test/common/mockDebug.ts | 110 +++++++++--------- 2 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index cb527bcfcba..123f5547fa8 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -489,6 +489,7 @@ "./vs/workbench/parts/debug/browser/linkDetector.ts", "./vs/workbench/parts/debug/common/debugProtocol.d.ts", "./vs/workbench/parts/debug/node/telemetryApp.ts", + "./vs/workbench/parts/debug/test/common/mockDebug.ts", "./vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts", "./vs/workbench/parts/emmet/browser/emmet.browser.contribution.ts", "./vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts", diff --git a/src/vs/workbench/parts/debug/test/common/mockDebug.ts b/src/vs/workbench/parts/debug/test/common/mockDebug.ts index fbb34d499e9..73359d78946 100644 --- a/src/vs/workbench/parts/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/parts/debug/test/common/mockDebug.ts @@ -17,52 +17,52 @@ export class MockDebugService implements IDebugService { public _serviceBrand: any; public get state(): State { - return null; + throw new Error('not implemented'); } public get onWillNewSession(): Event { - return null; + throw new Error('not implemented'); } public get onDidNewSession(): Event { - return null; + throw new Error('not implemented'); } public get onDidEndSession(): Event { - return null; + throw new Error('not implemented'); } public get onDidChangeState(): Event { - return null; + throw new Error('not implemented'); } public getConfigurationManager(): IConfigurationManager { - return null; + throw new Error('not implemented'); } public focusStackFrame(focusedStackFrame: IStackFrame): void { } sendAllBreakpoints(session?: IDebugSession): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public addBreakpoints(uri: uri, rawBreakpoints: IBreakpointData[]): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public updateBreakpoints(uri: uri, data: { [id: string]: IBreakpointUpdateData }, sendOnResourceSaved: boolean): void { } public enableOrDisableBreakpoints(enabled: boolean): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public setBreakpointsActivated(): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public removeBreakpoints(): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public addFunctionBreakpoint(): void { } @@ -70,25 +70,25 @@ export class MockDebugService implements IDebugService { public moveWatchExpression(id: string, position: number): void { } public renameFunctionBreakpoint(id: string, newFunctionName: string): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public removeFunctionBreakpoints(id?: string): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public addReplExpression(name: string): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public removeReplExpressions(): void { } public addWatchExpression(name?: string): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public renameWatchExpression(id: string, newName: string): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public removeWatchExpressions(id?: string): void { } @@ -98,19 +98,19 @@ export class MockDebugService implements IDebugService { } public restartSession(): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public stopSession(): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public getModel(): IDebugModel { - return null; + throw new Error('not implemented'); } public getViewModel(): IViewModel { - return null; + throw new Error('not implemented'); } public logToRepl(session: IDebugSession, value: string): void { } @@ -118,7 +118,7 @@ export class MockDebugService implements IDebugService { public sourceIsNotAvailable(uri: uri): void { } public tryToAutoFocusStackFrame(thread: IThread): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } } @@ -129,7 +129,7 @@ export class MockSession implements IDebugSession { removeReplExpressions(): void { } get onDidChangeReplElements(): Event { - return null; + throw new Error('not implemented'); } addReplExpression(stackFrame: IStackFrame, name: string): Promise { @@ -154,27 +154,27 @@ export class MockSession implements IDebugSession { } getSourceForUri(modelUri: uri): Source { - return null; + throw new Error('not implemented'); } getThread(threadId: number): IThread { - return null; + throw new Error('not implemented'); } get onDidCustomEvent(): Event { - return null; + throw new Error('not implemented'); } get onDidLoadedSource(): Event { - return null; + throw new Error('not implemented'); } get onDidChangeState(): Event { - return null; + throw new Error('not implemented'); } get onDidEndAdapter(): Event { - return null; + throw new Error('not implemented'); } setConfiguration(configuration: { resolved: IConfig, unresolved: IConfig }) { } @@ -184,7 +184,7 @@ export class MockSession implements IDebugSession { } getSource(raw: DebugProtocol.Source): Source { - return undefined; + throw new Error('not implemented'); } getLoadedSources(): Promise { @@ -311,104 +311,104 @@ export class MockRawSession { } public exceptionInfo(args: DebugProtocol.ExceptionInfoArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public launchOrAttach(args: IConfig): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public scopes(args: DebugProtocol.ScopesArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public variables(args: DebugProtocol.VariablesArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } evaluate(args: DebugProtocol.EvaluateArguments): Promise { - return Promise.resolve(null); + return Promise.resolve(null!); } public custom(request: string, args: any): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public terminate(restart = false): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public disconnect(restart?: boolean): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public threads(): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public stepIn(args: DebugProtocol.StepInArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public stepOut(args: DebugProtocol.StepOutArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public stepBack(args: DebugProtocol.StepBackArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public continue(args: DebugProtocol.ContinueArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public reverseContinue(args: DebugProtocol.ReverseContinueArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public pause(args: DebugProtocol.PauseArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public terminateThreads(args: DebugProtocol.TerminateThreadsArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public setVariable(args: DebugProtocol.SetVariableArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public restartFrame(args: DebugProtocol.RestartFrameArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public completions(args: DebugProtocol.CompletionsArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public next(args: DebugProtocol.NextArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public source(args: DebugProtocol.SourceArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public loadedSources(args: DebugProtocol.LoadedSourcesArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public setBreakpoints(args: DebugProtocol.SetBreakpointsArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public setFunctionBreakpoints(args: DebugProtocol.SetFunctionBreakpointsArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public setExceptionBreakpoints(args: DebugProtocol.SetExceptionBreakpointsArguments): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } - public readonly onDidStop: Event = null; + public readonly onDidStop: Event = null!; } From 2135dbb2734536a6337acd199fa7107bb534c267 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 16:48:20 -0800 Subject: [PATCH 409/429] Strict null work in task.contribution --- .../parts/tasks/common/taskService.ts | 2 +- .../electron-browser/task.contribution.ts | 34 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/src/vs/workbench/parts/tasks/common/taskService.ts b/src/vs/workbench/parts/tasks/common/taskService.ts index 827cb4c1cfa..d67b31a8af0 100644 --- a/src/vs/workbench/parts/tasks/common/taskService.ts +++ b/src/vs/workbench/parts/tasks/common/taskService.ts @@ -69,7 +69,7 @@ export interface ITaskService { /** * @param alias The task's name, label or defined identifier. */ - getTask(workspaceFolder: IWorkspaceFolder | string, alias: string | TaskIdentifier, compareId?: boolean): Promise; + getTask(workspaceFolder: IWorkspaceFolder | string, alias: string | TaskIdentifier, compareId?: boolean): Promise; getTasksForGroup(group: string): Promise; getRecentlyUsedTasks(): LinkedMap; createSorter(): TaskSorter; diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 4e1cccf03be..75a02655571 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -401,7 +401,7 @@ class TaskMap { } public get(workspaceFolder: IWorkspaceFolder | string): Task[] { - let result: Task[] = Types.isString(workspaceFolder) ? this._store.get(workspaceFolder) : this._store.get(workspaceFolder.uri.toString()); + let result: Task[] | undefined = Types.isString(workspaceFolder) ? this._store.get(workspaceFolder) : this._store.get(workspaceFolder.uri.toString()); if (!result) { result = []; Types.isString(workspaceFolder) ? this._store.set(workspaceFolder, result) : this._store.set(workspaceFolder.uri.toString(), result); @@ -426,7 +426,7 @@ class TaskMap { } interface TaskQuickPickEntry extends IQuickPickItem { - task: Task; + task: Task | null; } class TaskService extends Disposable implements ITaskService { @@ -449,14 +449,14 @@ class TaskService extends Disposable implements ITaskService { private _executionEngine: ExecutionEngine; private _workspaceFolders: IWorkspaceFolder[]; private _ignoredWorkspaceFolders: IWorkspaceFolder[]; - private _showIgnoreMessage: boolean; + private _showIgnoreMessage?: boolean; private _providers: Map; private _taskSystemInfos: Map; - private _workspaceTasksPromise: Promise>; + private _workspaceTasksPromise?: Promise>; - private _taskSystem: ITaskSystem; - private _taskSystemListener: IDisposable; + private _taskSystem?: ITaskSystem; + private _taskSystemListener?: IDisposable; private _recentlyUsedTasks: LinkedMap; private _taskRunningState: IContextKey; @@ -706,26 +706,24 @@ class TaskService extends Disposable implements ITaskService { this._taskSystemInfos.set(key, info); } - public getTask(folder: IWorkspaceFolder | string, identifier: string | TaskIdentifier, compareId: boolean = false): Promise { - let name = Types.isString(folder) ? folder : folder.name; + public getTask(folder: IWorkspaceFolder | string, identifier: string | TaskIdentifier, compareId: boolean = false): Promise { + const name = Types.isString(folder) ? folder : folder.name; if (this.ignoredWorkspaceFolders.some(ignored => ignored.name === name)) { return Promise.reject(new Error(nls.localize('TaskServer.folderIgnored', 'The folder {0} is ignored since it uses task version 0.1.0', name))); } - let key: string | KeyedTaskIdentifier; - if (!Types.isString(identifier)) { - key = TaskDefinition.createTaskIdentifier(identifier, console); - } else { - key = identifier; - } + const key: string | KeyedTaskIdentifier | undefined = !Types.isString(identifier) + ? TaskDefinition.createTaskIdentifier(identifier, console) + : identifier; + if (key === undefined) { return Promise.resolve(undefined); } return this.getGroupedTasks().then((map) => { - let values = map.get(folder); + const values = map.get(folder); if (!values) { return undefined; } - for (let task of values) { + for (const task of values) { if (task.matches(key, compareId)) { return task; } @@ -2463,7 +2461,7 @@ class TaskService extends Disposable implements ITaskService { this.runConfigureTasks(); return; } - let selectedTask: Task; + let selectedTask: Task | undefined; let selectedEntry: TaskQuickPickEntry; for (let task of tasks) { @@ -2664,7 +2662,7 @@ schema.definitions = { ...schemaVersion1.definitions, ...schemaVersion2.definitions, }; -schema.oneOf = [...schemaVersion2.oneOf, ...schemaVersion1.oneOf]; +schema.oneOf = [...(schemaVersion2.oneOf || []), ...(schemaVersion1.oneOf || [])]; let jsonRegistry = Registry.as(jsonContributionRegistry.Extensions.JSONContribution); jsonRegistry.registerSchema(schemaId, schema); From 3f9e857483a61f97094951b57976c4f3118208f1 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 17:10:52 -0800 Subject: [PATCH 410/429] Strict null work --- src/vs/workbench/browser/dnd.ts | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/vs/workbench/browser/dnd.ts b/src/vs/workbench/browser/dnd.ts index a7765e76c20..432b1cb77e5 100644 --- a/src/vs/workbench/browser/dnd.ts +++ b/src/vs/workbench/browser/dnd.ts @@ -60,8 +60,8 @@ export interface IDraggedEditor extends IDraggedResource { export interface ISerializedDraggedEditor { resource: string; - backupResource: string; - viewState: IEditorViewState; + backupResource?: string; + viewState: IEditorViewState | null; } export const CodeDataTransfers = { @@ -71,7 +71,7 @@ export const CodeDataTransfers = { export function extractResources(e: DragEvent, externalOnly?: boolean): Array { const resources: Array = []; - if (e.dataTransfer.types.length > 0) { + if (e.dataTransfer && e.dataTransfer.types.length > 0) { // Check for window-to-window DND if (!externalOnly) { @@ -286,7 +286,7 @@ export class ResourcesDropHandler { // Pass focus to window this.windowService.focusWindow(); - let workspacesToOpen: Promise; + let workspacesToOpen: Promise | undefined; // Open in separate windows if we drop workspaces or just one folder if (workspaces.length > 0 || folders.length === 1) { @@ -319,16 +319,16 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { super(); } - getDragURI(tree: ITree, obj: any): string | undefined { + getDragURI(tree: ITree, obj: any): string | null { const resource = this.toResource(obj); if (resource) { return resource.toString(); } - return undefined; + return null; } - getDragLabel(tree: ITree, elements: any[]): string | undefined { + getDragLabel(tree: ITree, elements: any[]): string | null { if (elements.length > 1) { return String(elements.length); } @@ -338,7 +338,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { return basenameOrAuthority(resource); } - return undefined; + return null; } onDragStart(tree: ITree, data: IDragAndDropData, originalEvent: DragMouseEvent): void { @@ -352,7 +352,7 @@ export class SimpleFileResourceDragAndDrop extends DefaultDragAndDrop { } export function fillResourceDataTransfers(accessor: ServicesAccessor, resources: (URI | { resource: URI, isDirectory: boolean })[], event: DragMouseEvent | DragEvent): void { - if (resources.length === 0) { + if (resources.length === 0 || !event.dataTransfer) { return; } @@ -390,7 +390,7 @@ export function fillResourceDataTransfers(accessor: ServicesAccessor, resources: files.forEach(file => { // Try to find editor view state from the visible editors that match given resource - let viewState: IEditorViewState; + let viewState: IEditorViewState | null = null; const textEditorWidgets = editorService.visibleTextEditorWidgets; for (const textEditorWidget of textEditorWidgets) { if (isCodeEditor(textEditorWidget)) { @@ -422,8 +422,8 @@ export class LocalSelectionTransfer { private static readonly INSTANCE = new LocalSelectionTransfer(); - private data: T[]; - private proto: T; + private data?: T[]; + private proto?: T; private constructor() { // protect against external instantiation @@ -444,7 +444,7 @@ export class LocalSelectionTransfer { } } - getData(proto: T): T[] { + getData(proto: T): T[] | undefined { if (this.hasData(proto)) { return this.data; } From 3711d0fc6738f69d0cbccff17c1e47a6ca76b23c Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 17:12:22 -0800 Subject: [PATCH 411/429] Strict null work on workbenchTestServices Throw not implemented instead of returning null results for most methods --- .../textfile/common/textFileService.ts | 2 +- .../textfile/test/textFileService.test.ts | 4 +- .../workbench/test/workbenchTestServices.ts | 86 ++++++++++--------- 3 files changed, 50 insertions(+), 42 deletions(-) diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index 8babc6bcb54..1b8e23675a7 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -57,7 +57,7 @@ export abstract class TextFileService extends Disposable implements ITextFileSer private _models: TextFileEditorModelManager; private currentFilesAssociationConfig: { [key: string]: string; }; - private configuredAutoSaveDelay: number; + private configuredAutoSaveDelay?: number; private configuredAutoSaveOnFocusChange: boolean; private configuredAutoSaveOnWindowChange: boolean; private configuredHotExit: string; diff --git a/src/vs/workbench/services/textfile/test/textFileService.test.ts b/src/vs/workbench/services/textfile/test/textFileService.test.ts index 7c75c57e3ea..3eb2f5092bb 100644 --- a/src/vs/workbench/services/textfile/test/textFileService.test.ts +++ b/src/vs/workbench/services/textfile/test/textFileService.test.ts @@ -58,7 +58,9 @@ suite('Files - TextFileService', () => { }); teardown(() => { - model.dispose(); + if (model) { + model.dispose(); + } (accessor.textFileService.models).clear(); (accessor.textFileService.models).dispose(); accessor.untitledEditorService.revertAll(); diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 2ab4c1cd7a7..283fcce77f2 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -488,7 +488,7 @@ export class TestPartService implements IPartService { } public getMenubarVisibility(): MenuBarVisibility { - return null; + throw new Error('not implemented'); } public getSideBarPosition() { @@ -505,7 +505,7 @@ export class TestPartService implements IPartService { public addClass(_clazz: string): void { } public removeClass(_clazz: string): void { } - public getWorkbenchElement(): HTMLElement { return undefined; } + public getWorkbenchElement(): HTMLElement { throw new Error('not implemented'); } public toggleZenMode(): void { } @@ -550,7 +550,7 @@ export class TestEditorGroupsService implements EditorGroupsServiceImpl { } } - return undefined; + return undefined!; } getLabel(_identifier: number): string { @@ -558,11 +558,11 @@ export class TestEditorGroupsService implements EditorGroupsServiceImpl { } findGroup(_scope: IFindGroupScope, _source?: number | IEditorGroup, _wrap?: boolean): IEditorGroup { - return null; + throw new Error('not implemented'); } activateGroup(_group: number | IEditorGroup): IEditorGroup { - return null; + throw new Error('not implemented'); } getSize(_group: number | IEditorGroup): number { @@ -578,21 +578,21 @@ export class TestEditorGroupsService implements EditorGroupsServiceImpl { setGroupOrientation(_orientation: any): void { } addGroup(_location: number | IEditorGroup, _direction: GroupDirection, _options?: IAddGroupOptions): IEditorGroup { - return null; + throw new Error('not implemented'); } removeGroup(_group: number | IEditorGroup): void { } moveGroup(_group: number | IEditorGroup, _location: number | IEditorGroup, _direction: GroupDirection): IEditorGroup { - return null; + throw new Error('not implemented'); } mergeGroup(_group: number | IEditorGroup, _target: number | IEditorGroup, _options?: IMergeGroupOptions): IEditorGroup { - return null; + throw new Error('not implemented'); } copyGroup(_group: number | IEditorGroup, _location: number | IEditorGroup, _direction: GroupDirection): IEditorGroup { - return null; + throw new Error('not implemented'); } } @@ -600,7 +600,7 @@ export class TestEditorGroup implements IEditorGroupView { constructor(public id: number) { } - group: EditorGroup = undefined; + get group(): EditorGroup { throw new Error('not implemented'); } activeControl: IEditor; activeEditor: IEditorInput; previewEditor: IEditorInput; @@ -629,7 +629,7 @@ export class TestEditorGroup implements IEditorGroupView { } getEditor(_index: number): IEditorInput { - return null; + throw new Error('not implemented'); } getIndexOfEditor(_editor: IEditorInput): number { @@ -637,11 +637,11 @@ export class TestEditorGroup implements IEditorGroupView { } openEditor(_editor: IEditorInput, _options?: IEditorOptions): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } openEditors(_editors: IEditorInputWithOptions[]): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } isOpened(_editor: IEditorInput): boolean { @@ -681,7 +681,7 @@ export class TestEditorGroup implements IEditorGroupView { focus(): void { } invokeWithinContext(fn: (accessor: ServicesAccessor) => T): T { - return fn(null); + throw new Error('not implemented'); } isEmpty(): boolean { return true; } @@ -714,12 +714,12 @@ export class TestEditorService implements EditorServiceImpl { return toDisposable(() => undefined); } - openEditor(_editor: any, _options?: any, _group?: any) { - return Promise.resolve(null); + openEditor(_editor: any, _options?: any, _group?: any): Promise { + throw new Error('not implemented'); } - openEditors(_editors: any, _group?: any) { - return Promise.resolve(null); + openEditors(_editors: any, _group?: any): Promise { + throw new Error('not implemented'); } isOpen(_editor: IEditorInput | IResourceInput | IUntitledResourceInput): boolean { @@ -727,7 +727,7 @@ export class TestEditorService implements EditorServiceImpl { } getOpened(_editor: IEditorInput | IResourceInput | IUntitledResourceInput): IEditorInput { - return undefined; + throw new Error('not implemented'); } replaceEditors(_editors: any, _group: any) { @@ -735,11 +735,11 @@ export class TestEditorService implements EditorServiceImpl { } invokeWithinEditorContext(fn: (accessor: ServicesAccessor) => T): T { - return fn(null); + throw new Error('not implemented'); } createInput(_input: IResourceInput | IUntitledResourceInput | IResourceDiffInput | IResourceSideBySideInput): IEditorInput { - return null; + throw new Error('not implemented'); } } @@ -799,7 +799,7 @@ export class TestFileService implements IFileService { } existsFile(_resource: URI): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } resolveContent(resource: URI, _options?: IResolveContentOptions): Promise { @@ -845,15 +845,15 @@ export class TestFileService implements IFileService { } moveFile(_source: URI, _target: URI, _overwrite?: boolean): Promise { - return Promise.resolve(null); + return Promise.resolve(null!); } copyFile(_source: URI, _target: URI, _overwrite?: boolean): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } createFile(_resource: URI, _content?: string, _options?: ICreateFileOptions): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } readFolder(_resource: URI) { @@ -861,7 +861,7 @@ export class TestFileService implements IFileService { } createFolder(_resource: URI): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } onDidChangeFileSystemProviderRegistrations = Event.None; @@ -870,8 +870,8 @@ export class TestFileService implements IFileService { return { dispose() { } }; } - activateProvider(_scheme: string) { - return Promise.resolve(null); + activateProvider(_scheme: string): Promise { + throw new Error('not implemented'); } canHandleResource(resource: URI): boolean { @@ -879,7 +879,7 @@ export class TestFileService implements IFileService { } del(_resource: URI, _options?: { useTrash?: boolean, recursive?: boolean }): Promise { - return Promise.resolve(null); + return Promise.resolve(); } watchFileChanges(_resource: URI): void { @@ -907,7 +907,7 @@ export class TestBackupFileService implements IBackupFileService { return Promise.resolve(false); } - public loadBackupResource(resource: URI): Promise { + public loadBackupResource(resource: URI): Promise { return this.hasBackup(resource).then(hasBackup => { if (hasBackup) { return this.toBackupResource(resource); @@ -926,7 +926,7 @@ export class TestBackupFileService implements IBackupFileService { } public toBackupResource(_resource: URI): URI { - return null; + throw new Error('not implemented'); } public backupResource(_resource: URI, _content: ITextSnapshot): Promise { @@ -945,7 +945,7 @@ export class TestBackupFileService implements IBackupFileService { } public resolveBackupContent(_backup: URI): Promise { - return Promise.resolve(null); + throw new Error('not implemented'); } public discardResourceBackup(_resource: URI): Promise { @@ -1052,7 +1052,10 @@ export class TestWindowService implements IWindowService { } getRecentlyOpened(): Promise { - return Promise.resolve(undefined); + return Promise.resolve({ + workspaces: [], + files: [] + }); } focusWindow(): Promise { @@ -1096,11 +1099,11 @@ export class TestWindowService implements IWindowService { } showSaveDialog(_options: Electron.SaveDialogOptions): Promise { - return Promise.resolve(undefined); + throw new Error('not implemented'); } showOpenDialog(_options: Electron.OpenDialogOptions): Promise { - return Promise.resolve(undefined); + throw new Error('not implemented'); } updateTouchBar(_items: ISerializableCommandAction[][]): Promise { @@ -1225,7 +1228,10 @@ export class TestWindowsService implements IWindowsService { } getRecentlyOpened(_windowId: number): Promise { - return Promise.resolve(undefined); + return Promise.resolve({ + workspaces: [], + files: [] + }); } focusWindow(_windowId: number): Promise { @@ -1290,7 +1296,7 @@ export class TestWindowsService implements IWindowsService { } getWindows(): Promise<{ id: number; workspace?: IWorkspaceIdentifier; folderUri?: ISingleFolderWorkspaceIdentifier; title: string; filename?: string; }[]> { - return Promise.resolve(undefined); + throw new Error('not implemented'); } getWindowCount(): Promise { @@ -1349,15 +1355,15 @@ export class TestWindowsService implements IWindowsService { } showMessageBox(_windowId: number, _options: Electron.MessageBoxOptions): Promise { - return Promise.resolve(undefined); + throw new Error('not implemented'); } showSaveDialog(_windowId: number, _options: Electron.SaveDialogOptions): Promise { - return Promise.resolve(undefined); + throw new Error('not implemented'); } showOpenDialog(_windowId: number, _options: Electron.OpenDialogOptions): Promise { - return Promise.resolve(undefined); + throw new Error('not implemented'); } openAboutDialog(): Promise { From 946a8750e63313dc406a12ac0af72e288b7e6438 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 17:30:39 -0800 Subject: [PATCH 412/429] Move more sections to include globs instead of listing individual files --- src/tsconfig.strictNullChecks.json | 55 +++++------------------------- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 123f5547fa8..fa5442f0e51 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -18,9 +18,16 @@ "./vs/editor/contrib/snippet/**/*.ts", "./vs/editor/contrib/suggest/**/*.ts", "./vs/editor/test/**/*.ts", + "./vs/workbench/browser/parts/notifications/**/*", + "./vs/workbench/electron-browser/actions/**/*", + "./vs/workbench/parts/emmet/**/*", + "./vs/workbench/parts/execution/**/*", "./vs/workbench/parts/snippets/**/*.ts", - "./vs/workbench/services/themes/**/*.ts", - "./vs/workbench/parts/welcome/**/*.ts" + "./vs/workbench/parts/welcome/**/*.ts", + "./vs/workbench/services/commands/**/*", + "./vs/workbench/services/files/node/watcher/**/*", + "./vs/workbench/services/issue/**/*", + "./vs/workbench/services/themes/**/*.ts" ], "files": [ "./vs/editor/contrib/bracketMatching/bracketMatching.ts", @@ -418,14 +425,6 @@ "./vs/workbench/browser/parts/editor/resourceViewer.ts", "./vs/workbench/browser/parts/editor/sideBySideEditor.ts", "./vs/workbench/browser/parts/editor/textEditor.ts", - "./vs/workbench/browser/parts/notifications/notificationsActions.ts", - "./vs/workbench/browser/parts/notifications/notificationsAlerts.ts", - "./vs/workbench/browser/parts/notifications/notificationsCenter.ts", - "./vs/workbench/browser/parts/notifications/notificationsCommands.ts", - "./vs/workbench/browser/parts/notifications/notificationsList.ts", - "./vs/workbench/browser/parts/notifications/notificationsStatus.ts", - "./vs/workbench/browser/parts/notifications/notificationsToasts.ts", - "./vs/workbench/browser/parts/notifications/notificationsViewer.ts", "./vs/workbench/browser/parts/quickinput/quickInputBox.ts", "./vs/workbench/browser/parts/quickinput/quickInputList.ts", "./vs/workbench/browser/parts/quickinput/quickInputUtils.ts", @@ -456,12 +455,6 @@ "./vs/workbench/common/theme.ts", "./vs/workbench/common/viewlet.ts", "./vs/workbench/common/views.ts", - "./vs/workbench/electron-browser/actions/developerActions", - "./vs/workbench/electron-browser/actions/developerActions.ts", - "./vs/workbench/electron-browser/actions/helpActions", - "./vs/workbench/electron-browser/actions/helpActions.ts", - "./vs/workbench/electron-browser/actions/windowActions", - "./vs/workbench/electron-browser/actions/windowActions.ts", "./vs/workbench/electron-browser/resources.ts", "./vs/workbench/electron-browser/window.ts", "./vs/workbench/parts/backup/common/backupRestorer.ts", @@ -490,17 +483,6 @@ "./vs/workbench/parts/debug/common/debugProtocol.d.ts", "./vs/workbench/parts/debug/node/telemetryApp.ts", "./vs/workbench/parts/debug/test/common/mockDebug.ts", - "./vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts", - "./vs/workbench/parts/emmet/browser/emmet.browser.contribution.ts", - "./vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts", - "./vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts", - "./vs/workbench/parts/emmet/electron-browser/emmetActions.ts", - "./vs/workbench/parts/emmet/test/electron-browser/emmetAction.test.ts", - "./vs/workbench/parts/execution/common/execution.ts", - "./vs/workbench/parts/execution/electron-browser/execution.contribution.ts", - "./vs/workbench/parts/execution/electron-browser/terminal.ts", - "./vs/workbench/parts/execution/electron-browser/terminalService.ts", - "./vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts", "./vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ts", "./vs/workbench/parts/experiments/electron-browser/experiments.contribution.ts", "./vs/workbench/parts/experiments/node/experimentService.ts", @@ -630,8 +612,6 @@ "./vs/workbench/services/backup/node/backupFileService.ts", "./vs/workbench/services/bulkEdit/electron-browser/bulkEditService.ts", "./vs/workbench/services/codeEditor/browser/codeEditorService.ts", - "./vs/workbench/services/commands/common/commandService.ts", - "./vs/workbench/services/commands/test/common/commandService.test.ts", "./vs/workbench/services/configuration/common/configuration.ts", "./vs/workbench/services/configuration/common/configurationModels.ts", "./vs/workbench/services/configuration/common/jsonEditing.ts", @@ -663,21 +643,6 @@ "./vs/workbench/services/extensions/test/node/rpcProtocol.test.ts", "./vs/workbench/services/files/electron-browser/encoding.ts", "./vs/workbench/services/files/electron-browser/streams.ts", - "./vs/workbench/services/files/node/watcher/common.ts", - "./vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts", - "./vs/workbench/services/files/node/watcher/nsfw/test/nsfwWatcherService.test.ts", - "./vs/workbench/services/files/node/watcher/nsfw/watcher.ts", - "./vs/workbench/services/files/node/watcher/nsfw/watcherApp.ts", - "./vs/workbench/services/files/node/watcher/nsfw/watcherIpc.ts", - "./vs/workbench/services/files/node/watcher/nsfw/watcherService.ts", - "./vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts", - "./vs/workbench/services/files/node/watcher/unix/test/chockidarWatcherService.test.ts", - "./vs/workbench/services/files/node/watcher/unix/watcher.ts", - "./vs/workbench/services/files/node/watcher/unix/watcherApp.ts", - "./vs/workbench/services/files/node/watcher/unix/watcherIpc.ts", - "./vs/workbench/services/files/node/watcher/unix/watcherService.ts", - "./vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts", - "./vs/workbench/services/files/node/watcher/win32/watcherService.ts", "./vs/workbench/services/files/test/electron-browser/utils.ts", "./vs/workbench/services/files/test/electron-browser/watcher.test.ts", "./vs/workbench/services/group/common/editorGroupsService.ts", @@ -685,8 +650,6 @@ "./vs/workbench/services/hash/node/hashService.ts", "./vs/workbench/services/history/common/history.ts", "./vs/workbench/services/history/electron-browser/history.ts", - "./vs/workbench/services/issue/common/issue.ts", - "./vs/workbench/services/issue/electron-browser/workbenchIssueService.ts", "./vs/workbench/services/jsonschemas/common/jsonValidationExtensionPoint.ts", "./vs/workbench/services/keybinding/common/keybindingIO.ts", "./vs/workbench/services/keybinding/common/keyboardMapper.ts", From 96e13e6cbf45c2e02dd75e8903ae0a0b654a2551 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 17:54:15 -0800 Subject: [PATCH 413/429] Unblock mainThread and extHost files from being strict null checked --- src/tsconfig.strictNullChecks.json | 21 +++++++++++++++++++ .../electron-browser/mainThreadWorkspace.ts | 6 +++--- src/vs/workbench/api/node/extHost.protocol.ts | 6 +++--- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index fa5442f0e51..8ef7ef697ab 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -397,9 +397,30 @@ "./vs/vscode.proposed.d.ts", "./vs/workbench/api/common/configurationExtensionPoint.ts", "./vs/workbench/api/common/menusExtensionPoint.ts", + "./vs/workbench/api/electron-browser/extHostCustomers.ts", + "./vs/workbench/api/electron-browser/mainThreadClipboard.ts", + "./vs/workbench/api/electron-browser/mainThreadCommands.ts", + "./vs/workbench/api/electron-browser/mainThreadErrors.ts", + "./vs/workbench/api/electron-browser/mainThreadFileSystem.ts", + "./vs/workbench/api/electron-browser/mainThreadLanguages.ts", + "./vs/workbench/api/electron-browser/mainThreadLogService.ts", + "./vs/workbench/api/electron-browser/mainThreadStatusBar.ts", + "./vs/workbench/api/electron-browser/mainThreadTelemetry.ts", + "./vs/workbench/api/electron-browser/mainThreadUrls.ts", + "./vs/workbench/api/electron-browser/mainThreadWindow.ts", + "./vs/workbench/api/electron-browser/mainThreadWorkspace.ts", + "./vs/workbench/api/node/extHost.protocol.ts", + "./vs/workbench/api/node/extHostClipboard.ts", + "./vs/workbench/api/node/extHostDialogs.ts", "./vs/workbench/api/node/extHostExtensionActivator.ts", + "./vs/workbench/api/node/extHostHeapService.ts", + "./vs/workbench/api/node/extHostLogService.ts", + "./vs/workbench/api/node/extHostMessageService.ts", "./vs/workbench/api/node/extHostSearch.fileIndex.ts", + "./vs/workbench/api/node/extHostStorage.ts", "./vs/workbench/api/node/extHostTypes.ts", + "./vs/workbench/api/node/extHostUrls.ts", + "./vs/workbench/api/node/extHostWindow.ts", "./vs/workbench/api/shared/editor.ts", "./vs/workbench/api/shared/tasks.ts", "./vs/workbench/browser/actions.ts", diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index 2b8311a2e3e..d99aab31ad5 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -103,7 +103,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { private _onDidChangeWorkspace(): void { const workspace = this._contextService.getWorkbenchState() === WorkbenchState.EMPTY ? null : this._contextService.getWorkspace(); this._proxy.$acceptWorkspaceData(workspace ? { - configuration: workspace.configuration, + configuration: workspace.configuration || undefined, folders: workspace.folders, id: workspace.id, name: this._labelService.getWorkspaceLabel(workspace) @@ -112,7 +112,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { // --- search --- - $startFileSearch(includePattern: string, _includeFolder: UriComponents, excludePatternOrDisregardExcludes: string | false, maxResults: number, token: CancellationToken): Promise { + $startFileSearch(includePattern: string, _includeFolder: UriComponents, excludePatternOrDisregardExcludes: string | false, maxResults: number, token: CancellationToken): Promise | undefined { const includeFolder = URI.revive(_includeFolder); const workspace = this._contextService.getWorkspace(); if (!workspace.folders.length) { @@ -196,7 +196,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { }); } - $resolveProxy(url: string): Promise { + $resolveProxy(url: string): Promise { return this._windowService.resolveProxy(url); } } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index a66f695c65c..944adfb24f7 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -505,12 +505,12 @@ export interface ExtHostUrlsShape { } export interface MainThreadWorkspaceShape extends IDisposable { - $startFileSearch(includePattern: string, includeFolder: URI, excludePatternOrDisregardExcludes: string | false, maxResults: number, token: CancellationToken): Promise; + $startFileSearch(includePattern: string, includeFolder: URI, excludePatternOrDisregardExcludes: string | false, maxResults: number, token: CancellationToken): Promise | undefined; $startTextSearch(query: IPatternInfo, options: ITextQueryBuilderOptions, requestId: number, token: CancellationToken): Promise; $checkExists(includes: string[], token: CancellationToken): Promise; $saveAll(includeUntitled?: boolean): Promise; $updateWorkspaceFolders(extensionName: string, index: number, deleteCount: number, workspaceFoldersToAdd: { uri: UriComponents, name?: string }[]): Promise; - $resolveProxy(url: string): Promise; + $resolveProxy(url: string): Promise; } export interface IFileChangeDto { @@ -718,7 +718,7 @@ export interface ExtHostTreeViewsShape { } export interface ExtHostWorkspaceShape { - $acceptWorkspaceData(workspace: IWorkspaceData): void; + $acceptWorkspaceData(workspace: IWorkspaceData | null): void; $handleTextSearchResult(result: IRawFileMatch2, requestId: number): void; } From ea577a79e420b82a974ad54289aeac9e9605e940 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 18:22:33 -0800 Subject: [PATCH 414/429] Strict null check more mainThread and extHost files --- src/tsconfig.strictNullChecks.json | 11 ++++++++++- .../api/electron-browser/mainThreadConfiguration.ts | 4 ++-- .../api/electron-browser/mainThreadDiagnostics.ts | 4 ++-- .../api/electron-browser/mainThreadDialogs.ts | 4 ++-- .../mainThreadFileSystemEventService.ts | 2 +- .../api/electron-browser/mainThreadProgress.ts | 10 ++++++---- .../api/electron-browser/mainThreadStorage.ts | 6 +++--- src/vs/workbench/api/node/extHost.protocol.ts | 4 ++-- src/vs/workbench/api/node/extHostOutputService.ts | 6 +++--- 9 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 8ef7ef697ab..c2fef8f88e1 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -400,11 +400,15 @@ "./vs/workbench/api/electron-browser/extHostCustomers.ts", "./vs/workbench/api/electron-browser/mainThreadClipboard.ts", "./vs/workbench/api/electron-browser/mainThreadCommands.ts", + "./vs/workbench/api/electron-browser/mainThreadDiagnostics.ts", "./vs/workbench/api/electron-browser/mainThreadErrors.ts", "./vs/workbench/api/electron-browser/mainThreadFileSystem.ts", + "./vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts", "./vs/workbench/api/electron-browser/mainThreadLanguages.ts", "./vs/workbench/api/electron-browser/mainThreadLogService.ts", + "./vs/workbench/api/electron-browser/mainThreadProgress.ts", "./vs/workbench/api/electron-browser/mainThreadStatusBar.ts", + "./vs/workbench/api/electron-browser/mainThreadStorage.ts", "./vs/workbench/api/electron-browser/mainThreadTelemetry.ts", "./vs/workbench/api/electron-browser/mainThreadUrls.ts", "./vs/workbench/api/electron-browser/mainThreadWindow.ts", @@ -416,6 +420,7 @@ "./vs/workbench/api/node/extHostHeapService.ts", "./vs/workbench/api/node/extHostLogService.ts", "./vs/workbench/api/node/extHostMessageService.ts", + "./vs/workbench/api/node/extHostOutputService.ts", "./vs/workbench/api/node/extHostSearch.fileIndex.ts", "./vs/workbench/api/node/extHostStorage.ts", "./vs/workbench/api/node/extHostTypes.ts", @@ -498,6 +503,7 @@ "./vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts", "./vs/workbench/parts/comments/common/commentModel.ts", "./vs/workbench/parts/comments/electron-browser/commentGlyphWidget.ts", + "./vs/workbench/parts/comments/electron-browser/commentService.ts", "./vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts", "./vs/workbench/parts/debug/browser/debugANSIHandling.ts", "./vs/workbench/parts/debug/browser/linkDetector.ts", @@ -732,7 +738,10 @@ "./vs/workbench/test/common/editor/editorOptions.test.ts", "./vs/workbench/test/common/notifications.test.ts", "./vs/workbench/test/electron-browser/api/extHostTypes.test.ts", - "./vs/workbench/test/electron-browser/api/mock.ts" + "./vs/workbench/test/electron-browser/api/mainThreadCommands.test.ts", + "./vs/workbench/test/electron-browser/api/mainThreadDiagnostics.test.ts", + "./vs/workbench/test/electron-browser/api/mock.ts", + "./vs/workbench/test/electron-browser/api/testRPCProtocol.ts" ], "exclude": [ "./typings/require-monaco.d.ts" diff --git a/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts b/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts index 0d91a9b058a..81929b60a66 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadConfiguration.ts @@ -56,12 +56,12 @@ export class MainThreadConfiguration implements MainThreadConfigurationShape { return this.writeConfiguration(target, key, undefined, resource); } - private writeConfiguration(target: ConfigurationTarget, key: string, value: any, resource: URI): Promise { + private writeConfiguration(target: ConfigurationTarget, key: string, value: any, resource: URI | null): Promise { target = target !== null && target !== undefined ? target : this.deriveConfigurationTarget(key, resource); return this.configurationService.updateValue(key, value, { resource }, target, true); } - private deriveConfigurationTarget(key: string, resource: URI): ConfigurationTarget { + private deriveConfigurationTarget(key: string, resource: URI | null): ConfigurationTarget { if (resource && this._workspaceContextService.getWorkbenchState() === WorkbenchState.WORKSPACE) { const configurationProperties = Registry.as(ConfigurationExtensions.Configuration).getConfigurationProperties(); if (configurationProperties[key] && configurationProperties[key].scope === ConfigurationScope.RESOURCE) { diff --git a/src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts b/src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts index ff13bad10d1..c04448ef31e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDiagnostics.ts @@ -22,7 +22,7 @@ export class MainThreadDiagnostics implements MainThreadDiagnosticsShape { } dispose(): void { - this._activeOwners.forEach(owner => this._markerService.changeAll(owner, undefined)); + this._activeOwners.forEach(owner => this._markerService.changeAll(owner, [])); } $changeMany(owner: string, entries: [UriComponents, IMarkerData[]][]): void { @@ -43,7 +43,7 @@ export class MainThreadDiagnostics implements MainThreadDiagnosticsShape { } $clear(owner: string): void { - this._markerService.changeAll(owner, undefined); + this._markerService.changeAll(owner, []); this._activeOwners.delete(owner); } } diff --git a/src/vs/workbench/api/electron-browser/mainThreadDialogs.ts b/src/vs/workbench/api/electron-browser/mainThreadDialogs.ts index 8ff02a01d93..a4d35e062f7 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDialogs.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDialogs.ts @@ -41,7 +41,7 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape { }; if (options.filters) { result.filters = []; - forEach(options.filters, entry => result.filters.push({ name: entry.key, extensions: entry.value })); + forEach(options.filters, entry => result.filters!.push({ name: entry.key, extensions: entry.value })); } return result; } @@ -53,7 +53,7 @@ export class MainThreadDialogs implements MainThreadDiaglogsShape { }; if (options.filters) { result.filters = []; - forEach(options.filters, entry => result.filters.push({ name: entry.key, extensions: entry.value })); + forEach(options.filters, entry => result.filters!.push({ name: entry.key, extensions: entry.value })); } return result; } diff --git a/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts b/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts index 08e4c2fd7a0..1e9d568863e 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadFileSystemEventService.ts @@ -52,7 +52,7 @@ export class MainThreadFileSystemEventService { // file operation events - (changes the editor makes) fileService.onAfterOperation(e => { if (e.operation === FileOperation.MOVE) { - proxy.$onFileRename(e.resource, e.target.resource!); + proxy.$onFileRename(e.resource, e.target!.resource); } }, undefined, this._listener); diff --git a/src/vs/workbench/api/electron-browser/mainThreadProgress.ts b/src/vs/workbench/api/electron-browser/mainThreadProgress.ts index 83ef37518c2..5521d8f3854 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadProgress.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadProgress.ts @@ -34,14 +34,16 @@ export class MainThreadProgress implements MainThreadProgressShape { } $progressReport(handle: number, message: IProgressStep): void { - if (this._progress.has(handle)) { - this._progress.get(handle).progress.report(message); + const entry = this._progress.get(handle); + if (entry) { + entry.progress.report(message); } } $progressEnd(handle: number): void { - if (this._progress.has(handle)) { - this._progress.get(handle).resolve(); + const entry = this._progress.get(handle); + if (entry) { + entry.resolve(); this._progress.delete(handle); } } diff --git a/src/vs/workbench/api/electron-browser/mainThreadStorage.ts b/src/vs/workbench/api/electron-browser/mainThreadStorage.ts index ac9c82bb075..96f63fbecba 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadStorage.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadStorage.ts @@ -39,7 +39,7 @@ export class MainThreadStorage implements MainThreadStorageShape { this._storageListener.dispose(); } - $getValue(shared: boolean, key: string): Promise { + $getValue(shared: boolean, key: string): Promise { if (shared) { this._sharedStorageKeysToWatch.set(key, true); } @@ -50,7 +50,7 @@ export class MainThreadStorage implements MainThreadStorageShape { } } - private _getValue(shared: boolean, key: string): T { + private _getValue(shared: boolean, key: string): T | undefined { let jsonValue = this._storageService.get(key, shared ? StorageScope.GLOBAL : StorageScope.WORKSPACE); if (!jsonValue) { return undefined; @@ -66,6 +66,6 @@ export class MainThreadStorage implements MainThreadStorageShape { } catch (err) { return Promise.reject(err); } - return undefined; + return Promise.resolve(undefined); } } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index 944adfb24f7..ce586acaa51 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -453,7 +453,7 @@ export interface MainThreadStatusBarShape extends IDisposable { } export interface MainThreadStorageShape extends IDisposable { - $getValue(shared: boolean, key: string): Promise; + $getValue(shared: boolean, key: string): Promise; $setValue(shared: boolean, key: string, value: object): Promise; } @@ -1074,7 +1074,7 @@ export interface ExtHostCommentsShape { } export interface ExtHostStorageShape { - $acceptValue(shared: boolean, key: string, value: object): void; + $acceptValue(shared: boolean, key: string, value: object | undefined): void; } // --- proxy identifiers diff --git a/src/vs/workbench/api/node/extHostOutputService.ts b/src/vs/workbench/api/node/extHostOutputService.ts index 9e64042fc1b..a72e053e94d 100644 --- a/src/vs/workbench/api/node/extHostOutputService.ts +++ b/src/vs/workbench/api/node/extHostOutputService.ts @@ -23,7 +23,7 @@ export abstract class AbstractExtHostOutputChannel extends Disposable implements protected readonly _onDidAppend: Emitter = this._register(new Emitter()); readonly onDidAppend: Event = this._onDidAppend.event; - constructor(name: string, log: boolean, file: URI, proxy: MainThreadOutputServiceShape) { + constructor(name: string, log: boolean, file: URI | undefined, proxy: MainThreadOutputServiceShape) { super(); this._name = name; @@ -58,7 +58,7 @@ export abstract class AbstractExtHostOutputChannel extends Disposable implements show(columnOrPreserveFocus?: vscode.ViewColumn | boolean, preserveFocus?: boolean): void { this.validate(); - this._id.then(id => this._proxy.$reveal(id, typeof columnOrPreserveFocus === 'boolean' ? columnOrPreserveFocus : preserveFocus)); + this._id.then(id => this._proxy.$reveal(id, !!(typeof columnOrPreserveFocus === 'boolean' ? columnOrPreserveFocus : preserveFocus))); } hide(): void { @@ -86,7 +86,7 @@ export abstract class AbstractExtHostOutputChannel extends Disposable implements export class ExtHostPushOutputChannel extends AbstractExtHostOutputChannel { constructor(name: string, proxy: MainThreadOutputServiceShape) { - super(name, false, null, proxy); + super(name, false, undefined, proxy); } append(value: string): void { From 05c58615e84ea2adc53d7fdf320fb8f02acc8673 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 6 Feb 2019 18:44:54 -0800 Subject: [PATCH 415/429] Change `ITheme.getColor(...)` to returned `Color | undefined` **Problem** `ITheme.getColor` is one of the major users of the type `null` in our codebase. However this function is used in many places that expected an `undefined` type instead. With the strict null work, this means that we have to write code such as `theme.getColor(...) || undefined` in some cases or have to work with `Color | null | undefined` types. **Fix** `undefined` is generally better supported by TypeScript and more natural in JavaScript. This change makes `ITheme.getColor` return `Color | undefined` instead of `Color | null`. --- .../editor/contrib/find/findOptionsWidget.ts | 4 +-- src/vs/editor/contrib/find/findWidget.ts | 28 +++++++++---------- .../editor/contrib/find/simpleFindWidget.ts | 26 ++++++++--------- .../contrib/gotoError/gotoErrorWidget.ts | 2 +- .../referenceSearch/referencesWidget.ts | 4 +-- .../browser/standaloneThemeServiceImpl.ts | 8 +++--- src/vs/platform/theme/common/colorRegistry.ts | 24 ++++++++-------- src/vs/platform/theme/common/styler.ts | 4 +-- src/vs/platform/theme/common/themeService.ts | 2 +- .../theme/test/common/testThemeService.ts | 4 +-- .../browser/parts/quickinput/quickInputBox.ts | 24 ++++++++-------- .../electron-browser/dirtydiffDecorator.ts | 6 ++-- .../themes/electron-browser/colorThemeData.ts | 6 ++-- 13 files changed, 71 insertions(+), 71 deletions(-) diff --git a/src/vs/editor/contrib/find/findOptionsWidget.ts b/src/vs/editor/contrib/find/findOptionsWidget.ts index 0637b0a9789..768bb6adaeb 100644 --- a/src/vs/editor/contrib/find/findOptionsWidget.ts +++ b/src/vs/editor/contrib/find/findOptionsWidget.ts @@ -46,7 +46,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { this._domNode.setAttribute('role', 'presentation'); this._domNode.setAttribute('aria-hidden', 'true'); - const inputActiveOptionBorderColor = themeService.getTheme().getColor(inputActiveOptionBorder) || undefined; + const inputActiveOptionBorderColor = themeService.getTheme().getColor(inputActiveOptionBorder); this.caseSensitive = this._register(new CaseSensitiveCheckbox({ appendTitle: this._keybindingLabelFor(FIND_IDS.ToggleCaseSensitiveCommand), @@ -179,7 +179,7 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget { } private _applyTheme(theme: ITheme) { - let inputStyles = { inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) || undefined }; + let inputStyles = { inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) }; this.caseSensitive.style(inputStyles); this.wholeWords.style(inputStyles); this.regex.style(inputStyles); diff --git a/src/vs/editor/contrib/find/findWidget.ts b/src/vs/editor/contrib/find/findWidget.ts index 70a97d62e8b..aab295b7f39 100644 --- a/src/vs/editor/contrib/find/findWidget.ts +++ b/src/vs/editor/contrib/find/findWidget.ts @@ -530,19 +530,19 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas private _applyTheme(theme: ITheme) { let inputStyles: IFindInputStyles = { - inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) || undefined, - inputBackground: theme.getColor(inputBackground) || undefined, - inputForeground: theme.getColor(inputForeground) || undefined, - inputBorder: theme.getColor(inputBorder) || undefined, - inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground) || undefined, - inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground) || undefined, - inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder) || undefined, - inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground) || undefined, - inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground) || undefined, - inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder) || undefined, - inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground) || undefined, - inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground) || undefined, - inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) || undefined, + inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder), + inputBackground: theme.getColor(inputBackground), + inputForeground: theme.getColor(inputForeground), + inputBorder: theme.getColor(inputBorder), + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), + inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground), + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), + inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground), + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), + inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground), + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder), }; this._findInput.style(inputStyles); this._replaceInputBox.style(inputStyles); @@ -1130,7 +1130,7 @@ export class SimpleButton extends Widget { // theming registerThemingParticipant((theme, collector) => { - const addBackgroundColorRule = (selector: string, color: Color | null): void => { + const addBackgroundColorRule = (selector: string, color: Color | undefined): void => { if (color) { collector.addRule(`.monaco-editor ${selector} { background-color: ${color}; }`); } diff --git a/src/vs/editor/contrib/find/simpleFindWidget.ts b/src/vs/editor/contrib/find/simpleFindWidget.ts index 28b0b5809ec..2c014684065 100644 --- a/src/vs/editor/contrib/find/simpleFindWidget.ts +++ b/src/vs/editor/contrib/find/simpleFindWidget.ts @@ -160,19 +160,19 @@ export abstract class SimpleFindWidget extends Widget { public updateTheme(theme: ITheme): void { const inputStyles: IFindInputStyles = { - inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder) || undefined, - inputBackground: theme.getColor(inputBackground) || undefined, - inputForeground: theme.getColor(inputForeground) || undefined, - inputBorder: theme.getColor(inputBorder) || undefined, - inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground) || undefined, - inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground) || undefined, - inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder) || undefined, - inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground) || undefined, - inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground) || undefined, - inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder) || undefined, - inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground) || undefined, - inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground) || undefined, - inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) || undefined + inputActiveOptionBorder: theme.getColor(inputActiveOptionBorder), + inputBackground: theme.getColor(inputBackground), + inputForeground: theme.getColor(inputForeground), + inputBorder: theme.getColor(inputBorder), + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), + inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground), + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), + inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground), + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), + inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground), + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) }; this._findInput.style(inputStyles); } diff --git a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts index 75f698e2bf9..22e8918aa23 100644 --- a/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts +++ b/src/vs/editor/contrib/gotoError/gotoErrorWidget.ts @@ -185,7 +185,7 @@ export class MarkerNavigationWidget extends ZoneWidget { } private _applyTheme(theme: ITheme) { - this._backgroundColor = theme.getColor(editorMarkerNavigationBackground) || undefined; + this._backgroundColor = theme.getColor(editorMarkerNavigationBackground); let colorId = editorMarkerNavigationError; if (this._severity === MarkerSeverity.Warning) { colorId = editorMarkerNavigationWarning; diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index cab5f97cdb0..60500684060 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -279,8 +279,8 @@ export class ReferenceWidget extends PeekViewWidget { arrowColor: borderColor, frameColor: borderColor, headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent, - primaryHeadingColor: theme.getColor(peekViewTitleForeground) || undefined, - secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) || undefined + primaryHeadingColor: theme.getColor(peekViewTitleForeground), + secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) }); } diff --git a/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts b/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts index d46974b5dd3..7efa2c38ba7 100644 --- a/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts +++ b/src/vs/editor/standalone/browser/standaloneThemeServiceImpl.ts @@ -28,7 +28,7 @@ class StandaloneTheme implements IStandaloneTheme { private themeData: IStandaloneThemeData; private colors: { [colorId: string]: Color } | null; - private defaultColors: { [colorId: string]: Color | null; }; + private defaultColors: { [colorId: string]: Color | undefined; }; private _tokenTheme: TokenTheme | null; constructor(name: string, standaloneThemeData: IStandaloneThemeData) { @@ -77,7 +77,7 @@ class StandaloneTheme implements IStandaloneTheme { return this.colors; } - public getColor(colorId: ColorIdentifier, useDefault?: boolean): Color | null { + public getColor(colorId: ColorIdentifier, useDefault?: boolean): Color | undefined { const color = this.getColors()[colorId]; if (color) { return color; @@ -85,10 +85,10 @@ class StandaloneTheme implements IStandaloneTheme { if (useDefault !== false) { return this.getDefault(colorId); } - return null; + return undefined; } - private getDefault(colorId: ColorIdentifier): Color | null { + private getDefault(colorId: ColorIdentifier): Color | undefined { let color = this.defaultColors[colorId]; if (color) { return color; diff --git a/src/vs/platform/theme/common/colorRegistry.ts b/src/vs/platform/theme/common/colorRegistry.ts index 9c89a6fdb4f..9c26136e804 100644 --- a/src/vs/platform/theme/common/colorRegistry.ts +++ b/src/vs/platform/theme/common/colorRegistry.ts @@ -27,7 +27,7 @@ export interface ColorContribution { export interface ColorFunction { - (theme: ITheme): Color | null; + (theme: ITheme): Color | undefined; } export interface ColorDefaults { @@ -71,7 +71,7 @@ export interface IColorRegistry { /** * Gets the default color of the given id */ - resolveDefaultColor(id: ColorIdentifier, theme: ITheme): Color | null; + resolveDefaultColor(id: ColorIdentifier, theme: ITheme): Color | undefined; /** * JSON schema for an object to assign color values to one of the color contributions. @@ -131,13 +131,13 @@ class ColorRegistry implements IColorRegistry { return Object.keys(this.colorsById).map(id => this.colorsById[id]); } - public resolveDefaultColor(id: ColorIdentifier, theme: ITheme): Color | null { + public resolveDefaultColor(id: ColorIdentifier, theme: ITheme): Color | undefined { const colorDesc = this.colorsById[id]; if (colorDesc && colorDesc.defaults) { const colorValue = colorDesc.defaults[theme.type]; return resolveColorValue(colorValue, theme); } - return null; + return undefined; } public getColorSchema(): IJSONSchema { @@ -385,7 +385,7 @@ export function darken(colorValue: ColorValue, factor: number): ColorFunction { if (color) { return color.darken(factor); } - return null; + return undefined; }; } @@ -395,7 +395,7 @@ export function lighten(colorValue: ColorValue, factor: number): ColorFunction { if (color) { return color.lighten(factor); } - return null; + return undefined; }; } @@ -405,7 +405,7 @@ export function transparent(colorValue: ColorValue, factor: number): ColorFuncti if (color) { return color.transparent(factor); } - return null; + return undefined; }; } @@ -417,7 +417,7 @@ export function oneOf(...colorValues: ColorValue[]): ColorFunction { return color; } } - return null; + return undefined; }; } @@ -434,7 +434,7 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue, } return from.transparent(factor * transparency); } - return null; + return undefined; }; } @@ -443,9 +443,9 @@ function lessProminent(colorValue: ColorValue, backgroundColorValue: ColorValue, /** * @param colorValue Resolve a color value in the context of a theme */ -function resolveColorValue(colorValue: ColorValue | null, theme: ITheme): Color | null { +function resolveColorValue(colorValue: ColorValue | null, theme: ITheme): Color | undefined { if (colorValue === null) { - return null; + return undefined; } else if (typeof colorValue === 'string') { if (colorValue[0] === '#') { return Color.fromHex(colorValue); @@ -456,7 +456,7 @@ function resolveColorValue(colorValue: ColorValue | null, theme: ITheme): Color } else if (typeof colorValue === 'function') { return colorValue(theme); } - return null; + return undefined; } export const workbenchColorsSchemaId = 'vscode://schemas/workbench-colors'; diff --git a/src/vs/platform/theme/common/styler.ts b/src/vs/platform/theme/common/styler.ts index eac33a668a9..f8377047e8e 100644 --- a/src/vs/platform/theme/common/styler.ts +++ b/src/vs/platform/theme/common/styler.ts @@ -9,7 +9,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { Color } from 'vs/base/common/color'; import { mixin } from 'vs/base/common/objects'; -export type styleFn = (colors: { [name: string]: Color | null }) => void; +export type styleFn = (colors: { [name: string]: Color | undefined }) => void; export interface IStyleOverrides { [color: string]: ColorIdentifier | undefined; @@ -24,7 +24,7 @@ export interface IColorMapping { } export interface IComputedStyles { - [color: string]: Color | null; + [color: string]: Color | undefined; } export function computeStyles(theme: ITheme, styleMap: IColorMapping): IComputedStyles { diff --git a/src/vs/platform/theme/common/themeService.ts b/src/vs/platform/theme/common/themeService.ts index 21ea865016c..9b6ea499582 100644 --- a/src/vs/platform/theme/common/themeService.ts +++ b/src/vs/platform/theme/common/themeService.ts @@ -52,7 +52,7 @@ export interface ITheme { * @param color the id of the color * @param useDefault specifies if the default color should be used. If not set, the default is used. */ - getColor(color: ColorIdentifier, useDefault?: boolean): Color | null; + getColor(color: ColorIdentifier, useDefault?: boolean): Color | undefined; /** * Returns whether the theme defines a value for the color. If not, that means the diff --git a/src/vs/platform/theme/test/common/testThemeService.ts b/src/vs/platform/theme/test/common/testThemeService.ts index 08207173349..e29bfc636f5 100644 --- a/src/vs/platform/theme/test/common/testThemeService.ts +++ b/src/vs/platform/theme/test/common/testThemeService.ts @@ -12,12 +12,12 @@ export class TestTheme implements ITheme { constructor(private colors: { [id: string]: string; } = {}, public type = DARK) { } - getColor(color: string, useDefault?: boolean): Color | null { + getColor(color: string, useDefault?: boolean): Color | undefined { let value = this.colors[color]; if (value) { return Color.fromHex(value); } - return null; + return undefined; } defines(color: string): boolean { diff --git a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts index 0bc7afbd713..08ede924c14 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInputBox.ts @@ -100,18 +100,18 @@ export class QuickInputBox { style(theme: ITheme) { this.inputBox.style({ - inputForeground: theme.getColor(inputForeground) || undefined, - inputBackground: theme.getColor(inputBackground) || undefined, - inputBorder: theme.getColor(inputBorder) || undefined, - inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground) || undefined, - inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground) || undefined, - inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder) || undefined, - inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground) || undefined, - inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground) || undefined, - inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder) || undefined, - inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground) || undefined, - inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground) || undefined, - inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder) || undefined, + inputForeground: theme.getColor(inputForeground), + inputBackground: theme.getColor(inputBackground), + inputBorder: theme.getColor(inputBorder), + inputValidationInfoBackground: theme.getColor(inputValidationInfoBackground), + inputValidationInfoForeground: theme.getColor(inputValidationInfoForeground), + inputValidationInfoBorder: theme.getColor(inputValidationInfoBorder), + inputValidationWarningBackground: theme.getColor(inputValidationWarningBackground), + inputValidationWarningForeground: theme.getColor(inputValidationWarningForeground), + inputValidationWarningBorder: theme.getColor(inputValidationWarningBorder), + inputValidationErrorBackground: theme.getColor(inputValidationErrorBackground), + inputValidationErrorForeground: theme.getColor(inputValidationErrorForeground), + inputValidationErrorBorder: theme.getColor(inputValidationErrorBorder), }); } diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts index 7801422a7da..c377a045578 100644 --- a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts @@ -156,7 +156,7 @@ function getChangeType(change: IChange): ChangeType { } } -function getChangeTypeColor(theme: ITheme, changeType: ChangeType): Color | null { +function getChangeTypeColor(theme: ITheme, changeType: ChangeType): Color | undefined { switch (changeType) { case ChangeType.Modify: return theme.getColor(editorGutterModifiedBackground); case ChangeType.Add: return theme.getColor(editorGutterAddedBackground); @@ -365,8 +365,8 @@ class DirtyDiffWidget extends PeekViewWidget { arrowColor: borderColor, frameColor: borderColor, headerBackgroundColor: theme.getColor(peekViewTitleBackground) || Color.transparent, - primaryHeadingColor: theme.getColor(peekViewTitleForeground) || undefined, - secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) || undefined + primaryHeadingColor: theme.getColor(peekViewTitleForeground), + secondaryHeadingColor: theme.getColor(peekViewTitleInfoForeground) }); } diff --git a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts index 1af44a2d51d..3ff37d4ac5a 100644 --- a/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts +++ b/src/vs/workbench/services/themes/electron-browser/colorThemeData.ts @@ -57,8 +57,8 @@ export class ColorThemeData implements IColorTheme { private colorMap: IColorMap = {}; private customColorMap: IColorMap = {}; - public getColor(colorId: ColorIdentifier, useDefault?: boolean): Color | null { - let color: Color | null = this.customColorMap[colorId]; + public getColor(colorId: ColorIdentifier, useDefault?: boolean): Color | undefined { + let color: Color | undefined = this.customColorMap[colorId]; if (color) { return color; } @@ -69,7 +69,7 @@ export class ColorThemeData implements IColorTheme { return color; } - public getDefault(colorId: ColorIdentifier): Color | null { + public getDefault(colorId: ColorIdentifier): Color | undefined { return colorRegistry.resolveDefaultColor(colorId, this); } From e2d1fd06d10ba7970b20d190b16e07404495988b Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 7 Feb 2019 08:49:36 +0100 Subject: [PATCH 416/429] debt - update extensions node dependency to 10.x --- extensions/configuration-editing/package.json | 2 +- extensions/configuration-editing/yarn.lock | 8 ++++---- extensions/css-language-features/package.json | 2 +- extensions/css-language-features/server/package.json | 2 +- extensions/css-language-features/server/yarn.lock | 8 ++++---- extensions/css-language-features/yarn.lock | 8 ++++---- extensions/extension-editing/package.json | 2 +- extensions/extension-editing/yarn.lock | 10 +++++----- extensions/git/package.json | 2 +- extensions/git/src/askpass.ts | 2 +- extensions/git/yarn.lock | 8 ++++---- extensions/grunt/package.json | 2 +- extensions/grunt/yarn.lock | 8 ++++---- extensions/gulp/package.json | 2 +- extensions/gulp/yarn.lock | 8 ++++---- extensions/html-language-features/package.json | 2 +- extensions/html-language-features/server/package.json | 2 +- extensions/html-language-features/server/yarn.lock | 8 ++++---- extensions/html-language-features/yarn.lock | 8 ++++---- extensions/jake/package.json | 2 +- extensions/jake/yarn.lock | 8 ++++---- extensions/json-language-features/package.json | 2 +- extensions/json-language-features/server/package.json | 2 +- extensions/json-language-features/server/yarn.lock | 8 ++++---- extensions/json-language-features/yarn.lock | 8 ++++---- extensions/markdown-language-features/package.json | 2 +- extensions/markdown-language-features/yarn.lock | 8 ++++---- extensions/npm/package.json | 2 +- extensions/npm/yarn.lock | 8 ++++---- extensions/php-language-features/package.json | 2 +- extensions/php-language-features/yarn.lock | 8 ++++---- extensions/vscode-api-tests/package.json | 2 +- extensions/vscode-api-tests/yarn.lock | 8 ++++---- extensions/vscode-colorize-tests/package.json | 2 +- extensions/vscode-colorize-tests/yarn.lock | 8 ++++---- 35 files changed, 87 insertions(+), 87 deletions(-) diff --git a/extensions/configuration-editing/package.json b/extensions/configuration-editing/package.json index 46f4eba3a95..9a1a95f5fb0 100644 --- a/extensions/configuration-editing/package.json +++ b/extensions/configuration-editing/package.json @@ -96,6 +96,6 @@ ] }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" } } diff --git a/extensions/configuration-editing/yarn.lock b/extensions/configuration-editing/yarn.lock index 752f2a3a6f9..49c47166066 100644 --- a/extensions/configuration-editing/yarn.lock +++ b/extensions/configuration-editing/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== jsonc-parser@2.0.2: version "2.0.2" diff --git a/extensions/css-language-features/package.json b/extensions/css-language-features/package.json index 79b32dd352b..99b022469d6 100644 --- a/extensions/css-language-features/package.json +++ b/extensions/css-language-features/package.json @@ -730,7 +730,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "mocha": "^5.2.0" } } diff --git a/extensions/css-language-features/server/package.json b/extensions/css-language-features/server/package.json index 6666da57282..9bc32c0a788 100644 --- a/extensions/css-language-features/server/package.json +++ b/extensions/css-language-features/server/package.json @@ -14,7 +14,7 @@ }, "devDependencies": { "@types/mocha": "2.2.33", - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "glob": "^7.1.2", "mocha": "^5.2.0", "mocha-junit-reporter": "^1.17.0", diff --git a/extensions/css-language-features/server/yarn.lock b/extensions/css-language-features/server/yarn.lock index 3e3e40f4a1d..a2fa388731d 100644 --- a/extensions/css-language-features/server/yarn.lock +++ b/extensions/css-language-features/server/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def" integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8= -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== ansi-regex@^3.0.0: version "3.0.0" diff --git a/extensions/css-language-features/yarn.lock b/extensions/css-language-features/yarn.lock index d626f86f433..6314214090a 100644 --- a/extensions/css-language-features/yarn.lock +++ b/extensions/css-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== balanced-match@^1.0.0: version "1.0.0" diff --git a/extensions/extension-editing/package.json b/extensions/extension-editing/package.json index 8ceab79d04e..52159b965bb 100644 --- a/extensions/extension-editing/package.json +++ b/extensions/extension-editing/package.json @@ -53,6 +53,6 @@ }, "devDependencies": { "@types/markdown-it": "0.0.2", - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" } } diff --git a/extensions/extension-editing/yarn.lock b/extensions/extension-editing/yarn.lock index d82f7c212a0..720c84f0656 100644 --- a/extensions/extension-editing/yarn.lock +++ b/extensions/extension-editing/yarn.lock @@ -7,16 +7,16 @@ resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660" integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA= +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== + "@types/node@^6.0.46": version "6.0.78" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470" integrity sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg== -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== - argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" diff --git a/extensions/git/package.json b/extensions/git/package.json index fdc08df06a8..435a8053c7b 100644 --- a/extensions/git/package.json +++ b/extensions/git/package.json @@ -1425,7 +1425,7 @@ "@types/byline": "4.2.31", "@types/file-type": "^5.2.1", "@types/mocha": "2.2.43", - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "@types/which": "^1.0.28", "mocha": "^3.2.0" } diff --git a/extensions/git/src/askpass.ts b/extensions/git/src/askpass.ts index b0dc28f8dd6..03000c7290d 100644 --- a/extensions/git/src/askpass.ts +++ b/extensions/git/src/askpass.ts @@ -65,7 +65,7 @@ export class Askpass implements Disposable { return ipcHandlePath; } - private onRequest(req: http.ServerRequest, res: http.ServerResponse): void { + private onRequest(req: http.IncomingMessage, res: http.ServerResponse): void { const chunks: string[] = []; req.setEncoding('utf8'); req.on('data', (d: string) => chunks.push(d)); diff --git a/extensions/git/yarn.lock b/extensions/git/yarn.lock index 1d859c5e73b..f13ef93c34f 100644 --- a/extensions/git/yarn.lock +++ b/extensions/git/yarn.lock @@ -26,10 +26,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb" integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ== -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== "@types/which@^1.0.28": version "1.0.28" diff --git a/extensions/grunt/package.json b/extensions/grunt/package.json index dc2520b4982..74fa452028a 100644 --- a/extensions/grunt/package.json +++ b/extensions/grunt/package.json @@ -19,7 +19,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/grunt/yarn.lock b/extensions/grunt/yarn.lock index 5e39a356be6..1bcd757b8a1 100644 --- a/extensions/grunt/yarn.lock +++ b/extensions/grunt/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/gulp/package.json b/extensions/gulp/package.json index 0c78e7fada0..a9139780f7a 100644 --- a/extensions/gulp/package.json +++ b/extensions/gulp/package.json @@ -19,7 +19,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/gulp/yarn.lock b/extensions/gulp/yarn.lock index 5e39a356be6..1bcd757b8a1 100644 --- a/extensions/gulp/yarn.lock +++ b/extensions/gulp/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/html-language-features/package.json b/extensions/html-language-features/package.json index b43ea73a1b0..29be30d1cea 100644 --- a/extensions/html-language-features/package.json +++ b/extensions/html-language-features/package.json @@ -181,6 +181,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" } } diff --git a/extensions/html-language-features/server/package.json b/extensions/html-language-features/server/package.json index ce5845b7345..4a1951e41e7 100644 --- a/extensions/html-language-features/server/package.json +++ b/extensions/html-language-features/server/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@types/mocha": "2.2.33", - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "glob": "^7.1.2", "mocha": "^5.2.0", "mocha-junit-reporter": "^1.17.0", diff --git a/extensions/html-language-features/server/yarn.lock b/extensions/html-language-features/server/yarn.lock index 056fdd468ad..e70561f1a73 100644 --- a/extensions/html-language-features/server/yarn.lock +++ b/extensions/html-language-features/server/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def" integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8= -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== ansi-regex@^3.0.0: version "3.0.0" diff --git a/extensions/html-language-features/yarn.lock b/extensions/html-language-features/yarn.lock index ee9e450ed7c..2737f409efa 100644 --- a/extensions/html-language-features/yarn.lock +++ b/extensions/html-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== applicationinsights@1.0.8: version "1.0.8" diff --git a/extensions/jake/package.json b/extensions/jake/package.json index f35e49fee26..30962bd7616 100644 --- a/extensions/jake/package.json +++ b/extensions/jake/package.json @@ -19,7 +19,7 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/jake/yarn.lock b/extensions/jake/yarn.lock index 5e39a356be6..1bcd757b8a1 100644 --- a/extensions/jake/yarn.lock +++ b/extensions/jake/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/json-language-features/package.json b/extensions/json-language-features/package.json index 6e982dac417..47d1f7bf32d 100644 --- a/extensions/json-language-features/package.json +++ b/extensions/json-language-features/package.json @@ -106,6 +106,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" } } \ No newline at end of file diff --git a/extensions/json-language-features/server/package.json b/extensions/json-language-features/server/package.json index 0868d9aa049..69c21ae84a9 100644 --- a/extensions/json-language-features/server/package.json +++ b/extensions/json-language-features/server/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/mocha": "2.2.33", - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" }, "scripts": { "prepublishOnly": "npm run clean && npm run test", diff --git a/extensions/json-language-features/server/yarn.lock b/extensions/json-language-features/server/yarn.lock index 1c933ebfb3c..2e1f8085f6d 100644 --- a/extensions/json-language-features/server/yarn.lock +++ b/extensions/json-language-features/server/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def" integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8= -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== agent-base@4, agent-base@^4.1.0: version "4.1.2" diff --git a/extensions/json-language-features/yarn.lock b/extensions/json-language-features/yarn.lock index 019393942b3..e49fc01bd24 100644 --- a/extensions/json-language-features/yarn.lock +++ b/extensions/json-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== applicationinsights@1.0.8: version "1.0.8" diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index d5da4b5aef6..d1a1d30eab5 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -305,7 +305,7 @@ "@types/highlight.js": "9.12.3", "@types/lodash.throttle": "^4.1.3", "@types/markdown-it": "0.0.2", - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "lodash.throttle": "^4.1.1", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", diff --git a/extensions/markdown-language-features/yarn.lock b/extensions/markdown-language-features/yarn.lock index e63c5f4da91..3848f47f6f2 100644 --- a/extensions/markdown-language-features/yarn.lock +++ b/extensions/markdown-language-features/yarn.lock @@ -29,10 +29,10 @@ resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660" integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA= -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== abbrev@1: version "1.1.1" diff --git a/extensions/npm/package.json b/extensions/npm/package.json index 6c8578ad784..43dc6a21557 100644 --- a/extensions/npm/package.json +++ b/extensions/npm/package.json @@ -24,7 +24,7 @@ }, "devDependencies": { "@types/minimatch": "^3.0.3", - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" }, "main": "./out/main", "activationEvents": [ diff --git a/extensions/npm/yarn.lock b/extensions/npm/yarn.lock index 3851d9a4b67..ca339ed8150 100644 --- a/extensions/npm/yarn.lock +++ b/extensions/npm/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== agent-base@4, agent-base@^4.1.0: version "4.2.0" diff --git a/extensions/php-language-features/package.json b/extensions/php-language-features/package.json index fb6beb6deb5..28ccad47def 100644 --- a/extensions/php-language-features/package.json +++ b/extensions/php-language-features/package.json @@ -80,6 +80,6 @@ "vscode-nls": "^4.0.0" }, "devDependencies": { - "@types/node": "^8.10.25" + "@types/node": "^10.12.21" } } diff --git a/extensions/php-language-features/yarn.lock b/extensions/php-language-features/yarn.lock index 5e39a356be6..1bcd757b8a1 100644 --- a/extensions/php-language-features/yarn.lock +++ b/extensions/php-language-features/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== vscode-nls@^4.0.0: version "4.0.0" diff --git a/extensions/vscode-api-tests/package.json b/extensions/vscode-api-tests/package.json index 4ee121e1b1b..e1716b8555a 100644 --- a/extensions/vscode-api-tests/package.json +++ b/extensions/vscode-api-tests/package.json @@ -49,7 +49,7 @@ }, "devDependencies": { "@types/mocha": "2.2.43", - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", "typescript": "^1.6.2", diff --git a/extensions/vscode-api-tests/yarn.lock b/extensions/vscode-api-tests/yarn.lock index 74a177b2aea..c7841be1397 100644 --- a/extensions/vscode-api-tests/yarn.lock +++ b/extensions/vscode-api-tests/yarn.lock @@ -7,10 +7,10 @@ resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.43.tgz#03c54589c43ad048cbcbfd63999b55d0424eec27" integrity sha512-xNlAmH+lRJdUMXClMTI9Y0pRqIojdxfm7DHsIxoB2iTzu3fnPmSMEN8SsSx0cdwV36d02PWCWaDUoZPDSln+xw== -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== ajv@^5.1.0: version "5.3.0" diff --git a/extensions/vscode-colorize-tests/package.json b/extensions/vscode-colorize-tests/package.json index 9b43cfa2a6c..763513a590a 100644 --- a/extensions/vscode-colorize-tests/package.json +++ b/extensions/vscode-colorize-tests/package.json @@ -12,7 +12,7 @@ "postinstall": "node ./node_modules/vscode/bin/install" }, "devDependencies": { - "@types/node": "^8.10.25", + "@types/node": "^10.12.21", "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", "vscode": "1.1.5" diff --git a/extensions/vscode-colorize-tests/yarn.lock b/extensions/vscode-colorize-tests/yarn.lock index b17b8b1954b..46684d06b5e 100644 --- a/extensions/vscode-colorize-tests/yarn.lock +++ b/extensions/vscode-colorize-tests/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@types/node@^8.10.25": - version "8.10.25" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e" - integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA== +"@types/node@^10.12.21": + version "10.12.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e" + integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ== ajv@^5.1.0: version "5.3.0" From bfa8c3d00bc1027c306434cceb0cc2e5291df196 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 7 Feb 2019 09:13:07 +0100 Subject: [PATCH 417/429] debt - properly disable-color-correct-rendering --- src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.js b/src/main.js index 5d6dcfca955..8a1975d75fc 100644 --- a/src/main.js +++ b/src/main.js @@ -151,7 +151,7 @@ function onReady() { function configureCommandlineSwitches(cliArgs, nodeCachedDataDir) { // Force pre-Chrome-60 color profile handling (for https://github.com/Microsoft/vscode/issues/51791) - app.commandLine.appendSwitch('disable-features', 'ColorCorrectRendering'); + app.commandLine.appendSwitch('disable-color-correct-rendering'); // Support JS Flags const jsFlags = resolveJSFlags(cliArgs, nodeCachedDataDir.jsFlags()); From f15a6faaca6c3c927e6dccfe9f829018381de838 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Thu, 7 Feb 2019 09:53:52 +0100 Subject: [PATCH 418/429] Try to fix Markdown --- extensions/markdown-language-features/package.json | 2 +- extensions/markdown-language-features/yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/markdown-language-features/package.json b/extensions/markdown-language-features/package.json index d1a1d30eab5..9dd958c29c9 100644 --- a/extensions/markdown-language-features/package.json +++ b/extensions/markdown-language-features/package.json @@ -310,7 +310,7 @@ "mocha-junit-reporter": "^1.17.0", "mocha-multi-reporters": "^1.1.7", "ts-loader": "^4.0.1", - "typescript": "^2.7.2", + "typescript": "^3.3.1", "vscode": "^1.1.10", "webpack": "^4.1.0", "webpack-cli": "^2.0.10" diff --git a/extensions/markdown-language-features/yarn.lock b/extensions/markdown-language-features/yarn.lock index 3848f47f6f2..e85ae950b3a 100644 --- a/extensions/markdown-language-features/yarn.lock +++ b/extensions/markdown-language-features/yarn.lock @@ -6010,10 +6010,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^2.7.2: - version "2.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" - integrity sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw== +typescript@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.1.tgz#6de14e1db4b8a006ac535e482c8ba018c55f750b" + integrity sha512-cTmIDFW7O0IHbn1DPYjkiebHxwtCMU+eTy30ZtJNBPF9j2O1ITu5XH2YnBeVRKWHqF+3JQwWJv0Q0aUgX8W7IA== uc.micro@^1.0.1: version "1.0.3" From 6f76a3b0fa06b6ab3bfb3cf9f0728a9d81a5c6f3 Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Thu, 7 Feb 2019 10:09:01 +0100 Subject: [PATCH 419/429] Strict null check 'vs/workbench/browser/parts/quickinput/*' (fixes #68000) --- src/tsconfig.strictNullChecks.json | 1 + .../contrib/documentSymbols/outlineModel.ts | 2 +- .../platform/quickinput/common/quickInput.ts | 8 ++-- .../browser/parts/quickinput/quickInput.ts | 46 +++++++++---------- 4 files changed, 30 insertions(+), 27 deletions(-) diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index c2fef8f88e1..25ff85bbc24 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -19,6 +19,7 @@ "./vs/editor/contrib/suggest/**/*.ts", "./vs/editor/test/**/*.ts", "./vs/workbench/browser/parts/notifications/**/*", + "./vs/workbench/browser/parts/quickinput/**/*", "./vs/workbench/electron-browser/actions/**/*", "./vs/workbench/parts/emmet/**/*", "./vs/workbench/parts/execution/**/*", diff --git a/src/vs/editor/contrib/documentSymbols/outlineModel.ts b/src/vs/editor/contrib/documentSymbols/outlineModel.ts index cf559331c52..76219b58881 100644 --- a/src/vs/editor/contrib/documentSymbols/outlineModel.ts +++ b/src/vs/editor/contrib/documentSymbols/outlineModel.ts @@ -268,7 +268,7 @@ export class OutlineModel extends TreeElement { if (data!.model) { // resolved -> return data - return Promise.resolve(data.model); + return Promise.resolve(data.model!); } // increase usage counter diff --git a/src/vs/platform/quickinput/common/quickInput.ts b/src/vs/platform/quickinput/common/quickInput.ts index 7dde852bb12..4f6d33febf1 100644 --- a/src/vs/platform/quickinput/common/quickInput.ts +++ b/src/vs/platform/quickinput/common/quickInput.ts @@ -150,7 +150,7 @@ export interface IQuickPick extends IQuickInput { readonly onDidChangeValue: Event; - readonly onDidAccept: Event; + readonly onDidAccept: Event; buttons: ReadonlyArray; @@ -183,7 +183,7 @@ export interface IInputBox extends IQuickInput { value: string; - valueSelection: Readonly<[number, number]>; + valueSelection: Readonly<[number, number]> | undefined; placeholder: string | undefined; @@ -191,7 +191,7 @@ export interface IInputBox extends IQuickInput { readonly onDidChangeValue: Event; - readonly onDidAccept: Event; + readonly onDidAccept: Event; buttons: ReadonlyArray; @@ -203,7 +203,9 @@ export interface IInputBox extends IQuickInput { } export interface IQuickInputButton { + /** iconPath or iconClass required */ iconPath?: { dark: URI; light?: URI; }; + /** iconPath or iconClass required */ iconClass?: string; tooltip?: string; } diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index 1816f6118ff..eb3c79581a7 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -252,21 +252,21 @@ class QuickInput implements IQuickInput { this.ui.leftActionBar.clear(); const leftButtons = this.buttons.filter(button => button === backButton); this.ui.leftActionBar.push(leftButtons.map((button, index) => { - const action = new Action(`id-${index}`, '', button.iconClass || getIconClass(button.iconPath), true, () => { + const action = new Action(`id-${index}`, '', button.iconClass || getIconClass(button.iconPath!), true, () => { this.onDidTriggerButtonEmitter.fire(button); return Promise.resolve(null); }); - action.tooltip = button.tooltip; + action.tooltip = button.tooltip || ''; return action; }), { icon: true, label: false }); this.ui.rightActionBar.clear(); const rightButtons = this.buttons.filter(button => button !== backButton); this.ui.rightActionBar.push(rightButtons.map((button, index) => { - const action = new Action(`id-${index}`, '', button.iconClass || getIconClass(button.iconPath), true, () => { + const action = new Action(`id-${index}`, '', button.iconClass || getIconClass(button.iconPath!), true, () => { this.onDidTriggerButtonEmitter.fire(button); return Promise.resolve(null); }); - action.tooltip = button.tooltip; + action.tooltip = button.tooltip || ''; return action; }), { icon: true, label: false }); } @@ -311,7 +311,7 @@ class QuickPick extends QuickInput implements IQuickPi private _value = ''; private _placeholder; private onDidChangeValueEmitter = new Emitter(); - private onDidAcceptEmitter = new Emitter(); + private onDidAcceptEmitter = new Emitter(); private _items: Array = []; private itemsUpdated = false; private _canSelectMany = false; @@ -319,11 +319,11 @@ class QuickPick extends QuickInput implements IQuickPi private _matchOnDetail = false; private _activeItems: T[] = []; private activeItemsUpdated = false; - private activeItemsToConfirm: T[] = []; + private activeItemsToConfirm: T[] | null = []; private onDidChangeActiveEmitter = new Emitter(); private _selectedItems: T[] = []; private selectedItemsUpdated = false; - private selectedItemsToConfirm: T[] = []; + private selectedItemsToConfirm: T[] | null = []; private onDidChangeSelectionEmitter = new Emitter(); private onDidTriggerItemButtonEmitter = new Emitter>(); @@ -651,7 +651,7 @@ class InputBox extends QuickInput implements IInputBox { private noValidationMessage = InputBox.noPromptMessage; private _validationMessage: string; private onDidValueChangeEmitter = new Emitter(); - private onDidAcceptEmitter = new Emitter(); + private onDidAcceptEmitter = new Emitter(); constructor(ui: QuickInputUI) { super(ui); @@ -791,7 +791,7 @@ export class QuickInputService extends Component implements IQuickInputService { private onDidTriggerButtonEmitter = this._register(new Emitter()); private keyMods: Writeable = { ctrlCmd: false, alt: false }; - private controller: QuickInput; + private controller: QuickInput | null = null; constructor( @IEnvironmentService private readonly environmentService: IEnvironmentService, @@ -830,7 +830,7 @@ export class QuickInputService extends Component implements IQuickInputService { } private setContextKey(id?: string) { - let key: IContextKey; + let key: IContextKey | undefined; if (id) { key = this.contexts[id]; if (!key) { @@ -971,7 +971,7 @@ export class QuickInputService extends Component implements IQuickInputService { })); this._register(list.onDidChangeFocus(() => { if (this.comboboxAccessibility) { - this.ui.inputBox.setAttribute('aria-activedescendant', this.ui.list.getActiveDescendant()); + this.ui.inputBox.setAttribute('aria-activedescendant', this.ui.list.getActiveDescendant() || ''); } })); @@ -1060,7 +1060,7 @@ export class QuickInputService extends Component implements IQuickInputService { return; } const input = this.createQuickPick(); - let activeItem: T; + let activeItem: T | undefined; const disposables = [ input, input.onDidAccept(() => { @@ -1114,15 +1114,15 @@ export class QuickInputService extends Component implements IQuickInputService { resolve(undefined); }), ]; - input.canSelectMany = options.canPickMany; + input.canSelectMany = !!options.canPickMany; input.placeholder = options.placeHolder; - input.ignoreFocusOut = options.ignoreFocusLost; - input.matchOnDescription = options.matchOnDescription; - input.matchOnDetail = options.matchOnDetail; + input.ignoreFocusOut = !!options.ignoreFocusLost; + input.matchOnDescription = !!options.matchOnDescription; + input.matchOnDetail = !!options.matchOnDetail; input.quickNavigate = options.quickNavigate; input.contextKey = options.contextKey; input.busy = true; - Promise.all([picks, options.activeItem]) + Promise.all[], T | undefined>([picks, options.activeItem]) .then(([items, _activeItem]) => { activeItem = _activeItem; input.busy = false; @@ -1189,12 +1189,12 @@ export class QuickInputService extends Component implements IQuickInputService { resolve(undefined); }), ]; - input.value = options.value; + input.value = options.value || ''; input.valueSelection = options.valueSelection; input.prompt = options.prompt; input.placeholder = options.placeHolder; - input.password = options.password; - input.ignoreFocusOut = options.ignoreFocusLost; + input.password = !!options.password; + input.ignoreFocusOut = !!options.ignoreFocusLost; input.show(); }); } @@ -1259,7 +1259,7 @@ export class QuickInputService extends Component implements IQuickInputService { this.countContainer.style.display = visibilities.count ? '' : 'none'; this.okContainer.style.display = visibilities.ok ? '' : 'none'; this.ui.message.style.display = visibilities.message ? '' : 'none'; - this.ui.list.display(visibilities.list); + this.ui.list.display(!!visibilities.list); this.ui.container.classList[visibilities.checkAll ? 'add' : 'remove']('show-checkboxes'); this.updateLayout(); // TODO } @@ -1271,7 +1271,7 @@ export class QuickInputService extends Component implements IQuickInputService { this.ui.inputBox.setAttribute('role', 'combobox'); this.ui.inputBox.setAttribute('aria-haspopup', 'true'); this.ui.inputBox.setAttribute('aria-autocomplete', 'list'); - this.ui.inputBox.setAttribute('aria-activedescendant', this.ui.list.getActiveDescendant()); + this.ui.inputBox.setAttribute('aria-activedescendant', this.ui.list.getActiveDescendant() || ''); } else { this.ui.inputBox.removeAttribute('role'); this.ui.inputBox.removeAttribute('aria-haspopup'); @@ -1400,7 +1400,7 @@ export const QuickPickManyToggle: ICommandAndKeybindingRule = { id: 'workbench.action.quickPickManyToggle', weight: KeybindingWeight.WorkbenchContrib, when: inQuickOpenContext, - primary: undefined, + primary: 0, handler: accessor => { const quickInputService = accessor.get(IQuickInputService); quickInputService.toggle(); From 45c7f29565821668f4d010b25e3289953bd9ac71 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 7 Feb 2019 10:25:53 +0100 Subject: [PATCH 420/429] fixes #68050 --- src/vs/base/browser/ui/tree/abstractTree.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index ee09be38112..9f30d9f0ab4 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -815,12 +815,12 @@ class TreeNodeListMouseController extends MouseController< return super.onPointer(e); } - if (!this.tree.openOnSingleClick && e.browserEvent.detail !== 2) { + const onTwistie = hasClass(e.browserEvent.target as HTMLElement, 'monaco-tl-twistie'); + + if (!this.tree.openOnSingleClick && e.browserEvent.detail !== 2 && !onTwistie) { return super.onPointer(e); } - const onTwistie = hasClass(e.browserEvent.target as HTMLElement, 'monaco-tl-twistie'); - if (this.tree.expandOnlyOnTwistieClick && !onTwistie) { return super.onPointer(e); } From b5c90cab8e6bcbc49da7cbb2c3248e8bd88ea4e6 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 7 Feb 2019 11:12:27 +0100 Subject: [PATCH 421/429] debt - increase timeout for some storage tests --- src/vs/base/test/node/storage/storage.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/base/test/node/storage/storage.test.ts b/src/vs/base/test/node/storage/storage.test.ts index 215c2bb530a..44ba7049630 100644 --- a/src/vs/base/test/node/storage/storage.test.ts +++ b/src/vs/base/test/node/storage/storage.test.ts @@ -539,7 +539,9 @@ suite('SQLite Storage Library', () => { await del(storageDir, tmpdir()); }); - test('real world example', async () => { + test('real world example', async function () { + this.timeout(20000); + const storageDir = uniqueStorageDir(); await mkdirp(storageDir); @@ -628,7 +630,9 @@ suite('SQLite Storage Library', () => { await del(storageDir, tmpdir()); }); - test('very large item value', async () => { + test('very large item value', async function () { + this.timeout(20000); + const storageDir = uniqueStorageDir(); await mkdirp(storageDir); From 021e796ee69898f144592e49b852a295dd5beb8a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 7 Feb 2019 11:37:18 +0100 Subject: [PATCH 422/429] fixes #68028 --- src/vs/base/browser/ui/list/listView.ts | 2 +- .../parts/files/electron-browser/explorerService.ts | 9 +++++++-- .../parts/files/electron-browser/views/explorerViewer.ts | 6 +++++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/list/listView.ts b/src/vs/base/browser/ui/list/listView.ts index a70fe3c8c84..7cf3f8ec9b3 100644 --- a/src/vs/base/browser/ui/list/listView.ts +++ b/src/vs/base/browser/ui/list/listView.ts @@ -552,9 +552,9 @@ export class ListView implements ISpliceable, IDisposable { const uri = this.dnd.getDragURI(item.element); item.dragStartDisposable.dispose(); + item.row.domNode!.draggable = !!uri; if (uri) { - item.row.domNode!.draggable = true; const onDragStart = domEvent(item.row.domNode!, 'dragstart'); item.dragStartDisposable = onDragStart(event => this.onDragStart(item.element, uri, event)); } diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/parts/files/electron-browser/explorerService.ts index 7bcd9095155..036e6690269 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerService.ts @@ -108,8 +108,13 @@ export class ExplorerService implements IExplorerService { return this.model.findClosest(resource); } - setEditable(stat: ExplorerItem, data: IEditableData): void { - this.editableStats.set(stat, data); + setEditable(stat: ExplorerItem, data: IEditableData | null): void { + if (!data) { + this.editableStats.delete(stat); + } else { + this.editableStats.set(stat, data); + } + this._onDidChangeEditable.fire(stat); } diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index e66f74f034a..09a81cbd485 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -533,7 +533,11 @@ export class FileDragAndDrop implements ITreeDragAndDrop { return false; } - getDragURI(element: ExplorerItem): string { + getDragURI(element: ExplorerItem): string | null { + if (this.explorerService.isEditable(element)) { + return null; + } + return element.resource.toString(); } From 87c5072ab080ae5ad3b93afb1d52d8c52aae46f3 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 7 Feb 2019 11:46:07 +0100 Subject: [PATCH 423/429] debt - workbench/parts => workbench/contrib --- .../backup/common/backup.contribution.ts | 0 .../backup/common/backupModelTracker.ts | 0 .../backup/common/backupRestorer.ts | 0 .../cli/electron-browser/cli.contribution.ts | 0 .../codeEditor/browser/menuPreventer.ts | 0 .../codeEditor/browser/simpleEditorOptions.ts | 0 .../codeEditor/electron-browser/accessibility.css | 0 .../codeEditor/electron-browser/accessibility.ts | 0 .../electron-browser/codeEditor.contribution.ts | 0 .../electron-browser/inspectKeybindings.ts | 0 .../languageConfigurationExtensionPoint.ts | 0 .../electron-browser/largeFileOptimizations.ts | 0 .../electron-browser/media/WordWrap_16x.svg | 0 .../electron-browser/media/suggestEnabledInput.css | 0 .../electron-browser/selectionClipboard.ts | 0 .../electron-browser/simpleEditorOptions.ts | 0 .../electron-browser/sleepResumeRepaintMinimap.ts | 0 .../electron-browser/suggestEnabledInput.ts | 0 .../electron-browser/textMate/inspectTMScopes.css | 0 .../electron-browser/textMate/inspectTMScopes.ts | 0 .../codeEditor/electron-browser/toggleMinimap.ts | 0 .../electron-browser/toggleMultiCursorModifier.ts | 0 .../toggleRenderControlCharacter.ts | 0 .../electron-browser/toggleRenderWhitespace.ts | 0 .../codeEditor/electron-browser/toggleWordWrap.ts | 0 .../electron-browser/workbenchReferenceSearch.ts | 0 .../comments/common/commentModel.ts | 0 .../comments/electron-browser/commentGlyphWidget.ts | 0 .../comments/electron-browser/commentNode.ts | 0 .../comments/electron-browser/commentService.ts | 0 .../electron-browser/commentThreadWidget.ts | 0 .../electron-browser/comments.contribution.ts | 0 .../electron-browser/commentsEditorContribution.ts | 0 .../comments/electron-browser/commentsPanel.ts | 0 .../comments/electron-browser/commentsTreeViewer.ts | 0 .../comments/electron-browser/media/close.svg | 0 .../comments/electron-browser/media/comment.svg | 0 .../comments/electron-browser/media/panel.css | 0 .../comments/electron-browser/media/review.css | 0 .../electron-browser/simpleCommentEditor.ts | 0 .../debug/browser/baseDebugView.ts | 0 .../debug/browser/breakpointsView.ts | 0 .../debug/browser/debugANSIHandling.ts | 0 .../debug/browser/debugActionItems.ts | 0 .../debug/browser/debugActions.ts | 0 .../debug/browser/debugCommands.ts | 0 .../debug/browser/debugContentProvider.ts | 0 .../debug/browser/debugEditorActions.ts | 0 .../debug/browser/debugEditorModelManager.ts | 0 .../debug/browser/debugQuickOpen.ts | 0 .../{parts => contrib}/debug/browser/debugStatus.ts | 0 .../debug/browser/debugToolbar.ts | 0 .../debug/browser/debugViewlet.ts | 0 .../debug/browser/exceptionWidget.ts | 0 .../debug/browser/linkDetector.ts | 0 .../debug/browser/loadedScriptsView.ts | 0 .../debug/browser/media/add-focus.svg | 0 .../debug/browser/media/add-inverse.svg | 0 .../{parts => contrib}/debug/browser/media/add.svg | 0 .../media/breakpoint-conditional-disabled.svg | 0 .../media/breakpoint-conditional-unverified.svg | 0 .../debug/browser/media/breakpoint-conditional.svg | 0 .../debug/browser/media/breakpoint-disabled.svg | 0 .../browser/media/breakpoint-function-disabled.svg | 0 .../media/breakpoint-function-unverified.svg | 0 .../debug/browser/media/breakpoint-function.svg | 0 .../debug/browser/media/breakpoint-hint.svg | 0 .../debug/browser/media/breakpoint-log-disabled.svg | 0 .../browser/media/breakpoint-log-unverified.svg | 0 .../debug/browser/media/breakpoint-log.svg | 0 .../debug/browser/media/breakpoint-unsupported.svg | 0 .../debug/browser/media/breakpoint-unverified.svg | 0 .../debug/browser/media/breakpoint.svg | 0 .../debug/browser/media/breakpointWidget.css | 0 .../browser/media/breakpoints-activate-inverse.svg | 0 .../debug/browser/media/breakpoints-activate.svg | 0 .../debug/browser/media/clear-repl-inverse.svg | 0 .../debug/browser/media/clear-repl.svg | 0 .../debug/browser/media/configure-inverse.svg | 0 .../debug/browser/media/configure.svg | 0 .../debug/browser/media/continue-inverse.svg | 0 .../debug/browser/media/continue.svg | 0 .../debug/browser/media/current-and-breakpoint.svg | 0 .../debug/browser/media/current-arrow.svg | 0 .../debug/browser/media/debug-dark.svg | 0 .../debug/browser/media/debug.contribution.css | 0 .../debug/browser/media/debugHover.css | 0 .../debug/browser/media/debugToolbar.css | 0 .../debug/browser/media/debugViewlet.css | 0 .../debug/browser/media/disconnect-inverse.svg | 0 .../debug/browser/media/disconnect.svg | 0 .../{parts => contrib}/debug/browser/media/drag.svg | 0 .../debug/browser/media/exceptionWidget.css | 0 .../debug/browser/media/pause-inverse.svg | 0 .../debug/browser/media/pause.svg | 0 .../debug/browser/media/remove-all-inverse.svg | 0 .../debug/browser/media/remove-all.svg | 0 .../debug/browser/media/repl-inverse.svg | 0 .../{parts => contrib}/debug/browser/media/repl.css | 0 .../{parts => contrib}/debug/browser/media/repl.svg | 0 .../debug/browser/media/restart-inverse.svg | 0 .../debug/browser/media/restart.svg | 0 .../browser/media/stackframe-and-breakpoint.svg | 0 .../debug/browser/media/stackframe-arrow.svg | 0 .../debug/browser/media/start-inverse.svg | 0 .../debug/browser/media/start.svg | 0 .../debug/browser/media/step-into-inverse.svg | 0 .../debug/browser/media/step-into.svg | 0 .../debug/browser/media/step-out-inverse.svg | 0 .../debug/browser/media/step-out.svg | 0 .../debug/browser/media/step-over-inverse.svg | 0 .../debug/browser/media/step-over.svg | 0 .../debug/browser/media/stop-inverse.svg | 0 .../{parts => contrib}/debug/browser/media/stop.svg | 0 .../debug/browser/statusbarColorProvider.ts | 0 .../{parts => contrib}/debug/common/debug.ts | 0 .../{parts => contrib}/debug/common/debugModel.ts | 0 .../debug/common/debugProtocol.d.ts | 0 .../{parts => contrib}/debug/common/debugSchemas.ts | 0 .../{parts => contrib}/debug/common/debugSource.ts | 0 .../{parts => contrib}/debug/common/debugUtils.ts | 0 .../debug/common/debugViewModel.ts | 0 .../{parts => contrib}/debug/common/replModel.ts | 0 .../debug/electron-browser/breakpointWidget.ts | 0 .../debug/electron-browser/callStackView.ts | 0 .../debug/electron-browser/debug.contribution.ts | 0 .../electron-browser/debugConfigurationManager.ts | 0 .../electron-browser/debugEditorContribution.ts | 0 .../debug/electron-browser/debugHover.ts | 0 .../debug/electron-browser/debugService.ts | 0 .../debug/electron-browser/debugSession.ts | 0 .../debug/electron-browser/electronDebugActions.ts | 0 .../debug/electron-browser/media/continue-tb.png | Bin .../media/continue-without-debugging-tb.png | Bin .../debug/electron-browser/media/pause-tb.png | Bin .../debug/electron-browser/media/restart-tb.png | Bin .../debug/electron-browser/media/stepinto-tb.png | Bin .../debug/electron-browser/media/stepout-tb.png | Bin .../debug/electron-browser/media/stepover-tb.png | Bin .../debug/electron-browser/media/stop-tb.png | Bin .../debug/electron-browser/rawDebugSession.ts | 0 .../debug/electron-browser/repl.ts | 0 .../debug/electron-browser/terminalSupport.ts | 0 .../debug/electron-browser/variablesView.ts | 0 .../debug/electron-browser/watchExpressionsView.ts | 0 .../{parts => contrib}/debug/node/debugAdapter.ts | 0 .../{parts => contrib}/debug/node/debugger.ts | 0 .../{parts => contrib}/debug/node/telemetryApp.ts | 0 .../{parts => contrib}/debug/node/terminals.ts | 0 .../debug/test/browser/baseDebugView.test.ts | 0 .../debug/test/browser/debugANSIHandling.test.ts | 0 .../debug/test/browser/linkDetector.test.ts | 0 .../debug/test/common/debugSource.test.ts | 0 .../debug/test/common/debugUtils.test.ts | 0 .../debug/test/common/debugViewModel.test.ts | 0 .../debug/test/common/mockDebug.ts | 0 .../debug/test/electron-browser/debugModel.test.ts | 0 .../debug/test/node/debugger.test.ts | 0 .../emmet/browser/actions/showEmmetCommands.ts | 0 .../emmet/browser/emmet.browser.contribution.ts | 0 .../electron-browser/actions/expandAbbreviation.ts | 0 .../emmet/electron-browser/emmet.contribution.ts | 0 .../emmet/electron-browser/emmetActions.ts | 0 .../emmet/test/electron-browser/emmetAction.test.ts | 0 .../execution/common/execution.ts | 0 .../execution/electron-browser/TerminalHelper.scpt | Bin .../electron-browser/execution.contribution.ts | 0 .../execution/electron-browser/iTermHelper.scpt | Bin .../execution/electron-browser/terminal.ts | 0 .../execution/electron-browser/terminalService.ts | 0 .../test/electron-browser/terminalService.test.ts | 0 .../electron-browser/experimentalPrompt.ts | 0 .../electron-browser/experiments.contribution.ts | 0 .../experiments/node/experimentService.ts | 0 .../test/electron-browser/experimentService.test.ts | 0 .../electron-browser/experimentalPrompts.test.ts | 0 .../extensions/browser/extensionsQuickOpen.ts | 0 .../extensions/browser/extensionsViewer.ts | 0 .../extensions/common/extensionQuery.ts | 0 .../extensions/common/extensions.ts | 0 .../extensions/common/extensionsFileTemplate.ts | 0 .../extensions/common/extensionsInput.ts | 0 .../extensions/electron-browser/extensionEditor.ts | 0 .../electron-browser/extensionProfileService.ts | 0 .../electron-browser/extensionTipsService.ts | 0 .../electron-browser/extensions.contribution.ts | 0 .../electron-browser/extensionsActions.ts | 0 .../extensionsActivationProgress.ts | 0 .../electron-browser/extensionsAutoProfiler.ts | 0 .../extensions/electron-browser/extensionsList.ts | 0 .../extensions/electron-browser/extensionsUtils.ts | 0 .../electron-browser/extensionsViewlet.ts | 0 .../extensions/electron-browser/extensionsViews.ts | 0 .../electron-browser/extensionsWidgets.ts | 0 .../extensions/electron-browser/media/EmptyStar.svg | 0 .../electron-browser/media/FullStarLight.svg | 0 .../electron-browser/media/HalfStarLight.svg | 0 .../electron-browser/media/clear-inverse.svg | 0 .../extensions/electron-browser/media/clear.svg | 0 .../electron-browser/media/defaultIcon.png | Bin .../electron-browser/media/extensionActions.css | 0 .../electron-browser/media/extensionEditor.css | 0 .../electron-browser/media/extensions-dark.svg | 0 .../electron-browser/media/extensions.css | 0 .../electron-browser/media/extensionsViewlet.css | 0 .../electron-browser/media/extensionsWidgets.css | 0 .../electron-browser/media/language-icon.svg | 0 .../extensions/electron-browser/media/loading.svg | 0 .../electron-browser/media/manage-inverse.svg | 0 .../extensions/electron-browser/media/manage.svg | 0 .../extensions/electron-browser/media/markdown.css | 0 .../media/profile-start-inverse.svg | 0 .../electron-browser/media/profile-start.svg | 0 .../electron-browser/media/profile-stop-inverse.svg | 0 .../electron-browser/media/profile-stop.svg | 0 .../media/runtimeExtensionsEditor.css | 0 .../electron-browser/media/save-inverse.svg | 0 .../extensions/electron-browser/media/save.svg | 0 .../electron-browser/media/start-inverse.svg | 0 .../extensions/electron-browser/media/start.svg | 0 .../electron-browser/media/theme-icon.png | Bin .../electron-browser/runtimeExtensionsEditor.ts | 0 .../extensions/node/extensionsWorkbenchService.ts | 0 .../extensions/test/common/extensionQuery.test.ts | 0 .../test/electron-browser/extensionsActions.test.ts | 0 .../electron-browser/extensionsTipsService.test.ts | 0 .../test/electron-browser/extensionsViews.test.ts | 0 .../extensionsWorkbenchService.test.ts | 0 .../electron-browser/feedback.contribution.ts | 0 .../feedback/electron-browser/feedback.ts | 0 .../electron-browser/feedbackStatusbarItem.ts | 0 .../feedback/electron-browser/media/close-dark.svg | 0 .../feedback/electron-browser/media/close.svg | 0 .../feedback/electron-browser/media/feedback.css | 0 .../feedback/electron-browser/media/happy.svg | 0 .../feedback/electron-browser/media/info.svg | 0 .../feedback/electron-browser/media/sad.svg | 0 .../feedback/electron-browser/media/smiley.svg | 0 .../feedback/electron-browser/media/twitter.svg | 0 .../files/browser/editors/binaryFileEditor.ts | 0 .../files/browser/editors/fileEditorTracker.ts | 0 .../files/browser/editors/textFileEditor.ts | 0 .../{parts => contrib}/files/browser/files.ts | 0 .../files/common/dirtyFilesTracker.ts | 0 .../files/common/editors/fileEditorInput.ts | 0 .../files/common/explorerModel.ts | 0 .../{parts => contrib}/files/common/files.ts | 0 .../files/electron-browser/explorerService.ts | 0 .../files/electron-browser/explorerViewlet.ts | 0 .../electron-browser/fileActions.contribution.ts | 0 .../files/electron-browser/fileActions.ts | 0 .../files/electron-browser/fileCommands.ts | 0 .../files/electron-browser/files.contribution.ts | 0 .../files/electron-browser/media/AddFile.svg | 0 .../electron-browser/media/AddFile_inverse.svg | 0 .../files/electron-browser/media/AddFolder.svg | 0 .../electron-browser/media/AddFolder_inverse.svg | 0 .../files/electron-browser/media/CollapseAll.svg | 0 .../electron-browser/media/CollapseAll_inverse.svg | 0 .../files/electron-browser/media/Preview.svg | 0 .../electron-browser/media/Preview_inverse.svg | 0 .../files/electron-browser/media/Refresh.svg | 0 .../electron-browser/media/Refresh_inverse.svg | 0 .../electron-browser/media/action-close-dark.svg | 0 .../media/action-close-dirty-dark.svg | 0 .../media/action-close-dirty-focus.svg | 0 .../electron-browser/media/action-close-dirty.svg | 0 .../electron-browser/media/action-close-focus.svg | 0 .../files/electron-browser/media/action-close.svg | 0 .../files/electron-browser/media/check-inverse.svg | 0 .../files/electron-browser/media/check.svg | 0 .../files/electron-browser/media/closeall.svg | 0 .../electron-browser/media/closeall_inverse.svg | 0 .../electron-browser/media/explorerviewlet.css | 0 .../files/electron-browser/media/fileactions.css | 0 .../files/electron-browser/media/files-dark.svg | 0 .../files/electron-browser/media/saveall.svg | 0 .../electron-browser/media/saveall_inverse.svg | 0 .../media/split-editor-horizontal-inverse.svg | 0 .../media/split-editor-horizontal.svg | 0 .../media/split-editor-vertical-inverse.svg | 0 .../media/split-editor-vertical.svg | 0 .../files/electron-browser/media/undo-inverse.svg | 0 .../files/electron-browser/media/undo.svg | 0 .../files/electron-browser/saveErrorHandler.ts | 0 .../files/electron-browser/views/emptyView.ts | 0 .../views/explorerDecorationsProvider.ts | 0 .../files/electron-browser/views/explorerView.ts | 0 .../files/electron-browser/views/explorerViewer.ts | 0 .../files/electron-browser/views/openEditorsView.ts | 0 .../files/test/browser/fileEditorInput.test.ts | 0 .../files/test/browser/fileEditorTracker.test.ts | 0 .../test/electron-browser/explorerModel.test.ts | 0 .../files/test/electron-browser/fileActions.test.ts | 0 .../{parts => contrib}/html/common/htmlInput.ts | 0 .../html/electron-browser/html.contribution.ts | 0 .../html/electron-browser/htmlPreviewPart.ts | 0 .../electron-browser/localizations.contribution.ts | 0 .../electron-browser/localizationsActions.ts | 0 .../{parts => contrib}/logs/common/logConstants.ts | 0 .../logs/electron-browser/logs.contribution.ts | 0 .../logs/electron-browser/logsActions.ts | 0 .../markers/electron-browser/constants.ts | 0 .../electron-browser/markers.contribution.ts | 0 .../markers/electron-browser/markers.ts | 0 .../electron-browser/markersFileDecorations.ts | 0 .../electron-browser/markersFilterOptions.ts | 0 .../markers/electron-browser/markersModel.ts | 0 .../markers/electron-browser/markersPanel.ts | 0 .../markers/electron-browser/markersPanelActions.ts | 0 .../markers/electron-browser/markersTreeViewer.ts | 0 .../electron-browser/media/excludeSettings-dark.svg | 0 .../electron-browser/media/excludeSettings.svg | 0 .../electron-browser/media/lightbulb-dark.svg | 0 .../markers/electron-browser/media/lightbulb.svg | 0 .../markers/electron-browser/media/markers.css | 0 .../electron-browser/media/status-error-inverse.svg | 0 .../markers/electron-browser/media/status-error.svg | 0 .../electron-browser/media/status-info-inverse.svg | 0 .../markers/electron-browser/media/status-info.svg | 0 .../media/status-warning-inverse.svg | 0 .../electron-browser/media/status-warning.svg | 0 .../markers/electron-browser/messages.ts | 0 .../test/electron-browser/markersModel.test.ts | 0 .../electron-browser/outline.contribution.ts | 0 .../outline/electron-browser/outline.ts | 0 .../outline/electron-browser/outlinePanel.css | 0 .../outline/electron-browser/outlinePanel.ts | 0 .../{parts => contrib}/output/browser/logViewer.ts | 0 .../output/browser/media/clear_output.svg | 0 .../output/browser/media/clear_output_inverse.svg | 0 .../output/browser/media/open_log_file.svg | 0 .../output/browser/media/open_log_file_inverse.svg | 0 .../output/browser/media/output.css | 0 .../output/browser/media/output_lock.svg | 0 .../output/browser/media/output_lock_inverse.svg | 0 .../output/browser/media/output_unlock.svg | 0 .../output/browser/media/output_unlock_inverse.svg | 0 .../output/browser/outputActions.ts | 0 .../output/browser/outputPanel.ts | 0 .../{parts => contrib}/output/common/output.ts | 0 .../output/common/outputLinkComputer.ts | 0 .../output/common/outputLinkProvider.ts | 0 .../output/electron-browser/output.contribution.ts | 0 .../output/electron-browser/outputServices.ts | 0 .../output/test/outputLinkProvider.test.ts | 0 .../electron-browser/performance.contribution.ts | 0 .../performance/electron-browser/perfviewEditor.ts | 0 .../performance/electron-browser/startupProfiler.ts | 0 .../performance/electron-browser/startupTimings.ts | 0 .../preferences/browser/keybindingWidgets.ts | 0 .../preferences/browser/keybindingsEditor.ts | 0 .../browser/keybindingsEditorContribution.ts | 0 .../browser/media/action-remove-dark.svg | 0 .../preferences/browser/media/action-remove.svg | 0 .../preferences/browser/media/add.svg | 0 .../preferences/browser/media/add_inverse.svg | 0 .../preferences/browser/media/clean-dark.svg | 0 .../preferences/browser/media/clean.svg | 0 .../preferences/browser/media/clear-inverse.svg | 0 .../preferences/browser/media/clear.svg | 0 .../preferences/browser/media/collapseAll.svg | 0 .../browser/media/collapseAll_inverse.svg | 0 .../preferences/browser/media/collapsed-dark.svg | 0 .../preferences/browser/media/collapsed.svg | 0 .../preferences/browser/media/edit.svg | 0 .../preferences/browser/media/edit_inverse.svg | 0 .../preferences/browser/media/ellipsis-inverse.svg | 0 .../preferences/browser/media/ellipsis.svg | 0 .../preferences/browser/media/expanded-dark.svg | 0 .../preferences/browser/media/expanded.svg | 0 .../preferences/browser/media/info.svg | 0 .../preferences/browser/media/keybindings.css | 0 .../preferences/browser/media/keybindingsEditor.css | 0 .../preferences/browser/media/open-file-inverse.svg | 0 .../preferences/browser/media/open-file.svg | 0 .../preferences/browser/media/preferences.css | 0 .../browser/media/record-keys-inverse.svg | 0 .../preferences/browser/media/record-keys.svg | 0 .../preferences/browser/media/regex-dark.svg | 0 .../preferences/browser/media/regex.svg | 0 .../preferences/browser/media/settingsWidgets.css | 0 .../preferences/browser/media/sort_precedence.svg | 0 .../browser/media/sort_precedence_inverse.svg | 0 .../preferences/browser/media/status-error.svg | 0 .../preferences/browser/preferencesActions.ts | 0 .../preferences/browser/preferencesEditor.ts | 0 .../preferences/browser/preferencesRenderers.ts | 0 .../preferences/browser/preferencesWidgets.ts | 0 .../preferences/browser/settingsLayout.ts | 0 .../preferences/browser/settingsTree.ts | 0 .../preferences/browser/settingsTreeModels.ts | 0 .../preferences/browser/settingsWidgets.ts | 0 .../preferences/browser/tocTree.ts | 0 .../preferences/common/preferences.ts | 0 .../preferences/common/preferencesContribution.ts | 0 .../preferences/common/smartSnippetInserter.ts | 0 .../electron-browser/media/check-inverse.svg | 0 .../preferences/electron-browser/media/check.svg | 0 .../electron-browser/media/configure-inverse.svg | 0 .../electron-browser/media/configure.svg | 0 .../electron-browser/media/edit-json-inverse.svg | 0 .../electron-browser/media/edit-json.svg | 0 .../media/preferences-editor-inverse.svg | 0 .../electron-browser/media/preferences-editor.svg | 0 .../electron-browser/media/settingsEditor2.css | 0 .../electron-browser/preferences.contribution.ts | 0 .../electron-browser/preferencesSearch.ts | 0 .../preferences/electron-browser/settingsEditor2.ts | 0 .../browser/keybindingsEditorContribution.test.ts | 0 .../test/browser/settingsTreeModels.test.ts | 0 .../test/common/smartSnippetInserter.test.ts | 0 .../quickopen/browser/commandsHandler.ts | 0 .../quickopen/browser/gotoLineHandler.ts | 0 .../quickopen/browser/gotoSymbolHandler.ts | 0 .../quickopen/browser/helpHandler.ts | 0 .../quickopen/browser/quickopen.contribution.ts | 0 .../quickopen/browser/viewPickerHandler.ts | 0 .../electron-browser/relauncher.contribution.ts | 0 .../workbench/{parts => contrib}/scm/common/scm.ts | 0 .../scm/electron-browser/dirtydiffDecorator.ts | 0 .../scm/electron-browser/media/check-inverse.svg | 0 .../scm/electron-browser/media/check.svg | 0 .../electron-browser/media/dirtydiffDecorator.css | 0 .../scm/electron-browser/media/icon-dark.svg | 0 .../scm/electron-browser/media/icon-light.svg | 0 .../scm/electron-browser/media/scmViewlet.css | 0 .../scm/electron-browser/scm.contribution.ts | 0 .../scm/electron-browser/scmActivity.ts | 0 .../scm/electron-browser/scmMenus.ts | 0 .../scm/electron-browser/scmUtil.ts | 0 .../scm/electron-browser/scmViewlet.ts | 0 .../search/browser/media/CollapseAll.svg | 0 .../search/browser/media/CollapseAll_inverse.svg | 0 .../search/browser/media/Refresh.svg | 0 .../search/browser/media/Refresh_inverse.svg | 0 .../search/browser/media/action-remove-dark.svg | 0 .../search/browser/media/action-remove.svg | 0 .../browser/media/clear-search-results-dark.svg | 0 .../search/browser/media/clear-search-results.svg | 0 .../search/browser/media/ellipsis-inverse.svg | 0 .../search/browser/media/ellipsis.svg | 0 .../search/browser/media/excludeSettings-dark.svg | 0 .../search/browser/media/excludeSettings.svg | 0 .../search/browser/media/expando-collapsed-dark.svg | 0 .../search/browser/media/expando-collapsed.svg | 0 .../search/browser/media/expando-expanded-dark.svg | 0 .../search/browser/media/expando-expanded.svg | 0 .../search/browser/media/replace-all-inverse.svg | 0 .../search/browser/media/replace-all.svg | 0 .../search/browser/media/replace-inverse.svg | 0 .../search/browser/media/replace.svg | 0 .../search/browser/media/searchview.css | 0 .../search/browser/media/stop-inverse.svg | 0 .../search/browser/media/stop.svg | 0 .../search/browser/openAnythingHandler.ts | 0 .../search/browser/openFileHandler.ts | 0 .../search/browser/openSymbolHandler.ts | 0 .../search/browser/patternInputWidget.ts | 0 .../search/browser/replaceContributions.ts | 0 .../search/browser/replaceService.ts | 0 .../search/browser/searchActions.ts | 0 .../search/browser/searchResultsView.ts | 0 .../{parts => contrib}/search/browser/searchView.ts | 0 .../search/browser/searchWidget.ts | 0 .../{parts => contrib}/search/common/constants.ts | 0 .../search/common/queryBuilder.ts | 0 .../{parts => contrib}/search/common/replace.ts | 0 .../{parts => contrib}/search/common/search.ts | 0 .../{parts => contrib}/search/common/searchModel.ts | 0 .../search/electron-browser/media/search-dark.svg | 0 .../electron-browser/media/search.contribution.css | 0 .../search/electron-browser/search.contribution.ts | 0 .../search/test/browser/mockSearchTree.ts | 0 .../search/test/browser/openFileHandler.test.ts | 0 .../search/test/browser/searchActions.test.ts | 0 .../search/test/browser/searchViewlet.test.ts | 0 .../search/test/common/queryBuilder.test.ts | 0 .../search/test/common/searchModel.test.ts | 0 .../search/test/common/searchResult.test.ts | 0 .../snippets/electron-browser/configureSnippets.ts | 0 .../snippets/electron-browser/insertSnippet.ts | 0 .../electron-browser/snippetCompletionProvider.ts | 0 .../electron-browser/snippets.contribution.ts | 0 .../snippets/electron-browser/snippetsFile.ts | 0 .../snippets/electron-browser/snippetsService.ts | 0 .../snippets/electron-browser/tabCompletion.ts | 0 .../test/electron-browser/snippetFile.test.ts | 0 .../test/electron-browser/snippetsRegistry.test.ts | 0 .../test/electron-browser/snippetsRewrite.test.ts | 0 .../test/electron-browser/snippetsService.test.ts | 0 .../electron-browser/partsSplash.contribution.ts | 0 .../stats/node/stats.contribution.ts | 0 .../{parts => contrib}/stats/node/workspaceStats.ts | 0 .../stats/test/workspaceStats.test.ts | 0 .../languageSurveys.contribution.ts | 0 .../surveys/electron-browser/nps.contribution.ts | 0 .../{parts => contrib}/tasks/browser/quickOpen.ts | 0 .../tasks/browser/taskQuickOpen.ts | 0 .../tasks/common/problemCollectors.ts | 0 .../tasks/common/problemMatcher.ts | 0 .../tasks/common/taskDefinitionRegistry.ts | 0 .../{parts => contrib}/tasks/common/taskService.ts | 0 .../{parts => contrib}/tasks/common/taskSystem.ts | 0 .../tasks/common/taskTemplates.ts | 0 .../{parts => contrib}/tasks/common/tasks.ts | 0 .../tasks/electron-browser/jsonSchemaCommon.ts | 0 .../tasks/electron-browser/jsonSchema_v1.ts | 0 .../tasks/electron-browser/jsonSchema_v2.ts | 0 .../electron-browser/media/configure-inverse.svg | 0 .../tasks/electron-browser/media/configure.svg | 0 .../tasks/electron-browser/media/status-error.svg | 0 .../tasks/electron-browser/media/status-info.svg | 0 .../tasks/electron-browser/media/status-warning.svg | 0 .../electron-browser/media/task.contribution.css | 0 .../tasks/electron-browser/media/task.svg | 0 .../tasks/electron-browser/runAutomaticTasks.ts | 0 .../tasks/electron-browser/task.contribution.ts | 0 .../tasks/electron-browser/terminalTaskSystem.ts | 0 .../tasks/node/processRunnerDetector.ts | 0 .../tasks/node/processTaskSystem.ts | 0 .../tasks/node/taskConfiguration.ts | 0 .../{parts => contrib}/tasks/node/tasks.ts | 0 .../tasks/test/common/problemMatcher.test.ts | 0 .../test/electron-browser/configuration.test.ts | 0 .../terminal/browser/terminalFindWidget.css | 0 .../terminal/browser/terminalFindWidget.ts | 0 .../terminal/browser/terminalQuickOpen.ts | 0 .../terminal/browser/terminalTab.ts | 0 .../terminal/browser/terminalWidgetManager.ts | 0 .../{parts => contrib}/terminal/common/terminal.ts | 0 .../terminal/common/terminalColorRegistry.ts | 0 .../terminal/common/terminalCommands.ts | 0 .../terminal/common/terminalMenu.ts | 0 .../terminal/common/terminalService.ts | 0 .../electron-browser/media/configure-inverse.svg | 0 .../terminal/electron-browser/media/configure.svg | 0 .../electron-browser/media/kill-inverse.svg | 0 .../terminal/electron-browser/media/kill.svg | 0 .../terminal/electron-browser/media/new-inverse.svg | 0 .../terminal/electron-browser/media/new.svg | 0 .../terminal/electron-browser/media/scrollbar.css | 0 .../media/split-horizontal-inverse.svg | 0 .../electron-browser/media/split-horizontal.svg | 0 .../electron-browser/media/split-inverse.svg | 0 .../terminal/electron-browser/media/split.svg | 0 .../terminal/electron-browser/media/terminal.css | 0 .../terminal/electron-browser/media/widgets.css | 0 .../terminal/electron-browser/media/xterm.css | 0 .../electron-browser/terminal.contribution.ts | 0 .../terminal/electron-browser/terminalActions.ts | 0 .../electron-browser/terminalConfigHelper.ts | 0 .../terminal/electron-browser/terminalInstance.ts | 0 .../electron-browser/terminalLinkHandler.ts | 0 .../terminal/electron-browser/terminalPanel.ts | 0 .../electron-browser/terminalProcessManager.ts | 0 .../terminal/electron-browser/terminalService.ts | 0 .../{parts => contrib}/terminal/node/terminal.ts | 0 .../terminal/node/terminalCommandTracker.ts | 0 .../terminal/node/terminalEnvironment.ts | 0 .../terminal/node/terminalProcess.ts | 0 .../terminal/node/terminalProcessExtHostProxy.ts | 0 .../terminal/node/windowsShellHelper.ts | 0 .../electron-browser/terminalColorRegistry.test.ts | 0 .../electron-browser/terminalConfigHelper.test.ts | 0 .../electron-browser/terminalLinkHandler.test.ts | 0 .../test/node/terminalCommandTracker.test.ts | 0 .../terminal/test/node/terminalEnvironment.test.ts | 0 .../themes/electron-browser/themes.contribution.ts | 0 .../themes/test/electron-browser/fixtures/foo.js | 0 .../electron-browser/themes.test.contribution.ts | 0 .../update/electron-browser/media/code-icon.svg | 0 .../update/electron-browser/media/markdown.css | 0 .../electron-browser/media/update.contribution.css | 0 .../update/electron-browser/media/update.svg | 0 .../update/electron-browser/releaseNotesEditor.ts | 0 .../update/electron-browser/update.contribution.ts | 0 .../update/electron-browser/update.ts | 0 .../url/electron-browser/url.contribution.ts | 0 .../watermark/electron-browser/watermark.css | 0 .../watermark/electron-browser/watermark.ts | 0 .../webview/electron-browser/baseWebviewEditor.ts | 0 .../webview/electron-browser/webview-pre.js | 0 .../electron-browser/webview.contribution.ts | 0 .../webview/electron-browser/webview.html | 0 .../webview/electron-browser/webviewCommands.ts | 0 .../webview/electron-browser/webviewEditor.ts | 0 .../webview/electron-browser/webviewEditorInput.ts | 0 .../electron-browser/webviewEditorInputFactory.ts | 0 .../electron-browser/webviewEditorService.ts | 0 .../webview/electron-browser/webviewElement.ts | 0 .../webview/electron-browser/webviewFindWidget.ts | 0 .../webview/electron-browser/webviewProtocols.ts | 0 .../{parts => contrib}/welcome/code-icon.svg | 0 .../electron-browser/gettingStarted.contribution.ts | 0 .../electron-browser/gettingStarted.ts | 0 .../electron-browser/telemetryOptOut.ts | 0 .../test/common/gettingStarted.test.ts | 0 .../overlay/browser/media/commandpalette-dark.svg | 0 .../overlay/browser/media/commandpalette.svg | 0 .../welcome/overlay/browser/welcomeOverlay.css | 0 .../welcome/overlay/browser/welcomeOverlay.ts | 0 .../page/electron-browser/vs_code_welcome_page.ts | 0 .../electron-browser/welcomePage.contribution.ts | 0 .../welcome/page/electron-browser/welcomePage.css | 0 .../welcome/page/electron-browser/welcomePage.ts | 0 .../electron-browser/editor/editorWalkThrough.ts | 0 .../editor/vs_code_editor_walkthrough.md | 0 .../electron-browser/walkThrough.contribution.ts | 0 .../electron-browser/walkThroughActions.ts | 0 .../electron-browser/walkThroughPart.css | 0 .../walkThrough/electron-browser/walkThroughPart.ts | 0 .../walkThrough/node/walkThroughContentProvider.ts | 0 .../welcome/walkThrough/node/walkThroughInput.ts | 0 .../welcome/walkThrough/node/walkThroughUtils.ts | 0 615 files changed, 0 insertions(+), 0 deletions(-) rename src/vs/workbench/{parts => contrib}/backup/common/backup.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/backup/common/backupModelTracker.ts (100%) rename src/vs/workbench/{parts => contrib}/backup/common/backupRestorer.ts (100%) rename src/vs/workbench/{parts => contrib}/cli/electron-browser/cli.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/browser/menuPreventer.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/browser/simpleEditorOptions.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/accessibility.css (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/accessibility.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/codeEditor.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/inspectKeybindings.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/largeFileOptimizations.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/media/WordWrap_16x.svg (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/media/suggestEnabledInput.css (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/selectionClipboard.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/simpleEditorOptions.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/suggestEnabledInput.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/textMate/inspectTMScopes.css (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/textMate/inspectTMScopes.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/toggleMinimap.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/toggleMultiCursorModifier.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/toggleRenderControlCharacter.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/toggleRenderWhitespace.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/toggleWordWrap.ts (100%) rename src/vs/workbench/{parts => contrib}/codeEditor/electron-browser/workbenchReferenceSearch.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/common/commentModel.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentGlyphWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentNode.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentService.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentThreadWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/comments.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentsEditorContribution.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentsPanel.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/commentsTreeViewer.ts (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/media/close.svg (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/media/comment.svg (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/media/panel.css (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/media/review.css (100%) rename src/vs/workbench/{parts => contrib}/comments/electron-browser/simpleCommentEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/baseDebugView.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/breakpointsView.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugANSIHandling.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugActionItems.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugActions.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugCommands.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugContentProvider.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugEditorActions.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugEditorModelManager.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugQuickOpen.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugStatus.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugToolbar.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/debugViewlet.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/exceptionWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/linkDetector.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/loadedScriptsView.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/add-focus.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/add-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/add.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-conditional-disabled.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-conditional-unverified.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-conditional.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-disabled.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-function-disabled.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-function-unverified.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-function.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-hint.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-log-disabled.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-log-unverified.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-log.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-unsupported.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint-unverified.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoint.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpointWidget.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoints-activate-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/breakpoints-activate.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/clear-repl-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/clear-repl.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/configure-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/configure.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/continue-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/continue.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/current-and-breakpoint.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/current-arrow.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/debug-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/debug.contribution.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/debugHover.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/debugToolbar.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/debugViewlet.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/disconnect-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/disconnect.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/drag.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/exceptionWidget.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/pause-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/pause.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/remove-all-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/remove-all.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/repl-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/repl.css (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/repl.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/restart-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/restart.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/stackframe-and-breakpoint.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/stackframe-arrow.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/start-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/start.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/step-into-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/step-into.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/step-out-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/step-out.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/step-over-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/step-over.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/stop-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/media/stop.svg (100%) rename src/vs/workbench/{parts => contrib}/debug/browser/statusbarColorProvider.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debug.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debugModel.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debugProtocol.d.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debugSchemas.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debugSource.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debugUtils.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/debugViewModel.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/common/replModel.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/breakpointWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/callStackView.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/debug.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/debugConfigurationManager.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/debugEditorContribution.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/debugHover.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/debugService.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/debugSession.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/electronDebugActions.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/continue-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/continue-without-debugging-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/pause-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/restart-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/stepinto-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/stepout-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/stepover-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/media/stop-tb.png (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/rawDebugSession.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/repl.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/terminalSupport.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/variablesView.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/electron-browser/watchExpressionsView.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/node/debugAdapter.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/node/debugger.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/node/telemetryApp.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/node/terminals.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/browser/baseDebugView.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/browser/debugANSIHandling.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/browser/linkDetector.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/common/debugSource.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/common/debugUtils.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/common/debugViewModel.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/common/mockDebug.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/electron-browser/debugModel.test.ts (100%) rename src/vs/workbench/{parts => contrib}/debug/test/node/debugger.test.ts (100%) rename src/vs/workbench/{parts => contrib}/emmet/browser/actions/showEmmetCommands.ts (100%) rename src/vs/workbench/{parts => contrib}/emmet/browser/emmet.browser.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/emmet/electron-browser/actions/expandAbbreviation.ts (100%) rename src/vs/workbench/{parts => contrib}/emmet/electron-browser/emmet.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/emmet/electron-browser/emmetActions.ts (100%) rename src/vs/workbench/{parts => contrib}/emmet/test/electron-browser/emmetAction.test.ts (100%) rename src/vs/workbench/{parts => contrib}/execution/common/execution.ts (100%) rename src/vs/workbench/{parts => contrib}/execution/electron-browser/TerminalHelper.scpt (100%) rename src/vs/workbench/{parts => contrib}/execution/electron-browser/execution.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/execution/electron-browser/iTermHelper.scpt (100%) rename src/vs/workbench/{parts => contrib}/execution/electron-browser/terminal.ts (100%) rename src/vs/workbench/{parts => contrib}/execution/electron-browser/terminalService.ts (100%) rename src/vs/workbench/{parts => contrib}/execution/test/electron-browser/terminalService.test.ts (100%) rename src/vs/workbench/{parts => contrib}/experiments/electron-browser/experimentalPrompt.ts (100%) rename src/vs/workbench/{parts => contrib}/experiments/electron-browser/experiments.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/experiments/node/experimentService.ts (100%) rename src/vs/workbench/{parts => contrib}/experiments/test/electron-browser/experimentService.test.ts (100%) rename src/vs/workbench/{parts => contrib}/experiments/test/electron-browser/experimentalPrompts.test.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/browser/extensionsQuickOpen.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/browser/extensionsViewer.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/common/extensionQuery.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/common/extensions.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/common/extensionsFileTemplate.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/common/extensionsInput.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionProfileService.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionTipsService.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensions.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsActions.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsActivationProgress.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsAutoProfiler.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsList.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsUtils.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsViewlet.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsViews.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/extensionsWidgets.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/EmptyStar.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/FullStarLight.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/HalfStarLight.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/clear-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/clear.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/defaultIcon.png (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/extensionActions.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/extensionEditor.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/extensions-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/extensions.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/extensionsViewlet.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/extensionsWidgets.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/language-icon.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/loading.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/manage-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/manage.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/markdown.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/profile-start-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/profile-start.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/profile-stop-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/profile-stop.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/runtimeExtensionsEditor.css (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/save-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/save.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/start-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/start.svg (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/media/theme-icon.png (100%) rename src/vs/workbench/{parts => contrib}/extensions/electron-browser/runtimeExtensionsEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/node/extensionsWorkbenchService.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/test/common/extensionQuery.test.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/test/electron-browser/extensionsActions.test.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/test/electron-browser/extensionsTipsService.test.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/test/electron-browser/extensionsViews.test.ts (100%) rename src/vs/workbench/{parts => contrib}/extensions/test/electron-browser/extensionsWorkbenchService.test.ts (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/feedback.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/feedback.ts (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/feedbackStatusbarItem.ts (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/close-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/close.svg (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/feedback.css (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/happy.svg (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/info.svg (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/sad.svg (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/smiley.svg (100%) rename src/vs/workbench/{parts => contrib}/feedback/electron-browser/media/twitter.svg (100%) rename src/vs/workbench/{parts => contrib}/files/browser/editors/binaryFileEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/files/browser/editors/fileEditorTracker.ts (100%) rename src/vs/workbench/{parts => contrib}/files/browser/editors/textFileEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/files/browser/files.ts (100%) rename src/vs/workbench/{parts => contrib}/files/common/dirtyFilesTracker.ts (100%) rename src/vs/workbench/{parts => contrib}/files/common/editors/fileEditorInput.ts (100%) rename src/vs/workbench/{parts => contrib}/files/common/explorerModel.ts (100%) rename src/vs/workbench/{parts => contrib}/files/common/files.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/explorerService.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/explorerViewlet.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/fileActions.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/fileActions.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/fileCommands.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/files.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/AddFile.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/AddFile_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/AddFolder.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/AddFolder_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/CollapseAll.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/CollapseAll_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/Preview.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/Preview_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/Refresh.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/Refresh_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/action-close-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/action-close-dirty-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/action-close-dirty-focus.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/action-close-dirty.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/action-close-focus.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/action-close.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/check-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/check.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/closeall.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/closeall_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/explorerviewlet.css (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/fileactions.css (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/files-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/saveall.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/saveall_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/split-editor-horizontal-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/split-editor-horizontal.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/split-editor-vertical-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/split-editor-vertical.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/undo-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/media/undo.svg (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/saveErrorHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/views/emptyView.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/views/explorerDecorationsProvider.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/views/explorerView.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/views/explorerViewer.ts (100%) rename src/vs/workbench/{parts => contrib}/files/electron-browser/views/openEditorsView.ts (100%) rename src/vs/workbench/{parts => contrib}/files/test/browser/fileEditorInput.test.ts (100%) rename src/vs/workbench/{parts => contrib}/files/test/browser/fileEditorTracker.test.ts (100%) rename src/vs/workbench/{parts => contrib}/files/test/electron-browser/explorerModel.test.ts (100%) rename src/vs/workbench/{parts => contrib}/files/test/electron-browser/fileActions.test.ts (100%) rename src/vs/workbench/{parts => contrib}/html/common/htmlInput.ts (100%) rename src/vs/workbench/{parts => contrib}/html/electron-browser/html.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/html/electron-browser/htmlPreviewPart.ts (100%) rename src/vs/workbench/{parts => contrib}/localizations/electron-browser/localizations.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/localizations/electron-browser/localizationsActions.ts (100%) rename src/vs/workbench/{parts => contrib}/logs/common/logConstants.ts (100%) rename src/vs/workbench/{parts => contrib}/logs/electron-browser/logs.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/logs/electron-browser/logsActions.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/constants.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markers.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markers.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markersFileDecorations.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markersFilterOptions.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markersModel.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markersPanel.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markersPanelActions.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/markersTreeViewer.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/excludeSettings-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/excludeSettings.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/lightbulb-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/lightbulb.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/markers.css (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/status-error-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/status-error.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/status-info-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/status-info.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/status-warning-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/media/status-warning.svg (100%) rename src/vs/workbench/{parts => contrib}/markers/electron-browser/messages.ts (100%) rename src/vs/workbench/{parts => contrib}/markers/test/electron-browser/markersModel.test.ts (100%) rename src/vs/workbench/{parts => contrib}/outline/electron-browser/outline.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/outline/electron-browser/outline.ts (100%) rename src/vs/workbench/{parts => contrib}/outline/electron-browser/outlinePanel.css (100%) rename src/vs/workbench/{parts => contrib}/outline/electron-browser/outlinePanel.ts (100%) rename src/vs/workbench/{parts => contrib}/output/browser/logViewer.ts (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/clear_output.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/clear_output_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/open_log_file.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/open_log_file_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/output.css (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/output_lock.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/output_lock_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/output_unlock.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/media/output_unlock_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/output/browser/outputActions.ts (100%) rename src/vs/workbench/{parts => contrib}/output/browser/outputPanel.ts (100%) rename src/vs/workbench/{parts => contrib}/output/common/output.ts (100%) rename src/vs/workbench/{parts => contrib}/output/common/outputLinkComputer.ts (100%) rename src/vs/workbench/{parts => contrib}/output/common/outputLinkProvider.ts (100%) rename src/vs/workbench/{parts => contrib}/output/electron-browser/output.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/output/electron-browser/outputServices.ts (100%) rename src/vs/workbench/{parts => contrib}/output/test/outputLinkProvider.test.ts (100%) rename src/vs/workbench/{parts => contrib}/performance/electron-browser/performance.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/performance/electron-browser/perfviewEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/performance/electron-browser/startupProfiler.ts (100%) rename src/vs/workbench/{parts => contrib}/performance/electron-browser/startupTimings.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/keybindingWidgets.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/keybindingsEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/keybindingsEditorContribution.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/action-remove-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/action-remove.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/add.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/add_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/clean-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/clean.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/clear-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/clear.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/collapseAll.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/collapseAll_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/collapsed-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/collapsed.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/edit.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/edit_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/ellipsis-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/ellipsis.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/expanded-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/expanded.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/info.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/keybindings.css (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/keybindingsEditor.css (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/open-file-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/open-file.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/preferences.css (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/record-keys-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/record-keys.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/regex-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/regex.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/settingsWidgets.css (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/sort_precedence.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/sort_precedence_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/media/status-error.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/preferencesActions.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/preferencesEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/preferencesRenderers.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/preferencesWidgets.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/settingsLayout.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/settingsTree.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/settingsTreeModels.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/settingsWidgets.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/browser/tocTree.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/common/preferences.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/common/preferencesContribution.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/common/smartSnippetInserter.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/check-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/check.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/configure-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/configure.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/edit-json-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/edit-json.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/preferences-editor-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/preferences-editor.svg (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/media/settingsEditor2.css (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/preferences.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/preferencesSearch.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/electron-browser/settingsEditor2.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/test/browser/keybindingsEditorContribution.test.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/test/browser/settingsTreeModels.test.ts (100%) rename src/vs/workbench/{parts => contrib}/preferences/test/common/smartSnippetInserter.test.ts (100%) rename src/vs/workbench/{parts => contrib}/quickopen/browser/commandsHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/quickopen/browser/gotoLineHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/quickopen/browser/gotoSymbolHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/quickopen/browser/helpHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/quickopen/browser/quickopen.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/quickopen/browser/viewPickerHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/relauncher/electron-browser/relauncher.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/common/scm.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/dirtydiffDecorator.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/media/check-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/media/check.svg (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/media/dirtydiffDecorator.css (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/media/icon-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/media/icon-light.svg (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/media/scmViewlet.css (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/scm.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/scmActivity.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/scmMenus.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/scmUtil.ts (100%) rename src/vs/workbench/{parts => contrib}/scm/electron-browser/scmViewlet.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/CollapseAll.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/CollapseAll_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/Refresh.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/Refresh_inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/action-remove-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/action-remove.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/clear-search-results-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/clear-search-results.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/ellipsis-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/ellipsis.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/excludeSettings-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/excludeSettings.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/expando-collapsed-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/expando-collapsed.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/expando-expanded-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/expando-expanded.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/replace-all-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/replace-all.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/replace-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/replace.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/searchview.css (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/stop-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/media/stop.svg (100%) rename src/vs/workbench/{parts => contrib}/search/browser/openAnythingHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/openFileHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/openSymbolHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/patternInputWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/replaceContributions.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/replaceService.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/searchActions.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/searchResultsView.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/searchView.ts (100%) rename src/vs/workbench/{parts => contrib}/search/browser/searchWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/search/common/constants.ts (100%) rename src/vs/workbench/{parts => contrib}/search/common/queryBuilder.ts (100%) rename src/vs/workbench/{parts => contrib}/search/common/replace.ts (100%) rename src/vs/workbench/{parts => contrib}/search/common/search.ts (100%) rename src/vs/workbench/{parts => contrib}/search/common/searchModel.ts (100%) rename src/vs/workbench/{parts => contrib}/search/electron-browser/media/search-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/search/electron-browser/media/search.contribution.css (100%) rename src/vs/workbench/{parts => contrib}/search/electron-browser/search.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/browser/mockSearchTree.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/browser/openFileHandler.test.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/browser/searchActions.test.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/browser/searchViewlet.test.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/common/queryBuilder.test.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/common/searchModel.test.ts (100%) rename src/vs/workbench/{parts => contrib}/search/test/common/searchResult.test.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/configureSnippets.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/insertSnippet.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/snippetCompletionProvider.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/snippets.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/snippetsFile.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/snippetsService.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/electron-browser/tabCompletion.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/test/electron-browser/snippetFile.test.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/test/electron-browser/snippetsRegistry.test.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/test/electron-browser/snippetsRewrite.test.ts (100%) rename src/vs/workbench/{parts => contrib}/snippets/test/electron-browser/snippetsService.test.ts (100%) rename src/vs/workbench/{parts => contrib}/splash/electron-browser/partsSplash.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/stats/node/stats.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/stats/node/workspaceStats.ts (100%) rename src/vs/workbench/{parts => contrib}/stats/test/workspaceStats.test.ts (100%) rename src/vs/workbench/{parts => contrib}/surveys/electron-browser/languageSurveys.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/surveys/electron-browser/nps.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/browser/quickOpen.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/browser/taskQuickOpen.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/problemCollectors.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/problemMatcher.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/taskDefinitionRegistry.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/taskService.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/taskSystem.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/taskTemplates.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/common/tasks.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/jsonSchemaCommon.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/jsonSchema_v1.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/jsonSchema_v2.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/configure-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/configure.svg (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/status-error.svg (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/status-info.svg (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/status-warning.svg (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/task.contribution.css (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/media/task.svg (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/runAutomaticTasks.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/task.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/electron-browser/terminalTaskSystem.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/node/processRunnerDetector.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/node/processTaskSystem.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/node/taskConfiguration.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/node/tasks.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/test/common/problemMatcher.test.ts (100%) rename src/vs/workbench/{parts => contrib}/tasks/test/electron-browser/configuration.test.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/browser/terminalFindWidget.css (100%) rename src/vs/workbench/{parts => contrib}/terminal/browser/terminalFindWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/browser/terminalQuickOpen.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/browser/terminalTab.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/browser/terminalWidgetManager.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/common/terminal.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/common/terminalColorRegistry.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/common/terminalCommands.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/common/terminalMenu.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/common/terminalService.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/configure-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/configure.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/kill-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/kill.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/new-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/new.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/scrollbar.css (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/split-horizontal-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/split-horizontal.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/split-inverse.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/split.svg (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/terminal.css (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/widgets.css (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/media/xterm.css (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminal.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalActions.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalConfigHelper.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalInstance.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalLinkHandler.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalPanel.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalProcessManager.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/electron-browser/terminalService.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/node/terminal.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/node/terminalCommandTracker.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/node/terminalEnvironment.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/node/terminalProcess.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/node/terminalProcessExtHostProxy.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/node/windowsShellHelper.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/test/electron-browser/terminalColorRegistry.test.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/test/electron-browser/terminalConfigHelper.test.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/test/electron-browser/terminalLinkHandler.test.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/test/node/terminalCommandTracker.test.ts (100%) rename src/vs/workbench/{parts => contrib}/terminal/test/node/terminalEnvironment.test.ts (100%) rename src/vs/workbench/{parts => contrib}/themes/electron-browser/themes.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/themes/test/electron-browser/fixtures/foo.js (100%) rename src/vs/workbench/{parts => contrib}/themes/test/electron-browser/themes.test.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/media/code-icon.svg (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/media/markdown.css (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/media/update.contribution.css (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/media/update.svg (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/releaseNotesEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/update.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/update/electron-browser/update.ts (100%) rename src/vs/workbench/{parts => contrib}/url/electron-browser/url.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/watermark/electron-browser/watermark.css (100%) rename src/vs/workbench/{parts => contrib}/watermark/electron-browser/watermark.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/baseWebviewEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webview-pre.js (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webview.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webview.html (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewCommands.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewEditor.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewEditorInput.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewEditorInputFactory.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewEditorService.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewElement.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewFindWidget.ts (100%) rename src/vs/workbench/{parts => contrib}/webview/electron-browser/webviewProtocols.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/code-icon.svg (100%) rename src/vs/workbench/{parts => contrib}/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/gettingStarted/electron-browser/gettingStarted.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/gettingStarted/electron-browser/telemetryOptOut.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/gettingStarted/test/common/gettingStarted.test.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/overlay/browser/media/commandpalette-dark.svg (100%) rename src/vs/workbench/{parts => contrib}/welcome/overlay/browser/media/commandpalette.svg (100%) rename src/vs/workbench/{parts => contrib}/welcome/overlay/browser/welcomeOverlay.css (100%) rename src/vs/workbench/{parts => contrib}/welcome/overlay/browser/welcomeOverlay.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/page/electron-browser/vs_code_welcome_page.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/page/electron-browser/welcomePage.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/page/electron-browser/welcomePage.css (100%) rename src/vs/workbench/{parts => contrib}/welcome/page/electron-browser/welcomePage.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/electron-browser/walkThrough.contribution.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/electron-browser/walkThroughActions.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/electron-browser/walkThroughPart.css (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/electron-browser/walkThroughPart.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/node/walkThroughContentProvider.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/node/walkThroughInput.ts (100%) rename src/vs/workbench/{parts => contrib}/welcome/walkThrough/node/walkThroughUtils.ts (100%) diff --git a/src/vs/workbench/parts/backup/common/backup.contribution.ts b/src/vs/workbench/contrib/backup/common/backup.contribution.ts similarity index 100% rename from src/vs/workbench/parts/backup/common/backup.contribution.ts rename to src/vs/workbench/contrib/backup/common/backup.contribution.ts diff --git a/src/vs/workbench/parts/backup/common/backupModelTracker.ts b/src/vs/workbench/contrib/backup/common/backupModelTracker.ts similarity index 100% rename from src/vs/workbench/parts/backup/common/backupModelTracker.ts rename to src/vs/workbench/contrib/backup/common/backupModelTracker.ts diff --git a/src/vs/workbench/parts/backup/common/backupRestorer.ts b/src/vs/workbench/contrib/backup/common/backupRestorer.ts similarity index 100% rename from src/vs/workbench/parts/backup/common/backupRestorer.ts rename to src/vs/workbench/contrib/backup/common/backupRestorer.ts diff --git a/src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts b/src/vs/workbench/contrib/cli/electron-browser/cli.contribution.ts similarity index 100% rename from src/vs/workbench/parts/cli/electron-browser/cli.contribution.ts rename to src/vs/workbench/contrib/cli/electron-browser/cli.contribution.ts diff --git a/src/vs/workbench/parts/codeEditor/browser/menuPreventer.ts b/src/vs/workbench/contrib/codeEditor/browser/menuPreventer.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/browser/menuPreventer.ts rename to src/vs/workbench/contrib/codeEditor/browser/menuPreventer.ts diff --git a/src/vs/workbench/parts/codeEditor/browser/simpleEditorOptions.ts b/src/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/browser/simpleEditorOptions.ts rename to src/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.css b/src/vs/workbench/contrib/codeEditor/electron-browser/accessibility.css similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/accessibility.css rename to src/vs/workbench/contrib/codeEditor/electron-browser/accessibility.css diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/accessibility.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/accessibility.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/codeEditor.contribution.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/codeEditor.contribution.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/codeEditor.contribution.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/codeEditor.contribution.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/inspectKeybindings.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/inspectKeybindings.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/largeFileOptimizations.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/largeFileOptimizations.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/largeFileOptimizations.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/largeFileOptimizations.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/media/WordWrap_16x.svg b/src/vs/workbench/contrib/codeEditor/electron-browser/media/WordWrap_16x.svg similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/media/WordWrap_16x.svg rename to src/vs/workbench/contrib/codeEditor/electron-browser/media/WordWrap_16x.svg diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/media/suggestEnabledInput.css b/src/vs/workbench/contrib/codeEditor/electron-browser/media/suggestEnabledInput.css similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/media/suggestEnabledInput.css rename to src/vs/workbench/contrib/codeEditor/electron-browser/media/suggestEnabledInput.css diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/selectionClipboard.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/selectionClipboard.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/simpleEditorOptions.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/simpleEditorOptions.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.css b/src/vs/workbench/contrib/codeEditor/electron-browser/textMate/inspectTMScopes.css similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.css rename to src/vs/workbench/contrib/codeEditor/electron-browser/textMate/inspectTMScopes.css diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/textMate/inspectTMScopes.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/textMate/inspectTMScopes.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleMinimap.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleMinimap.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/toggleMinimap.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/toggleMinimap.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleMultiCursorModifier.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/toggleMultiCursorModifier.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleRenderControlCharacter.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/toggleRenderControlCharacter.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleRenderWhitespace.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/toggleRenderWhitespace.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/workbenchReferenceSearch.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/workbenchReferenceSearch.ts similarity index 100% rename from src/vs/workbench/parts/codeEditor/electron-browser/workbenchReferenceSearch.ts rename to src/vs/workbench/contrib/codeEditor/electron-browser/workbenchReferenceSearch.ts diff --git a/src/vs/workbench/parts/comments/common/commentModel.ts b/src/vs/workbench/contrib/comments/common/commentModel.ts similarity index 100% rename from src/vs/workbench/parts/comments/common/commentModel.ts rename to src/vs/workbench/contrib/comments/common/commentModel.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentGlyphWidget.ts b/src/vs/workbench/contrib/comments/electron-browser/commentGlyphWidget.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentGlyphWidget.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentGlyphWidget.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentNode.ts b/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentNode.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentNode.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentService.ts b/src/vs/workbench/contrib/comments/electron-browser/commentService.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentService.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentService.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/comments.contribution.ts b/src/vs/workbench/contrib/comments/electron-browser/comments.contribution.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/comments.contribution.ts rename to src/vs/workbench/contrib/comments/electron-browser/comments.contribution.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/contrib/comments/electron-browser/commentsPanel.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentsPanel.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentsPanel.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/commentsTreeViewer.ts rename to src/vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts diff --git a/src/vs/workbench/parts/comments/electron-browser/media/close.svg b/src/vs/workbench/contrib/comments/electron-browser/media/close.svg similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/media/close.svg rename to src/vs/workbench/contrib/comments/electron-browser/media/close.svg diff --git a/src/vs/workbench/parts/comments/electron-browser/media/comment.svg b/src/vs/workbench/contrib/comments/electron-browser/media/comment.svg similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/media/comment.svg rename to src/vs/workbench/contrib/comments/electron-browser/media/comment.svg diff --git a/src/vs/workbench/parts/comments/electron-browser/media/panel.css b/src/vs/workbench/contrib/comments/electron-browser/media/panel.css similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/media/panel.css rename to src/vs/workbench/contrib/comments/electron-browser/media/panel.css diff --git a/src/vs/workbench/parts/comments/electron-browser/media/review.css b/src/vs/workbench/contrib/comments/electron-browser/media/review.css similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/media/review.css rename to src/vs/workbench/contrib/comments/electron-browser/media/review.css diff --git a/src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts b/src/vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts similarity index 100% rename from src/vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts rename to src/vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts diff --git a/src/vs/workbench/parts/debug/browser/baseDebugView.ts b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/baseDebugView.ts rename to src/vs/workbench/contrib/debug/browser/baseDebugView.ts diff --git a/src/vs/workbench/parts/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/breakpointsView.ts rename to src/vs/workbench/contrib/debug/browser/breakpointsView.ts diff --git a/src/vs/workbench/parts/debug/browser/debugANSIHandling.ts b/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugANSIHandling.ts rename to src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts diff --git a/src/vs/workbench/parts/debug/browser/debugActionItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionItems.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugActionItems.ts rename to src/vs/workbench/contrib/debug/browser/debugActionItems.ts diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/contrib/debug/browser/debugActions.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugActions.ts rename to src/vs/workbench/contrib/debug/browser/debugActions.ts diff --git a/src/vs/workbench/parts/debug/browser/debugCommands.ts b/src/vs/workbench/contrib/debug/browser/debugCommands.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugCommands.ts rename to src/vs/workbench/contrib/debug/browser/debugCommands.ts diff --git a/src/vs/workbench/parts/debug/browser/debugContentProvider.ts b/src/vs/workbench/contrib/debug/browser/debugContentProvider.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugContentProvider.ts rename to src/vs/workbench/contrib/debug/browser/debugContentProvider.ts diff --git a/src/vs/workbench/parts/debug/browser/debugEditorActions.ts b/src/vs/workbench/contrib/debug/browser/debugEditorActions.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugEditorActions.ts rename to src/vs/workbench/contrib/debug/browser/debugEditorActions.ts diff --git a/src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts b/src/vs/workbench/contrib/debug/browser/debugEditorModelManager.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugEditorModelManager.ts rename to src/vs/workbench/contrib/debug/browser/debugEditorModelManager.ts diff --git a/src/vs/workbench/parts/debug/browser/debugQuickOpen.ts b/src/vs/workbench/contrib/debug/browser/debugQuickOpen.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugQuickOpen.ts rename to src/vs/workbench/contrib/debug/browser/debugQuickOpen.ts diff --git a/src/vs/workbench/parts/debug/browser/debugStatus.ts b/src/vs/workbench/contrib/debug/browser/debugStatus.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugStatus.ts rename to src/vs/workbench/contrib/debug/browser/debugStatus.ts diff --git a/src/vs/workbench/parts/debug/browser/debugToolbar.ts b/src/vs/workbench/contrib/debug/browser/debugToolbar.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugToolbar.ts rename to src/vs/workbench/contrib/debug/browser/debugToolbar.ts diff --git a/src/vs/workbench/parts/debug/browser/debugViewlet.ts b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/debugViewlet.ts rename to src/vs/workbench/contrib/debug/browser/debugViewlet.ts diff --git a/src/vs/workbench/parts/debug/browser/exceptionWidget.ts b/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/exceptionWidget.ts rename to src/vs/workbench/contrib/debug/browser/exceptionWidget.ts diff --git a/src/vs/workbench/parts/debug/browser/linkDetector.ts b/src/vs/workbench/contrib/debug/browser/linkDetector.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/linkDetector.ts rename to src/vs/workbench/contrib/debug/browser/linkDetector.ts diff --git a/src/vs/workbench/parts/debug/browser/loadedScriptsView.ts b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/loadedScriptsView.ts rename to src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts diff --git a/src/vs/workbench/parts/debug/browser/media/add-focus.svg b/src/vs/workbench/contrib/debug/browser/media/add-focus.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/add-focus.svg rename to src/vs/workbench/contrib/debug/browser/media/add-focus.svg diff --git a/src/vs/workbench/parts/debug/browser/media/add-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/add-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/add-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/add-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/add.svg b/src/vs/workbench/contrib/debug/browser/media/add.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/add.svg rename to src/vs/workbench/contrib/debug/browser/media/add.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-conditional-disabled.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-conditional-disabled.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-conditional-disabled.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-conditional-disabled.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-conditional-unverified.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-conditional-unverified.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-conditional-unverified.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-conditional-unverified.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-conditional.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-conditional.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-conditional.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-conditional.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-disabled.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-disabled.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-disabled.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-disabled.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-function-disabled.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-function-disabled.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-function-disabled.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-function-disabled.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-function-unverified.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-function-unverified.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-function-unverified.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-function-unverified.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-function.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-function.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-function.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-function.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-hint.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-hint.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-hint.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-hint.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-log-disabled.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-log-disabled.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-log-disabled.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-log-disabled.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-log-unverified.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-log-unverified.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-log-unverified.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-log-unverified.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-log.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-log.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-log.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-log.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-unsupported.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-unsupported.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-unsupported.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-unsupported.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint-unverified.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint-unverified.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint-unverified.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint-unverified.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoint.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoint.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoint.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoint.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpointWidget.css b/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpointWidget.css rename to src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoints-activate-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoints-activate-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoints-activate-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoints-activate-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/breakpoints-activate.svg b/src/vs/workbench/contrib/debug/browser/media/breakpoints-activate.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/breakpoints-activate.svg rename to src/vs/workbench/contrib/debug/browser/media/breakpoints-activate.svg diff --git a/src/vs/workbench/parts/debug/browser/media/clear-repl-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/clear-repl-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/clear-repl-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/clear-repl-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/clear-repl.svg b/src/vs/workbench/contrib/debug/browser/media/clear-repl.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/clear-repl.svg rename to src/vs/workbench/contrib/debug/browser/media/clear-repl.svg diff --git a/src/vs/workbench/parts/debug/browser/media/configure-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/configure-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/configure-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/configure-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/configure.svg b/src/vs/workbench/contrib/debug/browser/media/configure.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/configure.svg rename to src/vs/workbench/contrib/debug/browser/media/configure.svg diff --git a/src/vs/workbench/parts/debug/browser/media/continue-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/continue-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/continue-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/continue-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/continue.svg b/src/vs/workbench/contrib/debug/browser/media/continue.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/continue.svg rename to src/vs/workbench/contrib/debug/browser/media/continue.svg diff --git a/src/vs/workbench/parts/debug/browser/media/current-and-breakpoint.svg b/src/vs/workbench/contrib/debug/browser/media/current-and-breakpoint.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/current-and-breakpoint.svg rename to src/vs/workbench/contrib/debug/browser/media/current-and-breakpoint.svg diff --git a/src/vs/workbench/parts/debug/browser/media/current-arrow.svg b/src/vs/workbench/contrib/debug/browser/media/current-arrow.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/current-arrow.svg rename to src/vs/workbench/contrib/debug/browser/media/current-arrow.svg diff --git a/src/vs/workbench/parts/debug/browser/media/debug-dark.svg b/src/vs/workbench/contrib/debug/browser/media/debug-dark.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/debug-dark.svg rename to src/vs/workbench/contrib/debug/browser/media/debug-dark.svg diff --git a/src/vs/workbench/parts/debug/browser/media/debug.contribution.css b/src/vs/workbench/contrib/debug/browser/media/debug.contribution.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/debug.contribution.css rename to src/vs/workbench/contrib/debug/browser/media/debug.contribution.css diff --git a/src/vs/workbench/parts/debug/browser/media/debugHover.css b/src/vs/workbench/contrib/debug/browser/media/debugHover.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/debugHover.css rename to src/vs/workbench/contrib/debug/browser/media/debugHover.css diff --git a/src/vs/workbench/parts/debug/browser/media/debugToolbar.css b/src/vs/workbench/contrib/debug/browser/media/debugToolbar.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/debugToolbar.css rename to src/vs/workbench/contrib/debug/browser/media/debugToolbar.css diff --git a/src/vs/workbench/parts/debug/browser/media/debugViewlet.css b/src/vs/workbench/contrib/debug/browser/media/debugViewlet.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/debugViewlet.css rename to src/vs/workbench/contrib/debug/browser/media/debugViewlet.css diff --git a/src/vs/workbench/parts/debug/browser/media/disconnect-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/disconnect-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/disconnect-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/disconnect-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/disconnect.svg b/src/vs/workbench/contrib/debug/browser/media/disconnect.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/disconnect.svg rename to src/vs/workbench/contrib/debug/browser/media/disconnect.svg diff --git a/src/vs/workbench/parts/debug/browser/media/drag.svg b/src/vs/workbench/contrib/debug/browser/media/drag.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/drag.svg rename to src/vs/workbench/contrib/debug/browser/media/drag.svg diff --git a/src/vs/workbench/parts/debug/browser/media/exceptionWidget.css b/src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/exceptionWidget.css rename to src/vs/workbench/contrib/debug/browser/media/exceptionWidget.css diff --git a/src/vs/workbench/parts/debug/browser/media/pause-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/pause-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/pause-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/pause-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/pause.svg b/src/vs/workbench/contrib/debug/browser/media/pause.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/pause.svg rename to src/vs/workbench/contrib/debug/browser/media/pause.svg diff --git a/src/vs/workbench/parts/debug/browser/media/remove-all-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/remove-all-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/remove-all-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/remove-all-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/remove-all.svg b/src/vs/workbench/contrib/debug/browser/media/remove-all.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/remove-all.svg rename to src/vs/workbench/contrib/debug/browser/media/remove-all.svg diff --git a/src/vs/workbench/parts/debug/browser/media/repl-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/repl-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/repl-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/repl-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/repl.css b/src/vs/workbench/contrib/debug/browser/media/repl.css similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/repl.css rename to src/vs/workbench/contrib/debug/browser/media/repl.css diff --git a/src/vs/workbench/parts/debug/browser/media/repl.svg b/src/vs/workbench/contrib/debug/browser/media/repl.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/repl.svg rename to src/vs/workbench/contrib/debug/browser/media/repl.svg diff --git a/src/vs/workbench/parts/debug/browser/media/restart-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/restart-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/restart-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/restart-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/restart.svg b/src/vs/workbench/contrib/debug/browser/media/restart.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/restart.svg rename to src/vs/workbench/contrib/debug/browser/media/restart.svg diff --git a/src/vs/workbench/parts/debug/browser/media/stackframe-and-breakpoint.svg b/src/vs/workbench/contrib/debug/browser/media/stackframe-and-breakpoint.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/stackframe-and-breakpoint.svg rename to src/vs/workbench/contrib/debug/browser/media/stackframe-and-breakpoint.svg diff --git a/src/vs/workbench/parts/debug/browser/media/stackframe-arrow.svg b/src/vs/workbench/contrib/debug/browser/media/stackframe-arrow.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/stackframe-arrow.svg rename to src/vs/workbench/contrib/debug/browser/media/stackframe-arrow.svg diff --git a/src/vs/workbench/parts/debug/browser/media/start-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/start-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/start-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/start-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/start.svg b/src/vs/workbench/contrib/debug/browser/media/start.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/start.svg rename to src/vs/workbench/contrib/debug/browser/media/start.svg diff --git a/src/vs/workbench/parts/debug/browser/media/step-into-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/step-into-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/step-into-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/step-into-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/step-into.svg b/src/vs/workbench/contrib/debug/browser/media/step-into.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/step-into.svg rename to src/vs/workbench/contrib/debug/browser/media/step-into.svg diff --git a/src/vs/workbench/parts/debug/browser/media/step-out-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/step-out-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/step-out-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/step-out-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/step-out.svg b/src/vs/workbench/contrib/debug/browser/media/step-out.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/step-out.svg rename to src/vs/workbench/contrib/debug/browser/media/step-out.svg diff --git a/src/vs/workbench/parts/debug/browser/media/step-over-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/step-over-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/step-over-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/step-over-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/step-over.svg b/src/vs/workbench/contrib/debug/browser/media/step-over.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/step-over.svg rename to src/vs/workbench/contrib/debug/browser/media/step-over.svg diff --git a/src/vs/workbench/parts/debug/browser/media/stop-inverse.svg b/src/vs/workbench/contrib/debug/browser/media/stop-inverse.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/stop-inverse.svg rename to src/vs/workbench/contrib/debug/browser/media/stop-inverse.svg diff --git a/src/vs/workbench/parts/debug/browser/media/stop.svg b/src/vs/workbench/contrib/debug/browser/media/stop.svg similarity index 100% rename from src/vs/workbench/parts/debug/browser/media/stop.svg rename to src/vs/workbench/contrib/debug/browser/media/stop.svg diff --git a/src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts b/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.ts similarity index 100% rename from src/vs/workbench/parts/debug/browser/statusbarColorProvider.ts rename to src/vs/workbench/contrib/debug/browser/statusbarColorProvider.ts diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debug.ts rename to src/vs/workbench/contrib/debug/common/debug.ts diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/contrib/debug/common/debugModel.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debugModel.ts rename to src/vs/workbench/contrib/debug/common/debugModel.ts diff --git a/src/vs/workbench/parts/debug/common/debugProtocol.d.ts b/src/vs/workbench/contrib/debug/common/debugProtocol.d.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debugProtocol.d.ts rename to src/vs/workbench/contrib/debug/common/debugProtocol.d.ts diff --git a/src/vs/workbench/parts/debug/common/debugSchemas.ts b/src/vs/workbench/contrib/debug/common/debugSchemas.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debugSchemas.ts rename to src/vs/workbench/contrib/debug/common/debugSchemas.ts diff --git a/src/vs/workbench/parts/debug/common/debugSource.ts b/src/vs/workbench/contrib/debug/common/debugSource.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debugSource.ts rename to src/vs/workbench/contrib/debug/common/debugSource.ts diff --git a/src/vs/workbench/parts/debug/common/debugUtils.ts b/src/vs/workbench/contrib/debug/common/debugUtils.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debugUtils.ts rename to src/vs/workbench/contrib/debug/common/debugUtils.ts diff --git a/src/vs/workbench/parts/debug/common/debugViewModel.ts b/src/vs/workbench/contrib/debug/common/debugViewModel.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/debugViewModel.ts rename to src/vs/workbench/contrib/debug/common/debugViewModel.ts diff --git a/src/vs/workbench/parts/debug/common/replModel.ts b/src/vs/workbench/contrib/debug/common/replModel.ts similarity index 100% rename from src/vs/workbench/parts/debug/common/replModel.ts rename to src/vs/workbench/contrib/debug/common/replModel.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts b/src/vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/breakpointWidget.ts rename to src/vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/callStackView.ts b/src/vs/workbench/contrib/debug/electron-browser/callStackView.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/callStackView.ts rename to src/vs/workbench/contrib/debug/electron-browser/callStackView.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts rename to src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/debugConfigurationManager.ts rename to src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts rename to src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/debugHover.ts b/src/vs/workbench/contrib/debug/electron-browser/debugHover.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/debugHover.ts rename to src/vs/workbench/contrib/debug/electron-browser/debugHover.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/contrib/debug/electron-browser/debugService.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/debugService.ts rename to src/vs/workbench/contrib/debug/electron-browser/debugService.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/debugSession.ts b/src/vs/workbench/contrib/debug/electron-browser/debugSession.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/debugSession.ts rename to src/vs/workbench/contrib/debug/electron-browser/debugSession.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts b/src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/electronDebugActions.ts rename to src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/media/continue-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/continue-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/continue-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/continue-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/continue-without-debugging-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/continue-without-debugging-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/continue-without-debugging-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/continue-without-debugging-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/pause-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/pause-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/pause-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/pause-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/restart-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/restart-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/restart-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/restart-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/stepinto-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/stepinto-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/stepinto-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/stepinto-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/stepout-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/stepout-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/stepout-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/stepout-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/stepover-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/stepover-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/stepover-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/stepover-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/media/stop-tb.png b/src/vs/workbench/contrib/debug/electron-browser/media/stop-tb.png similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/media/stop-tb.png rename to src/vs/workbench/contrib/debug/electron-browser/media/stop-tb.png diff --git a/src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts b/src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/rawDebugSession.ts rename to src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/contrib/debug/electron-browser/repl.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/repl.ts rename to src/vs/workbench/contrib/debug/electron-browser/repl.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts b/src/vs/workbench/contrib/debug/electron-browser/terminalSupport.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/terminalSupport.ts rename to src/vs/workbench/contrib/debug/electron-browser/terminalSupport.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/variablesView.ts b/src/vs/workbench/contrib/debug/electron-browser/variablesView.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/variablesView.ts rename to src/vs/workbench/contrib/debug/electron-browser/variablesView.ts diff --git a/src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts b/src/vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts similarity index 100% rename from src/vs/workbench/parts/debug/electron-browser/watchExpressionsView.ts rename to src/vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts diff --git a/src/vs/workbench/parts/debug/node/debugAdapter.ts b/src/vs/workbench/contrib/debug/node/debugAdapter.ts similarity index 100% rename from src/vs/workbench/parts/debug/node/debugAdapter.ts rename to src/vs/workbench/contrib/debug/node/debugAdapter.ts diff --git a/src/vs/workbench/parts/debug/node/debugger.ts b/src/vs/workbench/contrib/debug/node/debugger.ts similarity index 100% rename from src/vs/workbench/parts/debug/node/debugger.ts rename to src/vs/workbench/contrib/debug/node/debugger.ts diff --git a/src/vs/workbench/parts/debug/node/telemetryApp.ts b/src/vs/workbench/contrib/debug/node/telemetryApp.ts similarity index 100% rename from src/vs/workbench/parts/debug/node/telemetryApp.ts rename to src/vs/workbench/contrib/debug/node/telemetryApp.ts diff --git a/src/vs/workbench/parts/debug/node/terminals.ts b/src/vs/workbench/contrib/debug/node/terminals.ts similarity index 100% rename from src/vs/workbench/parts/debug/node/terminals.ts rename to src/vs/workbench/contrib/debug/node/terminals.ts diff --git a/src/vs/workbench/parts/debug/test/browser/baseDebugView.test.ts b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/browser/baseDebugView.test.ts rename to src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts diff --git a/src/vs/workbench/parts/debug/test/browser/debugANSIHandling.test.ts b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/browser/debugANSIHandling.test.ts rename to src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts diff --git a/src/vs/workbench/parts/debug/test/browser/linkDetector.test.ts b/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/browser/linkDetector.test.ts rename to src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts diff --git a/src/vs/workbench/parts/debug/test/common/debugSource.test.ts b/src/vs/workbench/contrib/debug/test/common/debugSource.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/common/debugSource.test.ts rename to src/vs/workbench/contrib/debug/test/common/debugSource.test.ts diff --git a/src/vs/workbench/parts/debug/test/common/debugUtils.test.ts b/src/vs/workbench/contrib/debug/test/common/debugUtils.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/common/debugUtils.test.ts rename to src/vs/workbench/contrib/debug/test/common/debugUtils.test.ts diff --git a/src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts b/src/vs/workbench/contrib/debug/test/common/debugViewModel.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/common/debugViewModel.test.ts rename to src/vs/workbench/contrib/debug/test/common/debugViewModel.test.ts diff --git a/src/vs/workbench/parts/debug/test/common/mockDebug.ts b/src/vs/workbench/contrib/debug/test/common/mockDebug.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/common/mockDebug.ts rename to src/vs/workbench/contrib/debug/test/common/mockDebug.ts diff --git a/src/vs/workbench/parts/debug/test/electron-browser/debugModel.test.ts b/src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/electron-browser/debugModel.test.ts rename to src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts diff --git a/src/vs/workbench/parts/debug/test/node/debugger.test.ts b/src/vs/workbench/contrib/debug/test/node/debugger.test.ts similarity index 100% rename from src/vs/workbench/parts/debug/test/node/debugger.test.ts rename to src/vs/workbench/contrib/debug/test/node/debugger.test.ts diff --git a/src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts b/src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts similarity index 100% rename from src/vs/workbench/parts/emmet/browser/actions/showEmmetCommands.ts rename to src/vs/workbench/contrib/emmet/browser/actions/showEmmetCommands.ts diff --git a/src/vs/workbench/parts/emmet/browser/emmet.browser.contribution.ts b/src/vs/workbench/contrib/emmet/browser/emmet.browser.contribution.ts similarity index 100% rename from src/vs/workbench/parts/emmet/browser/emmet.browser.contribution.ts rename to src/vs/workbench/contrib/emmet/browser/emmet.browser.contribution.ts diff --git a/src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts b/src/vs/workbench/contrib/emmet/electron-browser/actions/expandAbbreviation.ts similarity index 100% rename from src/vs/workbench/parts/emmet/electron-browser/actions/expandAbbreviation.ts rename to src/vs/workbench/contrib/emmet/electron-browser/actions/expandAbbreviation.ts diff --git a/src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts b/src/vs/workbench/contrib/emmet/electron-browser/emmet.contribution.ts similarity index 100% rename from src/vs/workbench/parts/emmet/electron-browser/emmet.contribution.ts rename to src/vs/workbench/contrib/emmet/electron-browser/emmet.contribution.ts diff --git a/src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts b/src/vs/workbench/contrib/emmet/electron-browser/emmetActions.ts similarity index 100% rename from src/vs/workbench/parts/emmet/electron-browser/emmetActions.ts rename to src/vs/workbench/contrib/emmet/electron-browser/emmetActions.ts diff --git a/src/vs/workbench/parts/emmet/test/electron-browser/emmetAction.test.ts b/src/vs/workbench/contrib/emmet/test/electron-browser/emmetAction.test.ts similarity index 100% rename from src/vs/workbench/parts/emmet/test/electron-browser/emmetAction.test.ts rename to src/vs/workbench/contrib/emmet/test/electron-browser/emmetAction.test.ts diff --git a/src/vs/workbench/parts/execution/common/execution.ts b/src/vs/workbench/contrib/execution/common/execution.ts similarity index 100% rename from src/vs/workbench/parts/execution/common/execution.ts rename to src/vs/workbench/contrib/execution/common/execution.ts diff --git a/src/vs/workbench/parts/execution/electron-browser/TerminalHelper.scpt b/src/vs/workbench/contrib/execution/electron-browser/TerminalHelper.scpt similarity index 100% rename from src/vs/workbench/parts/execution/electron-browser/TerminalHelper.scpt rename to src/vs/workbench/contrib/execution/electron-browser/TerminalHelper.scpt diff --git a/src/vs/workbench/parts/execution/electron-browser/execution.contribution.ts b/src/vs/workbench/contrib/execution/electron-browser/execution.contribution.ts similarity index 100% rename from src/vs/workbench/parts/execution/electron-browser/execution.contribution.ts rename to src/vs/workbench/contrib/execution/electron-browser/execution.contribution.ts diff --git a/src/vs/workbench/parts/execution/electron-browser/iTermHelper.scpt b/src/vs/workbench/contrib/execution/electron-browser/iTermHelper.scpt similarity index 100% rename from src/vs/workbench/parts/execution/electron-browser/iTermHelper.scpt rename to src/vs/workbench/contrib/execution/electron-browser/iTermHelper.scpt diff --git a/src/vs/workbench/parts/execution/electron-browser/terminal.ts b/src/vs/workbench/contrib/execution/electron-browser/terminal.ts similarity index 100% rename from src/vs/workbench/parts/execution/electron-browser/terminal.ts rename to src/vs/workbench/contrib/execution/electron-browser/terminal.ts diff --git a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts b/src/vs/workbench/contrib/execution/electron-browser/terminalService.ts similarity index 100% rename from src/vs/workbench/parts/execution/electron-browser/terminalService.ts rename to src/vs/workbench/contrib/execution/electron-browser/terminalService.ts diff --git a/src/vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts b/src/vs/workbench/contrib/execution/test/electron-browser/terminalService.test.ts similarity index 100% rename from src/vs/workbench/parts/execution/test/electron-browser/terminalService.test.ts rename to src/vs/workbench/contrib/execution/test/electron-browser/terminalService.test.ts diff --git a/src/vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ts b/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts similarity index 100% rename from src/vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ts rename to src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts diff --git a/src/vs/workbench/parts/experiments/electron-browser/experiments.contribution.ts b/src/vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts similarity index 100% rename from src/vs/workbench/parts/experiments/electron-browser/experiments.contribution.ts rename to src/vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts diff --git a/src/vs/workbench/parts/experiments/node/experimentService.ts b/src/vs/workbench/contrib/experiments/node/experimentService.ts similarity index 100% rename from src/vs/workbench/parts/experiments/node/experimentService.ts rename to src/vs/workbench/contrib/experiments/node/experimentService.ts diff --git a/src/vs/workbench/parts/experiments/test/electron-browser/experimentService.test.ts b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts similarity index 100% rename from src/vs/workbench/parts/experiments/test/electron-browser/experimentService.test.ts rename to src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts diff --git a/src/vs/workbench/parts/experiments/test/electron-browser/experimentalPrompts.test.ts b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts similarity index 100% rename from src/vs/workbench/parts/experiments/test/electron-browser/experimentalPrompts.test.ts rename to src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts diff --git a/src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts b/src/vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts similarity index 100% rename from src/vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts rename to src/vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts diff --git a/src/vs/workbench/parts/extensions/browser/extensionsViewer.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts similarity index 100% rename from src/vs/workbench/parts/extensions/browser/extensionsViewer.ts rename to src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts diff --git a/src/vs/workbench/parts/extensions/common/extensionQuery.ts b/src/vs/workbench/contrib/extensions/common/extensionQuery.ts similarity index 100% rename from src/vs/workbench/parts/extensions/common/extensionQuery.ts rename to src/vs/workbench/contrib/extensions/common/extensionQuery.ts diff --git a/src/vs/workbench/parts/extensions/common/extensions.ts b/src/vs/workbench/contrib/extensions/common/extensions.ts similarity index 100% rename from src/vs/workbench/parts/extensions/common/extensions.ts rename to src/vs/workbench/contrib/extensions/common/extensions.ts diff --git a/src/vs/workbench/parts/extensions/common/extensionsFileTemplate.ts b/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts similarity index 100% rename from src/vs/workbench/parts/extensions/common/extensionsFileTemplate.ts rename to src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts diff --git a/src/vs/workbench/parts/extensions/common/extensionsInput.ts b/src/vs/workbench/contrib/extensions/common/extensionsInput.ts similarity index 100% rename from src/vs/workbench/parts/extensions/common/extensionsInput.ts rename to src/vs/workbench/contrib/extensions/common/extensionsInput.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionEditor.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionProfileService.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensions.contribution.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsActions.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsActivationProgress.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActivationProgress.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsActivationProgress.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsActivationProgress.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsAutoProfiler.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsAutoProfiler.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsList.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsUtils.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsUtils.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsViewlet.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsViews.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/extensionsWidgets.ts rename to src/vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/EmptyStar.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/EmptyStar.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/EmptyStar.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/EmptyStar.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/FullStarLight.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/FullStarLight.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/FullStarLight.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/FullStarLight.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/HalfStarLight.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/HalfStarLight.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/HalfStarLight.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/HalfStarLight.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/clear-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/clear-inverse.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/clear-inverse.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/clear-inverse.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/clear.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/clear.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/clear.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/clear.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/defaultIcon.png b/src/vs/workbench/contrib/extensions/electron-browser/media/defaultIcon.png similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/defaultIcon.png rename to src/vs/workbench/contrib/extensions/electron-browser/media/defaultIcon.png diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionActions.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/extensionActions.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/extensionActions.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionEditor.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/extensionEditor.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/extensionEditor.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensions-dark.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/extensions-dark.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/extensions-dark.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/extensions-dark.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensions.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensions.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/extensions.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/extensions.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionsViewlet.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/extensionsViewlet.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/extensionsViewlet.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/extensionsWidgets.css b/src/vs/workbench/contrib/extensions/electron-browser/media/extensionsWidgets.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/extensionsWidgets.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/extensionsWidgets.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/language-icon.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/language-icon.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/language-icon.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/language-icon.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/loading.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/loading.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/loading.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/loading.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/manage-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/manage-inverse.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/manage-inverse.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/manage-inverse.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/manage.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/manage.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/manage.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/manage.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/markdown.css b/src/vs/workbench/contrib/extensions/electron-browser/media/markdown.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/markdown.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/markdown.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/profile-start-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/profile-start-inverse.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/profile-start-inverse.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/profile-start-inverse.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/profile-start.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/profile-start.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/profile-start.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/profile-start.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/profile-stop-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/profile-stop-inverse.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/profile-stop-inverse.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/profile-stop-inverse.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/profile-stop.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/profile-stop.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/profile-stop.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/profile-stop.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css b/src/vs/workbench/contrib/extensions/electron-browser/media/runtimeExtensionsEditor.css similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/runtimeExtensionsEditor.css rename to src/vs/workbench/contrib/extensions/electron-browser/media/runtimeExtensionsEditor.css diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/save-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/save-inverse.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/save-inverse.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/save-inverse.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/save.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/save.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/save.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/save.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/start-inverse.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/start-inverse.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/start-inverse.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/start-inverse.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/start.svg b/src/vs/workbench/contrib/extensions/electron-browser/media/start.svg similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/start.svg rename to src/vs/workbench/contrib/extensions/electron-browser/media/start.svg diff --git a/src/vs/workbench/parts/extensions/electron-browser/media/theme-icon.png b/src/vs/workbench/contrib/extensions/electron-browser/media/theme-icon.png similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/media/theme-icon.png rename to src/vs/workbench/contrib/extensions/electron-browser/media/theme-icon.png diff --git a/src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts similarity index 100% rename from src/vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor.ts rename to src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts similarity index 100% rename from src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts rename to src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts diff --git a/src/vs/workbench/parts/extensions/test/common/extensionQuery.test.ts b/src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts similarity index 100% rename from src/vs/workbench/parts/extensions/test/common/extensionQuery.test.ts rename to src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts similarity index 100% rename from src/vs/workbench/parts/extensions/test/electron-browser/extensionsActions.test.ts rename to src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts similarity index 100% rename from src/vs/workbench/parts/extensions/test/electron-browser/extensionsTipsService.test.ts rename to src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts similarity index 100% rename from src/vs/workbench/parts/extensions/test/electron-browser/extensionsViews.test.ts rename to src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts diff --git a/src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts similarity index 100% rename from src/vs/workbench/parts/extensions/test/electron-browser/extensionsWorkbenchService.test.ts rename to src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts b/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts rename to src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedback.ts b/src/vs/workbench/contrib/feedback/electron-browser/feedback.ts similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/feedback.ts rename to src/vs/workbench/contrib/feedback/electron-browser/feedback.ts diff --git a/src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts b/src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts rename to src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/close-dark.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/close-dark.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/close-dark.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/close-dark.svg diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/close.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/close.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/close.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/close.svg diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/feedback.css b/src/vs/workbench/contrib/feedback/electron-browser/media/feedback.css similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/feedback.css rename to src/vs/workbench/contrib/feedback/electron-browser/media/feedback.css diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/happy.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/happy.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/happy.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/happy.svg diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/info.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/info.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/info.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/info.svg diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/sad.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/sad.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/sad.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/sad.svg diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/smiley.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/smiley.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/smiley.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/smiley.svg diff --git a/src/vs/workbench/parts/feedback/electron-browser/media/twitter.svg b/src/vs/workbench/contrib/feedback/electron-browser/media/twitter.svg similarity index 100% rename from src/vs/workbench/parts/feedback/electron-browser/media/twitter.svg rename to src/vs/workbench/contrib/feedback/electron-browser/media/twitter.svg diff --git a/src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts b/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts similarity index 100% rename from src/vs/workbench/parts/files/browser/editors/binaryFileEditor.ts rename to src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts diff --git a/src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts similarity index 100% rename from src/vs/workbench/parts/files/browser/editors/fileEditorTracker.ts rename to src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts similarity index 100% rename from src/vs/workbench/parts/files/browser/editors/textFileEditor.ts rename to src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts diff --git a/src/vs/workbench/parts/files/browser/files.ts b/src/vs/workbench/contrib/files/browser/files.ts similarity index 100% rename from src/vs/workbench/parts/files/browser/files.ts rename to src/vs/workbench/contrib/files/browser/files.ts diff --git a/src/vs/workbench/parts/files/common/dirtyFilesTracker.ts b/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts similarity index 100% rename from src/vs/workbench/parts/files/common/dirtyFilesTracker.ts rename to src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts diff --git a/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts similarity index 100% rename from src/vs/workbench/parts/files/common/editors/fileEditorInput.ts rename to src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts diff --git a/src/vs/workbench/parts/files/common/explorerModel.ts b/src/vs/workbench/contrib/files/common/explorerModel.ts similarity index 100% rename from src/vs/workbench/parts/files/common/explorerModel.ts rename to src/vs/workbench/contrib/files/common/explorerModel.ts diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/contrib/files/common/files.ts similarity index 100% rename from src/vs/workbench/parts/files/common/files.ts rename to src/vs/workbench/contrib/files/common/files.ts diff --git a/src/vs/workbench/parts/files/electron-browser/explorerService.ts b/src/vs/workbench/contrib/files/electron-browser/explorerService.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/explorerService.ts rename to src/vs/workbench/contrib/files/electron-browser/explorerService.ts diff --git a/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts b/src/vs/workbench/contrib/files/electron-browser/explorerViewlet.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts rename to src/vs/workbench/contrib/files/electron-browser/explorerViewlet.ts diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/fileActions.contribution.ts rename to src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/contrib/files/electron-browser/fileActions.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/fileActions.ts rename to src/vs/workbench/contrib/files/electron-browser/fileActions.ts diff --git a/src/vs/workbench/parts/files/electron-browser/fileCommands.ts b/src/vs/workbench/contrib/files/electron-browser/fileCommands.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/fileCommands.ts rename to src/vs/workbench/contrib/files/electron-browser/fileCommands.ts diff --git a/src/vs/workbench/parts/files/electron-browser/files.contribution.ts b/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/files.contribution.ts rename to src/vs/workbench/contrib/files/electron-browser/files.contribution.ts diff --git a/src/vs/workbench/parts/files/electron-browser/media/AddFile.svg b/src/vs/workbench/contrib/files/electron-browser/media/AddFile.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/AddFile.svg rename to src/vs/workbench/contrib/files/electron-browser/media/AddFile.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/AddFile_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/AddFile_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/AddFile_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/AddFile_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/AddFolder.svg b/src/vs/workbench/contrib/files/electron-browser/media/AddFolder.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/AddFolder.svg rename to src/vs/workbench/contrib/files/electron-browser/media/AddFolder.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/AddFolder_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/AddFolder_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/AddFolder_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/AddFolder_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/CollapseAll.svg b/src/vs/workbench/contrib/files/electron-browser/media/CollapseAll.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/CollapseAll.svg rename to src/vs/workbench/contrib/files/electron-browser/media/CollapseAll.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/CollapseAll_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/CollapseAll_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/CollapseAll_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/CollapseAll_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/Preview.svg b/src/vs/workbench/contrib/files/electron-browser/media/Preview.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/Preview.svg rename to src/vs/workbench/contrib/files/electron-browser/media/Preview.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/Preview_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/Preview_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/Preview_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/Preview_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/Refresh.svg b/src/vs/workbench/contrib/files/electron-browser/media/Refresh.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/Refresh.svg rename to src/vs/workbench/contrib/files/electron-browser/media/Refresh.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/Refresh_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/Refresh_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/Refresh_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/Refresh_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/action-close-dark.svg b/src/vs/workbench/contrib/files/electron-browser/media/action-close-dark.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/action-close-dark.svg rename to src/vs/workbench/contrib/files/electron-browser/media/action-close-dark.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/action-close-dirty-dark.svg b/src/vs/workbench/contrib/files/electron-browser/media/action-close-dirty-dark.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/action-close-dirty-dark.svg rename to src/vs/workbench/contrib/files/electron-browser/media/action-close-dirty-dark.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/action-close-dirty-focus.svg b/src/vs/workbench/contrib/files/electron-browser/media/action-close-dirty-focus.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/action-close-dirty-focus.svg rename to src/vs/workbench/contrib/files/electron-browser/media/action-close-dirty-focus.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/action-close-dirty.svg b/src/vs/workbench/contrib/files/electron-browser/media/action-close-dirty.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/action-close-dirty.svg rename to src/vs/workbench/contrib/files/electron-browser/media/action-close-dirty.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/action-close-focus.svg b/src/vs/workbench/contrib/files/electron-browser/media/action-close-focus.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/action-close-focus.svg rename to src/vs/workbench/contrib/files/electron-browser/media/action-close-focus.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/action-close.svg b/src/vs/workbench/contrib/files/electron-browser/media/action-close.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/action-close.svg rename to src/vs/workbench/contrib/files/electron-browser/media/action-close.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/check-inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/check-inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/check-inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/check-inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/check.svg b/src/vs/workbench/contrib/files/electron-browser/media/check.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/check.svg rename to src/vs/workbench/contrib/files/electron-browser/media/check.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/closeall.svg b/src/vs/workbench/contrib/files/electron-browser/media/closeall.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/closeall.svg rename to src/vs/workbench/contrib/files/electron-browser/media/closeall.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/closeall_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/closeall_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/closeall_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/closeall_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/explorerviewlet.css b/src/vs/workbench/contrib/files/electron-browser/media/explorerviewlet.css similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/explorerviewlet.css rename to src/vs/workbench/contrib/files/electron-browser/media/explorerviewlet.css diff --git a/src/vs/workbench/parts/files/electron-browser/media/fileactions.css b/src/vs/workbench/contrib/files/electron-browser/media/fileactions.css similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/fileactions.css rename to src/vs/workbench/contrib/files/electron-browser/media/fileactions.css diff --git a/src/vs/workbench/parts/files/electron-browser/media/files-dark.svg b/src/vs/workbench/contrib/files/electron-browser/media/files-dark.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/files-dark.svg rename to src/vs/workbench/contrib/files/electron-browser/media/files-dark.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/saveall.svg b/src/vs/workbench/contrib/files/electron-browser/media/saveall.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/saveall.svg rename to src/vs/workbench/contrib/files/electron-browser/media/saveall.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/saveall_inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/saveall_inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/saveall_inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/saveall_inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/split-editor-horizontal-inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/split-editor-horizontal-inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/split-editor-horizontal-inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/split-editor-horizontal-inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/split-editor-horizontal.svg b/src/vs/workbench/contrib/files/electron-browser/media/split-editor-horizontal.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/split-editor-horizontal.svg rename to src/vs/workbench/contrib/files/electron-browser/media/split-editor-horizontal.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/split-editor-vertical-inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/split-editor-vertical-inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/split-editor-vertical-inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/split-editor-vertical-inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/split-editor-vertical.svg b/src/vs/workbench/contrib/files/electron-browser/media/split-editor-vertical.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/split-editor-vertical.svg rename to src/vs/workbench/contrib/files/electron-browser/media/split-editor-vertical.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/undo-inverse.svg b/src/vs/workbench/contrib/files/electron-browser/media/undo-inverse.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/undo-inverse.svg rename to src/vs/workbench/contrib/files/electron-browser/media/undo-inverse.svg diff --git a/src/vs/workbench/parts/files/electron-browser/media/undo.svg b/src/vs/workbench/contrib/files/electron-browser/media/undo.svg similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/media/undo.svg rename to src/vs/workbench/contrib/files/electron-browser/media/undo.svg diff --git a/src/vs/workbench/parts/files/electron-browser/saveErrorHandler.ts b/src/vs/workbench/contrib/files/electron-browser/saveErrorHandler.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/saveErrorHandler.ts rename to src/vs/workbench/contrib/files/electron-browser/saveErrorHandler.ts diff --git a/src/vs/workbench/parts/files/electron-browser/views/emptyView.ts b/src/vs/workbench/contrib/files/electron-browser/views/emptyView.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/views/emptyView.ts rename to src/vs/workbench/contrib/files/electron-browser/views/emptyView.ts diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider.ts rename to src/vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/views/explorerView.ts rename to src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts rename to src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/electron-browser/views/openEditorsView.ts similarity index 100% rename from src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts rename to src/vs/workbench/contrib/files/electron-browser/views/openEditorsView.ts diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts similarity index 100% rename from src/vs/workbench/parts/files/test/browser/fileEditorInput.test.ts rename to src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts diff --git a/src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts similarity index 100% rename from src/vs/workbench/parts/files/test/browser/fileEditorTracker.test.ts rename to src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts diff --git a/src/vs/workbench/parts/files/test/electron-browser/explorerModel.test.ts b/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts similarity index 100% rename from src/vs/workbench/parts/files/test/electron-browser/explorerModel.test.ts rename to src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts diff --git a/src/vs/workbench/parts/files/test/electron-browser/fileActions.test.ts b/src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts similarity index 100% rename from src/vs/workbench/parts/files/test/electron-browser/fileActions.test.ts rename to src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts diff --git a/src/vs/workbench/parts/html/common/htmlInput.ts b/src/vs/workbench/contrib/html/common/htmlInput.ts similarity index 100% rename from src/vs/workbench/parts/html/common/htmlInput.ts rename to src/vs/workbench/contrib/html/common/htmlInput.ts diff --git a/src/vs/workbench/parts/html/electron-browser/html.contribution.ts b/src/vs/workbench/contrib/html/electron-browser/html.contribution.ts similarity index 100% rename from src/vs/workbench/parts/html/electron-browser/html.contribution.ts rename to src/vs/workbench/contrib/html/electron-browser/html.contribution.ts diff --git a/src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts b/src/vs/workbench/contrib/html/electron-browser/htmlPreviewPart.ts similarity index 100% rename from src/vs/workbench/parts/html/electron-browser/htmlPreviewPart.ts rename to src/vs/workbench/contrib/html/electron-browser/htmlPreviewPart.ts diff --git a/src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts b/src/vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts similarity index 100% rename from src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts rename to src/vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts diff --git a/src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts b/src/vs/workbench/contrib/localizations/electron-browser/localizationsActions.ts similarity index 100% rename from src/vs/workbench/parts/localizations/electron-browser/localizationsActions.ts rename to src/vs/workbench/contrib/localizations/electron-browser/localizationsActions.ts diff --git a/src/vs/workbench/parts/logs/common/logConstants.ts b/src/vs/workbench/contrib/logs/common/logConstants.ts similarity index 100% rename from src/vs/workbench/parts/logs/common/logConstants.ts rename to src/vs/workbench/contrib/logs/common/logConstants.ts diff --git a/src/vs/workbench/parts/logs/electron-browser/logs.contribution.ts b/src/vs/workbench/contrib/logs/electron-browser/logs.contribution.ts similarity index 100% rename from src/vs/workbench/parts/logs/electron-browser/logs.contribution.ts rename to src/vs/workbench/contrib/logs/electron-browser/logs.contribution.ts diff --git a/src/vs/workbench/parts/logs/electron-browser/logsActions.ts b/src/vs/workbench/contrib/logs/electron-browser/logsActions.ts similarity index 100% rename from src/vs/workbench/parts/logs/electron-browser/logsActions.ts rename to src/vs/workbench/contrib/logs/electron-browser/logsActions.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/constants.ts b/src/vs/workbench/contrib/markers/electron-browser/constants.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/constants.ts rename to src/vs/workbench/contrib/markers/electron-browser/constants.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/electron-browser/markers.contribution.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markers.contribution.ts rename to src/vs/workbench/contrib/markers/electron-browser/markers.contribution.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markers.ts b/src/vs/workbench/contrib/markers/electron-browser/markers.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markers.ts rename to src/vs/workbench/contrib/markers/electron-browser/markers.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markersFileDecorations.ts b/src/vs/workbench/contrib/markers/electron-browser/markersFileDecorations.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markersFileDecorations.ts rename to src/vs/workbench/contrib/markers/electron-browser/markersFileDecorations.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markersFilterOptions.ts b/src/vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markersFilterOptions.ts rename to src/vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markersModel.ts b/src/vs/workbench/contrib/markers/electron-browser/markersModel.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markersModel.ts rename to src/vs/workbench/contrib/markers/electron-browser/markersModel.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanel.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markersPanel.ts rename to src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markersPanelActions.ts rename to src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts b/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/markersTreeViewer.ts rename to src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts diff --git a/src/vs/workbench/parts/markers/electron-browser/media/excludeSettings-dark.svg b/src/vs/workbench/contrib/markers/electron-browser/media/excludeSettings-dark.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/excludeSettings-dark.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/excludeSettings-dark.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/excludeSettings.svg b/src/vs/workbench/contrib/markers/electron-browser/media/excludeSettings.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/excludeSettings.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/excludeSettings.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/lightbulb-dark.svg b/src/vs/workbench/contrib/markers/electron-browser/media/lightbulb-dark.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/lightbulb-dark.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/lightbulb-dark.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/lightbulb.svg b/src/vs/workbench/contrib/markers/electron-browser/media/lightbulb.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/lightbulb.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/lightbulb.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/markers.css b/src/vs/workbench/contrib/markers/electron-browser/media/markers.css similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/markers.css rename to src/vs/workbench/contrib/markers/electron-browser/media/markers.css diff --git a/src/vs/workbench/parts/markers/electron-browser/media/status-error-inverse.svg b/src/vs/workbench/contrib/markers/electron-browser/media/status-error-inverse.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/status-error-inverse.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/status-error-inverse.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/status-error.svg b/src/vs/workbench/contrib/markers/electron-browser/media/status-error.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/status-error.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/status-error.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/status-info-inverse.svg b/src/vs/workbench/contrib/markers/electron-browser/media/status-info-inverse.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/status-info-inverse.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/status-info-inverse.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/status-info.svg b/src/vs/workbench/contrib/markers/electron-browser/media/status-info.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/status-info.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/status-info.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/status-warning-inverse.svg b/src/vs/workbench/contrib/markers/electron-browser/media/status-warning-inverse.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/status-warning-inverse.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/status-warning-inverse.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/media/status-warning.svg b/src/vs/workbench/contrib/markers/electron-browser/media/status-warning.svg similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/media/status-warning.svg rename to src/vs/workbench/contrib/markers/electron-browser/media/status-warning.svg diff --git a/src/vs/workbench/parts/markers/electron-browser/messages.ts b/src/vs/workbench/contrib/markers/electron-browser/messages.ts similarity index 100% rename from src/vs/workbench/parts/markers/electron-browser/messages.ts rename to src/vs/workbench/contrib/markers/electron-browser/messages.ts diff --git a/src/vs/workbench/parts/markers/test/electron-browser/markersModel.test.ts b/src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts similarity index 100% rename from src/vs/workbench/parts/markers/test/electron-browser/markersModel.test.ts rename to src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts diff --git a/src/vs/workbench/parts/outline/electron-browser/outline.contribution.ts b/src/vs/workbench/contrib/outline/electron-browser/outline.contribution.ts similarity index 100% rename from src/vs/workbench/parts/outline/electron-browser/outline.contribution.ts rename to src/vs/workbench/contrib/outline/electron-browser/outline.contribution.ts diff --git a/src/vs/workbench/parts/outline/electron-browser/outline.ts b/src/vs/workbench/contrib/outline/electron-browser/outline.ts similarity index 100% rename from src/vs/workbench/parts/outline/electron-browser/outline.ts rename to src/vs/workbench/contrib/outline/electron-browser/outline.ts diff --git a/src/vs/workbench/parts/outline/electron-browser/outlinePanel.css b/src/vs/workbench/contrib/outline/electron-browser/outlinePanel.css similarity index 100% rename from src/vs/workbench/parts/outline/electron-browser/outlinePanel.css rename to src/vs/workbench/contrib/outline/electron-browser/outlinePanel.css diff --git a/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts b/src/vs/workbench/contrib/outline/electron-browser/outlinePanel.ts similarity index 100% rename from src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts rename to src/vs/workbench/contrib/outline/electron-browser/outlinePanel.ts diff --git a/src/vs/workbench/parts/output/browser/logViewer.ts b/src/vs/workbench/contrib/output/browser/logViewer.ts similarity index 100% rename from src/vs/workbench/parts/output/browser/logViewer.ts rename to src/vs/workbench/contrib/output/browser/logViewer.ts diff --git a/src/vs/workbench/parts/output/browser/media/clear_output.svg b/src/vs/workbench/contrib/output/browser/media/clear_output.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/clear_output.svg rename to src/vs/workbench/contrib/output/browser/media/clear_output.svg diff --git a/src/vs/workbench/parts/output/browser/media/clear_output_inverse.svg b/src/vs/workbench/contrib/output/browser/media/clear_output_inverse.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/clear_output_inverse.svg rename to src/vs/workbench/contrib/output/browser/media/clear_output_inverse.svg diff --git a/src/vs/workbench/parts/output/browser/media/open_log_file.svg b/src/vs/workbench/contrib/output/browser/media/open_log_file.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/open_log_file.svg rename to src/vs/workbench/contrib/output/browser/media/open_log_file.svg diff --git a/src/vs/workbench/parts/output/browser/media/open_log_file_inverse.svg b/src/vs/workbench/contrib/output/browser/media/open_log_file_inverse.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/open_log_file_inverse.svg rename to src/vs/workbench/contrib/output/browser/media/open_log_file_inverse.svg diff --git a/src/vs/workbench/parts/output/browser/media/output.css b/src/vs/workbench/contrib/output/browser/media/output.css similarity index 100% rename from src/vs/workbench/parts/output/browser/media/output.css rename to src/vs/workbench/contrib/output/browser/media/output.css diff --git a/src/vs/workbench/parts/output/browser/media/output_lock.svg b/src/vs/workbench/contrib/output/browser/media/output_lock.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/output_lock.svg rename to src/vs/workbench/contrib/output/browser/media/output_lock.svg diff --git a/src/vs/workbench/parts/output/browser/media/output_lock_inverse.svg b/src/vs/workbench/contrib/output/browser/media/output_lock_inverse.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/output_lock_inverse.svg rename to src/vs/workbench/contrib/output/browser/media/output_lock_inverse.svg diff --git a/src/vs/workbench/parts/output/browser/media/output_unlock.svg b/src/vs/workbench/contrib/output/browser/media/output_unlock.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/output_unlock.svg rename to src/vs/workbench/contrib/output/browser/media/output_unlock.svg diff --git a/src/vs/workbench/parts/output/browser/media/output_unlock_inverse.svg b/src/vs/workbench/contrib/output/browser/media/output_unlock_inverse.svg similarity index 100% rename from src/vs/workbench/parts/output/browser/media/output_unlock_inverse.svg rename to src/vs/workbench/contrib/output/browser/media/output_unlock_inverse.svg diff --git a/src/vs/workbench/parts/output/browser/outputActions.ts b/src/vs/workbench/contrib/output/browser/outputActions.ts similarity index 100% rename from src/vs/workbench/parts/output/browser/outputActions.ts rename to src/vs/workbench/contrib/output/browser/outputActions.ts diff --git a/src/vs/workbench/parts/output/browser/outputPanel.ts b/src/vs/workbench/contrib/output/browser/outputPanel.ts similarity index 100% rename from src/vs/workbench/parts/output/browser/outputPanel.ts rename to src/vs/workbench/contrib/output/browser/outputPanel.ts diff --git a/src/vs/workbench/parts/output/common/output.ts b/src/vs/workbench/contrib/output/common/output.ts similarity index 100% rename from src/vs/workbench/parts/output/common/output.ts rename to src/vs/workbench/contrib/output/common/output.ts diff --git a/src/vs/workbench/parts/output/common/outputLinkComputer.ts b/src/vs/workbench/contrib/output/common/outputLinkComputer.ts similarity index 100% rename from src/vs/workbench/parts/output/common/outputLinkComputer.ts rename to src/vs/workbench/contrib/output/common/outputLinkComputer.ts diff --git a/src/vs/workbench/parts/output/common/outputLinkProvider.ts b/src/vs/workbench/contrib/output/common/outputLinkProvider.ts similarity index 100% rename from src/vs/workbench/parts/output/common/outputLinkProvider.ts rename to src/vs/workbench/contrib/output/common/outputLinkProvider.ts diff --git a/src/vs/workbench/parts/output/electron-browser/output.contribution.ts b/src/vs/workbench/contrib/output/electron-browser/output.contribution.ts similarity index 100% rename from src/vs/workbench/parts/output/electron-browser/output.contribution.ts rename to src/vs/workbench/contrib/output/electron-browser/output.contribution.ts diff --git a/src/vs/workbench/parts/output/electron-browser/outputServices.ts b/src/vs/workbench/contrib/output/electron-browser/outputServices.ts similarity index 100% rename from src/vs/workbench/parts/output/electron-browser/outputServices.ts rename to src/vs/workbench/contrib/output/electron-browser/outputServices.ts diff --git a/src/vs/workbench/parts/output/test/outputLinkProvider.test.ts b/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts similarity index 100% rename from src/vs/workbench/parts/output/test/outputLinkProvider.test.ts rename to src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts diff --git a/src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts b/src/vs/workbench/contrib/performance/electron-browser/performance.contribution.ts similarity index 100% rename from src/vs/workbench/parts/performance/electron-browser/performance.contribution.ts rename to src/vs/workbench/contrib/performance/electron-browser/performance.contribution.ts diff --git a/src/vs/workbench/parts/performance/electron-browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts similarity index 100% rename from src/vs/workbench/parts/performance/electron-browser/perfviewEditor.ts rename to src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts diff --git a/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts b/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts similarity index 100% rename from src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts rename to src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts diff --git a/src/vs/workbench/parts/performance/electron-browser/startupTimings.ts b/src/vs/workbench/contrib/performance/electron-browser/startupTimings.ts similarity index 100% rename from src/vs/workbench/parts/performance/electron-browser/startupTimings.ts rename to src/vs/workbench/contrib/performance/electron-browser/startupTimings.ts diff --git a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts rename to src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/keybindingsEditor.ts rename to src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts b/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts rename to src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts diff --git a/src/vs/workbench/parts/preferences/browser/media/action-remove-dark.svg b/src/vs/workbench/contrib/preferences/browser/media/action-remove-dark.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/action-remove-dark.svg rename to src/vs/workbench/contrib/preferences/browser/media/action-remove-dark.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/action-remove.svg b/src/vs/workbench/contrib/preferences/browser/media/action-remove.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/action-remove.svg rename to src/vs/workbench/contrib/preferences/browser/media/action-remove.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/add.svg b/src/vs/workbench/contrib/preferences/browser/media/add.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/add.svg rename to src/vs/workbench/contrib/preferences/browser/media/add.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/add_inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/add_inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/add_inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/add_inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/clean-dark.svg b/src/vs/workbench/contrib/preferences/browser/media/clean-dark.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/clean-dark.svg rename to src/vs/workbench/contrib/preferences/browser/media/clean-dark.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/clean.svg b/src/vs/workbench/contrib/preferences/browser/media/clean.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/clean.svg rename to src/vs/workbench/contrib/preferences/browser/media/clean.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/clear-inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/clear-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/clear-inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/clear-inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/clear.svg b/src/vs/workbench/contrib/preferences/browser/media/clear.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/clear.svg rename to src/vs/workbench/contrib/preferences/browser/media/clear.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/collapseAll.svg b/src/vs/workbench/contrib/preferences/browser/media/collapseAll.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/collapseAll.svg rename to src/vs/workbench/contrib/preferences/browser/media/collapseAll.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/collapseAll_inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/collapseAll_inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/collapseAll_inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/collapseAll_inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/collapsed-dark.svg b/src/vs/workbench/contrib/preferences/browser/media/collapsed-dark.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/collapsed-dark.svg rename to src/vs/workbench/contrib/preferences/browser/media/collapsed-dark.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/collapsed.svg b/src/vs/workbench/contrib/preferences/browser/media/collapsed.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/collapsed.svg rename to src/vs/workbench/contrib/preferences/browser/media/collapsed.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/edit.svg b/src/vs/workbench/contrib/preferences/browser/media/edit.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/edit.svg rename to src/vs/workbench/contrib/preferences/browser/media/edit.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/edit_inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/edit_inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/edit_inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/edit_inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/ellipsis-inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/ellipsis-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/ellipsis-inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/ellipsis-inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/ellipsis.svg b/src/vs/workbench/contrib/preferences/browser/media/ellipsis.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/ellipsis.svg rename to src/vs/workbench/contrib/preferences/browser/media/ellipsis.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/expanded-dark.svg b/src/vs/workbench/contrib/preferences/browser/media/expanded-dark.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/expanded-dark.svg rename to src/vs/workbench/contrib/preferences/browser/media/expanded-dark.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/expanded.svg b/src/vs/workbench/contrib/preferences/browser/media/expanded.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/expanded.svg rename to src/vs/workbench/contrib/preferences/browser/media/expanded.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/info.svg b/src/vs/workbench/contrib/preferences/browser/media/info.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/info.svg rename to src/vs/workbench/contrib/preferences/browser/media/info.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/keybindings.css b/src/vs/workbench/contrib/preferences/browser/media/keybindings.css similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/keybindings.css rename to src/vs/workbench/contrib/preferences/browser/media/keybindings.css diff --git a/src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css b/src/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/keybindingsEditor.css rename to src/vs/workbench/contrib/preferences/browser/media/keybindingsEditor.css diff --git a/src/vs/workbench/parts/preferences/browser/media/open-file-inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/open-file-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/open-file-inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/open-file-inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/open-file.svg b/src/vs/workbench/contrib/preferences/browser/media/open-file.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/open-file.svg rename to src/vs/workbench/contrib/preferences/browser/media/open-file.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/preferences.css b/src/vs/workbench/contrib/preferences/browser/media/preferences.css similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/preferences.css rename to src/vs/workbench/contrib/preferences/browser/media/preferences.css diff --git a/src/vs/workbench/parts/preferences/browser/media/record-keys-inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/record-keys-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/record-keys-inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/record-keys-inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/record-keys.svg b/src/vs/workbench/contrib/preferences/browser/media/record-keys.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/record-keys.svg rename to src/vs/workbench/contrib/preferences/browser/media/record-keys.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/regex-dark.svg b/src/vs/workbench/contrib/preferences/browser/media/regex-dark.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/regex-dark.svg rename to src/vs/workbench/contrib/preferences/browser/media/regex-dark.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/regex.svg b/src/vs/workbench/contrib/preferences/browser/media/regex.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/regex.svg rename to src/vs/workbench/contrib/preferences/browser/media/regex.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/settingsWidgets.css b/src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/settingsWidgets.css rename to src/vs/workbench/contrib/preferences/browser/media/settingsWidgets.css diff --git a/src/vs/workbench/parts/preferences/browser/media/sort_precedence.svg b/src/vs/workbench/contrib/preferences/browser/media/sort_precedence.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/sort_precedence.svg rename to src/vs/workbench/contrib/preferences/browser/media/sort_precedence.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/sort_precedence_inverse.svg b/src/vs/workbench/contrib/preferences/browser/media/sort_precedence_inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/sort_precedence_inverse.svg rename to src/vs/workbench/contrib/preferences/browser/media/sort_precedence_inverse.svg diff --git a/src/vs/workbench/parts/preferences/browser/media/status-error.svg b/src/vs/workbench/contrib/preferences/browser/media/status-error.svg similarity index 100% rename from src/vs/workbench/parts/preferences/browser/media/status-error.svg rename to src/vs/workbench/contrib/preferences/browser/media/status-error.svg diff --git a/src/vs/workbench/parts/preferences/browser/preferencesActions.ts b/src/vs/workbench/contrib/preferences/browser/preferencesActions.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/preferencesActions.ts rename to src/vs/workbench/contrib/preferences/browser/preferencesActions.ts diff --git a/src/vs/workbench/parts/preferences/browser/preferencesEditor.ts b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/preferencesEditor.ts rename to src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts rename to src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts diff --git a/src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts b/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/preferencesWidgets.ts rename to src/vs/workbench/contrib/preferences/browser/preferencesWidgets.ts diff --git a/src/vs/workbench/parts/preferences/browser/settingsLayout.ts b/src/vs/workbench/contrib/preferences/browser/settingsLayout.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/settingsLayout.ts rename to src/vs/workbench/contrib/preferences/browser/settingsLayout.ts diff --git a/src/vs/workbench/parts/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/settingsTree.ts rename to src/vs/workbench/contrib/preferences/browser/settingsTree.ts diff --git a/src/vs/workbench/parts/preferences/browser/settingsTreeModels.ts b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/settingsTreeModels.ts rename to src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts diff --git a/src/vs/workbench/parts/preferences/browser/settingsWidgets.ts b/src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/settingsWidgets.ts rename to src/vs/workbench/contrib/preferences/browser/settingsWidgets.ts diff --git a/src/vs/workbench/parts/preferences/browser/tocTree.ts b/src/vs/workbench/contrib/preferences/browser/tocTree.ts similarity index 100% rename from src/vs/workbench/parts/preferences/browser/tocTree.ts rename to src/vs/workbench/contrib/preferences/browser/tocTree.ts diff --git a/src/vs/workbench/parts/preferences/common/preferences.ts b/src/vs/workbench/contrib/preferences/common/preferences.ts similarity index 100% rename from src/vs/workbench/parts/preferences/common/preferences.ts rename to src/vs/workbench/contrib/preferences/common/preferences.ts diff --git a/src/vs/workbench/parts/preferences/common/preferencesContribution.ts b/src/vs/workbench/contrib/preferences/common/preferencesContribution.ts similarity index 100% rename from src/vs/workbench/parts/preferences/common/preferencesContribution.ts rename to src/vs/workbench/contrib/preferences/common/preferencesContribution.ts diff --git a/src/vs/workbench/parts/preferences/common/smartSnippetInserter.ts b/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.ts similarity index 100% rename from src/vs/workbench/parts/preferences/common/smartSnippetInserter.ts rename to src/vs/workbench/contrib/preferences/common/smartSnippetInserter.ts diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/check-inverse.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/check-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/check-inverse.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/check-inverse.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/check.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/check.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/check.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/check.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/configure-inverse.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/configure-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/configure-inverse.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/configure-inverse.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/configure.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/configure.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/configure.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/configure.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/edit-json-inverse.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/edit-json-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/edit-json-inverse.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/edit-json-inverse.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/edit-json.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/edit-json.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/edit-json.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/edit-json.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/preferences-editor-inverse.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/preferences-editor-inverse.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/preferences-editor.svg b/src/vs/workbench/contrib/preferences/electron-browser/media/preferences-editor.svg similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/preferences-editor.svg rename to src/vs/workbench/contrib/preferences/electron-browser/media/preferences-editor.svg diff --git a/src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css b/src/vs/workbench/contrib/preferences/electron-browser/media/settingsEditor2.css similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/media/settingsEditor2.css rename to src/vs/workbench/contrib/preferences/electron-browser/media/settingsEditor2.css diff --git a/src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts b/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/preferences.contribution.ts rename to src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts diff --git a/src/vs/workbench/parts/preferences/electron-browser/preferencesSearch.ts b/src/vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/preferencesSearch.ts rename to src/vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts diff --git a/src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts similarity index 100% rename from src/vs/workbench/parts/preferences/electron-browser/settingsEditor2.ts rename to src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts diff --git a/src/vs/workbench/parts/preferences/test/browser/keybindingsEditorContribution.test.ts b/src/vs/workbench/contrib/preferences/test/browser/keybindingsEditorContribution.test.ts similarity index 100% rename from src/vs/workbench/parts/preferences/test/browser/keybindingsEditorContribution.test.ts rename to src/vs/workbench/contrib/preferences/test/browser/keybindingsEditorContribution.test.ts diff --git a/src/vs/workbench/parts/preferences/test/browser/settingsTreeModels.test.ts b/src/vs/workbench/contrib/preferences/test/browser/settingsTreeModels.test.ts similarity index 100% rename from src/vs/workbench/parts/preferences/test/browser/settingsTreeModels.test.ts rename to src/vs/workbench/contrib/preferences/test/browser/settingsTreeModels.test.ts diff --git a/src/vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts b/src/vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts similarity index 100% rename from src/vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts rename to src/vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts diff --git a/src/vs/workbench/parts/quickopen/browser/commandsHandler.ts b/src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts similarity index 100% rename from src/vs/workbench/parts/quickopen/browser/commandsHandler.ts rename to src/vs/workbench/contrib/quickopen/browser/commandsHandler.ts diff --git a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts similarity index 100% rename from src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts rename to src/vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts similarity index 100% rename from src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts rename to src/vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts diff --git a/src/vs/workbench/parts/quickopen/browser/helpHandler.ts b/src/vs/workbench/contrib/quickopen/browser/helpHandler.ts similarity index 100% rename from src/vs/workbench/parts/quickopen/browser/helpHandler.ts rename to src/vs/workbench/contrib/quickopen/browser/helpHandler.ts diff --git a/src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts b/src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts similarity index 100% rename from src/vs/workbench/parts/quickopen/browser/quickopen.contribution.ts rename to src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts diff --git a/src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts b/src/vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts similarity index 100% rename from src/vs/workbench/parts/quickopen/browser/viewPickerHandler.ts rename to src/vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts diff --git a/src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts b/src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts similarity index 100% rename from src/vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts rename to src/vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts diff --git a/src/vs/workbench/parts/scm/common/scm.ts b/src/vs/workbench/contrib/scm/common/scm.ts similarity index 100% rename from src/vs/workbench/parts/scm/common/scm.ts rename to src/vs/workbench/contrib/scm/common/scm.ts diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/contrib/scm/electron-browser/dirtydiffDecorator.ts similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts rename to src/vs/workbench/contrib/scm/electron-browser/dirtydiffDecorator.ts diff --git a/src/vs/workbench/parts/scm/electron-browser/media/check-inverse.svg b/src/vs/workbench/contrib/scm/electron-browser/media/check-inverse.svg similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/media/check-inverse.svg rename to src/vs/workbench/contrib/scm/electron-browser/media/check-inverse.svg diff --git a/src/vs/workbench/parts/scm/electron-browser/media/check.svg b/src/vs/workbench/contrib/scm/electron-browser/media/check.svg similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/media/check.svg rename to src/vs/workbench/contrib/scm/electron-browser/media/check.svg diff --git a/src/vs/workbench/parts/scm/electron-browser/media/dirtydiffDecorator.css b/src/vs/workbench/contrib/scm/electron-browser/media/dirtydiffDecorator.css similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/media/dirtydiffDecorator.css rename to src/vs/workbench/contrib/scm/electron-browser/media/dirtydiffDecorator.css diff --git a/src/vs/workbench/parts/scm/electron-browser/media/icon-dark.svg b/src/vs/workbench/contrib/scm/electron-browser/media/icon-dark.svg similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/media/icon-dark.svg rename to src/vs/workbench/contrib/scm/electron-browser/media/icon-dark.svg diff --git a/src/vs/workbench/parts/scm/electron-browser/media/icon-light.svg b/src/vs/workbench/contrib/scm/electron-browser/media/icon-light.svg similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/media/icon-light.svg rename to src/vs/workbench/contrib/scm/electron-browser/media/icon-light.svg diff --git a/src/vs/workbench/parts/scm/electron-browser/media/scmViewlet.css b/src/vs/workbench/contrib/scm/electron-browser/media/scmViewlet.css similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/media/scmViewlet.css rename to src/vs/workbench/contrib/scm/electron-browser/media/scmViewlet.css diff --git a/src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts b/src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/scm.contribution.ts rename to src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts diff --git a/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts b/src/vs/workbench/contrib/scm/electron-browser/scmActivity.ts similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/scmActivity.ts rename to src/vs/workbench/contrib/scm/electron-browser/scmActivity.ts diff --git a/src/vs/workbench/parts/scm/electron-browser/scmMenus.ts b/src/vs/workbench/contrib/scm/electron-browser/scmMenus.ts similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/scmMenus.ts rename to src/vs/workbench/contrib/scm/electron-browser/scmMenus.ts diff --git a/src/vs/workbench/parts/scm/electron-browser/scmUtil.ts b/src/vs/workbench/contrib/scm/electron-browser/scmUtil.ts similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/scmUtil.ts rename to src/vs/workbench/contrib/scm/electron-browser/scmUtil.ts diff --git a/src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts similarity index 100% rename from src/vs/workbench/parts/scm/electron-browser/scmViewlet.ts rename to src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts diff --git a/src/vs/workbench/parts/search/browser/media/CollapseAll.svg b/src/vs/workbench/contrib/search/browser/media/CollapseAll.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/CollapseAll.svg rename to src/vs/workbench/contrib/search/browser/media/CollapseAll.svg diff --git a/src/vs/workbench/parts/search/browser/media/CollapseAll_inverse.svg b/src/vs/workbench/contrib/search/browser/media/CollapseAll_inverse.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/CollapseAll_inverse.svg rename to src/vs/workbench/contrib/search/browser/media/CollapseAll_inverse.svg diff --git a/src/vs/workbench/parts/search/browser/media/Refresh.svg b/src/vs/workbench/contrib/search/browser/media/Refresh.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/Refresh.svg rename to src/vs/workbench/contrib/search/browser/media/Refresh.svg diff --git a/src/vs/workbench/parts/search/browser/media/Refresh_inverse.svg b/src/vs/workbench/contrib/search/browser/media/Refresh_inverse.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/Refresh_inverse.svg rename to src/vs/workbench/contrib/search/browser/media/Refresh_inverse.svg diff --git a/src/vs/workbench/parts/search/browser/media/action-remove-dark.svg b/src/vs/workbench/contrib/search/browser/media/action-remove-dark.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/action-remove-dark.svg rename to src/vs/workbench/contrib/search/browser/media/action-remove-dark.svg diff --git a/src/vs/workbench/parts/search/browser/media/action-remove.svg b/src/vs/workbench/contrib/search/browser/media/action-remove.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/action-remove.svg rename to src/vs/workbench/contrib/search/browser/media/action-remove.svg diff --git a/src/vs/workbench/parts/search/browser/media/clear-search-results-dark.svg b/src/vs/workbench/contrib/search/browser/media/clear-search-results-dark.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/clear-search-results-dark.svg rename to src/vs/workbench/contrib/search/browser/media/clear-search-results-dark.svg diff --git a/src/vs/workbench/parts/search/browser/media/clear-search-results.svg b/src/vs/workbench/contrib/search/browser/media/clear-search-results.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/clear-search-results.svg rename to src/vs/workbench/contrib/search/browser/media/clear-search-results.svg diff --git a/src/vs/workbench/parts/search/browser/media/ellipsis-inverse.svg b/src/vs/workbench/contrib/search/browser/media/ellipsis-inverse.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/ellipsis-inverse.svg rename to src/vs/workbench/contrib/search/browser/media/ellipsis-inverse.svg diff --git a/src/vs/workbench/parts/search/browser/media/ellipsis.svg b/src/vs/workbench/contrib/search/browser/media/ellipsis.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/ellipsis.svg rename to src/vs/workbench/contrib/search/browser/media/ellipsis.svg diff --git a/src/vs/workbench/parts/search/browser/media/excludeSettings-dark.svg b/src/vs/workbench/contrib/search/browser/media/excludeSettings-dark.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/excludeSettings-dark.svg rename to src/vs/workbench/contrib/search/browser/media/excludeSettings-dark.svg diff --git a/src/vs/workbench/parts/search/browser/media/excludeSettings.svg b/src/vs/workbench/contrib/search/browser/media/excludeSettings.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/excludeSettings.svg rename to src/vs/workbench/contrib/search/browser/media/excludeSettings.svg diff --git a/src/vs/workbench/parts/search/browser/media/expando-collapsed-dark.svg b/src/vs/workbench/contrib/search/browser/media/expando-collapsed-dark.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/expando-collapsed-dark.svg rename to src/vs/workbench/contrib/search/browser/media/expando-collapsed-dark.svg diff --git a/src/vs/workbench/parts/search/browser/media/expando-collapsed.svg b/src/vs/workbench/contrib/search/browser/media/expando-collapsed.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/expando-collapsed.svg rename to src/vs/workbench/contrib/search/browser/media/expando-collapsed.svg diff --git a/src/vs/workbench/parts/search/browser/media/expando-expanded-dark.svg b/src/vs/workbench/contrib/search/browser/media/expando-expanded-dark.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/expando-expanded-dark.svg rename to src/vs/workbench/contrib/search/browser/media/expando-expanded-dark.svg diff --git a/src/vs/workbench/parts/search/browser/media/expando-expanded.svg b/src/vs/workbench/contrib/search/browser/media/expando-expanded.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/expando-expanded.svg rename to src/vs/workbench/contrib/search/browser/media/expando-expanded.svg diff --git a/src/vs/workbench/parts/search/browser/media/replace-all-inverse.svg b/src/vs/workbench/contrib/search/browser/media/replace-all-inverse.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/replace-all-inverse.svg rename to src/vs/workbench/contrib/search/browser/media/replace-all-inverse.svg diff --git a/src/vs/workbench/parts/search/browser/media/replace-all.svg b/src/vs/workbench/contrib/search/browser/media/replace-all.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/replace-all.svg rename to src/vs/workbench/contrib/search/browser/media/replace-all.svg diff --git a/src/vs/workbench/parts/search/browser/media/replace-inverse.svg b/src/vs/workbench/contrib/search/browser/media/replace-inverse.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/replace-inverse.svg rename to src/vs/workbench/contrib/search/browser/media/replace-inverse.svg diff --git a/src/vs/workbench/parts/search/browser/media/replace.svg b/src/vs/workbench/contrib/search/browser/media/replace.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/replace.svg rename to src/vs/workbench/contrib/search/browser/media/replace.svg diff --git a/src/vs/workbench/parts/search/browser/media/searchview.css b/src/vs/workbench/contrib/search/browser/media/searchview.css similarity index 100% rename from src/vs/workbench/parts/search/browser/media/searchview.css rename to src/vs/workbench/contrib/search/browser/media/searchview.css diff --git a/src/vs/workbench/parts/search/browser/media/stop-inverse.svg b/src/vs/workbench/contrib/search/browser/media/stop-inverse.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/stop-inverse.svg rename to src/vs/workbench/contrib/search/browser/media/stop-inverse.svg diff --git a/src/vs/workbench/parts/search/browser/media/stop.svg b/src/vs/workbench/contrib/search/browser/media/stop.svg similarity index 100% rename from src/vs/workbench/parts/search/browser/media/stop.svg rename to src/vs/workbench/contrib/search/browser/media/stop.svg diff --git a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts b/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/openAnythingHandler.ts rename to src/vs/workbench/contrib/search/browser/openAnythingHandler.ts diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/contrib/search/browser/openFileHandler.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/openFileHandler.ts rename to src/vs/workbench/contrib/search/browser/openFileHandler.ts diff --git a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/openSymbolHandler.ts rename to src/vs/workbench/contrib/search/browser/openSymbolHandler.ts diff --git a/src/vs/workbench/parts/search/browser/patternInputWidget.ts b/src/vs/workbench/contrib/search/browser/patternInputWidget.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/patternInputWidget.ts rename to src/vs/workbench/contrib/search/browser/patternInputWidget.ts diff --git a/src/vs/workbench/parts/search/browser/replaceContributions.ts b/src/vs/workbench/contrib/search/browser/replaceContributions.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/replaceContributions.ts rename to src/vs/workbench/contrib/search/browser/replaceContributions.ts diff --git a/src/vs/workbench/parts/search/browser/replaceService.ts b/src/vs/workbench/contrib/search/browser/replaceService.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/replaceService.ts rename to src/vs/workbench/contrib/search/browser/replaceService.ts diff --git a/src/vs/workbench/parts/search/browser/searchActions.ts b/src/vs/workbench/contrib/search/browser/searchActions.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/searchActions.ts rename to src/vs/workbench/contrib/search/browser/searchActions.ts diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/contrib/search/browser/searchResultsView.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/searchResultsView.ts rename to src/vs/workbench/contrib/search/browser/searchResultsView.ts diff --git a/src/vs/workbench/parts/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/searchView.ts rename to src/vs/workbench/contrib/search/browser/searchView.ts diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/contrib/search/browser/searchWidget.ts similarity index 100% rename from src/vs/workbench/parts/search/browser/searchWidget.ts rename to src/vs/workbench/contrib/search/browser/searchWidget.ts diff --git a/src/vs/workbench/parts/search/common/constants.ts b/src/vs/workbench/contrib/search/common/constants.ts similarity index 100% rename from src/vs/workbench/parts/search/common/constants.ts rename to src/vs/workbench/contrib/search/common/constants.ts diff --git a/src/vs/workbench/parts/search/common/queryBuilder.ts b/src/vs/workbench/contrib/search/common/queryBuilder.ts similarity index 100% rename from src/vs/workbench/parts/search/common/queryBuilder.ts rename to src/vs/workbench/contrib/search/common/queryBuilder.ts diff --git a/src/vs/workbench/parts/search/common/replace.ts b/src/vs/workbench/contrib/search/common/replace.ts similarity index 100% rename from src/vs/workbench/parts/search/common/replace.ts rename to src/vs/workbench/contrib/search/common/replace.ts diff --git a/src/vs/workbench/parts/search/common/search.ts b/src/vs/workbench/contrib/search/common/search.ts similarity index 100% rename from src/vs/workbench/parts/search/common/search.ts rename to src/vs/workbench/contrib/search/common/search.ts diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/contrib/search/common/searchModel.ts similarity index 100% rename from src/vs/workbench/parts/search/common/searchModel.ts rename to src/vs/workbench/contrib/search/common/searchModel.ts diff --git a/src/vs/workbench/parts/search/electron-browser/media/search-dark.svg b/src/vs/workbench/contrib/search/electron-browser/media/search-dark.svg similarity index 100% rename from src/vs/workbench/parts/search/electron-browser/media/search-dark.svg rename to src/vs/workbench/contrib/search/electron-browser/media/search-dark.svg diff --git a/src/vs/workbench/parts/search/electron-browser/media/search.contribution.css b/src/vs/workbench/contrib/search/electron-browser/media/search.contribution.css similarity index 100% rename from src/vs/workbench/parts/search/electron-browser/media/search.contribution.css rename to src/vs/workbench/contrib/search/electron-browser/media/search.contribution.css diff --git a/src/vs/workbench/parts/search/electron-browser/search.contribution.ts b/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts similarity index 100% rename from src/vs/workbench/parts/search/electron-browser/search.contribution.ts rename to src/vs/workbench/contrib/search/electron-browser/search.contribution.ts diff --git a/src/vs/workbench/parts/search/test/browser/mockSearchTree.ts b/src/vs/workbench/contrib/search/test/browser/mockSearchTree.ts similarity index 100% rename from src/vs/workbench/parts/search/test/browser/mockSearchTree.ts rename to src/vs/workbench/contrib/search/test/browser/mockSearchTree.ts diff --git a/src/vs/workbench/parts/search/test/browser/openFileHandler.test.ts b/src/vs/workbench/contrib/search/test/browser/openFileHandler.test.ts similarity index 100% rename from src/vs/workbench/parts/search/test/browser/openFileHandler.test.ts rename to src/vs/workbench/contrib/search/test/browser/openFileHandler.test.ts diff --git a/src/vs/workbench/parts/search/test/browser/searchActions.test.ts b/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts similarity index 100% rename from src/vs/workbench/parts/search/test/browser/searchActions.test.ts rename to src/vs/workbench/contrib/search/test/browser/searchActions.test.ts diff --git a/src/vs/workbench/parts/search/test/browser/searchViewlet.test.ts b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts similarity index 100% rename from src/vs/workbench/parts/search/test/browser/searchViewlet.test.ts rename to src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts diff --git a/src/vs/workbench/parts/search/test/common/queryBuilder.test.ts b/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts similarity index 100% rename from src/vs/workbench/parts/search/test/common/queryBuilder.test.ts rename to src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts diff --git a/src/vs/workbench/parts/search/test/common/searchModel.test.ts b/src/vs/workbench/contrib/search/test/common/searchModel.test.ts similarity index 100% rename from src/vs/workbench/parts/search/test/common/searchModel.test.ts rename to src/vs/workbench/contrib/search/test/common/searchModel.test.ts diff --git a/src/vs/workbench/parts/search/test/common/searchResult.test.ts b/src/vs/workbench/contrib/search/test/common/searchResult.test.ts similarity index 100% rename from src/vs/workbench/parts/search/test/common/searchResult.test.ts rename to src/vs/workbench/contrib/search/test/common/searchResult.test.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts b/src/vs/workbench/contrib/snippets/electron-browser/configureSnippets.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/configureSnippets.ts rename to src/vs/workbench/contrib/snippets/electron-browser/configureSnippets.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts b/src/vs/workbench/contrib/snippets/electron-browser/insertSnippet.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts rename to src/vs/workbench/contrib/snippets/electron-browser/insertSnippet.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider.ts rename to src/vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippets.contribution.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/snippets.contribution.ts rename to src/vs/workbench/contrib/snippets/electron-browser/snippets.contribution.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsFile.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippetsFile.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/snippetsFile.ts rename to src/vs/workbench/contrib/snippets/electron-browser/snippetsFile.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippetsService.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/snippetsService.ts rename to src/vs/workbench/contrib/snippets/electron-browser/snippetsService.ts diff --git a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts b/src/vs/workbench/contrib/snippets/electron-browser/tabCompletion.ts similarity index 100% rename from src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts rename to src/vs/workbench/contrib/snippets/electron-browser/tabCompletion.ts diff --git a/src/vs/workbench/parts/snippets/test/electron-browser/snippetFile.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetFile.test.ts similarity index 100% rename from src/vs/workbench/parts/snippets/test/electron-browser/snippetFile.test.ts rename to src/vs/workbench/contrib/snippets/test/electron-browser/snippetFile.test.ts diff --git a/src/vs/workbench/parts/snippets/test/electron-browser/snippetsRegistry.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRegistry.test.ts similarity index 100% rename from src/vs/workbench/parts/snippets/test/electron-browser/snippetsRegistry.test.ts rename to src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRegistry.test.ts diff --git a/src/vs/workbench/parts/snippets/test/electron-browser/snippetsRewrite.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRewrite.test.ts similarity index 100% rename from src/vs/workbench/parts/snippets/test/electron-browser/snippetsRewrite.test.ts rename to src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRewrite.test.ts diff --git a/src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsService.test.ts similarity index 100% rename from src/vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts rename to src/vs/workbench/contrib/snippets/test/electron-browser/snippetsService.test.ts diff --git a/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts b/src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts similarity index 100% rename from src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts rename to src/vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts diff --git a/src/vs/workbench/parts/stats/node/stats.contribution.ts b/src/vs/workbench/contrib/stats/node/stats.contribution.ts similarity index 100% rename from src/vs/workbench/parts/stats/node/stats.contribution.ts rename to src/vs/workbench/contrib/stats/node/stats.contribution.ts diff --git a/src/vs/workbench/parts/stats/node/workspaceStats.ts b/src/vs/workbench/contrib/stats/node/workspaceStats.ts similarity index 100% rename from src/vs/workbench/parts/stats/node/workspaceStats.ts rename to src/vs/workbench/contrib/stats/node/workspaceStats.ts diff --git a/src/vs/workbench/parts/stats/test/workspaceStats.test.ts b/src/vs/workbench/contrib/stats/test/workspaceStats.test.ts similarity index 100% rename from src/vs/workbench/parts/stats/test/workspaceStats.test.ts rename to src/vs/workbench/contrib/stats/test/workspaceStats.test.ts diff --git a/src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts b/src/vs/workbench/contrib/surveys/electron-browser/languageSurveys.contribution.ts similarity index 100% rename from src/vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts rename to src/vs/workbench/contrib/surveys/electron-browser/languageSurveys.contribution.ts diff --git a/src/vs/workbench/parts/surveys/electron-browser/nps.contribution.ts b/src/vs/workbench/contrib/surveys/electron-browser/nps.contribution.ts similarity index 100% rename from src/vs/workbench/parts/surveys/electron-browser/nps.contribution.ts rename to src/vs/workbench/contrib/surveys/electron-browser/nps.contribution.ts diff --git a/src/vs/workbench/parts/tasks/browser/quickOpen.ts b/src/vs/workbench/contrib/tasks/browser/quickOpen.ts similarity index 100% rename from src/vs/workbench/parts/tasks/browser/quickOpen.ts rename to src/vs/workbench/contrib/tasks/browser/quickOpen.ts diff --git a/src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts b/src/vs/workbench/contrib/tasks/browser/taskQuickOpen.ts similarity index 100% rename from src/vs/workbench/parts/tasks/browser/taskQuickOpen.ts rename to src/vs/workbench/contrib/tasks/browser/taskQuickOpen.ts diff --git a/src/vs/workbench/parts/tasks/common/problemCollectors.ts b/src/vs/workbench/contrib/tasks/common/problemCollectors.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/problemCollectors.ts rename to src/vs/workbench/contrib/tasks/common/problemCollectors.ts diff --git a/src/vs/workbench/parts/tasks/common/problemMatcher.ts b/src/vs/workbench/contrib/tasks/common/problemMatcher.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/problemMatcher.ts rename to src/vs/workbench/contrib/tasks/common/problemMatcher.ts diff --git a/src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts b/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts rename to src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts diff --git a/src/vs/workbench/parts/tasks/common/taskService.ts b/src/vs/workbench/contrib/tasks/common/taskService.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/taskService.ts rename to src/vs/workbench/contrib/tasks/common/taskService.ts diff --git a/src/vs/workbench/parts/tasks/common/taskSystem.ts b/src/vs/workbench/contrib/tasks/common/taskSystem.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/taskSystem.ts rename to src/vs/workbench/contrib/tasks/common/taskSystem.ts diff --git a/src/vs/workbench/parts/tasks/common/taskTemplates.ts b/src/vs/workbench/contrib/tasks/common/taskTemplates.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/taskTemplates.ts rename to src/vs/workbench/contrib/tasks/common/taskTemplates.ts diff --git a/src/vs/workbench/parts/tasks/common/tasks.ts b/src/vs/workbench/contrib/tasks/common/tasks.ts similarity index 100% rename from src/vs/workbench/parts/tasks/common/tasks.ts rename to src/vs/workbench/contrib/tasks/common/tasks.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts rename to src/vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts rename to src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts rename to src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg b/src/vs/workbench/contrib/tasks/electron-browser/media/configure-inverse.svg similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/configure-inverse.svg rename to src/vs/workbench/contrib/tasks/electron-browser/media/configure-inverse.svg diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/configure.svg b/src/vs/workbench/contrib/tasks/electron-browser/media/configure.svg similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/configure.svg rename to src/vs/workbench/contrib/tasks/electron-browser/media/configure.svg diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/status-error.svg b/src/vs/workbench/contrib/tasks/electron-browser/media/status-error.svg similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/status-error.svg rename to src/vs/workbench/contrib/tasks/electron-browser/media/status-error.svg diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/status-info.svg b/src/vs/workbench/contrib/tasks/electron-browser/media/status-info.svg similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/status-info.svg rename to src/vs/workbench/contrib/tasks/electron-browser/media/status-info.svg diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/status-warning.svg b/src/vs/workbench/contrib/tasks/electron-browser/media/status-warning.svg similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/status-warning.svg rename to src/vs/workbench/contrib/tasks/electron-browser/media/status-warning.svg diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css b/src/vs/workbench/contrib/tasks/electron-browser/media/task.contribution.css similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/task.contribution.css rename to src/vs/workbench/contrib/tasks/electron-browser/media/task.contribution.css diff --git a/src/vs/workbench/parts/tasks/electron-browser/media/task.svg b/src/vs/workbench/contrib/tasks/electron-browser/media/task.svg similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/media/task.svg rename to src/vs/workbench/contrib/tasks/electron-browser/media/task.svg diff --git a/src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts b/src/vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts rename to src/vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts rename to src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts diff --git a/src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts similarity index 100% rename from src/vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts rename to src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts diff --git a/src/vs/workbench/parts/tasks/node/processRunnerDetector.ts b/src/vs/workbench/contrib/tasks/node/processRunnerDetector.ts similarity index 100% rename from src/vs/workbench/parts/tasks/node/processRunnerDetector.ts rename to src/vs/workbench/contrib/tasks/node/processRunnerDetector.ts diff --git a/src/vs/workbench/parts/tasks/node/processTaskSystem.ts b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts similarity index 100% rename from src/vs/workbench/parts/tasks/node/processTaskSystem.ts rename to src/vs/workbench/contrib/tasks/node/processTaskSystem.ts diff --git a/src/vs/workbench/parts/tasks/node/taskConfiguration.ts b/src/vs/workbench/contrib/tasks/node/taskConfiguration.ts similarity index 100% rename from src/vs/workbench/parts/tasks/node/taskConfiguration.ts rename to src/vs/workbench/contrib/tasks/node/taskConfiguration.ts diff --git a/src/vs/workbench/parts/tasks/node/tasks.ts b/src/vs/workbench/contrib/tasks/node/tasks.ts similarity index 100% rename from src/vs/workbench/parts/tasks/node/tasks.ts rename to src/vs/workbench/contrib/tasks/node/tasks.ts diff --git a/src/vs/workbench/parts/tasks/test/common/problemMatcher.test.ts b/src/vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts similarity index 100% rename from src/vs/workbench/parts/tasks/test/common/problemMatcher.test.ts rename to src/vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts diff --git a/src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts b/src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts similarity index 100% rename from src/vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts rename to src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts diff --git a/src/vs/workbench/parts/terminal/browser/terminalFindWidget.css b/src/vs/workbench/contrib/terminal/browser/terminalFindWidget.css similarity index 100% rename from src/vs/workbench/parts/terminal/browser/terminalFindWidget.css rename to src/vs/workbench/contrib/terminal/browser/terminalFindWidget.css diff --git a/src/vs/workbench/parts/terminal/browser/terminalFindWidget.ts b/src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts similarity index 100% rename from src/vs/workbench/parts/terminal/browser/terminalFindWidget.ts rename to src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts diff --git a/src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts b/src/vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts similarity index 100% rename from src/vs/workbench/parts/terminal/browser/terminalQuickOpen.ts rename to src/vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts diff --git a/src/vs/workbench/parts/terminal/browser/terminalTab.ts b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts similarity index 100% rename from src/vs/workbench/parts/terminal/browser/terminalTab.ts rename to src/vs/workbench/contrib/terminal/browser/terminalTab.ts diff --git a/src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts b/src/vs/workbench/contrib/terminal/browser/terminalWidgetManager.ts similarity index 100% rename from src/vs/workbench/parts/terminal/browser/terminalWidgetManager.ts rename to src/vs/workbench/contrib/terminal/browser/terminalWidgetManager.ts diff --git a/src/vs/workbench/parts/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts similarity index 100% rename from src/vs/workbench/parts/terminal/common/terminal.ts rename to src/vs/workbench/contrib/terminal/common/terminal.ts diff --git a/src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts b/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts similarity index 100% rename from src/vs/workbench/parts/terminal/common/terminalColorRegistry.ts rename to src/vs/workbench/contrib/terminal/common/terminalColorRegistry.ts diff --git a/src/vs/workbench/parts/terminal/common/terminalCommands.ts b/src/vs/workbench/contrib/terminal/common/terminalCommands.ts similarity index 100% rename from src/vs/workbench/parts/terminal/common/terminalCommands.ts rename to src/vs/workbench/contrib/terminal/common/terminalCommands.ts diff --git a/src/vs/workbench/parts/terminal/common/terminalMenu.ts b/src/vs/workbench/contrib/terminal/common/terminalMenu.ts similarity index 100% rename from src/vs/workbench/parts/terminal/common/terminalMenu.ts rename to src/vs/workbench/contrib/terminal/common/terminalMenu.ts diff --git a/src/vs/workbench/parts/terminal/common/terminalService.ts b/src/vs/workbench/contrib/terminal/common/terminalService.ts similarity index 100% rename from src/vs/workbench/parts/terminal/common/terminalService.ts rename to src/vs/workbench/contrib/terminal/common/terminalService.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/configure-inverse.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/configure-inverse.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/configure-inverse.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/configure-inverse.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/configure.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/configure.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/configure.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/configure.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/kill-inverse.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/kill-inverse.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/kill-inverse.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/kill-inverse.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/kill.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/kill.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/kill.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/kill.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/new-inverse.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/new-inverse.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/new-inverse.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/new-inverse.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/new.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/new.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/new.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/new.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/scrollbar.css b/src/vs/workbench/contrib/terminal/electron-browser/media/scrollbar.css similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/scrollbar.css rename to src/vs/workbench/contrib/terminal/electron-browser/media/scrollbar.css diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/split-horizontal-inverse.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/split-horizontal-inverse.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/split-horizontal-inverse.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/split-horizontal-inverse.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/split-horizontal.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/split-horizontal.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/split-horizontal.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/split-horizontal.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/split-inverse.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/split-inverse.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/split-inverse.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/split-inverse.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/split.svg b/src/vs/workbench/contrib/terminal/electron-browser/media/split.svg similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/split.svg rename to src/vs/workbench/contrib/terminal/electron-browser/media/split.svg diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/terminal.css b/src/vs/workbench/contrib/terminal/electron-browser/media/terminal.css similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/terminal.css rename to src/vs/workbench/contrib/terminal/electron-browser/media/terminal.css diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/widgets.css b/src/vs/workbench/contrib/terminal/electron-browser/media/widgets.css similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/widgets.css rename to src/vs/workbench/contrib/terminal/electron-browser/media/widgets.css diff --git a/src/vs/workbench/parts/terminal/electron-browser/media/xterm.css b/src/vs/workbench/contrib/terminal/electron-browser/media/xterm.css similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/media/xterm.css rename to src/vs/workbench/contrib/terminal/electron-browser/media/xterm.css diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminal.contribution.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalActions.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalInstance.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalPanel.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts diff --git a/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts similarity index 100% rename from src/vs/workbench/parts/terminal/electron-browser/terminalService.ts rename to src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts diff --git a/src/vs/workbench/parts/terminal/node/terminal.ts b/src/vs/workbench/contrib/terminal/node/terminal.ts similarity index 100% rename from src/vs/workbench/parts/terminal/node/terminal.ts rename to src/vs/workbench/contrib/terminal/node/terminal.ts diff --git a/src/vs/workbench/parts/terminal/node/terminalCommandTracker.ts b/src/vs/workbench/contrib/terminal/node/terminalCommandTracker.ts similarity index 100% rename from src/vs/workbench/parts/terminal/node/terminalCommandTracker.ts rename to src/vs/workbench/contrib/terminal/node/terminalCommandTracker.ts diff --git a/src/vs/workbench/parts/terminal/node/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/node/terminalEnvironment.ts similarity index 100% rename from src/vs/workbench/parts/terminal/node/terminalEnvironment.ts rename to src/vs/workbench/contrib/terminal/node/terminalEnvironment.ts diff --git a/src/vs/workbench/parts/terminal/node/terminalProcess.ts b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts similarity index 100% rename from src/vs/workbench/parts/terminal/node/terminalProcess.ts rename to src/vs/workbench/contrib/terminal/node/terminalProcess.ts diff --git a/src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts b/src/vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts similarity index 100% rename from src/vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts rename to src/vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts diff --git a/src/vs/workbench/parts/terminal/node/windowsShellHelper.ts b/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts similarity index 100% rename from src/vs/workbench/parts/terminal/node/windowsShellHelper.ts rename to src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts similarity index 100% rename from src/vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts rename to src/vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts similarity index 100% rename from src/vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts rename to src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts diff --git a/src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts similarity index 100% rename from src/vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts rename to src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts diff --git a/src/vs/workbench/parts/terminal/test/node/terminalCommandTracker.test.ts b/src/vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts similarity index 100% rename from src/vs/workbench/parts/terminal/test/node/terminalCommandTracker.test.ts rename to src/vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts diff --git a/src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts b/src/vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts similarity index 100% rename from src/vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts rename to src/vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts diff --git a/src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts b/src/vs/workbench/contrib/themes/electron-browser/themes.contribution.ts similarity index 100% rename from src/vs/workbench/parts/themes/electron-browser/themes.contribution.ts rename to src/vs/workbench/contrib/themes/electron-browser/themes.contribution.ts diff --git a/src/vs/workbench/parts/themes/test/electron-browser/fixtures/foo.js b/src/vs/workbench/contrib/themes/test/electron-browser/fixtures/foo.js similarity index 100% rename from src/vs/workbench/parts/themes/test/electron-browser/fixtures/foo.js rename to src/vs/workbench/contrib/themes/test/electron-browser/fixtures/foo.js diff --git a/src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts b/src/vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution.ts similarity index 100% rename from src/vs/workbench/parts/themes/test/electron-browser/themes.test.contribution.ts rename to src/vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution.ts diff --git a/src/vs/workbench/parts/update/electron-browser/media/code-icon.svg b/src/vs/workbench/contrib/update/electron-browser/media/code-icon.svg similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/media/code-icon.svg rename to src/vs/workbench/contrib/update/electron-browser/media/code-icon.svg diff --git a/src/vs/workbench/parts/update/electron-browser/media/markdown.css b/src/vs/workbench/contrib/update/electron-browser/media/markdown.css similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/media/markdown.css rename to src/vs/workbench/contrib/update/electron-browser/media/markdown.css diff --git a/src/vs/workbench/parts/update/electron-browser/media/update.contribution.css b/src/vs/workbench/contrib/update/electron-browser/media/update.contribution.css similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/media/update.contribution.css rename to src/vs/workbench/contrib/update/electron-browser/media/update.contribution.css diff --git a/src/vs/workbench/parts/update/electron-browser/media/update.svg b/src/vs/workbench/contrib/update/electron-browser/media/update.svg similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/media/update.svg rename to src/vs/workbench/contrib/update/electron-browser/media/update.svg diff --git a/src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/releaseNotesEditor.ts rename to src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts diff --git a/src/vs/workbench/parts/update/electron-browser/update.contribution.ts b/src/vs/workbench/contrib/update/electron-browser/update.contribution.ts similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/update.contribution.ts rename to src/vs/workbench/contrib/update/electron-browser/update.contribution.ts diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/contrib/update/electron-browser/update.ts similarity index 100% rename from src/vs/workbench/parts/update/electron-browser/update.ts rename to src/vs/workbench/contrib/update/electron-browser/update.ts diff --git a/src/vs/workbench/parts/url/electron-browser/url.contribution.ts b/src/vs/workbench/contrib/url/electron-browser/url.contribution.ts similarity index 100% rename from src/vs/workbench/parts/url/electron-browser/url.contribution.ts rename to src/vs/workbench/contrib/url/electron-browser/url.contribution.ts diff --git a/src/vs/workbench/parts/watermark/electron-browser/watermark.css b/src/vs/workbench/contrib/watermark/electron-browser/watermark.css similarity index 100% rename from src/vs/workbench/parts/watermark/electron-browser/watermark.css rename to src/vs/workbench/contrib/watermark/electron-browser/watermark.css diff --git a/src/vs/workbench/parts/watermark/electron-browser/watermark.ts b/src/vs/workbench/contrib/watermark/electron-browser/watermark.ts similarity index 100% rename from src/vs/workbench/parts/watermark/electron-browser/watermark.ts rename to src/vs/workbench/contrib/watermark/electron-browser/watermark.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts b/src/vs/workbench/contrib/webview/electron-browser/baseWebviewEditor.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/baseWebviewEditor.ts rename to src/vs/workbench/contrib/webview/electron-browser/baseWebviewEditor.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webview-pre.js b/src/vs/workbench/contrib/webview/electron-browser/webview-pre.js similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webview-pre.js rename to src/vs/workbench/contrib/webview/electron-browser/webview-pre.js diff --git a/src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webview.contribution.ts rename to src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webview.html b/src/vs/workbench/contrib/webview/electron-browser/webview.html similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webview.html rename to src/vs/workbench/contrib/webview/electron-browser/webview.html diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewCommands.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewCommands.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewCommands.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewEditor.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewEditor.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewEditor.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewEditorInput.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewEditorInput.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewEditorInput.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditorInputFactory.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewEditorInputFactory.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewEditorInputFactory.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewEditorInputFactory.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewEditorService.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewEditorService.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewEditorService.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewElement.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewFindWidget.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewFindWidget.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewFindWidget.ts diff --git a/src/vs/workbench/parts/webview/electron-browser/webviewProtocols.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewProtocols.ts similarity index 100% rename from src/vs/workbench/parts/webview/electron-browser/webviewProtocols.ts rename to src/vs/workbench/contrib/webview/electron-browser/webviewProtocols.ts diff --git a/src/vs/workbench/parts/welcome/code-icon.svg b/src/vs/workbench/contrib/welcome/code-icon.svg similarity index 100% rename from src/vs/workbench/parts/welcome/code-icon.svg rename to src/vs/workbench/contrib/welcome/code-icon.svg diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts similarity index 100% rename from src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts rename to src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.contribution.ts diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts similarity index 100% rename from src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts rename to src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.ts diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts similarity index 100% rename from src/vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut.ts rename to src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts diff --git a/src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts b/src/vs/workbench/contrib/welcome/gettingStarted/test/common/gettingStarted.test.ts similarity index 100% rename from src/vs/workbench/parts/welcome/gettingStarted/test/common/gettingStarted.test.ts rename to src/vs/workbench/contrib/welcome/gettingStarted/test/common/gettingStarted.test.ts diff --git a/src/vs/workbench/parts/welcome/overlay/browser/media/commandpalette-dark.svg b/src/vs/workbench/contrib/welcome/overlay/browser/media/commandpalette-dark.svg similarity index 100% rename from src/vs/workbench/parts/welcome/overlay/browser/media/commandpalette-dark.svg rename to src/vs/workbench/contrib/welcome/overlay/browser/media/commandpalette-dark.svg diff --git a/src/vs/workbench/parts/welcome/overlay/browser/media/commandpalette.svg b/src/vs/workbench/contrib/welcome/overlay/browser/media/commandpalette.svg similarity index 100% rename from src/vs/workbench/parts/welcome/overlay/browser/media/commandpalette.svg rename to src/vs/workbench/contrib/welcome/overlay/browser/media/commandpalette.svg diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css b/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.css similarity index 100% rename from src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.css rename to src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.css diff --git a/src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts similarity index 100% rename from src/vs/workbench/parts/welcome/overlay/browser/welcomeOverlay.ts rename to src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts b/src/vs/workbench/contrib/welcome/page/electron-browser/vs_code_welcome_page.ts similarity index 100% rename from src/vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page.ts rename to src/vs/workbench/contrib/welcome/page/electron-browser/vs_code_welcome_page.ts diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution.ts similarity index 100% rename from src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution.ts rename to src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution.ts diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.css similarity index 100% rename from src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.css rename to src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.css diff --git a/src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.ts similarity index 100% rename from src/vs/workbench/parts/welcome/page/electron-browser/welcomePage.ts rename to src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts rename to src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md rename to src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/vs_code_editor_walkthrough.md diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution.ts rename to src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions.ts rename to src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.css similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.css rename to src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.css diff --git a/src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart.ts rename to src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts b/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider.ts rename to src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts b/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughInput.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/node/walkThroughInput.ts rename to src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughInput.ts diff --git a/src/vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts b/src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughUtils.ts similarity index 100% rename from src/vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils.ts rename to src/vs/workbench/contrib/welcome/walkThrough/node/walkThroughUtils.ts From 35523f6c51bdc1edae1696a586dadd021fe47096 Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Thu, 7 Feb 2019 11:48:58 +0100 Subject: [PATCH 424/429] debt - workbench/parts => workbench/contrib (update imports and scripts) --- build/gulpfile.vscode.js | 10 +- build/lib/i18n.resources.json | 66 ++-- build/lib/i18n.ts | 2 +- build/lib/test/i18n.test.ts | 4 +- build/lib/tslint/translationRemindRule.ts | 2 +- src/tsconfig.strictNullChecks.json | 310 +++++++++--------- .../test/common/quickOpenScorer.test.ts | 6 +- src/vs/base/test/node/storage/storage.test.ts | 2 +- .../colorRegistry.releaseTest.ts | 12 +- .../api/browser/viewsExtensionPoint.ts | 6 +- .../extensionHost.contribution.ts | 2 +- .../electron-browser/mainThreadComments.ts | 6 +- .../mainThreadDebugService.ts | 6 +- .../mainThreadLanguageFeatures.ts | 2 +- .../mainThreadOutputService.ts | 2 +- .../api/electron-browser/mainThreadTask.ts | 8 +- .../mainThreadTerminalService.ts | 2 +- .../api/electron-browser/mainThreadWebview.ts | 6 +- .../electron-browser/mainThreadWorkspace.ts | 2 +- src/vs/workbench/api/node/extHost.protocol.ts | 6 +- .../workbench/api/node/extHostApiCommands.ts | 2 +- .../workbench/api/node/extHostDebugService.ts | 8 +- .../api/node/extHostTerminalService.ts | 6 +- .../api/node/extHostTypeConverters.ts | 2 +- src/vs/workbench/api/node/extHostWorkspace.ts | 2 +- src/vs/workbench/buildfile.js | 6 +- src/vs/workbench/common/actions.ts | 2 +- .../backup/common/backup.contribution.ts | 4 +- .../electron-browser/simpleEditorOptions.ts | 6 +- .../electron-browser/suggestEnabledInput.ts | 6 +- .../electron-browser/toggleWordWrap.ts | 4 +- .../comments/electron-browser/commentNode.ts | 4 +- .../electron-browser/commentService.ts | 2 +- .../electron-browser/commentThreadWidget.ts | 6 +- .../electron-browser/comments.contribution.ts | 4 +- .../commentsEditorContribution.ts | 6 +- .../electron-browser/commentsPanel.ts | 8 +- .../electron-browser/commentsTreeViewer.ts | 2 +- .../electron-browser/simpleCommentEditor.ts | 4 +- .../contrib/debug/browser/baseDebugView.ts | 4 +- .../contrib/debug/browser/breakpointsView.ts | 6 +- .../debug/browser/debugANSIHandling.ts | 2 +- .../contrib/debug/browser/debugActionItems.ts | 2 +- .../contrib/debug/browser/debugActions.ts | 4 +- .../contrib/debug/browser/debugCommands.ts | 8 +- .../debug/browser/debugContentProvider.ts | 4 +- .../debug/browser/debugEditorActions.ts | 4 +- .../debug/browser/debugEditorModelManager.ts | 4 +- .../contrib/debug/browser/debugQuickOpen.ts | 4 +- .../contrib/debug/browser/debugStatus.ts | 4 +- .../contrib/debug/browser/debugToolbar.ts | 8 +- .../contrib/debug/browser/debugViewlet.ts | 8 +- .../contrib/debug/browser/exceptionWidget.ts | 4 +- .../debug/browser/loadedScriptsView.ts | 8 +- .../debug/browser/statusbarColorProvider.ts | 2 +- .../workbench/contrib/debug/common/debug.ts | 6 +- .../contrib/debug/common/debugModel.ts | 4 +- .../contrib/debug/common/debugSchemas.ts | 2 +- .../contrib/debug/common/debugSource.ts | 4 +- .../contrib/debug/common/debugUtils.ts | 2 +- .../contrib/debug/common/debugViewModel.ts | 2 +- .../contrib/debug/common/replModel.ts | 4 +- .../electron-browser/breakpointWidget.ts | 6 +- .../debug/electron-browser/callStackView.ts | 12 +- .../electron-browser/debug.contribution.ts | 40 +-- .../debugConfigurationManager.ts | 8 +- .../debugEditorContribution.ts | 10 +- .../debug/electron-browser/debugHover.ts | 10 +- .../debug/electron-browser/debugService.ts | 24 +- .../debug/electron-browser/debugSession.ts | 12 +- .../electron-browser/electronDebugActions.ts | 4 +- .../debug/electron-browser/rawDebugSession.ts | 4 +- .../contrib/debug/electron-browser/repl.ts | 24 +- .../debug/electron-browser/terminalSupport.ts | 8 +- .../debug/electron-browser/variablesView.ts | 10 +- .../electron-browser/watchExpressionsView.ts | 12 +- .../contrib/debug/node/debugAdapter.ts | 4 +- .../workbench/contrib/debug/node/debugger.ts | 10 +- .../workbench/contrib/debug/node/terminals.ts | 4 +- .../debug/test/browser/baseDebugView.test.ts | 6 +- .../test/browser/debugANSIHandling.test.ts | 4 +- .../debug/test/browser/linkDetector.test.ts | 2 +- .../debug/test/common/debugSource.test.ts | 2 +- .../debug/test/common/debugUtils.test.ts | 2 +- .../debug/test/common/debugViewModel.test.ts | 6 +- .../contrib/debug/test/common/mockDebug.ts | 4 +- .../test/electron-browser/debugModel.test.ts | 10 +- .../contrib/debug/test/node/debugger.test.ts | 6 +- .../actions/expandAbbreviation.ts | 2 +- .../test/electron-browser/emmetAction.test.ts | 2 +- .../execution.contribution.ts | 10 +- .../electron-browser/terminalService.ts | 6 +- .../electron-browser/terminalService.test.ts | 4 +- .../electron-browser/experimentalPrompt.ts | 4 +- .../experiments.contribution.ts | 4 +- .../experiments/node/experimentService.ts | 2 +- .../experimentService.test.ts | 2 +- .../experimentalPrompts.test.ts | 6 +- .../extensions/browser/extensionsQuickOpen.ts | 2 +- .../extensions/browser/extensionsViewer.ts | 2 +- .../extensions/common/extensionsInput.ts | 2 +- .../electron-browser/extensionEditor.ts | 14 +- .../extensionProfileService.ts | 2 +- .../electron-browser/extensionTipsService.ts | 10 +- .../extensions.contribution.ts | 44 +-- .../electron-browser/extensionsActions.ts | 8 +- .../extensionsAutoProfiler.ts | 4 +- .../electron-browser/extensionsList.ts | 6 +- .../electron-browser/extensionsViewlet.ts | 10 +- .../electron-browser/extensionsViews.ts | 10 +- .../electron-browser/extensionsWidgets.ts | 2 +- .../runtimeExtensionsEditor.ts | 4 +- .../node/extensionsWorkbenchService.ts | 4 +- .../test/common/extensionQuery.test.ts | 2 +- .../extensionsActions.test.ts | 8 +- .../extensionsTipsService.test.ts | 8 +- .../electron-browser/extensionsViews.test.ts | 10 +- .../extensionsWorkbenchService.test.ts | 6 +- .../electron-browser/feedback.contribution.ts | 2 +- .../electron-browser/feedbackStatusbarItem.ts | 2 +- .../files/browser/editors/binaryFileEditor.ts | 4 +- .../browser/editors/fileEditorTracker.ts | 4 +- .../files/browser/editors/textFileEditor.ts | 4 +- .../workbench/contrib/files/browser/files.ts | 4 +- .../contrib/files/common/dirtyFilesTracker.ts | 2 +- .../files/common/editors/fileEditorInput.ts | 2 +- .../workbench/contrib/files/common/files.ts | 2 +- .../files/electron-browser/explorerService.ts | 4 +- .../files/electron-browser/explorerViewlet.ts | 8 +- .../fileActions.contribution.ts | 16 +- .../files/electron-browser/fileActions.ts | 8 +- .../files/electron-browser/fileCommands.ts | 6 +- .../electron-browser/files.contribution.ts | 18 +- .../electron-browser/saveErrorHandler.ts | 6 +- .../views/explorerDecorationsProvider.ts | 2 +- .../electron-browser/views/explorerView.ts | 10 +- .../electron-browser/views/explorerViewer.ts | 6 +- .../electron-browser/views/openEditorsView.ts | 6 +- .../test/browser/fileEditorInput.test.ts | 2 +- .../test/browser/fileEditorTracker.test.ts | 2 +- .../electron-browser/explorerModel.test.ts | 4 +- .../test/electron-browser/fileActions.test.ts | 2 +- .../electron-browser/html.contribution.ts | 4 +- .../html/electron-browser/htmlPreviewPart.ts | 6 +- .../localizations.contribution.ts | 4 +- .../electron-browser/logs.contribution.ts | 6 +- .../electron-browser/markers.contribution.ts | 12 +- .../electron-browser/markersFilterOptions.ts | 2 +- .../markers/electron-browser/markersPanel.ts | 14 +- .../electron-browser/markersPanelActions.ts | 10 +- .../electron-browser/markersTreeViewer.ts | 8 +- .../electron-browser/markersModel.test.ts | 2 +- .../electron-browser/outline.contribution.ts | 4 +- .../contrib/output/browser/logViewer.ts | 2 +- .../contrib/output/browser/outputActions.ts | 4 +- .../contrib/output/browser/outputPanel.ts | 4 +- .../output/common/outputLinkProvider.ts | 6 +- .../electron-browser/output.contribution.ts | 10 +- .../output/electron-browser/outputServices.ts | 6 +- .../output/test/outputLinkProvider.test.ts | 2 +- .../performance.contribution.ts | 2 +- .../electron-browser/perfviewEditor.ts | 2 +- .../electron-browser/startupProfiler.ts | 2 +- .../electron-browser/startupTimings.ts | 2 +- .../preferences/browser/keybindingWidgets.ts | 2 +- .../preferences/browser/keybindingsEditor.ts | 4 +- .../browser/keybindingsEditorContribution.ts | 4 +- .../preferences/browser/preferencesEditor.ts | 6 +- .../browser/preferencesRenderers.ts | 2 +- .../preferences/browser/settingsTree.ts | 8 +- .../preferences/browser/settingsTreeModels.ts | 6 +- .../contrib/preferences/browser/tocTree.ts | 6 +- .../preferences.contribution.ts | 40 +-- .../electron-browser/preferencesSearch.ts | 2 +- .../electron-browser/settingsEditor2.ts | 16 +- .../keybindingsEditorContribution.test.ts | 2 +- .../test/browser/settingsTreeModels.test.ts | 2 +- .../test/common/smartSnippetInserter.test.ts | 2 +- .../browser/quickopen.contribution.ts | 10 +- .../quickopen/browser/viewPickerHandler.ts | 4 +- .../scm/electron-browser/scm.contribution.ts | 4 +- .../scm/electron-browser/scmActivity.ts | 2 +- .../scm/electron-browser/scmViewlet.ts | 2 +- .../search/browser/openAnythingHandler.ts | 6 +- .../contrib/search/browser/openFileHandler.ts | 4 +- .../search/browser/openSymbolHandler.ts | 2 +- .../search/browser/replaceContributions.ts | 4 +- .../contrib/search/browser/replaceService.ts | 4 +- .../contrib/search/browser/searchActions.ts | 8 +- .../search/browser/searchResultsView.ts | 6 +- .../contrib/search/browser/searchView.ts | 18 +- .../contrib/search/browser/searchWidget.ts | 4 +- .../contrib/search/common/replace.ts | 2 +- .../contrib/search/common/searchModel.ts | 2 +- .../electron-browser/search.contribution.ts | 22 +- .../test/browser/openFileHandler.test.ts | 2 +- .../search/test/browser/searchActions.test.ts | 6 +- .../search/test/browser/searchViewlet.test.ts | 2 +- .../search/test/common/queryBuilder.test.ts | 2 +- .../search/test/common/searchModel.test.ts | 2 +- .../search/test/common/searchResult.test.ts | 4 +- .../electron-browser/configureSnippets.ts | 4 +- .../electron-browser/insertSnippet.ts | 4 +- .../snippetCompletionProvider.ts | 4 +- .../electron-browser/snippets.contribution.ts | 2 +- .../electron-browser/snippetsService.ts | 4 +- .../electron-browser/tabCompletion.ts | 8 +- .../test/electron-browser/snippetFile.test.ts | 2 +- .../electron-browser/snippetsRegistry.test.ts | 2 +- .../electron-browser/snippetsRewrite.test.ts | 2 +- .../electron-browser/snippetsService.test.ts | 6 +- .../contrib/stats/node/stats.contribution.ts | 2 +- .../contrib/stats/test/workspaceStats.test.ts | 2 +- .../contrib/tasks/browser/quickOpen.ts | 4 +- .../contrib/tasks/browser/taskQuickOpen.ts | 4 +- .../contrib/tasks/common/problemCollectors.ts | 2 +- .../tasks/common/taskDefinitionRegistry.ts | 2 +- .../contrib/tasks/common/taskService.ts | 4 +- .../workbench/contrib/tasks/common/tasks.ts | 2 +- .../electron-browser/jsonSchemaCommon.ts | 2 +- .../tasks/electron-browser/jsonSchema_v1.ts | 2 +- .../tasks/electron-browser/jsonSchema_v2.ts | 2 +- .../electron-browser/runAutomaticTasks.ts | 4 +- .../electron-browser/task.contribution.ts | 28 +- .../electron-browser/terminalTaskSystem.ts | 12 +- .../contrib/tasks/node/processTaskSystem.ts | 10 +- .../contrib/tasks/node/taskConfiguration.ts | 4 +- src/vs/workbench/contrib/tasks/node/tasks.ts | 4 +- .../tasks/test/common/problemMatcher.test.ts | 2 +- .../electron-browser/configuration.test.ts | 6 +- .../terminal/browser/terminalFindWidget.ts | 2 +- .../terminal/browser/terminalQuickOpen.ts | 2 +- .../contrib/terminal/browser/terminalTab.ts | 2 +- .../terminal/common/terminalCommands.ts | 2 +- .../contrib/terminal/common/terminalMenu.ts | 2 +- .../terminal/common/terminalService.ts | 2 +- .../electron-browser/terminal.contribution.ts | 20 +- .../electron-browser/terminalActions.ts | 6 +- .../electron-browser/terminalConfigHelper.ts | 4 +- .../electron-browser/terminalInstance.ts | 18 +- .../electron-browser/terminalLinkHandler.ts | 4 +- .../electron-browser/terminalPanel.ts | 12 +- .../terminalProcessManager.ts | 10 +- .../electron-browser/terminalService.ts | 14 +- .../terminal/node/terminalCommandTracker.ts | 2 +- .../terminal/node/terminalEnvironment.ts | 2 +- .../contrib/terminal/node/terminalProcess.ts | 4 +- .../node/terminalProcessExtHostProxy.ts | 4 +- .../terminal/node/windowsShellHelper.ts | 2 +- .../terminalColorRegistry.test.ts | 2 +- .../terminalConfigHelper.test.ts | 4 +- .../terminalLinkHandler.test.ts | 2 +- .../test/node/terminalCommandTracker.test.ts | 2 +- .../test/node/terminalEnvironment.test.ts | 2 +- .../electron-browser/themes.contribution.ts | 2 +- .../electron-browser/releaseNotesEditor.ts | 4 +- .../watermark/electron-browser/watermark.ts | 10 +- .../electron-browser/webview.contribution.ts | 2 +- .../webview/electron-browser/webviewEditor.ts | 2 +- .../electron-browser/webviewElement.ts | 2 +- .../electron-browser/telemetryOptOut.ts | 4 +- .../welcome/overlay/browser/welcomeOverlay.ts | 2 +- .../welcomePage.contribution.ts | 2 +- .../page/electron-browser/welcomePage.ts | 12 +- .../editor/editorWalkThrough.ts | 2 +- .../walkThrough.contribution.ts | 10 +- .../electron-browser/walkThroughActions.ts | 2 +- .../electron-browser/walkThroughPart.ts | 4 +- .../editor/test/browser/editorService.test.ts | 2 +- .../api/extHostApiCommands.test.ts | 2 +- .../api/extHostLanguageFeatures.test.ts | 2 +- .../quickopen.perf.integrationTest.ts | 2 +- .../textsearch.perf.integrationTest.ts | 6 +- .../workbench/test/workbenchTestServices.ts | 4 +- src/vs/workbench/workbench.main.ts | 120 +++---- tslint.json | 14 +- 276 files changed, 1014 insertions(+), 1014 deletions(-) diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index a7ca09844cd..dbddf5215dd 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -66,12 +66,12 @@ const vscodeResources = [ 'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}', 'out-build/vs/base/browser/ui/octiconLabel/octicons/**', 'out-build/vs/workbench/browser/media/*-theme.css', - 'out-build/vs/workbench/parts/debug/**/*.json', - 'out-build/vs/workbench/parts/execution/**/*.scpt', - 'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js', + 'out-build/vs/workbench/contrib/debug/**/*.json', + 'out-build/vs/workbench/contrib/execution/**/*.scpt', + 'out-build/vs/workbench/contrib/webview/electron-browser/webview-pre.js', 'out-build/vs/**/markdown.css', - 'out-build/vs/workbench/parts/tasks/**/*.json', - 'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md', + 'out-build/vs/workbench/contrib/tasks/**/*.json', + 'out-build/vs/workbench/contrib/welcome/walkThrough/**/*.md', 'out-build/vs/workbench/services/files/**/*.exe', 'out-build/vs/workbench/services/files/**/*.md', 'out-build/vs/code/electron-browser/workbench/**', diff --git a/build/lib/i18n.resources.json b/build/lib/i18n.resources.json index f8a57d73f6b..5adbf22d988 100644 --- a/build/lib/i18n.resources.json +++ b/build/lib/i18n.resources.json @@ -27,135 +27,135 @@ "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/cli", + "name": "vs/workbench/contrib/cli", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/codeEditor", + "name": "vs/workbench/contrib/codeEditor", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/comments", + "name": "vs/workbench/contrib/comments", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/debug", + "name": "vs/workbench/contrib/debug", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/emmet", + "name": "vs/workbench/contrib/emmet", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/execution", + "name": "vs/workbench/contrib/execution", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/extensions", + "name": "vs/workbench/contrib/extensions", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/feedback", + "name": "vs/workbench/contrib/feedback", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/files", + "name": "vs/workbench/contrib/files", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/html", + "name": "vs/workbench/contrib/html", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/markers", + "name": "vs/workbench/contrib/markers", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/localizations", + "name": "vs/workbench/contrib/localizations", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/logs", + "name": "vs/workbench/contrib/logs", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/output", + "name": "vs/workbench/contrib/output", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/performance", + "name": "vs/workbench/contrib/performance", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/preferences", + "name": "vs/workbench/contrib/preferences", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/quickopen", + "name": "vs/workbench/contrib/quickopen", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/relauncher", + "name": "vs/workbench/contrib/relauncher", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/scm", + "name": "vs/workbench/contrib/scm", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/search", + "name": "vs/workbench/contrib/search", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/snippets", + "name": "vs/workbench/contrib/snippets", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/stats", + "name": "vs/workbench/contrib/stats", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/surveys", + "name": "vs/workbench/contrib/surveys", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/tasks", + "name": "vs/workbench/contrib/tasks", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/terminal", + "name": "vs/workbench/contrib/terminal", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/themes", + "name": "vs/workbench/contrib/themes", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/trust", + "name": "vs/workbench/contrib/trust", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/update", + "name": "vs/workbench/contrib/update", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/url", + "name": "vs/workbench/contrib/url", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/watermark", + "name": "vs/workbench/contrib/watermark", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/webview", + "name": "vs/workbench/contrib/webview", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/welcome", + "name": "vs/workbench/contrib/welcome", "project": "vscode-workbench" }, { - "name": "vs/workbench/parts/outline", + "name": "vs/workbench/contrib/outline", "project": "vscode-workbench" }, { diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 5cde7d8f87a..6f6139ad388 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -602,7 +602,7 @@ export function getResource(sourceFile: string): Resource { return { name: 'vs/base', project: editorProject }; } else if (/^vs\/code/.test(sourceFile)) { return { name: 'vs/code', project: workbenchProject }; - } else if (/^vs\/workbench\/parts/.test(sourceFile)) { + } else if (/^vs\/workbench\/contrib/.test(sourceFile)) { resource = sourceFile.split('/', 4).join('/'); return { name: resource, project: workbenchProject }; } else if (/^vs\/workbench\/services/.test(sourceFile)) { diff --git a/build/lib/test/i18n.test.ts b/build/lib/test/i18n.test.ts index cfc1041974b..eebc7742457 100644 --- a/build/lib/test/i18n.test.ts +++ b/build/lib/test/i18n.test.ts @@ -38,7 +38,7 @@ suite('XLF Parser Tests', () => { editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, - workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, + workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject}; @@ -47,7 +47,7 @@ suite('XLF Parser Tests', () => { assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor); assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base); assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code); - assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts); + assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts); assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices); assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench); }); diff --git a/build/lib/tslint/translationRemindRule.ts b/build/lib/tslint/translationRemindRule.ts index 559b782c6da..e2671599d3c 100644 --- a/build/lib/tslint/translationRemindRule.ts +++ b/build/lib/tslint/translationRemindRule.ts @@ -42,7 +42,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker { private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) { const currentFile = node.getSourceFile().fileName; const matchService = currentFile.match(/vs\/workbench\/services\/\w+/); - const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/); + const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/); if (!matchService && !matchPart) { return; } diff --git a/src/tsconfig.strictNullChecks.json b/src/tsconfig.strictNullChecks.json index 25ff85bbc24..aeddd30bfc3 100644 --- a/src/tsconfig.strictNullChecks.json +++ b/src/tsconfig.strictNullChecks.json @@ -21,10 +21,10 @@ "./vs/workbench/browser/parts/notifications/**/*", "./vs/workbench/browser/parts/quickinput/**/*", "./vs/workbench/electron-browser/actions/**/*", - "./vs/workbench/parts/emmet/**/*", - "./vs/workbench/parts/execution/**/*", - "./vs/workbench/parts/snippets/**/*.ts", - "./vs/workbench/parts/welcome/**/*.ts", + "./vs/workbench/contrib/emmet/**/*", + "./vs/workbench/contrib/execution/**/*", + "./vs/workbench/contrib/snippets/**/*.ts", + "./vs/workbench/contrib/welcome/**/*.ts", "./vs/workbench/services/commands/**/*", "./vs/workbench/services/files/node/watcher/**/*", "./vs/workbench/services/issue/**/*", @@ -484,157 +484,157 @@ "./vs/workbench/common/views.ts", "./vs/workbench/electron-browser/resources.ts", "./vs/workbench/electron-browser/window.ts", - "./vs/workbench/parts/backup/common/backupRestorer.ts", - "./vs/workbench/parts/cli/electron-browser/cli.contribution.ts", - "./vs/workbench/parts/codeEditor/browser/menuPreventer.ts", - "./vs/workbench/parts/codeEditor/browser/simpleEditorOptions.ts", - "./vs/workbench/parts/codeEditor/electron-browser/accessibility.ts", - "./vs/workbench/parts/codeEditor/electron-browser/inspectKeybindings.ts", - "./vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts", - "./vs/workbench/parts/codeEditor/electron-browser/largeFileOptimizations.ts", - "./vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts", - "./vs/workbench/parts/codeEditor/electron-browser/simpleEditorOptions.ts", - "./vs/workbench/parts/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts", - "./vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput.ts", - "./vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts", - "./vs/workbench/parts/codeEditor/electron-browser/toggleMinimap.ts", - "./vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts", - "./vs/workbench/parts/codeEditor/electron-browser/toggleRenderControlCharacter.ts", - "./vs/workbench/parts/codeEditor/electron-browser/toggleRenderWhitespace.ts", - "./vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts", - "./vs/workbench/parts/comments/common/commentModel.ts", - "./vs/workbench/parts/comments/electron-browser/commentGlyphWidget.ts", - "./vs/workbench/parts/comments/electron-browser/commentService.ts", - "./vs/workbench/parts/comments/electron-browser/simpleCommentEditor.ts", - "./vs/workbench/parts/debug/browser/debugANSIHandling.ts", - "./vs/workbench/parts/debug/browser/linkDetector.ts", - "./vs/workbench/parts/debug/common/debugProtocol.d.ts", - "./vs/workbench/parts/debug/node/telemetryApp.ts", - "./vs/workbench/parts/debug/test/common/mockDebug.ts", - "./vs/workbench/parts/experiments/electron-browser/experimentalPrompt.ts", - "./vs/workbench/parts/experiments/electron-browser/experiments.contribution.ts", - "./vs/workbench/parts/experiments/node/experimentService.ts", - "./vs/workbench/parts/extensions/browser/extensionsQuickOpen.ts", - "./vs/workbench/parts/extensions/browser/extensionsViewer.ts", - "./vs/workbench/parts/extensions/common/extensionQuery.ts", - "./vs/workbench/parts/extensions/common/extensions.ts", - "./vs/workbench/parts/extensions/common/extensionsFileTemplate.ts", - "./vs/workbench/parts/extensions/common/extensionsInput.ts", - "./vs/workbench/parts/extensions/electron-browser/extensionTipsService.ts", - "./vs/workbench/parts/extensions/electron-browser/extensionsActions.ts", - "./vs/workbench/parts/extensions/electron-browser/extensionsActivationProgress.ts", - "./vs/workbench/parts/extensions/electron-browser/extensionsUtils.ts", - "./vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts", - "./vs/workbench/parts/extensions/test/common/extensionQuery.test.ts", - "./vs/workbench/parts/feedback/electron-browser/feedback.contribution.ts", - "./vs/workbench/parts/feedback/electron-browser/feedback.ts", - "./vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem.ts", - "./vs/workbench/parts/files/browser/files.ts", - "./vs/workbench/parts/files/common/explorerModel.ts", - "./vs/workbench/parts/files/common/files.ts", - "./vs/workbench/parts/files/electron-browser/explorerService.ts", - "./vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider.ts", - "./vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts", - "./vs/workbench/parts/localizations/electron-browser/localizationsActions.ts", - "./vs/workbench/parts/logs/common/logConstants.ts", - "./vs/workbench/parts/logs/electron-browser/logs.contribution.ts", - "./vs/workbench/parts/logs/electron-browser/logsActions.ts", - "./vs/workbench/parts/markers/electron-browser/constants.ts", - "./vs/workbench/parts/markers/electron-browser/markers.ts", - "./vs/workbench/parts/markers/electron-browser/markersFileDecorations.ts", - "./vs/workbench/parts/markers/electron-browser/markersFilterOptions.ts", - "./vs/workbench/parts/markers/electron-browser/markersModel.ts", - "./vs/workbench/parts/markers/electron-browser/markersPanelActions.ts", - "./vs/workbench/parts/markers/electron-browser/messages.ts", - "./vs/workbench/parts/markers/test/electron-browser/markersModel.test.ts", - "./vs/workbench/parts/outline/electron-browser/outline.ts", - "./vs/workbench/parts/output/common/output.ts", - "./vs/workbench/parts/output/common/outputLinkComputer.ts", - "./vs/workbench/parts/output/common/outputLinkProvider.ts", - "./vs/workbench/parts/performance/electron-browser/startupTimings.ts", - "./vs/workbench/parts/preferences/browser/settingsWidgets.ts", - "./vs/workbench/parts/preferences/common/smartSnippetInserter.ts", - "./vs/workbench/parts/preferences/test/common/smartSnippetInserter.test.ts", - "./vs/workbench/parts/quickopen/browser/commandsHandler.ts", - "./vs/workbench/parts/quickopen/browser/gotoLineHandler.ts", - "./vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts", - "./vs/workbench/parts/quickopen/browser/helpHandler.ts", - "./vs/workbench/parts/quickopen/browser/quickopen.contribution.ts", - "./vs/workbench/parts/quickopen/browser/viewPickerHandler.ts", - "./vs/workbench/parts/relauncher/electron-browser/relauncher.contribution.ts", - "./vs/workbench/parts/scm/common/scm.ts", - "./vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts", - "./vs/workbench/parts/scm/electron-browser/scmActivity.ts", - "./vs/workbench/parts/scm/electron-browser/scmMenus.ts", - "./vs/workbench/parts/scm/electron-browser/scmUtil.ts", - "./vs/workbench/parts/search/browser/openAnythingHandler.ts", - "./vs/workbench/parts/search/browser/openFileHandler.ts", - "./vs/workbench/parts/search/browser/openSymbolHandler.ts", - "./vs/workbench/parts/search/browser/patternInputWidget.ts", - "./vs/workbench/parts/search/browser/replaceContributions.ts", - "./vs/workbench/parts/search/browser/replaceService.ts", - "./vs/workbench/parts/search/common/constants.ts", - "./vs/workbench/parts/search/common/queryBuilder.ts", - "./vs/workbench/parts/search/common/replace.ts", - "./vs/workbench/parts/search/common/search.ts", - "./vs/workbench/parts/search/common/searchModel.ts", - "./vs/workbench/parts/search/test/browser/mockSearchTree.ts", - "./vs/workbench/parts/search/test/browser/openFileHandler.test.ts", - "./vs/workbench/parts/search/test/common/searchModel.test.ts", - "./vs/workbench/parts/search/test/common/searchResult.test.ts", - "./vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts", - "./vs/workbench/parts/stats/node/stats.contribution.ts", - "./vs/workbench/parts/stats/node/workspaceStats.ts", - "./vs/workbench/parts/stats/test/workspaceStats.test.ts", - "./vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution.ts", - "./vs/workbench/parts/surveys/electron-browser/nps.contribution.ts", - "./vs/workbench/parts/tasks/browser/quickOpen.ts", - "./vs/workbench/parts/tasks/browser/taskQuickOpen.ts", - "./vs/workbench/parts/tasks/common/problemCollectors.ts", - "./vs/workbench/parts/tasks/common/problemMatcher.ts", - "./vs/workbench/parts/tasks/common/taskDefinitionRegistry.ts", - "./vs/workbench/parts/tasks/common/taskService.ts", - "./vs/workbench/parts/tasks/common/taskSystem.ts", - "./vs/workbench/parts/tasks/common/taskTemplates.ts", - "./vs/workbench/parts/tasks/common/tasks.ts", - "./vs/workbench/parts/tasks/electron-browser/jsonSchemaCommon.ts", - "./vs/workbench/parts/tasks/electron-browser/jsonSchema_v1.ts", - "./vs/workbench/parts/tasks/electron-browser/jsonSchema_v2.ts", - "./vs/workbench/parts/tasks/electron-browser/runAutomaticTasks.ts", - "./vs/workbench/parts/tasks/electron-browser/terminalTaskSystem.ts", - "./vs/workbench/parts/tasks/node/processRunnerDetector.ts", - "./vs/workbench/parts/tasks/node/processTaskSystem.ts", - "./vs/workbench/parts/tasks/node/taskConfiguration.ts", - "./vs/workbench/parts/tasks/node/tasks.ts", - "./vs/workbench/parts/tasks/test/common/problemMatcher.test.ts", - "./vs/workbench/parts/tasks/test/electron-browser/configuration.test.ts", - "./vs/workbench/parts/terminal/browser/terminalFindWidget.ts", - "./vs/workbench/parts/terminal/browser/terminalQuickOpen.ts", - "./vs/workbench/parts/terminal/browser/terminalTab.ts", - "./vs/workbench/parts/terminal/browser/terminalWidgetManager.ts", - "./vs/workbench/parts/terminal/common/terminal.ts", - "./vs/workbench/parts/terminal/common/terminalColorRegistry.ts", - "./vs/workbench/parts/terminal/common/terminalCommands.ts", - "./vs/workbench/parts/terminal/common/terminalMenu.ts", - "./vs/workbench/parts/terminal/common/terminalService.ts", - "./vs/workbench/parts/terminal/electron-browser/terminalConfigHelper.ts", - "./vs/workbench/parts/terminal/electron-browser/terminalInstance.ts", - "./vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts", - "./vs/workbench/parts/terminal/electron-browser/terminalProcessManager.ts", - "./vs/workbench/parts/terminal/node/terminal.ts", - "./vs/workbench/parts/terminal/node/terminalCommandTracker.ts", - "./vs/workbench/parts/terminal/node/terminalEnvironment.ts", - "./vs/workbench/parts/terminal/node/terminalProcess.ts", - "./vs/workbench/parts/terminal/node/terminalProcessExtHostProxy.ts", - "./vs/workbench/parts/terminal/node/windowsShellHelper.ts", - "./vs/workbench/parts/terminal/test/electron-browser/terminalColorRegistry.test.ts", - "./vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts", - "./vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts", - "./vs/workbench/parts/terminal/test/node/terminalCommandTracker.test.ts", - "./vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts", - "./vs/workbench/parts/themes/electron-browser/themes.contribution.ts", - "./vs/workbench/parts/url/electron-browser/url.contribution.ts", - "./vs/workbench/parts/webview/electron-browser/webviewProtocols.ts", + "./vs/workbench/contrib/backup/common/backupRestorer.ts", + "./vs/workbench/contrib/cli/electron-browser/cli.contribution.ts", + "./vs/workbench/contrib/codeEditor/browser/menuPreventer.ts", + "./vs/workbench/contrib/codeEditor/browser/simpleEditorOptions.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/accessibility.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/inspectKeybindings.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/largeFileOptimizations.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/selectionClipboard.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/sleepResumeRepaintMinimap.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/textMate/inspectTMScopes.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/toggleMinimap.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/toggleMultiCursorModifier.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/toggleRenderControlCharacter.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/toggleRenderWhitespace.ts", + "./vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts", + "./vs/workbench/contrib/comments/common/commentModel.ts", + "./vs/workbench/contrib/comments/electron-browser/commentGlyphWidget.ts", + "./vs/workbench/contrib/comments/electron-browser/commentService.ts", + "./vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts", + "./vs/workbench/contrib/debug/browser/debugANSIHandling.ts", + "./vs/workbench/contrib/debug/browser/linkDetector.ts", + "./vs/workbench/contrib/debug/common/debugProtocol.d.ts", + "./vs/workbench/contrib/debug/node/telemetryApp.ts", + "./vs/workbench/contrib/debug/test/common/mockDebug.ts", + "./vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts", + "./vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts", + "./vs/workbench/contrib/experiments/node/experimentService.ts", + "./vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts", + "./vs/workbench/contrib/extensions/browser/extensionsViewer.ts", + "./vs/workbench/contrib/extensions/common/extensionQuery.ts", + "./vs/workbench/contrib/extensions/common/extensions.ts", + "./vs/workbench/contrib/extensions/common/extensionsFileTemplate.ts", + "./vs/workbench/contrib/extensions/common/extensionsInput.ts", + "./vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts", + "./vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts", + "./vs/workbench/contrib/extensions/electron-browser/extensionsActivationProgress.ts", + "./vs/workbench/contrib/extensions/electron-browser/extensionsUtils.ts", + "./vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts", + "./vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts", + "./vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts", + "./vs/workbench/contrib/feedback/electron-browser/feedback.ts", + "./vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts", + "./vs/workbench/contrib/files/browser/files.ts", + "./vs/workbench/contrib/files/common/explorerModel.ts", + "./vs/workbench/contrib/files/common/files.ts", + "./vs/workbench/contrib/files/electron-browser/explorerService.ts", + "./vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts", + "./vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts", + "./vs/workbench/contrib/localizations/electron-browser/localizationsActions.ts", + "./vs/workbench/contrib/logs/common/logConstants.ts", + "./vs/workbench/contrib/logs/electron-browser/logs.contribution.ts", + "./vs/workbench/contrib/logs/electron-browser/logsActions.ts", + "./vs/workbench/contrib/markers/electron-browser/constants.ts", + "./vs/workbench/contrib/markers/electron-browser/markers.ts", + "./vs/workbench/contrib/markers/electron-browser/markersFileDecorations.ts", + "./vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts", + "./vs/workbench/contrib/markers/electron-browser/markersModel.ts", + "./vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts", + "./vs/workbench/contrib/markers/electron-browser/messages.ts", + "./vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts", + "./vs/workbench/contrib/outline/electron-browser/outline.ts", + "./vs/workbench/contrib/output/common/output.ts", + "./vs/workbench/contrib/output/common/outputLinkComputer.ts", + "./vs/workbench/contrib/output/common/outputLinkProvider.ts", + "./vs/workbench/contrib/performance/electron-browser/startupTimings.ts", + "./vs/workbench/contrib/preferences/browser/settingsWidgets.ts", + "./vs/workbench/contrib/preferences/common/smartSnippetInserter.ts", + "./vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts", + "./vs/workbench/contrib/quickopen/browser/commandsHandler.ts", + "./vs/workbench/contrib/quickopen/browser/gotoLineHandler.ts", + "./vs/workbench/contrib/quickopen/browser/gotoSymbolHandler.ts", + "./vs/workbench/contrib/quickopen/browser/helpHandler.ts", + "./vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts", + "./vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts", + "./vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution.ts", + "./vs/workbench/contrib/scm/common/scm.ts", + "./vs/workbench/contrib/scm/electron-browser/dirtydiffDecorator.ts", + "./vs/workbench/contrib/scm/electron-browser/scmActivity.ts", + "./vs/workbench/contrib/scm/electron-browser/scmMenus.ts", + "./vs/workbench/contrib/scm/electron-browser/scmUtil.ts", + "./vs/workbench/contrib/search/browser/openAnythingHandler.ts", + "./vs/workbench/contrib/search/browser/openFileHandler.ts", + "./vs/workbench/contrib/search/browser/openSymbolHandler.ts", + "./vs/workbench/contrib/search/browser/patternInputWidget.ts", + "./vs/workbench/contrib/search/browser/replaceContributions.ts", + "./vs/workbench/contrib/search/browser/replaceService.ts", + "./vs/workbench/contrib/search/common/constants.ts", + "./vs/workbench/contrib/search/common/queryBuilder.ts", + "./vs/workbench/contrib/search/common/replace.ts", + "./vs/workbench/contrib/search/common/search.ts", + "./vs/workbench/contrib/search/common/searchModel.ts", + "./vs/workbench/contrib/search/test/browser/mockSearchTree.ts", + "./vs/workbench/contrib/search/test/browser/openFileHandler.test.ts", + "./vs/workbench/contrib/search/test/common/searchModel.test.ts", + "./vs/workbench/contrib/search/test/common/searchResult.test.ts", + "./vs/workbench/contrib/splash/electron-browser/partsSplash.contribution.ts", + "./vs/workbench/contrib/stats/node/stats.contribution.ts", + "./vs/workbench/contrib/stats/node/workspaceStats.ts", + "./vs/workbench/contrib/stats/test/workspaceStats.test.ts", + "./vs/workbench/contrib/surveys/electron-browser/languageSurveys.contribution.ts", + "./vs/workbench/contrib/surveys/electron-browser/nps.contribution.ts", + "./vs/workbench/contrib/tasks/browser/quickOpen.ts", + "./vs/workbench/contrib/tasks/browser/taskQuickOpen.ts", + "./vs/workbench/contrib/tasks/common/problemCollectors.ts", + "./vs/workbench/contrib/tasks/common/problemMatcher.ts", + "./vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts", + "./vs/workbench/contrib/tasks/common/taskService.ts", + "./vs/workbench/contrib/tasks/common/taskSystem.ts", + "./vs/workbench/contrib/tasks/common/taskTemplates.ts", + "./vs/workbench/contrib/tasks/common/tasks.ts", + "./vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts", + "./vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts", + "./vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts", + "./vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts", + "./vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts", + "./vs/workbench/contrib/tasks/node/processRunnerDetector.ts", + "./vs/workbench/contrib/tasks/node/processTaskSystem.ts", + "./vs/workbench/contrib/tasks/node/taskConfiguration.ts", + "./vs/workbench/contrib/tasks/node/tasks.ts", + "./vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts", + "./vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts", + "./vs/workbench/contrib/terminal/browser/terminalFindWidget.ts", + "./vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts", + "./vs/workbench/contrib/terminal/browser/terminalTab.ts", + "./vs/workbench/contrib/terminal/browser/terminalWidgetManager.ts", + "./vs/workbench/contrib/terminal/common/terminal.ts", + "./vs/workbench/contrib/terminal/common/terminalColorRegistry.ts", + "./vs/workbench/contrib/terminal/common/terminalCommands.ts", + "./vs/workbench/contrib/terminal/common/terminalMenu.ts", + "./vs/workbench/contrib/terminal/common/terminalService.ts", + "./vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts", + "./vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts", + "./vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts", + "./vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts", + "./vs/workbench/contrib/terminal/node/terminal.ts", + "./vs/workbench/contrib/terminal/node/terminalCommandTracker.ts", + "./vs/workbench/contrib/terminal/node/terminalEnvironment.ts", + "./vs/workbench/contrib/terminal/node/terminalProcess.ts", + "./vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts", + "./vs/workbench/contrib/terminal/node/windowsShellHelper.ts", + "./vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts", + "./vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts", + "./vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts", + "./vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts", + "./vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts", + "./vs/workbench/contrib/themes/electron-browser/themes.contribution.ts", + "./vs/workbench/contrib/url/electron-browser/url.contribution.ts", + "./vs/workbench/contrib/webview/electron-browser/webviewProtocols.ts", "./vs/workbench/services/activity/common/activity.ts", "./vs/workbench/services/backup/common/backup.ts", "./vs/workbench/services/backup/node/backupFileService.ts", diff --git a/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts b/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts index dd317811cee..1ecc9e83e42 100644 --- a/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts +++ b/src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts @@ -797,9 +797,9 @@ suite('Quick Open Scorer', () => { }); test('compareFilesByScore - avoid match scattering (bug #12095)', function () { - const resourceA = URI.file('src/vs/workbench/parts/files/common/explorerViewModel.ts'); - const resourceB = URI.file('src/vs/workbench/parts/files/browser/views/explorerView.ts'); - const resourceC = URI.file('src/vs/workbench/parts/files/browser/views/explorerViewer.ts'); + const resourceA = URI.file('src/vs/workbench/contrib/files/common/explorerViewModel.ts'); + const resourceB = URI.file('src/vs/workbench/contrib/files/browser/views/explorerView.ts'); + const resourceC = URI.file('src/vs/workbench/contrib/files/browser/views/explorerViewer.ts'); let query = 'filesexplorerview.ts'; diff --git a/src/vs/base/test/node/storage/storage.test.ts b/src/vs/base/test/node/storage/storage.test.ts index 44ba7049630..16f71f8d208 100644 --- a/src/vs/base/test/node/storage/storage.test.ts +++ b/src/vs/base/test/node/storage/storage.test.ts @@ -555,7 +555,7 @@ suite('SQLite Storage Library', () => { items1.set('debug.actionswidgetposition', '0.6880952380952381'); const items2 = new Map(); - items2.set('workbench.editors.files.textfileeditor', '{"textEditorViewState":[["file:///Users/dummy/Documents/ticino-playground/play.htm",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":6,"column":16},"position":{"lineNumber":6,"column":16}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":0},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}],["file:///Users/dummy/Documents/ticino-playground/nakefile.js",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":7,"column":81},"position":{"lineNumber":7,"column":81}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":20},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}],["file:///Users/dummy/Desktop/vscode2/.gitattributes",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":9,"column":12},"position":{"lineNumber":9,"column":12}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":20},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}],["file:///Users/dummy/Desktop/vscode2/src/vs/workbench/parts/search/browser/openAnythingHandler.ts",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":1,"column":1},"position":{"lineNumber":1,"column":1}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":0},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}]]}'); + items2.set('workbench.editors.files.textfileeditor', '{"textEditorViewState":[["file:///Users/dummy/Documents/ticino-playground/play.htm",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":6,"column":16},"position":{"lineNumber":6,"column":16}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":0},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}],["file:///Users/dummy/Documents/ticino-playground/nakefile.js",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":7,"column":81},"position":{"lineNumber":7,"column":81}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":20},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}],["file:///Users/dummy/Desktop/vscode2/.gitattributes",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":9,"column":12},"position":{"lineNumber":9,"column":12}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":20},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}],["file:///Users/dummy/Desktop/vscode2/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts",{"0":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":1,"column":1},"position":{"lineNumber":1,"column":1}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":0},"contributionsState":{"editor.contrib.folding":{},"editor.contrib.wordHighlighter":false}}}]]}'); const items3 = new Map(); items3.set('nps/iscandidate', 'false'); diff --git a/src/vs/platform/theme/test/electron-browser/colorRegistry.releaseTest.ts b/src/vs/platform/theme/test/electron-browser/colorRegistry.releaseTest.ts index 30e0d0ca05e..1e92b4d8608 100644 --- a/src/vs/platform/theme/test/electron-browser/colorRegistry.releaseTest.ts +++ b/src/vs/platform/theme/test/electron-browser/colorRegistry.releaseTest.ts @@ -6,12 +6,12 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IColorRegistry, Extensions, ColorContribution } from 'vs/platform/theme/common/colorRegistry'; import { editorMarkerNavigationError } from 'vs/editor/contrib/gotoError/gotoErrorWidget'; -import { overviewRulerModifiedForeground } from 'vs/workbench/parts/scm/electron-browser/dirtydiffDecorator'; -import { STATUS_BAR_DEBUGGING_BACKGROUND } from 'vs/workbench/parts/debug/browser/statusbarColorProvider'; -import { debugExceptionWidgetBackground } from 'vs/workbench/parts/debug/browser/exceptionWidget'; -import { debugToolBarBackground } from 'vs/workbench/parts/debug/browser/debugToolbar'; -import { buttonBackground } from 'vs/workbench/parts/welcome/page/electron-browser/welcomePage'; -import { embeddedEditorBackground } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart'; +import { overviewRulerModifiedForeground } from 'vs/workbench/contrib/scm/electron-browser/dirtydiffDecorator'; +import { STATUS_BAR_DEBUGGING_BACKGROUND } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider'; +import { debugExceptionWidgetBackground } from 'vs/workbench/contrib/debug/browser/exceptionWidget'; +import { debugToolBarBackground } from 'vs/workbench/contrib/debug/browser/debugToolbar'; +import { buttonBackground } from 'vs/workbench/contrib/welcome/page/electron-browser/welcomePage'; +import { embeddedEditorBackground } from 'vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart'; import { request, asText } from 'vs/base/node/request'; import * as pfs from 'vs/base/node/pfs'; import * as path from 'path'; diff --git a/src/vs/workbench/api/browser/viewsExtensionPoint.ts b/src/vs/workbench/api/browser/viewsExtensionPoint.ts index 4674ec350c6..cca5a3194e9 100644 --- a/src/vs/workbench/api/browser/viewsExtensionPoint.ts +++ b/src/vs/workbench/api/browser/viewsExtensionPoint.ts @@ -16,9 +16,9 @@ import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWo import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { Registry } from 'vs/platform/registry/common/platform'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { VIEWLET_ID as EXPLORER } from 'vs/workbench/parts/files/common/files'; -import { VIEWLET_ID as SCM } from 'vs/workbench/parts/scm/common/scm'; -import { VIEWLET_ID as DEBUG } from 'vs/workbench/parts/debug/common/debug'; +import { VIEWLET_ID as EXPLORER } from 'vs/workbench/contrib/files/common/files'; +import { VIEWLET_ID as SCM } from 'vs/workbench/contrib/scm/common/scm'; +import { VIEWLET_ID as DEBUG } from 'vs/workbench/contrib/debug/common/debug'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { URI } from 'vs/base/common/uri'; import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ShowViewletAction } from 'vs/workbench/browser/viewlet'; diff --git a/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts b/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts index e0e07ea27ce..3e466d8b5b3 100644 --- a/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts +++ b/src/vs/workbench/api/electron-browser/extensionHost.contribution.ts @@ -11,7 +11,7 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; // --- other interested parties import { JSONValidationExtensionPoint } from 'vs/workbench/services/jsonschemas/common/jsonValidationExtensionPoint'; import { ColorExtensionPoint } from 'vs/workbench/services/themes/common/colorExtensionPoint'; -import { LanguageConfigurationFileHandler } from 'vs/workbench/parts/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint'; +import { LanguageConfigurationFileHandler } from 'vs/workbench/contrib/codeEditor/electron-browser/languageConfiguration/languageConfigurationExtensionPoint'; // --- mainThread participants import 'vs/workbench/api/node/apiCommands'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadComments.ts b/src/vs/workbench/api/electron-browser/mainThreadComments.ts index f62f4c820f4..b8b975d7188 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadComments.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadComments.ts @@ -11,14 +11,14 @@ import { keys } from 'vs/base/common/map'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ExtHostCommentsShape, ExtHostContext, IExtHostContext, MainContext, MainThreadCommentsShape, CommentProviderFeatures } from '../node/extHost.protocol'; -import { ICommentService } from 'vs/workbench/parts/comments/electron-browser/commentService'; -import { COMMENTS_PANEL_ID, CommentsPanel, COMMENTS_PANEL_TITLE } from 'vs/workbench/parts/comments/electron-browser/commentsPanel'; +import { ICommentService } from 'vs/workbench/contrib/comments/electron-browser/commentService'; +import { COMMENTS_PANEL_ID, CommentsPanel, COMMENTS_PANEL_TITLE } from 'vs/workbench/contrib/comments/electron-browser/commentsPanel'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { URI } from 'vs/base/common/uri'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { generateUuid } from 'vs/base/common/uuid'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ICommentsConfiguration } from 'vs/workbench/parts/comments/electron-browser/comments.contribution'; +import { ICommentsConfiguration } from 'vs/workbench/contrib/comments/electron-browser/comments.contribution'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { Registry } from 'vs/platform/registry/common/platform'; import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts index 2eac8972c17..287c7320573 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadDebugService.ts @@ -5,16 +5,16 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { URI as uri } from 'vs/base/common/uri'; -import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, ITerminalSettings, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDebugAdapterTrackerFactory } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, IConfig, IDebugConfigurationProvider, IBreakpoint, IFunctionBreakpoint, IBreakpointData, ITerminalSettings, IDebugAdapter, IDebugAdapterDescriptorFactory, IDebugSession, IDebugAdapterFactory, IDebugAdapterTrackerFactory } from 'vs/workbench/contrib/debug/common/debug'; import { ExtHostContext, ExtHostDebugServiceShape, MainThreadDebugServiceShape, DebugSessionUUID, MainContext, IExtHostContext, IBreakpointsDeltaDto, ISourceMultiBreakpointDto, ISourceBreakpointDto, IFunctionBreakpointDto, IDebugSessionDto } from 'vs/workbench/api/node/extHost.protocol'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; import severity from 'vs/base/common/severity'; -import { AbstractDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter'; +import { AbstractDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/parts/debug/common/debugUtils'; +import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/contrib/debug/common/debugUtils'; @extHostNamedCustomer(MainContext.MainThreadDebugService) export class MainThreadDebugService implements MainThreadDebugServiceShape, IDebugAdapterFactory { diff --git a/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts index bdd181a2cac..4432efc4373 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts @@ -7,7 +7,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { Emitter } from 'vs/base/common/event'; import { ITextModel, ISingleEditOperation } from 'vs/editor/common/model'; import * as modes from 'vs/editor/common/modes'; -import * as search from 'vs/workbench/parts/search/common/search'; +import * as search from 'vs/workbench/contrib/search/common/search'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Position as EditorPosition } from 'vs/editor/common/core/position'; import { Range as EditorRange } from 'vs/editor/common/core/range'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadOutputService.ts b/src/vs/workbench/api/electron-browser/mainThreadOutputService.ts index 7427501f88c..6318bbd9559 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadOutputService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadOutputService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Registry } from 'vs/platform/registry/common/platform'; -import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID, Extensions, IOutputChannelRegistry } from 'vs/workbench/parts/output/common/output'; +import { IOutputService, IOutputChannel, OUTPUT_PANEL_ID, Extensions, IOutputChannelRegistry } from 'vs/workbench/contrib/output/common/output'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { MainThreadOutputServiceShape, MainContext, IExtHostContext, ExtHostOutputServiceShape, ExtHostContext } from '../node/extHost.protocol'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadTask.ts b/src/vs/workbench/api/electron-browser/mainThreadTask.ts index cbd8ea073e5..37231f85b42 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTask.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTask.ts @@ -18,13 +18,13 @@ import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspac import { ContributedTask, KeyedTaskIdentifier, TaskExecution, Task, TaskEvent, TaskEventKind, PresentationOptions, CommandOptions, CommandConfiguration, RuntimeType, CustomTask, TaskScope, TaskSource, TaskSourceKind, ExtensionTaskSource, RunOptions, TaskSet -} from 'vs/workbench/parts/tasks/common/tasks'; +} from 'vs/workbench/contrib/tasks/common/tasks'; -import { ResolveSet, ResolvedVariables } from 'vs/workbench/parts/tasks/common/taskSystem'; -import { ITaskService, TaskFilter, ITaskProvider } from 'vs/workbench/parts/tasks/common/taskService'; +import { ResolveSet, ResolvedVariables } from 'vs/workbench/contrib/tasks/common/taskSystem'; +import { ITaskService, TaskFilter, ITaskProvider } from 'vs/workbench/contrib/tasks/common/taskService'; -import { TaskDefinition } from 'vs/workbench/parts/tasks/node/tasks'; +import { TaskDefinition } from 'vs/workbench/contrib/tasks/node/tasks'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; import { ExtHostContext, MainThreadTaskShape, ExtHostTaskShape, MainContext, IExtHostContext } from 'vs/workbench/api/node/extHost.protocol'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts index bdc0b212563..d340f73f602 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTerminalService.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalProcessExtHostProxy, ITerminalProcessExtHostRequest, ITerminalDimensions, EXT_HOST_CREATION_DELAY } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalProcessExtHostProxy, ITerminalProcessExtHostRequest, ITerminalDimensions, EXT_HOST_CREATION_DELAY } from 'vs/workbench/contrib/terminal/common/terminal'; import { ExtHostContext, ExtHostTerminalServiceShape, MainThreadTerminalServiceShape, MainContext, IExtHostContext, ShellLaunchConfigDto } from 'vs/workbench/api/node/extHost.protocol'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadWebview.ts b/src/vs/workbench/api/electron-browser/mainThreadWebview.ts index ee93e07d8d0..a6fd8c6d75a 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWebview.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWebview.ts @@ -10,9 +10,9 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { ExtHostContext, ExtHostWebviewsShape, IExtHostContext, MainContext, MainThreadWebviewsShape, WebviewPanelHandle, WebviewPanelShowOptions } from 'vs/workbench/api/node/extHost.protocol'; import { editorGroupToViewColumn, EditorViewColumn, viewColumnToEditorGroup } from 'vs/workbench/api/shared/editor'; -import { WebviewEditor } from 'vs/workbench/parts/webview/electron-browser/webviewEditor'; -import { WebviewEditorInput } from 'vs/workbench/parts/webview/electron-browser/webviewEditorInput'; -import { ICreateWebViewShowOptions, IWebviewEditorService, WebviewInputOptions, WebviewReviver } from 'vs/workbench/parts/webview/electron-browser/webviewEditorService'; +import { WebviewEditor } from 'vs/workbench/contrib/webview/electron-browser/webviewEditor'; +import { WebviewEditorInput } from 'vs/workbench/contrib/webview/electron-browser/webviewEditorInput'; +import { ICreateWebViewShowOptions, IWebviewEditorService, WebviewInputOptions, WebviewReviver } from 'vs/workbench/contrib/webview/electron-browser/webviewEditorService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index d99aab31ad5..f7c61326bed 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -17,7 +17,7 @@ import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostCustomers'; -import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder'; +import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/contrib/search/common/queryBuilder'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index ce586acaa51..790a4c8e2a6 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -33,9 +33,9 @@ import { EndOfLine, IFileOperationOptions, TextEditorLineNumbersStyle } from 'vs import { EditorViewColumn } from 'vs/workbench/api/shared/editor'; import { TaskDTO, TaskExecutionDTO, TaskFilterDTO, TaskHandleDTO, TaskProcessEndedDTO, TaskProcessStartedDTO, TaskSystemInfoDTO, TaskSetDTO } from 'vs/workbench/api/shared/tasks'; import { ITreeItem, IRevealOptions } from 'vs/workbench/common/views'; -import { IAdapterDescriptor, IConfig, ITerminalSettings } from 'vs/workbench/parts/debug/common/debug'; -import { ITextQueryBuilderOptions } from 'vs/workbench/parts/search/common/queryBuilder'; -import { ITerminalDimensions } from 'vs/workbench/parts/terminal/common/terminal'; +import { IAdapterDescriptor, IConfig, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug'; +import { ITextQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder'; +import { ITerminalDimensions } from 'vs/workbench/contrib/terminal/common/terminal'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { IRPCProtocol, createExtHostContextProxyIdentifier as createExtId, createMainContextProxyIdentifier as createMainId } from 'vs/workbench/services/extensions/node/proxyIdentifier'; import { IProgressOptions, IProgressStep } from 'vs/platform/progress/common/progress'; diff --git a/src/vs/workbench/api/node/extHostApiCommands.ts b/src/vs/workbench/api/node/extHostApiCommands.ts index 9565fbc108c..c8fdd92051e 100644 --- a/src/vs/workbench/api/node/extHostApiCommands.ts +++ b/src/vs/workbench/api/node/extHostApiCommands.ts @@ -11,7 +11,7 @@ import * as types from 'vs/workbench/api/node/extHostTypes'; import { IRawColorInfo, WorkspaceEditDto } from 'vs/workbench/api/node/extHost.protocol'; import { ISingleEditOperation } from 'vs/editor/common/model'; import * as modes from 'vs/editor/common/modes'; -import * as search from 'vs/workbench/parts/search/common/search'; +import * as search from 'vs/workbench/contrib/search/common/search'; import { ICommandHandlerDescription } from 'vs/platform/commands/common/commands'; import { ExtHostCommands } from 'vs/workbench/api/node/extHostCommands'; import { CustomCodeAction } from 'vs/workbench/api/node/extHostLanguageFeatures'; diff --git a/src/vs/workbench/api/node/extHostDebugService.ts b/src/vs/workbench/api/node/extHostDebugService.ts index a4b106f656b..a1c246eab34 100644 --- a/src/vs/workbench/api/node/extHostDebugService.ts +++ b/src/vs/workbench/api/node/extHostDebugService.ts @@ -15,16 +15,16 @@ import { } from 'vs/workbench/api/node/extHost.protocol'; import * as vscode from 'vscode'; import { Disposable, Position, Location, SourceBreakpoint, FunctionBreakpoint, DebugAdapterServer, DebugAdapterExecutable } from 'vs/workbench/api/node/extHostTypes'; -import { ExecutableDebugAdapter, SocketDebugAdapter, AbstractDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter'; +import { ExecutableDebugAdapter, SocketDebugAdapter, AbstractDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter'; import { ExtHostWorkspace } from 'vs/workbench/api/node/extHostWorkspace'; import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionService'; import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/node/extHostDocumentsAndEditors'; -import { ITerminalSettings, IDebuggerContribution, IConfig, IDebugAdapter, IDebugAdapterServer, IDebugAdapterExecutable, IAdapterDescriptor } from 'vs/workbench/parts/debug/common/debug'; -import { getTerminalLauncher, hasChildProcesses, prepareCommand } from 'vs/workbench/parts/debug/node/terminals'; +import { ITerminalSettings, IDebuggerContribution, IConfig, IDebugAdapter, IDebugAdapterServer, IDebugAdapterExecutable, IAdapterDescriptor } from 'vs/workbench/contrib/debug/common/debug'; +import { getTerminalLauncher, hasChildProcesses, prepareCommand } from 'vs/workbench/contrib/debug/node/terminals'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { AbstractVariableResolverService } from 'vs/workbench/services/configurationResolver/node/variableResolver'; import { ExtHostConfiguration, ExtHostConfigProvider } from './extHostConfiguration'; -import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/parts/debug/common/debugUtils'; +import { convertToVSCPaths, convertToDAPaths } from 'vs/workbench/contrib/debug/common/debugUtils'; import { ExtHostTerminalService } from 'vs/workbench/api/node/extHostTerminalService'; import { IDisposable } from 'vs/base/common/lifecycle'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; diff --git a/src/vs/workbench/api/node/extHostTerminalService.ts b/src/vs/workbench/api/node/extHostTerminalService.ts index 005f6b766a8..6e72538aebd 100644 --- a/src/vs/workbench/api/node/extHostTerminalService.ts +++ b/src/vs/workbench/api/node/extHostTerminalService.ts @@ -6,13 +6,13 @@ import * as vscode from 'vscode'; import { URI, UriComponents } from 'vs/base/common/uri'; import * as platform from 'vs/base/common/platform'; -import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; +import * as terminalEnvironment from 'vs/workbench/contrib/terminal/node/terminalEnvironment'; import { Event, Emitter } from 'vs/base/common/event'; import { ExtHostTerminalServiceShape, MainContext, MainThreadTerminalServiceShape, IMainContext, ShellLaunchConfigDto } from 'vs/workbench/api/node/extHost.protocol'; import { ExtHostConfiguration } from 'vs/workbench/api/node/extHostConfiguration'; import { ILogService } from 'vs/platform/log/common/log'; -import { EXT_HOST_CREATION_DELAY } from 'vs/workbench/parts/terminal/common/terminal'; -import { TerminalProcess } from 'vs/workbench/parts/terminal/node/terminalProcess'; +import { EXT_HOST_CREATION_DELAY } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TerminalProcess } from 'vs/workbench/contrib/terminal/node/terminalProcess'; import { timeout } from 'vs/base/common/async'; import { generateRandomPipeName } from 'vs/base/parts/ipc/node/ipc.net'; import * as http from 'http'; diff --git a/src/vs/workbench/api/node/extHostTypeConverters.ts b/src/vs/workbench/api/node/extHostTypeConverters.ts index 81e79899972..3cc5c1cb05b 100644 --- a/src/vs/workbench/api/node/extHostTypeConverters.ts +++ b/src/vs/workbench/api/node/extHostTypeConverters.ts @@ -5,7 +5,7 @@ import * as modes from 'vs/editor/common/modes'; import * as types from './extHostTypes'; -import * as search from 'vs/workbench/parts/search/common/search'; +import * as search from 'vs/workbench/contrib/search/common/search'; import { ITextEditorOptions } from 'vs/platform/editor/common/editor'; import { EditorViewColumn } from 'vs/workbench/api/shared/editor'; import { IDecorationOptions, IThemeDecorationRenderOptions, IDecorationRenderOptions, IContentDecorationRenderOptions } from 'vs/editor/common/editorCommon'; diff --git a/src/vs/workbench/api/node/extHostWorkspace.ts b/src/vs/workbench/api/node/extHostWorkspace.ts index 00fa6ec1cf1..7175e06d423 100644 --- a/src/vs/workbench/api/node/extHostWorkspace.ts +++ b/src/vs/workbench/api/node/extHostWorkspace.ts @@ -20,7 +20,7 @@ import { Severity } from 'vs/platform/notification/common/notification'; import { IRawFileMatch2, resultIsMatch } from 'vs/platform/search/common/search'; import { Workspace, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { Range, RelativePattern } from 'vs/workbench/api/node/extHostTypes'; -import { ITextQueryBuilderOptions } from 'vs/workbench/parts/search/common/queryBuilder'; +import { ITextQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import * as vscode from 'vscode'; import { ExtHostWorkspaceShape, IMainContext, IWorkspaceData, MainContext, MainThreadMessageServiceShape, MainThreadWorkspaceShape } from './extHost.protocol'; diff --git a/src/vs/workbench/buildfile.js b/src/vs/workbench/buildfile.js index 8946ef5adb8..83c43b0ace9 100644 --- a/src/vs/workbench/buildfile.js +++ b/src/vs/workbench/buildfile.js @@ -17,12 +17,12 @@ function createModuleDescription(name, exclude) { exports.collectModules = function () { var modules = [ - createModuleDescription('vs/workbench/parts/output/common/outputLinkComputer', ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']), + createModuleDescription('vs/workbench/contrib/output/common/outputLinkComputer', ['vs/base/common/worker/simpleWorker', 'vs/editor/common/services/editorSimpleWorker']), - createModuleDescription('vs/workbench/parts/debug/node/telemetryApp', []), + createModuleDescription('vs/workbench/contrib/debug/node/telemetryApp', []), createModuleDescription('vs/workbench/services/search/node/searchApp', []), - + createModuleDescription('vs/workbench/services/files/node/watcher/unix/watcherApp', []), createModuleDescription('vs/workbench/services/files/node/watcher/nsfw/watcherApp', []), diff --git a/src/vs/workbench/common/actions.ts b/src/vs/workbench/common/actions.ts index b2530b09a97..f805576e516 100644 --- a/src/vs/workbench/common/actions.ts +++ b/src/vs/workbench/common/actions.ts @@ -54,7 +54,7 @@ Registry.add(Extensions.WorkbenchActions, new class implements IWorkbenchActionR // menu item // TODO@Rob slightly weird if-check required because of - // https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/search/electron-browser/search.contribution.ts#L266 + // https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts#L266 if (descriptor.label) { let idx = alias.indexOf(': '); diff --git a/src/vs/workbench/contrib/backup/common/backup.contribution.ts b/src/vs/workbench/contrib/backup/common/backup.contribution.ts index eefa6d146d5..f3ac6e3a0bd 100644 --- a/src/vs/workbench/contrib/backup/common/backup.contribution.ts +++ b/src/vs/workbench/contrib/backup/common/backup.contribution.ts @@ -5,8 +5,8 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { BackupModelTracker } from 'vs/workbench/parts/backup/common/backupModelTracker'; -import { BackupRestorer } from 'vs/workbench/parts/backup/common/backupRestorer'; +import { BackupModelTracker } from 'vs/workbench/contrib/backup/common/backupModelTracker'; +import { BackupRestorer } from 'vs/workbench/contrib/backup/common/backupRestorer'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; // Register Backup Model Tracker diff --git a/src/vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts index 2aefe2da134..892a59ae182 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions.ts @@ -7,9 +7,9 @@ import { ICodeEditorWidgetOptions } from 'vs/editor/browser/widget/codeEditorWid import { ContextMenuController } from 'vs/editor/contrib/contextmenu/contextmenu'; import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2'; import { SuggestController } from 'vs/editor/contrib/suggest/suggestController'; -import { MenuPreventer } from 'vs/workbench/parts/codeEditor/browser/menuPreventer'; -import { SelectionClipboard } from 'vs/workbench/parts/codeEditor/electron-browser/selectionClipboard'; -import { TabCompletionController } from 'vs/workbench/parts/snippets/electron-browser/tabCompletion'; +import { MenuPreventer } from 'vs/workbench/contrib/codeEditor/browser/menuPreventer'; +import { SelectionClipboard } from 'vs/workbench/contrib/codeEditor/electron-browser/selectionClipboard'; +import { TabCompletionController } from 'vs/workbench/contrib/snippets/electron-browser/tabCompletion'; export function getSimpleCodeEditorWidgetOptions(): ICodeEditorWidgetOptions { return { diff --git a/src/vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts index 8c692b4fcc2..92dcfbb4cbf 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput.ts @@ -29,9 +29,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ColorIdentifier, editorSelectionBackground, inputBackground, inputBorder, inputForeground, inputPlaceholderForeground, selectionBackground } from 'vs/platform/theme/common/colorRegistry'; import { IStyleOverrides, IThemable, attachStyler } from 'vs/platform/theme/common/styler'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { MenuPreventer } from 'vs/workbench/parts/codeEditor/browser/menuPreventer'; -import { getSimpleEditorOptions } from 'vs/workbench/parts/codeEditor/browser/simpleEditorOptions'; -import { SelectionClipboard } from 'vs/workbench/parts/codeEditor/electron-browser/selectionClipboard'; +import { MenuPreventer } from 'vs/workbench/contrib/codeEditor/browser/menuPreventer'; +import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions'; +import { SelectionClipboard } from 'vs/workbench/contrib/codeEditor/electron-browser/selectionClipboard'; interface SuggestResultsProvider { /** diff --git a/src/vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts index 1ef5416fc34..448b3479093 100644 --- a/src/vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap.ts @@ -279,7 +279,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: TOGGLE_WORD_WRAP_ID, title: nls.localize('unwrapMinified', "Disable wrapping for this file"), - iconLocation: { dark: URI.parse(require.toUrl('vs/workbench/parts/codeEditor/electron-browser/media/WordWrap_16x.svg')) } + iconLocation: { dark: URI.parse(require.toUrl('vs/workbench/contrib/codeEditor/electron-browser/media/WordWrap_16x.svg')) } }, group: 'navigation', order: 1, @@ -293,7 +293,7 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { id: TOGGLE_WORD_WRAP_ID, title: nls.localize('wrapMinified', "Enable wrapping for this file"), - iconLocation: { dark: URI.parse(require.toUrl('vs/workbench/parts/codeEditor/electron-browser/media/WordWrap_16x.svg')) } + iconLocation: { dark: URI.parse(require.toUrl('vs/workbench/contrib/codeEditor/electron-browser/media/WordWrap_16x.svg')) } }, group: 'navigation', order: 1, diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts b/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts index 1dd1703a77b..6c61815bdb2 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/commentNode.ts @@ -20,8 +20,8 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { inputValidationErrorBorder } from 'vs/platform/theme/common/colorRegistry'; import { attachButtonStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { ICommentService } from 'vs/workbench/parts/comments/electron-browser/commentService'; -import { SimpleCommentEditor } from 'vs/workbench/parts/comments/electron-browser/simpleCommentEditor'; +import { ICommentService } from 'vs/workbench/contrib/comments/electron-browser/commentService'; +import { SimpleCommentEditor } from 'vs/workbench/contrib/comments/electron-browser/simpleCommentEditor'; import { KeyCode } from 'vs/base/common/keyCodes'; import { isMacintosh } from 'vs/base/common/platform'; import { Selection } from 'vs/editor/common/core/selection'; diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentService.ts b/src/vs/workbench/contrib/comments/electron-browser/commentService.ts index 6540d310ea2..8d89ebd79b1 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/commentService.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/commentService.ts @@ -12,7 +12,7 @@ import { Range } from 'vs/editor/common/core/range'; import { keys } from 'vs/base/common/map'; import { CancellationToken } from 'vs/base/common/cancellation'; import { assign } from 'vs/base/common/objects'; -import { ICommentThreadChangedEvent } from 'vs/workbench/parts/comments/common/commentModel'; +import { ICommentThreadChangedEvent } from 'vs/workbench/contrib/comments/common/commentModel'; export const ICommentService = createDecorator('commentService'); diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts index c5eea6a8d01..c288cd08cc9 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/commentThreadWidget.ts @@ -20,7 +20,7 @@ import { peekViewBorder } from 'vs/editor/contrib/referenceSearch/referencesWidg import { IOptions, ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget'; import { attachButtonStyler } from 'vs/platform/theme/common/styler'; import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; -import { CommentGlyphWidget } from 'vs/workbench/parts/comments/electron-browser/commentGlyphWidget'; +import { CommentGlyphWidget } from 'vs/workbench/contrib/comments/electron-browser/commentGlyphWidget'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IModelService } from 'vs/editor/common/services/modelService'; import { SimpleCommentEditor } from './simpleCommentEditor'; @@ -29,13 +29,13 @@ import { transparent, editorForeground, textLinkActiveForeground, textLinkForegr import { IModeService } from 'vs/editor/common/services/modeService'; import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { KeyCode } from 'vs/base/common/keyCodes'; -import { ICommentService } from 'vs/workbench/parts/comments/electron-browser/commentService'; +import { ICommentService } from 'vs/workbench/contrib/comments/electron-browser/commentService'; import { Range, IRange } from 'vs/editor/common/core/range'; import { IPosition } from 'vs/editor/common/core/position'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer'; import { IMarginData } from 'vs/editor/browser/controller/mouseTarget'; -import { CommentNode } from 'vs/workbench/parts/comments/electron-browser/commentNode'; +import { CommentNode } from 'vs/workbench/contrib/comments/electron-browser/commentNode'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ITextModel } from 'vs/editor/common/model'; diff --git a/src/vs/workbench/contrib/comments/electron-browser/comments.contribution.ts b/src/vs/workbench/contrib/comments/electron-browser/comments.contribution.ts index 37421047f9c..4c00b71e1f3 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/comments.contribution.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/comments.contribution.ts @@ -6,8 +6,8 @@ import * as nls from 'vs/nls'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { Registry } from 'vs/platform/registry/common/platform'; -import 'vs/workbench/parts/comments/electron-browser/commentsEditorContribution'; -import { ICommentService, CommentService } from 'vs/workbench/parts/comments/electron-browser/commentService'; +import 'vs/workbench/contrib/comments/electron-browser/commentsEditorContribution'; +import { ICommentService, CommentService } from 'vs/workbench/contrib/comments/electron-browser/commentService'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; export interface ICommentsConfiguration { diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts b/src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts index e761197389b..467d81e927d 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/commentsEditorContribution.ts @@ -23,8 +23,8 @@ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/co import { editorForeground } from 'vs/platform/theme/common/colorRegistry'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { CommentThreadCollapsibleState } from 'vs/workbench/api/node/extHostTypes'; -import { ReviewZoneWidget, COMMENTEDITOR_DECORATION_KEY } from 'vs/workbench/parts/comments/electron-browser/commentThreadWidget'; -import { ICommentService, ICommentInfo } from 'vs/workbench/parts/comments/electron-browser/commentService'; +import { ReviewZoneWidget, COMMENTEDITOR_DECORATION_KEY } from 'vs/workbench/contrib/comments/electron-browser/commentThreadWidget'; +import { ICommentService, ICommentInfo } from 'vs/workbench/contrib/comments/electron-browser/commentService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; @@ -34,7 +34,7 @@ import { IMarginData } from 'vs/editor/browser/controller/mouseTarget'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; -import { overviewRulerCommentingRangeForeground } from 'vs/workbench/parts/comments/electron-browser/commentGlyphWidget'; +import { overviewRulerCommentingRangeForeground } from 'vs/workbench/contrib/comments/electron-browser/commentGlyphWidget'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND } from 'vs/workbench/common/theme'; diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentsPanel.ts b/src/vs/workbench/contrib/comments/electron-browser/commentsPanel.ts index a366d8c320b..7c275394f73 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/commentsPanel.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/commentsPanel.ts @@ -14,10 +14,10 @@ import { TreeResourceNavigator, WorkbenchTree } from 'vs/platform/list/browser/l import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { Panel } from 'vs/workbench/browser/panel'; -import { CommentNode, CommentsModel, ResourceWithCommentThreads, ICommentThreadChangedEvent } from 'vs/workbench/parts/comments/common/commentModel'; -import { ReviewController } from 'vs/workbench/parts/comments/electron-browser/commentsEditorContribution'; -import { CommentsDataFilter, CommentsDataSource, CommentsModelRenderer } from 'vs/workbench/parts/comments/electron-browser/commentsTreeViewer'; -import { ICommentService, IWorkspaceCommentThreadsEvent } from 'vs/workbench/parts/comments/electron-browser/commentService'; +import { CommentNode, CommentsModel, ResourceWithCommentThreads, ICommentThreadChangedEvent } from 'vs/workbench/contrib/comments/common/commentModel'; +import { ReviewController } from 'vs/workbench/contrib/comments/electron-browser/commentsEditorContribution'; +import { CommentsDataFilter, CommentsDataSource, CommentsModelRenderer } from 'vs/workbench/contrib/comments/electron-browser/commentsTreeViewer'; +import { ICommentService, IWorkspaceCommentThreadsEvent } from 'vs/workbench/contrib/comments/electron-browser/commentService'; import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { textLinkForeground, textLinkActiveForeground, focusBorder, textPreformatForeground } from 'vs/platform/theme/common/colorRegistry'; diff --git a/src/vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts b/src/vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts index f67bfd09039..b5b2d867c25 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/commentsTreeViewer.ts @@ -12,7 +12,7 @@ import { URI } from 'vs/base/common/uri'; import { IDataSource, IFilter, IRenderer as ITreeRenderer, ITree } from 'vs/base/parts/tree/browser/tree'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels'; -import { CommentNode, CommentsModel, ResourceWithCommentThreads } from 'vs/workbench/parts/comments/common/commentModel'; +import { CommentNode, CommentsModel, ResourceWithCommentThreads } from 'vs/workbench/contrib/comments/common/commentModel'; export class CommentsDataSource implements IDataSource { public getId(tree: ITree, element: any): string { diff --git a/src/vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts b/src/vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts index 779d0e58fe7..dc695dcddfc 100644 --- a/src/vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts +++ b/src/vs/workbench/contrib/comments/electron-browser/simpleCommentEditor.ts @@ -12,11 +12,11 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { ICommandService } from 'vs/platform/commands/common/commands'; // Allowed Editor Contributions: -import { MenuPreventer } from 'vs/workbench/parts/codeEditor/browser/menuPreventer'; +import { MenuPreventer } from 'vs/workbench/contrib/codeEditor/browser/menuPreventer'; import { ContextMenuController } from 'vs/editor/contrib/contextmenu/contextmenu'; import { SuggestController } from 'vs/editor/contrib/suggest/suggestController'; import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2'; -import { TabCompletionController } from 'vs/workbench/parts/snippets/electron-browser/tabCompletion'; +import { TabCompletionController } from 'vs/workbench/contrib/snippets/electron-browser/tabCompletion'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/contrib/debug/browser/baseDebugView.ts b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts index c073bb18876..0a79cb2a500 100644 --- a/src/vs/workbench/contrib/debug/browser/baseDebugView.ts +++ b/src/vs/workbench/contrib/debug/browser/baseDebugView.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import * as dom from 'vs/base/browser/dom'; -import { IExpression, IDebugService } from 'vs/workbench/parts/debug/common/debug'; -import { Expression, Variable } from 'vs/workbench/parts/debug/common/debugModel'; +import { IExpression, IDebugService } from 'vs/workbench/contrib/debug/common/debug'; +import { Expression, Variable } from 'vs/workbench/contrib/debug/common/debugModel'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInputValidationOptions, InputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { ITreeRenderer, ITreeNode } from 'vs/base/browser/ui/tree/tree'; diff --git a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts index 7361a91dbb4..aa3f5428681 100644 --- a/src/vs/workbench/contrib/debug/browser/breakpointsView.ts +++ b/src/vs/workbench/contrib/debug/browser/breakpointsView.ts @@ -7,9 +7,9 @@ import * as nls from 'vs/nls'; import * as resources from 'vs/base/common/resources'; import * as dom from 'vs/base/browser/dom'; import { IAction, Action } from 'vs/base/common/actions'; -import { IDebugService, IBreakpoint, CONTEXT_BREAKPOINTS_FOCUSED, EDITOR_CONTRIBUTION_ID, State, DEBUG_SCHEME, IFunctionBreakpoint, IExceptionBreakpoint, IEnablement, IDebugEditorContribution } from 'vs/workbench/parts/debug/common/debug'; -import { ExceptionBreakpoint, FunctionBreakpoint, Breakpoint } from 'vs/workbench/parts/debug/common/debugModel'; -import { AddFunctionBreakpointAction, ToggleBreakpointsActivatedAction, RemoveAllBreakpointsAction, RemoveBreakpointAction, EnableAllBreakpointsAction, DisableAllBreakpointsAction, ReapplyBreakpointsAction } from 'vs/workbench/parts/debug/browser/debugActions'; +import { IDebugService, IBreakpoint, CONTEXT_BREAKPOINTS_FOCUSED, EDITOR_CONTRIBUTION_ID, State, DEBUG_SCHEME, IFunctionBreakpoint, IExceptionBreakpoint, IEnablement, IDebugEditorContribution } from 'vs/workbench/contrib/debug/common/debug'; +import { ExceptionBreakpoint, FunctionBreakpoint, Breakpoint } from 'vs/workbench/contrib/debug/common/debugModel'; +import { AddFunctionBreakpointAction, ToggleBreakpointsActivatedAction, RemoveAllBreakpointsAction, RemoveBreakpointAction, EnableAllBreakpointsAction, DisableAllBreakpointsAction, ReapplyBreakpointsAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { IContextMenuService, IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; diff --git a/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts b/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts index b373c452689..31b85e0087e 100644 --- a/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts +++ b/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; +import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; /** * @param text The content to stylize. diff --git a/src/vs/workbench/contrib/debug/browser/debugActionItems.ts b/src/vs/workbench/contrib/debug/browser/debugActionItems.ts index 5982a254e28..07298620ba1 100644 --- a/src/vs/workbench/contrib/debug/browser/debugActionItems.ts +++ b/src/vs/workbench/contrib/debug/browser/debugActionItems.ts @@ -12,7 +12,7 @@ import { SelectBox, ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selec import { SelectActionItem, IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IDebugService, IDebugSession } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachSelectBoxStyler, attachStylerCallback } from 'vs/platform/theme/common/styler'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; diff --git a/src/vs/workbench/contrib/debug/browser/debugActions.ts b/src/vs/workbench/contrib/debug/browser/debugActions.ts index c00d6590dc7..bf9c754e095 100644 --- a/src/vs/workbench/contrib/debug/browser/debugActions.ts +++ b/src/vs/workbench/contrib/debug/browser/debugActions.ts @@ -11,8 +11,8 @@ import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IFileService } from 'vs/platform/files/common/files'; import { IDebugService, State, IDebugSession, IThread, IEnablement, IBreakpoint, IStackFrame, REPL_ID } - from 'vs/workbench/parts/debug/common/debug'; -import { Variable, Expression, Thread, Breakpoint } from 'vs/workbench/parts/debug/common/debugModel'; + from 'vs/workbench/contrib/debug/common/debug'; +import { Variable, Expression, Thread, Breakpoint } from 'vs/workbench/contrib/debug/common/debugModel'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/contrib/debug/browser/debugCommands.ts b/src/vs/workbench/contrib/debug/browser/debugCommands.ts index f983c1cc2d0..726e1970104 100644 --- a/src/vs/workbench/contrib/debug/browser/debugCommands.ts +++ b/src/vs/workbench/contrib/debug/browser/debugCommands.ts @@ -9,16 +9,16 @@ import { List } from 'vs/base/browser/ui/list/listWidget'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IListService } from 'vs/platform/list/browser/listService'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; -import { IDebugService, IEnablement, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_VARIABLES_FOCUSED, EDITOR_CONTRIBUTION_ID, IDebugEditorContribution, CONTEXT_IN_DEBUG_MODE, CONTEXT_EXPRESSION_SELECTED, CONTEXT_BREAKPOINT_SELECTED, IConfig } from 'vs/workbench/parts/debug/common/debug'; -import { Expression, Variable, Breakpoint, FunctionBreakpoint } from 'vs/workbench/parts/debug/common/debugModel'; -import { IExtensionsViewlet, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/parts/extensions/common/extensions'; +import { IDebugService, IEnablement, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_WATCH_EXPRESSIONS_FOCUSED, CONTEXT_VARIABLES_FOCUSED, EDITOR_CONTRIBUTION_ID, IDebugEditorContribution, CONTEXT_IN_DEBUG_MODE, CONTEXT_EXPRESSION_SELECTED, CONTEXT_BREAKPOINT_SELECTED, IConfig } from 'vs/workbench/contrib/debug/common/debug'; +import { Expression, Variable, Breakpoint, FunctionBreakpoint } from 'vs/workbench/contrib/debug/common/debugModel'; +import { IExtensionsViewlet, VIEWLET_ID as EXTENSIONS_VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { openBreakpointSource } from 'vs/workbench/parts/debug/browser/breakpointsView'; +import { openBreakpointSource } from 'vs/workbench/contrib/debug/browser/breakpointsView'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { InputFocusedContext } from 'vs/platform/workbench/common/contextkeys'; import { ServicesAccessor } from 'vs/editor/browser/editorExtensions'; diff --git a/src/vs/workbench/contrib/debug/browser/debugContentProvider.ts b/src/vs/workbench/contrib/debug/browser/debugContentProvider.ts index 8e21de41975..5909b232d63 100644 --- a/src/vs/workbench/contrib/debug/browser/debugContentProvider.ts +++ b/src/vs/workbench/contrib/debug/browser/debugContentProvider.ts @@ -11,8 +11,8 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { DEBUG_SCHEME, IDebugService, IDebugSession } from 'vs/workbench/parts/debug/common/debug'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +import { DEBUG_SCHEME, IDebugService, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService'; import { EditOperation } from 'vs/editor/common/core/editOperation'; import { Range } from 'vs/editor/common/core/range'; diff --git a/src/vs/workbench/contrib/debug/browser/debugEditorActions.ts b/src/vs/workbench/contrib/debug/browser/debugEditorActions.ts index 0ee09ead1c7..25a792b2ebf 100644 --- a/src/vs/workbench/contrib/debug/browser/debugEditorActions.ts +++ b/src/vs/workbench/contrib/debug/browser/debugEditorActions.ts @@ -9,12 +9,12 @@ import { Range } from 'vs/editor/common/core/range'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ServicesAccessor, registerEditorAction, EditorAction, IActionOptions } from 'vs/editor/browser/editorExtensions'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE, State, REPL_ID, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, BreakpointWidgetContext, IBreakpoint } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, CONTEXT_IN_DEBUG_MODE, CONTEXT_DEBUG_STATE, State, REPL_ID, VIEWLET_ID, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, BreakpointWidgetContext, IBreakpoint } from 'vs/workbench/contrib/debug/common/debug'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { openBreakpointSource } from 'vs/workbench/parts/debug/browser/breakpointsView'; +import { openBreakpointSource } from 'vs/workbench/contrib/debug/browser/breakpointsView'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { PanelFocusContext } from 'vs/workbench/browser/parts/panel/panelPart'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; diff --git a/src/vs/workbench/contrib/debug/browser/debugEditorModelManager.ts b/src/vs/workbench/contrib/debug/browser/debugEditorModelManager.ts index ca2475294da..9e0908183b9 100644 --- a/src/vs/workbench/contrib/debug/browser/debugEditorModelManager.ts +++ b/src/vs/workbench/contrib/debug/browser/debugEditorModelManager.ts @@ -8,10 +8,10 @@ import { Constants } from 'vs/editor/common/core/uint'; import { Range } from 'vs/editor/common/core/range'; import { ITextModel, TrackedRangeStickiness, IModelDeltaDecoration, IModelDecorationOptions } from 'vs/editor/common/model'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IDebugService, IBreakpoint, State, IBreakpointUpdateData } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, IBreakpoint, State, IBreakpointUpdateData } from 'vs/workbench/contrib/debug/common/debug'; import { IModelService } from 'vs/editor/common/services/modelService'; import { MarkdownString } from 'vs/base/common/htmlContent'; -import { getBreakpointMessageAndClassName } from 'vs/workbench/parts/debug/browser/breakpointsView'; +import { getBreakpointMessageAndClassName } from 'vs/workbench/contrib/debug/browser/breakpointsView'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { registerColor } from 'vs/platform/theme/common/colorRegistry'; import { localize } from 'vs/nls'; diff --git a/src/vs/workbench/contrib/debug/browser/debugQuickOpen.ts b/src/vs/workbench/contrib/debug/browser/debugQuickOpen.ts index 3fe73ff856a..d06528d460b 100644 --- a/src/vs/workbench/contrib/debug/browser/debugQuickOpen.ts +++ b/src/vs/workbench/contrib/debug/browser/debugQuickOpen.ts @@ -8,10 +8,10 @@ import * as Filters from 'vs/base/common/filters'; import * as Quickopen from 'vs/workbench/browser/quickopen'; import * as QuickOpen from 'vs/base/parts/quickopen/common/quickOpen'; import * as Model from 'vs/base/parts/quickopen/browser/quickOpenModel'; -import { IDebugService, ILaunch } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, ILaunch } from 'vs/workbench/contrib/debug/common/debug'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { StartAction } from 'vs/workbench/parts/debug/browser/debugActions'; +import { StartAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/contrib/debug/browser/debugStatus.ts b/src/vs/workbench/contrib/debug/browser/debugStatus.ts index 0a069f34415..eb810bf137a 100644 --- a/src/vs/workbench/contrib/debug/browser/debugStatus.ts +++ b/src/vs/workbench/contrib/debug/browser/debugStatus.ts @@ -9,10 +9,10 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; -import { IDebugService, State, IDebugConfiguration } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, State, IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug'; import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { STATUS_BAR_DEBUGGING_FOREGROUND, isStatusbarInDebugMode } from 'vs/workbench/parts/debug/browser/statusbarColorProvider'; +import { STATUS_BAR_DEBUGGING_FOREGROUND, isStatusbarInDebugMode } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider'; const $ = dom.$; diff --git a/src/vs/workbench/contrib/debug/browser/debugToolbar.ts b/src/vs/workbench/contrib/debug/browser/debugToolbar.ts index 98ae68a8914..3ec36f960ca 100644 --- a/src/vs/workbench/contrib/debug/browser/debugToolbar.ts +++ b/src/vs/workbench/contrib/debug/browser/debugToolbar.ts @@ -13,9 +13,9 @@ import { IAction, IRunEvent } from 'vs/base/common/actions'; import { ActionBar, ActionsOrientation } from 'vs/base/browser/ui/actionbar/actionbar'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IDebugConfiguration, IDebugService, State } from 'vs/workbench/parts/debug/common/debug'; -import { AbstractDebugAction, PauseAction, ContinueAction, StepBackAction, ReverseContinueAction, StopAction, DisconnectAction, StepOverAction, StepIntoAction, StepOutAction, RestartAction, FocusSessionAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { FocusSessionActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems'; +import { IDebugConfiguration, IDebugService, State } from 'vs/workbench/contrib/debug/common/debug'; +import { AbstractDebugAction, PauseAction, ContinueAction, StepBackAction, ReverseContinueAction, StopAction, DisconnectAction, StepOverAction, StepIntoAction, StepOutAction, RestartAction, FocusSessionAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +import { FocusSessionActionItem } from 'vs/workbench/contrib/debug/browser/debugActionItems'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -29,7 +29,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati import { RunOnceScheduler } from 'vs/base/common/async'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { isExtensionHostDebugging } from 'vs/workbench/parts/debug/common/debugUtils'; +import { isExtensionHostDebugging } from 'vs/workbench/contrib/debug/common/debugUtils'; const DEBUG_TOOLBAR_POSITION_KEY = 'debug.actionswidgetposition'; const DEBUG_TOOLBAR_Y_KEY = 'debug.actionswidgety'; diff --git a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts index 43d5daa5de7..8660286c4fb 100644 --- a/src/vs/workbench/contrib/debug/browser/debugViewlet.ts +++ b/src/vs/workbench/contrib/debug/browser/debugViewlet.ts @@ -9,9 +9,9 @@ import { IAction } from 'vs/base/common/actions'; import * as DOM from 'vs/base/browser/dom'; import { IActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { ViewContainerViewlet } from 'vs/workbench/browser/parts/views/viewsViewlet'; -import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration } from 'vs/workbench/parts/debug/common/debug'; -import { StartAction, ToggleReplAction, ConfigureAction, AbstractDebugAction, SelectAndStartAction, FocusSessionAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { StartDebugActionItem, FocusSessionActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems'; +import { IDebugService, VIEWLET_ID, State, BREAKPOINTS_VIEW_ID, IDebugConfiguration } from 'vs/workbench/contrib/debug/common/debug'; +import { StartAction, ToggleReplAction, ConfigureAction, AbstractDebugAction, SelectAndStartAction, FocusSessionAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +import { StartDebugActionItem, FocusSessionActionItem } from 'vs/workbench/contrib/debug/browser/debugActionItems'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IProgressService, IProgressRunner } from 'vs/platform/progress/common/progress'; @@ -24,7 +24,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { memoize } from 'vs/base/common/decorators'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { DebugToolbar } from 'vs/workbench/parts/debug/browser/debugToolbar'; +import { DebugToolbar } from 'vs/workbench/contrib/debug/browser/debugToolbar'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; diff --git a/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts b/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts index 3f2dfd1beac..1b971255d7e 100644 --- a/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts +++ b/src/vs/workbench/contrib/debug/browser/exceptionWidget.ts @@ -8,13 +8,13 @@ import * as nls from 'vs/nls'; import * as dom from 'vs/base/browser/dom'; import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IExceptionInfo } from 'vs/workbench/parts/debug/common/debug'; +import { IExceptionInfo } from 'vs/workbench/contrib/debug/common/debug'; import { RunOnceScheduler } from 'vs/base/common/async'; import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; import { registerColor } from 'vs/platform/theme/common/colorRegistry'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; +import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; const $ = dom.$; // theming diff --git a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts index 9379dbf7926..8a85289d1d4 100644 --- a/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts +++ b/src/vs/workbench/contrib/debug/browser/loadedScriptsView.ts @@ -12,9 +12,9 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { renderViewTree } from 'vs/workbench/parts/debug/browser/baseDebugView'; -import { IDebugSession, IDebugService, IDebugModel, CONTEXT_LOADED_SCRIPTS_ITEM_TYPE } from 'vs/workbench/parts/debug/common/debug'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +import { renderViewTree } from 'vs/workbench/contrib/debug/browser/baseDebugView'; +import { IDebugSession, IDebugService, IDebugModel, CONTEXT_LOADED_SCRIPTS_ITEM_TYPE } from 'vs/workbench/contrib/debug/common/debug'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; @@ -31,7 +31,7 @@ import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { WorkbenchAsyncDataTree, IListService, TreeResourceNavigator2 } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { DebugContentProvider } from 'vs/workbench/parts/debug/browser/debugContentProvider'; +import { DebugContentProvider } from 'vs/workbench/contrib/debug/browser/debugContentProvider'; import { dispose } from 'vs/base/common/lifecycle'; import { createMatches, FuzzyScore } from 'vs/base/common/filters'; diff --git a/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.ts b/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.ts index 43591298a91..7ee9bf99083 100644 --- a/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.ts +++ b/src/vs/workbench/contrib/debug/browser/statusbarColorProvider.ts @@ -8,7 +8,7 @@ import { localize } from 'vs/nls'; import { registerColor, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; -import { IDebugService, State } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, State } from 'vs/workbench/contrib/debug/common/debug'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_BACKGROUND, Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_BORDER } from 'vs/workbench/common/theme'; import { addClass, removeClass, createStyleSheet } from 'vs/base/browser/dom'; diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index 903ce32c4e4..0e629cd2d1b 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -14,7 +14,7 @@ import { ITextModel as EditorIModel } from 'vs/editor/common/model'; import { IEditor } from 'vs/workbench/common/editor'; import { Position } from 'vs/editor/common/core/position'; import { CompletionItem } from 'vs/editor/common/modes'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { Range, IRange } from 'vs/editor/common/core/range'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; @@ -22,9 +22,9 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { IDisposable } from 'vs/base/common/lifecycle'; import { IViewContainersRegistry, ViewContainer, Extensions as ViewContainerExtensions } from 'vs/workbench/common/views'; import { Registry } from 'vs/platform/registry/common/platform'; -import { TaskIdentifier } from 'vs/workbench/parts/tasks/common/tasks'; +import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks'; import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; +import { IOutputService } from 'vs/workbench/contrib/output/common/output'; export const VIEWLET_ID = 'workbench.view.debug'; export const VIEW_CONTAINER: ViewContainer = Registry.as(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID); diff --git a/src/vs/workbench/contrib/debug/common/debugModel.ts b/src/vs/workbench/contrib/debug/common/debugModel.ts index 428f37ebc6a..35172eda586 100644 --- a/src/vs/workbench/contrib/debug/common/debugModel.ts +++ b/src/vs/workbench/contrib/debug/common/debugModel.ts @@ -17,8 +17,8 @@ import { Range, IRange } from 'vs/editor/common/core/range'; import { ITreeElement, IExpression, IExpressionContainer, IDebugSession, IStackFrame, IExceptionBreakpoint, IBreakpoint, IFunctionBreakpoint, IDebugModel, IReplElementSource, IThread, IRawModelUpdate, IScope, IRawStoppedDetails, IEnablement, IBreakpointData, IExceptionInfo, IReplElement, IBreakpointsChangeEvent, IBreakpointUpdateData, IBaseBreakpoint, State -} from 'vs/workbench/parts/debug/common/debug'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +} from 'vs/workbench/contrib/debug/common/debug'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { commonSuffixLength } from 'vs/base/common/strings'; import { sep } from 'vs/base/common/paths'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/contrib/debug/common/debugSchemas.ts b/src/vs/workbench/contrib/debug/common/debugSchemas.ts index 67b573e33d4..6788b899874 100644 --- a/src/vs/workbench/contrib/debug/common/debugSchemas.ts +++ b/src/vs/workbench/contrib/debug/common/debugSchemas.ts @@ -5,7 +5,7 @@ import * as extensionsRegistry from 'vs/workbench/services/extensions/common/extensionsRegistry'; import * as nls from 'vs/nls'; -import { IDebuggerContribution, ICompound } from 'vs/workbench/parts/debug/common/debug'; +import { IDebuggerContribution, ICompound } from 'vs/workbench/contrib/debug/common/debug'; import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; import { inputsSchema } from 'vs/workbench/services/configurationResolver/common/configurationResolverSchema'; diff --git a/src/vs/workbench/contrib/debug/common/debugSource.ts b/src/vs/workbench/contrib/debug/common/debugSource.ts index bb4d1a11ea1..0cfc1e8b6b3 100644 --- a/src/vs/workbench/contrib/debug/common/debugSource.ts +++ b/src/vs/workbench/contrib/debug/common/debugSource.ts @@ -7,11 +7,11 @@ import * as nls from 'vs/nls'; import { URI as uri } from 'vs/base/common/uri'; import * as paths from 'vs/base/common/paths'; import * as resources from 'vs/base/common/resources'; -import { DEBUG_SCHEME } from 'vs/workbench/parts/debug/common/debug'; +import { DEBUG_SCHEME } from 'vs/workbench/contrib/debug/common/debug'; import { IRange } from 'vs/editor/common/core/range'; import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { Schemas } from 'vs/base/common/network'; -import { isUri } from 'vs/workbench/parts/debug/common/debugUtils'; +import { isUri } from 'vs/workbench/contrib/debug/common/debugUtils'; const UNKNOWN_SOURCE_LABEL = nls.localize('unknownSource', "Unknown Source"); diff --git a/src/vs/workbench/contrib/debug/common/debugUtils.ts b/src/vs/workbench/contrib/debug/common/debugUtils.ts index 6203b590794..b1b54612c29 100644 --- a/src/vs/workbench/contrib/debug/common/debugUtils.ts +++ b/src/vs/workbench/contrib/debug/common/debugUtils.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { equalsIgnoreCase } from 'vs/base/common/strings'; -import { IConfig } from 'vs/workbench/parts/debug/common/debug'; +import { IConfig } from 'vs/workbench/contrib/debug/common/debug'; import { URI as uri } from 'vs/base/common/uri'; import { isAbsolute_posix, isAbsolute_win32 } from 'vs/base/common/paths'; import { deepClone } from 'vs/base/common/objects'; diff --git a/src/vs/workbench/contrib/debug/common/debugViewModel.ts b/src/vs/workbench/contrib/debug/common/debugViewModel.ts index 4969af831f4..d65b9d9ae09 100644 --- a/src/vs/workbench/contrib/debug/common/debugViewModel.ts +++ b/src/vs/workbench/contrib/debug/common/debugViewModel.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Event, Emitter } from 'vs/base/common/event'; -import { CONTEXT_EXPRESSION_SELECTED, IViewModel, IStackFrame, IDebugSession, IThread, IExpression, IFunctionBreakpoint, CONTEXT_BREAKPOINT_SELECTED, CONTEXT_LOADED_SCRIPTS_SUPPORTED } from 'vs/workbench/parts/debug/common/debug'; +import { CONTEXT_EXPRESSION_SELECTED, IViewModel, IStackFrame, IDebugSession, IThread, IExpression, IFunctionBreakpoint, CONTEXT_BREAKPOINT_SELECTED, CONTEXT_LOADED_SCRIPTS_SUPPORTED } from 'vs/workbench/contrib/debug/common/debug'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; export class ViewModel implements IViewModel { diff --git a/src/vs/workbench/contrib/debug/common/replModel.ts b/src/vs/workbench/contrib/debug/common/replModel.ts index 65c3fe2d7e4..d78e15f9884 100644 --- a/src/vs/workbench/contrib/debug/common/replModel.ts +++ b/src/vs/workbench/contrib/debug/common/replModel.ts @@ -5,8 +5,8 @@ import * as nls from 'vs/nls'; import severity from 'vs/base/common/severity'; -import { IReplElement, IStackFrame, IExpression, IReplElementSource, IDebugSession } from 'vs/workbench/parts/debug/common/debug'; -import { Expression, SimpleReplElement, RawObjectReplElement } from 'vs/workbench/parts/debug/common/debugModel'; +import { IReplElement, IStackFrame, IExpression, IReplElementSource, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; +import { Expression, SimpleReplElement, RawObjectReplElement } from 'vs/workbench/contrib/debug/common/debugModel'; import { isUndefinedOrNull, isObject } from 'vs/base/common/types'; import { basenameOrAuthority } from 'vs/base/common/resources'; import { URI } from 'vs/base/common/uri'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts b/src/vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts index 173de047a1a..f2aa24229b2 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/breakpointWidget.ts @@ -13,7 +13,7 @@ import { Position, IPosition } from 'vs/editor/common/core/position'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { IDebugService, IBreakpoint, BreakpointWidgetContext as Context, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, DEBUG_SCHEME, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_IN_BREAKPOINT_WIDGET } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, IBreakpoint, BreakpointWidgetContext as Context, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, DEBUG_SCHEME, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_IN_BREAKPOINT_WIDGET } from 'vs/workbench/contrib/debug/common/debug'; import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -32,8 +32,8 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { IDecorationOptions } from 'vs/editor/common/editorCommon'; import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { getSimpleCodeEditorWidgetOptions } from 'vs/workbench/parts/codeEditor/electron-browser/simpleEditorOptions'; -import { getSimpleEditorOptions } from 'vs/workbench/parts/codeEditor/browser/simpleEditorOptions'; +import { getSimpleCodeEditorWidgetOptions } from 'vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions'; +import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions'; import { IRange, Range } from 'vs/editor/common/core/range'; const $ = dom.$; diff --git a/src/vs/workbench/contrib/debug/electron-browser/callStackView.ts b/src/vs/workbench/contrib/debug/electron-browser/callStackView.ts index 4be39474958..0d300602afa 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/callStackView.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/callStackView.ts @@ -7,23 +7,23 @@ import * as nls from 'vs/nls'; import { RunOnceScheduler, ignoreErrors } from 'vs/base/common/async'; import * as dom from 'vs/base/browser/dom'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; -import { IDebugService, State, IStackFrame, IDebugSession, IThread, CONTEXT_CALLSTACK_ITEM_TYPE, IDebugModel } from 'vs/workbench/parts/debug/common/debug'; -import { Thread, StackFrame, ThreadAndSessionIds } from 'vs/workbench/parts/debug/common/debugModel'; +import { IDebugService, State, IStackFrame, IDebugSession, IThread, CONTEXT_CALLSTACK_ITEM_TYPE, IDebugModel } from 'vs/workbench/contrib/debug/common/debug'; +import { Thread, StackFrame, ThreadAndSessionIds } from 'vs/workbench/contrib/debug/common/debugModel'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { MenuId, IMenu, IMenuService } from 'vs/platform/actions/common/actions'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { renderViewTree } from 'vs/workbench/parts/debug/browser/baseDebugView'; +import { renderViewTree } from 'vs/workbench/contrib/debug/browser/baseDebugView'; import { IAction } from 'vs/base/common/actions'; -import { RestartAction, StopAction, ContinueAction, StepOverAction, StepIntoAction, StepOutAction, PauseAction, RestartFrameAction, TerminateThreadAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { CopyStackTraceAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; +import { RestartAction, StopAction, ContinueAction, StepOverAction, StepIntoAction, StepOutAction, PauseAction, RestartFrameAction, TerminateThreadAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +import { CopyStackTraceAction } from 'vs/workbench/contrib/debug/electron-browser/electronDebugActions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IViewletPanelOptions, ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; import { ILabelService } from 'vs/platform/label/common/label'; -import { DebugSession } from 'vs/workbench/parts/debug/electron-browser/debugSession'; +import { DebugSession } from 'vs/workbench/contrib/debug/electron-browser/debugSession'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemActionItem'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts index 2d640f1a84c..1e902f6796e 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debug.contribution.ts @@ -17,43 +17,43 @@ import { ShowViewletAction, Extensions as ViewletExtensions, ViewletRegistry, Vi import { TogglePanelAction, Extensions as PanelExtensions, PanelRegistry, PanelDescriptor } from 'vs/workbench/browser/panel'; import { StatusbarItemDescriptor, IStatusbarRegistry, Extensions as StatusExtensions } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; -import { VariablesView } from 'vs/workbench/parts/debug/electron-browser/variablesView'; -import { BreakpointsView } from 'vs/workbench/parts/debug/browser/breakpointsView'; -import { WatchExpressionsView } from 'vs/workbench/parts/debug/electron-browser/watchExpressionsView'; -import { CallStackView } from 'vs/workbench/parts/debug/electron-browser/callStackView'; +import { VariablesView } from 'vs/workbench/contrib/debug/electron-browser/variablesView'; +import { BreakpointsView } from 'vs/workbench/contrib/debug/browser/breakpointsView'; +import { WatchExpressionsView } from 'vs/workbench/contrib/debug/electron-browser/watchExpressionsView'; +import { CallStackView } from 'vs/workbench/contrib/debug/electron-browser/callStackView'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { IDebugService, VIEWLET_ID, REPL_ID, CONTEXT_IN_DEBUG_MODE, INTERNAL_CONSOLE_OPTIONS_SCHEMA, CONTEXT_DEBUG_STATE, VARIABLES_VIEW_ID, CALLSTACK_VIEW_ID, WATCH_VIEW_ID, BREAKPOINTS_VIEW_ID, VIEW_CONTAINER, LOADED_SCRIPTS_VIEW_ID, CONTEXT_LOADED_SCRIPTS_SUPPORTED, CONTEXT_IN_DEBUG_REPL -} from 'vs/workbench/parts/debug/common/debug'; +} from 'vs/workbench/contrib/debug/common/debug'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; -import { DebugEditorModelManager } from 'vs/workbench/parts/debug/browser/debugEditorModelManager'; +import { DebugEditorModelManager } from 'vs/workbench/contrib/debug/browser/debugEditorModelManager'; import { StepOverAction, FocusReplAction, StepIntoAction, StepOutAction, StartAction, RestartAction, ContinueAction, StopAction, DisconnectAction, PauseAction, AddFunctionBreakpointAction, ConfigureAction, DisableAllBreakpointsAction, EnableAllBreakpointsAction, RemoveAllBreakpointsAction, RunAction, ReapplyBreakpointsAction, SelectAndStartAction, TerminateThreadAction -} from 'vs/workbench/parts/debug/browser/debugActions'; -import { DebugToolbar } from 'vs/workbench/parts/debug/browser/debugToolbar'; -import * as service from 'vs/workbench/parts/debug/electron-browser/debugService'; -import { DebugContentProvider } from 'vs/workbench/parts/debug/browser/debugContentProvider'; -import 'vs/workbench/parts/debug/electron-browser/debugEditorContribution'; +} from 'vs/workbench/contrib/debug/browser/debugActions'; +import { DebugToolbar } from 'vs/workbench/contrib/debug/browser/debugToolbar'; +import * as service from 'vs/workbench/contrib/debug/electron-browser/debugService'; +import { DebugContentProvider } from 'vs/workbench/contrib/debug/browser/debugContentProvider'; +import 'vs/workbench/contrib/debug/electron-browser/debugEditorContribution'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { registerCommands, ADD_CONFIGURATION_ID, TOGGLE_INLINE_BREAKPOINT_ID } from 'vs/workbench/parts/debug/browser/debugCommands'; +import { registerCommands, ADD_CONFIGURATION_ID, TOGGLE_INLINE_BREAKPOINT_ID } from 'vs/workbench/contrib/debug/browser/debugCommands'; import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; -import { StatusBarColorProvider } from 'vs/workbench/parts/debug/browser/statusbarColorProvider'; +import { StatusBarColorProvider } from 'vs/workbench/contrib/debug/browser/statusbarColorProvider'; import { ViewsRegistry } from 'vs/workbench/common/views'; import { isMacintosh } from 'vs/base/common/platform'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { URI } from 'vs/base/common/uri'; -import { DebugViewlet } from 'vs/workbench/parts/debug/browser/debugViewlet'; -import { Repl, ClearReplAction } from 'vs/workbench/parts/debug/electron-browser/repl'; -import { DebugQuickOpenHandler } from 'vs/workbench/parts/debug/browser/debugQuickOpen'; -import { DebugStatus } from 'vs/workbench/parts/debug/browser/debugStatus'; +import { DebugViewlet } from 'vs/workbench/contrib/debug/browser/debugViewlet'; +import { Repl, ClearReplAction } from 'vs/workbench/contrib/debug/electron-browser/repl'; +import { DebugQuickOpenHandler } from 'vs/workbench/contrib/debug/browser/debugQuickOpen'; +import { DebugStatus } from 'vs/workbench/contrib/debug/browser/debugStatus'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; -import { LoadedScriptsView } from 'vs/workbench/parts/debug/browser/loadedScriptsView'; -import { TOGGLE_LOG_POINT_ID, TOGGLE_CONDITIONAL_BREAKPOINT_ID, TOGGLE_BREAKPOINT_ID } from 'vs/workbench/parts/debug/browser/debugEditorActions'; +import { LoadedScriptsView } from 'vs/workbench/contrib/debug/browser/loadedScriptsView'; +import { TOGGLE_LOG_POINT_ID, TOGGLE_CONDITIONAL_BREAKPOINT_ID, TOGGLE_BREAKPOINT_ID } from 'vs/workbench/contrib/debug/browser/debugEditorActions'; class OpenDebugViewletAction extends ShowViewletAction { public static readonly ID = VIEWLET_ID; @@ -442,7 +442,7 @@ if (isMacintosh) { const registerTouchBarEntry = (id: string, title: string, order, when: ContextKeyExpr, icon: string) => { MenuRegistry.appendMenuItem(MenuId.TouchBarContext, { command: { - id, title, iconLocation: { dark: URI.parse(require.toUrl(`vs/workbench/parts/debug/electron-browser/media/${icon}`)) } + id, title, iconLocation: { dark: URI.parse(require.toUrl(`vs/workbench/contrib/debug/electron-browser/media/${icon}`)) } }, when, group: '9_debug', diff --git a/src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts b/src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts index 87c69d51e3f..90d5cbeeeb9 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debugConfigurationManager.ts @@ -21,16 +21,16 @@ import { IFileService } from 'vs/platform/files/common/files'; import { IWorkspaceContextService, IWorkspaceFolder, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, ITerminalSettings, ITerminalLauncher, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory, IDebugAdapterTrackerFactory, IDebugService } from 'vs/workbench/parts/debug/common/debug'; -import { Debugger } from 'vs/workbench/parts/debug/node/debugger'; +import { IDebugConfigurationProvider, ICompound, IDebugConfiguration, IConfig, IGlobalConfig, IConfigurationManager, ILaunch, IDebugAdapterDescriptorFactory, IDebugAdapter, ITerminalSettings, ITerminalLauncher, IDebugSession, IAdapterDescriptor, CONTEXT_DEBUG_CONFIGURATION_TYPE, IDebugAdapterFactory, IDebugAdapterTrackerFactory, IDebugService } from 'vs/workbench/contrib/debug/common/debug'; +import { Debugger } from 'vs/workbench/contrib/debug/node/debugger'; import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { isCodeEditor } from 'vs/editor/browser/editorBrowser'; import { launchSchemaId } from 'vs/workbench/services/configuration/common/configuration'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; -import { TerminalLauncher } from 'vs/workbench/parts/debug/electron-browser/terminalSupport'; +import { TerminalLauncher } from 'vs/workbench/contrib/debug/electron-browser/terminalSupport'; import { Registry } from 'vs/platform/registry/common/platform'; import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { launchSchema, debuggersExtPoint, breakpointsExtPoint } from 'vs/workbench/parts/debug/common/debugSchemas'; +import { launchSchema, debuggersExtPoint, breakpointsExtPoint } from 'vs/workbench/contrib/debug/common/debugSchemas'; import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { onUnexpectedError } from 'vs/base/common/errors'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts index f6350174f3a..caeb140c6ae 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debugEditorContribution.ts @@ -28,11 +28,11 @@ import { IConfigurationService, IConfigurationOverrides } from 'vs/platform/conf import { ICommandService } from 'vs/platform/commands/common/commands'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; -import { DebugHoverWidget } from 'vs/workbench/parts/debug/electron-browser/debugHover'; -import { RemoveBreakpointAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { IDebugEditorContribution, IDebugService, State, IBreakpoint, EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, IStackFrame, IDebugConfiguration, IExpression, IExceptionInfo, BreakpointWidgetContext } from 'vs/workbench/parts/debug/common/debug'; -import { BreakpointWidget } from 'vs/workbench/parts/debug/electron-browser/breakpointWidget'; -import { ExceptionWidget } from 'vs/workbench/parts/debug/browser/exceptionWidget'; +import { DebugHoverWidget } from 'vs/workbench/contrib/debug/electron-browser/debugHover'; +import { RemoveBreakpointAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +import { IDebugEditorContribution, IDebugService, State, IBreakpoint, EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, IStackFrame, IDebugConfiguration, IExpression, IExceptionInfo, BreakpointWidgetContext } from 'vs/workbench/contrib/debug/common/debug'; +import { BreakpointWidget } from 'vs/workbench/contrib/debug/electron-browser/breakpointWidget'; +import { ExceptionWidget } from 'vs/workbench/contrib/debug/browser/exceptionWidget'; import { FloatingClickWidget } from 'vs/workbench/browser/parts/editor/editorWidgets'; import { Position } from 'vs/editor/common/core/position'; import { CoreEditingCommands } from 'vs/editor/browser/controller/coreCommands'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/debugHover.ts b/src/vs/workbench/contrib/debug/electron-browser/debugHover.ts index 788457f386f..5f607046ec1 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debugHover.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debugHover.ts @@ -14,16 +14,16 @@ import { Position } from 'vs/editor/common/core/position'; import { Range } from 'vs/editor/common/core/range'; import { IContentWidget, ICodeEditor, IContentWidgetPosition, ContentWidgetPositionPreference } from 'vs/editor/browser/editorBrowser'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/parts/debug/common/debug'; -import { Expression } from 'vs/workbench/parts/debug/common/debugModel'; -import { renderExpressionValue } from 'vs/workbench/parts/debug/browser/baseDebugView'; -import { VariablesRenderer } from 'vs/workbench/parts/debug/electron-browser/variablesView'; +import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/contrib/debug/common/debug'; +import { Expression } from 'vs/workbench/contrib/debug/common/debugModel'; +import { renderExpressionValue } from 'vs/workbench/contrib/debug/browser/baseDebugView'; +import { VariablesRenderer } from 'vs/workbench/contrib/debug/electron-browser/variablesView'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry'; import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; -import { getExactExpressionStartAndEnd } from 'vs/workbench/parts/debug/common/debugUtils'; +import { getExactExpressionStartAndEnd } from 'vs/workbench/contrib/debug/common/debugUtils'; import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/debugService.ts b/src/vs/workbench/contrib/debug/electron-browser/debugService.ts index 1ec06113de4..5aac6bdf13c 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debugService.ts @@ -18,14 +18,14 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { FileChangesEvent, FileChangeType, IFileService } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { DebugModel, ExceptionBreakpoint, FunctionBreakpoint, Breakpoint, Expression } from 'vs/workbench/parts/debug/common/debugModel'; -import { ViewModel } from 'vs/workbench/parts/debug/common/debugViewModel'; -import * as debugactions from 'vs/workbench/parts/debug/browser/debugActions'; -import { ConfigurationManager } from 'vs/workbench/parts/debug/electron-browser/debugConfigurationManager'; -import Constants from 'vs/workbench/parts/markers/electron-browser/constants'; -import { ITaskService, ITaskSummary } from 'vs/workbench/parts/tasks/common/taskService'; -import { TaskError } from 'vs/workbench/parts/tasks/common/taskSystem'; -import { VIEWLET_ID as EXPLORER_VIEWLET_ID } from 'vs/workbench/parts/files/common/files'; +import { DebugModel, ExceptionBreakpoint, FunctionBreakpoint, Breakpoint, Expression } from 'vs/workbench/contrib/debug/common/debugModel'; +import { ViewModel } from 'vs/workbench/contrib/debug/common/debugViewModel'; +import * as debugactions from 'vs/workbench/contrib/debug/browser/debugActions'; +import { ConfigurationManager } from 'vs/workbench/contrib/debug/electron-browser/debugConfigurationManager'; +import Constants from 'vs/workbench/contrib/markers/electron-browser/constants'; +import { ITaskService, ITaskSummary } from 'vs/workbench/contrib/tasks/common/taskService'; +import { TaskError } from 'vs/workbench/contrib/tasks/common/taskSystem'; +import { VIEWLET_ID as EXPLORER_VIEWLET_ID } from 'vs/workbench/contrib/files/common/files'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; @@ -36,15 +36,15 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { EXTENSION_LOG_BROADCAST_CHANNEL, EXTENSION_ATTACH_BROADCAST_CHANNEL, EXTENSION_TERMINATE_BROADCAST_CHANNEL, EXTENSION_RELOAD_BROADCAST_CHANNEL, EXTENSION_CLOSE_EXTHOST_BROADCAST_CHANNEL } from 'vs/platform/extensions/common/extensionHost'; import { IBroadcastService } from 'vs/platform/broadcast/electron-browser/broadcastService'; import { IRemoteConsoleLog, parse, getFirstFrame } from 'vs/base/node/console'; -import { TaskEvent, TaskEventKind, TaskIdentifier } from 'vs/workbench/parts/tasks/common/tasks'; +import { TaskEvent, TaskEventKind, TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { IAction, Action } from 'vs/base/common/actions'; import { deepClone, equals } from 'vs/base/common/objects'; -import { DebugSession } from 'vs/workbench/parts/debug/electron-browser/debugSession'; +import { DebugSession } from 'vs/workbench/contrib/debug/electron-browser/debugSession'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { IDebugService, State, IDebugSession, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, IThread, IDebugConfiguration, VIEWLET_ID, REPL_ID, IConfig, ILaunch, IViewModel, IConfigurationManager, IDebugModel, IEnablement, IBreakpoint, IBreakpointData, ICompound, IGlobalConfig, IStackFrame, AdapterEndEvent, getStateLabel } from 'vs/workbench/parts/debug/common/debug'; -import { isExtensionHostDebugging } from 'vs/workbench/parts/debug/common/debugUtils'; +import { IDebugService, State, IDebugSession, CONTEXT_DEBUG_TYPE, CONTEXT_DEBUG_STATE, CONTEXT_IN_DEBUG_MODE, IThread, IDebugConfiguration, VIEWLET_ID, REPL_ID, IConfig, ILaunch, IViewModel, IConfigurationManager, IDebugModel, IEnablement, IBreakpoint, IBreakpointData, ICompound, IGlobalConfig, IStackFrame, AdapterEndEvent, getStateLabel } from 'vs/workbench/contrib/debug/common/debug'; +import { isExtensionHostDebugging } from 'vs/workbench/contrib/debug/common/debugUtils'; import { isErrorWithActions, createErrorWithActions } from 'vs/base/common/errorsWithActions'; import { RunOnceScheduler } from 'vs/base/common/async'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/debugSession.ts b/src/vs/workbench/contrib/debug/electron-browser/debugSession.ts index 9f5c32a30c4..6410fd8e966 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/debugSession.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/debugSession.ts @@ -12,11 +12,11 @@ import { Event, Emitter } from 'vs/base/common/event'; import { CompletionItem, completionKindFromLegacyString } from 'vs/editor/common/modes'; import { Position } from 'vs/editor/common/core/position'; import * as aria from 'vs/base/browser/ui/aria/aria'; -import { IDebugSession, IConfig, IThread, IRawModelUpdate, IDebugService, IRawStoppedDetails, State, LoadedSourceEvent, IFunctionBreakpoint, IExceptionBreakpoint, IBreakpoint, IExceptionInfo, AdapterEndEvent, IDebugger, VIEWLET_ID, IDebugConfiguration, IReplElement, IStackFrame, IExpression, IReplElementSource } from 'vs/workbench/parts/debug/common/debug'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +import { IDebugSession, IConfig, IThread, IRawModelUpdate, IDebugService, IRawStoppedDetails, State, LoadedSourceEvent, IFunctionBreakpoint, IExceptionBreakpoint, IBreakpoint, IExceptionInfo, AdapterEndEvent, IDebugger, VIEWLET_ID, IDebugConfiguration, IReplElement, IStackFrame, IExpression, IReplElementSource } from 'vs/workbench/contrib/debug/common/debug'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { mixin } from 'vs/base/common/objects'; -import { Thread, ExpressionContainer, DebugModel } from 'vs/workbench/parts/debug/common/debugModel'; -import { RawDebugSession } from 'vs/workbench/parts/debug/electron-browser/rawDebugSession'; +import { Thread, ExpressionContainer, DebugModel } from 'vs/workbench/contrib/debug/common/debugModel'; +import { RawDebugSession } from 'vs/workbench/contrib/debug/electron-browser/rawDebugSession'; import product from 'vs/platform/node/product'; import { IWorkspaceFolder, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; @@ -25,11 +25,11 @@ import { generateUuid } from 'vs/base/common/uuid'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { normalizeDriveLetter } from 'vs/base/common/labels'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; +import { IOutputService } from 'vs/workbench/contrib/output/common/output'; import { Range } from 'vs/editor/common/core/range'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { ReplModel } from 'vs/workbench/parts/debug/common/replModel'; +import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel'; import { onUnexpectedError } from 'vs/base/common/errors'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts b/src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts index fb7babcc56b..6dbbe42f377 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/electronDebugActions.ts @@ -5,8 +5,8 @@ import * as nls from 'vs/nls'; import { Action } from 'vs/base/common/actions'; -import { Variable } from 'vs/workbench/parts/debug/common/debugModel'; -import { IDebugService, IStackFrame } from 'vs/workbench/parts/debug/common/debug'; +import { Variable } from 'vs/workbench/contrib/debug/common/debugModel'; +import { IDebugService, IStackFrame } from 'vs/workbench/contrib/debug/common/debug'; import { clipboard } from 'electron'; import { isWindows } from 'vs/base/common/platform'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts b/src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts index 8801d1105ec..8b28b1564f2 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/rawDebugSession.ts @@ -9,8 +9,8 @@ import * as objects from 'vs/base/common/objects'; import { Action } from 'vs/base/common/actions'; import * as errors from 'vs/base/common/errors'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { formatPII, isUri } from 'vs/workbench/parts/debug/common/debugUtils'; -import { IDebugAdapter, IConfig, AdapterEndEvent, IDebugger } from 'vs/workbench/parts/debug/common/debug'; +import { formatPII, isUri } from 'vs/workbench/contrib/debug/common/debugUtils'; +import { IDebugAdapter, IConfig, AdapterEndEvent, IDebugger } from 'vs/workbench/contrib/debug/common/debug'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; import * as cp from 'child_process'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/repl.ts b/src/vs/workbench/contrib/debug/electron-browser/repl.ts index 21b493db790..b9df4de1e42 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/repl.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/repl.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/css!vs/workbench/parts/debug/browser/media/repl'; +import 'vs/css!vs/workbench/contrib/debug/browser/media/repl'; import * as nls from 'vs/nls'; import { URI as uri } from 'vs/base/common/uri'; import * as errors from 'vs/base/common/errors'; @@ -32,32 +32,32 @@ import { memoize } from 'vs/base/common/decorators'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget'; -import { IDebugService, REPL_ID, DEBUG_SCHEME, CONTEXT_IN_DEBUG_REPL, IDebugSession, State, IReplElement, IExpressionContainer, IExpression, IReplElementSource } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService, REPL_ID, DEBUG_SCHEME, CONTEXT_IN_DEBUG_REPL, IDebugSession, State, IReplElement, IExpressionContainer, IExpression, IReplElementSource } from 'vs/workbench/contrib/debug/common/debug'; import { HistoryNavigator } from 'vs/base/common/history'; import { IHistoryNavigationWidget } from 'vs/base/browser/history'; import { createAndBindHistoryNavigationWidgetScopedContextKeyService } from 'vs/platform/widget/browser/contextScopedHistoryWidget'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { getSimpleCodeEditorWidgetOptions } from 'vs/workbench/parts/codeEditor/electron-browser/simpleEditorOptions'; -import { getSimpleEditorOptions } from 'vs/workbench/parts/codeEditor/browser/simpleEditorOptions'; +import { getSimpleCodeEditorWidgetOptions } from 'vs/workbench/contrib/codeEditor/electron-browser/simpleEditorOptions'; +import { getSimpleEditorOptions } from 'vs/workbench/contrib/codeEditor/browser/simpleEditorOptions'; import { IDecorationOptions } from 'vs/editor/common/editorCommon'; import { transparent, editorForeground } from 'vs/platform/theme/common/colorRegistry'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { FocusSessionActionItem } from 'vs/workbench/parts/debug/browser/debugActionItems'; +import { FocusSessionActionItem } from 'vs/workbench/contrib/debug/browser/debugActionItems'; import { CompletionContext, CompletionList, CompletionProviderRegistry } from 'vs/editor/common/modes'; import { first } from 'vs/base/common/arrays'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { Variable, Expression, SimpleReplElement, RawObjectReplElement } from 'vs/workbench/parts/debug/common/debugModel'; +import { Variable, Expression, SimpleReplElement, RawObjectReplElement } from 'vs/workbench/contrib/debug/common/debugModel'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; -import { VariablesRenderer } from 'vs/workbench/parts/debug/electron-browser/variablesView'; +import { VariablesRenderer } from 'vs/workbench/contrib/debug/electron-browser/variablesView'; import { ITreeRenderer, ITreeNode, ITreeContextMenuEvent, IAsyncDataSource } from 'vs/base/browser/ui/tree/tree'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { renderExpressionValue } from 'vs/workbench/parts/debug/browser/baseDebugView'; -import { handleANSIOutput } from 'vs/workbench/parts/debug/browser/debugANSIHandling'; +import { renderExpressionValue } from 'vs/workbench/contrib/debug/browser/baseDebugView'; +import { handleANSIOutput } from 'vs/workbench/contrib/debug/browser/debugANSIHandling'; import { ILabelService } from 'vs/platform/label/common/label'; -import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; -import { CopyAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; -import { ReplCollapseAllAction } from 'vs/workbench/parts/debug/browser/debugActions'; +import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; +import { CopyAction } from 'vs/workbench/contrib/debug/electron-browser/electronDebugActions'; +import { ReplCollapseAllAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { removeAnsiEscapeCodes, isFullWidthCharacter, endsWith } from 'vs/base/common/strings'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/terminalSupport.ts b/src/vs/workbench/contrib/debug/electron-browser/terminalSupport.ts index 810909605db..43be1917204 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/terminalSupport.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/terminalSupport.ts @@ -5,10 +5,10 @@ import * as nls from 'vs/nls'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { ITerminalService, ITerminalInstance } from 'vs/workbench/parts/terminal/common/terminal'; -import { ITerminalService as IExternalTerminalService } from 'vs/workbench/parts/execution/common/execution'; -import { ITerminalLauncher, ITerminalSettings } from 'vs/workbench/parts/debug/common/debug'; -import { hasChildProcesses, prepareCommand } from 'vs/workbench/parts/debug/node/terminals'; +import { ITerminalService, ITerminalInstance } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ITerminalService as IExternalTerminalService } from 'vs/workbench/contrib/execution/common/execution'; +import { ITerminalLauncher, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug'; +import { hasChildProcesses, prepareCommand } from 'vs/workbench/contrib/debug/node/terminals'; export class TerminalLauncher implements ITerminalLauncher { diff --git a/src/vs/workbench/contrib/debug/electron-browser/variablesView.ts b/src/vs/workbench/contrib/debug/electron-browser/variablesView.ts index b6b470d6697..87fcd26abaa 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/variablesView.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/variablesView.ts @@ -8,14 +8,14 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import * as dom from 'vs/base/browser/dom'; import { CollapseAction2 } from 'vs/workbench/browser/viewlet'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; -import { IDebugService, IExpression, IScope, CONTEXT_VARIABLES_FOCUSED, IViewModel } from 'vs/workbench/parts/debug/common/debug'; -import { Variable, Scope } from 'vs/workbench/parts/debug/common/debugModel'; +import { IDebugService, IExpression, IScope, CONTEXT_VARIABLES_FOCUSED, IViewModel } from 'vs/workbench/contrib/debug/common/debug'; +import { Variable, Scope } from 'vs/workbench/contrib/debug/common/debugModel'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { renderViewTree, renderVariable, IInputBoxOptions, AbstractExpressionsRenderer, IExpressionTemplateData } from 'vs/workbench/parts/debug/browser/baseDebugView'; +import { renderViewTree, renderVariable, IInputBoxOptions, AbstractExpressionsRenderer, IExpressionTemplateData } from 'vs/workbench/contrib/debug/browser/baseDebugView'; import { IAction } from 'vs/base/common/actions'; -import { SetValueAction, AddToWatchExpressionsAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { CopyValueAction, CopyEvaluatePathAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; +import { SetValueAction, AddToWatchExpressionsAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +import { CopyValueAction, CopyEvaluatePathAction } from 'vs/workbench/contrib/debug/electron-browser/electronDebugActions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IViewletPanelOptions, ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; diff --git a/src/vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts b/src/vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts index 24c330faa89..052a012c7d3 100644 --- a/src/vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts +++ b/src/vs/workbench/contrib/debug/electron-browser/watchExpressionsView.ts @@ -8,21 +8,21 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import * as dom from 'vs/base/browser/dom'; import { CollapseAction2 } from 'vs/workbench/browser/viewlet'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; -import { IDebugService, IExpression, CONTEXT_WATCH_EXPRESSIONS_FOCUSED } from 'vs/workbench/parts/debug/common/debug'; -import { Expression, Variable } from 'vs/workbench/parts/debug/common/debugModel'; -import { AddWatchExpressionAction, RemoveAllWatchExpressionsAction, EditWatchExpressionAction, RemoveWatchExpressionAction } from 'vs/workbench/parts/debug/browser/debugActions'; +import { IDebugService, IExpression, CONTEXT_WATCH_EXPRESSIONS_FOCUSED } from 'vs/workbench/contrib/debug/common/debug'; +import { Expression, Variable } from 'vs/workbench/contrib/debug/common/debugModel'; +import { AddWatchExpressionAction, RemoveAllWatchExpressionsAction, EditWatchExpressionAction, RemoveWatchExpressionAction } from 'vs/workbench/contrib/debug/browser/debugActions'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IAction } from 'vs/base/common/actions'; -import { CopyValueAction } from 'vs/workbench/parts/debug/electron-browser/electronDebugActions'; +import { CopyValueAction } from 'vs/workbench/contrib/debug/electron-browser/electronDebugActions'; import { Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { renderExpressionValue, renderViewTree, IInputBoxOptions, AbstractExpressionsRenderer, IExpressionTemplateData } from 'vs/workbench/parts/debug/browser/baseDebugView'; +import { renderExpressionValue, renderViewTree, IInputBoxOptions, AbstractExpressionsRenderer, IExpressionTemplateData } from 'vs/workbench/contrib/debug/browser/baseDebugView'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IViewletPanelOptions, ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; -import { VariablesRenderer, variableSetEmitter } from 'vs/workbench/parts/debug/electron-browser/variablesView'; +import { VariablesRenderer, variableSetEmitter } from 'vs/workbench/contrib/debug/electron-browser/variablesView'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { WorkbenchAsyncDataTree, IListService } from 'vs/platform/list/browser/listService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; diff --git a/src/vs/workbench/contrib/debug/node/debugAdapter.ts b/src/vs/workbench/contrib/debug/node/debugAdapter.ts index 81954344b9b..c6948364d4e 100644 --- a/src/vs/workbench/contrib/debug/node/debugAdapter.ts +++ b/src/vs/workbench/contrib/debug/node/debugAdapter.ts @@ -15,8 +15,8 @@ import * as platform from 'vs/base/common/platform'; import { Emitter, Event } from 'vs/base/common/event'; import { ExtensionsChannelId } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; -import { IDebugAdapter, IDebugAdapterExecutable, IDebuggerContribution, IPlatformSpecificAdapterContribution, IDebugAdapterServer } from 'vs/workbench/parts/debug/common/debug'; +import { IOutputService } from 'vs/workbench/contrib/output/common/output'; +import { IDebugAdapter, IDebugAdapterExecutable, IDebuggerContribution, IPlatformSpecificAdapterContribution, IDebugAdapterServer } from 'vs/workbench/contrib/debug/common/debug'; /** * Abstract implementation of the low level API for a debug adapter. diff --git a/src/vs/workbench/contrib/debug/node/debugger.ts b/src/vs/workbench/contrib/debug/node/debugger.ts index 7d0d8bff16d..01f5edd2451 100644 --- a/src/vs/workbench/contrib/debug/node/debugger.ts +++ b/src/vs/workbench/contrib/debug/node/debugger.ts @@ -10,18 +10,18 @@ import * as objects from 'vs/base/common/objects'; import { TelemetryAppenderClient } from 'vs/platform/telemetry/node/telemetryIpc'; import { IJSONSchema, IJSONSchemaSnippet } from 'vs/base/common/jsonSchema'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { IConfig, IDebuggerContribution, IDebugAdapterExecutable, INTERNAL_CONSOLE_OPTIONS_SCHEMA, IConfigurationManager, IDebugAdapter, IDebugConfiguration, ITerminalSettings, IDebugger, IDebugSession, IAdapterDescriptor, IDebugAdapterServer } from 'vs/workbench/parts/debug/common/debug'; +import { IConfig, IDebuggerContribution, IDebugAdapterExecutable, INTERNAL_CONSOLE_OPTIONS_SCHEMA, IConfigurationManager, IDebugAdapter, IDebugConfiguration, ITerminalSettings, IDebugger, IDebugSession, IAdapterDescriptor, IDebugAdapterServer } from 'vs/workbench/contrib/debug/common/debug'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; -import { ExecutableDebugAdapter, SocketDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter'; +import { IOutputService } from 'vs/workbench/contrib/output/common/output'; +import { ExecutableDebugAdapter, SocketDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import * as ConfigurationResolverUtils from 'vs/workbench/services/configurationResolver/common/configurationResolverUtils'; import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { memoize } from 'vs/base/common/decorators'; -import { TaskDefinitionRegistry } from 'vs/workbench/parts/tasks/common/taskDefinitionRegistry'; +import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry'; import { getPathFromAmdModule } from 'vs/base/common/amd'; import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration'; import { URI } from 'vs/base/common/uri'; @@ -225,7 +225,7 @@ export class Debugger implements IDebugger { env: { ELECTRON_RUN_AS_NODE: 1, PIPE_LOGGING: 'true', - AMD_ENTRYPOINT: 'vs/workbench/parts/debug/node/telemetryApp' + AMD_ENTRYPOINT: 'vs/workbench/contrib/debug/node/telemetryApp' } } ); diff --git a/src/vs/workbench/contrib/debug/node/terminals.ts b/src/vs/workbench/contrib/debug/node/terminals.ts index 177576e9161..31c0332eb54 100644 --- a/src/vs/workbench/contrib/debug/node/terminals.ts +++ b/src/vs/workbench/contrib/debug/node/terminals.ts @@ -8,7 +8,7 @@ import * as nls from 'vs/nls'; import * as env from 'vs/base/common/platform'; import * as pfs from 'vs/base/node/pfs'; import { assign } from 'vs/base/common/objects'; -import { ITerminalLauncher, ITerminalSettings } from 'vs/workbench/parts/debug/common/debug'; +import { ITerminalLauncher, ITerminalSettings } from 'vs/workbench/contrib/debug/common/debug'; import { getPathFromAmdModule } from 'vs/base/common/amd'; const TERMINAL_TITLE = nls.localize('console.title', "VS Code Console"); @@ -129,7 +129,7 @@ class MacTerminalService extends TerminalLauncher { // and then launches the program inside that window. const script = terminalApp === MacTerminalService.DEFAULT_TERMINAL_OSX ? 'TerminalHelper' : 'iTermHelper'; - const scriptpath = getPathFromAmdModule(require, `vs/workbench/parts/execution/electron-browser/${script}.scpt`); + const scriptpath = getPathFromAmdModule(require, `vs/workbench/contrib/execution/electron-browser/${script}.scpt`); const osaArgs = [ scriptpath, diff --git a/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts index e90ea964925..d4549a65671 100644 --- a/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/baseDebugView.test.ts @@ -4,10 +4,10 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { replaceWhitespace, renderExpressionValue, renderVariable } from 'vs/workbench/parts/debug/browser/baseDebugView'; +import { replaceWhitespace, renderExpressionValue, renderVariable } from 'vs/workbench/contrib/debug/browser/baseDebugView'; import * as dom from 'vs/base/browser/dom'; -import { Expression, Variable, Scope, StackFrame, Thread } from 'vs/workbench/parts/debug/common/debugModel'; -import { MockSession } from 'vs/workbench/parts/debug/test/common/mockDebug'; +import { Expression, Variable, Scope, StackFrame, Thread } from 'vs/workbench/contrib/debug/common/debugModel'; +import { MockSession } from 'vs/workbench/contrib/debug/test/common/mockDebug'; import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; const $ = dom.$; diff --git a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts index fe95a2e055a..e42257fb540 100644 --- a/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/debugANSIHandling.test.ts @@ -6,10 +6,10 @@ import * as assert from 'assert'; import * as dom from 'vs/base/browser/dom'; import { generateUuid } from 'vs/base/common/uuid'; -import { appendStylizedStringToContainer, handleANSIOutput } from 'vs/workbench/parts/debug/browser/debugANSIHandling'; +import { appendStylizedStringToContainer, handleANSIOutput } from 'vs/workbench/contrib/debug/browser/debugANSIHandling'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; -import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; +import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; suite('Debug - ANSI Handling', () => { diff --git a/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts b/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts index efae57e5ca0..c164d37d9db 100644 --- a/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts +++ b/src/vs/workbench/contrib/debug/test/browser/linkDetector.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { workbenchInstantiationService } from 'vs/workbench/test/workbenchTestServices'; -import { LinkDetector } from 'vs/workbench/parts/debug/browser/linkDetector'; +import { LinkDetector } from 'vs/workbench/contrib/debug/browser/linkDetector'; import { isWindows } from 'vs/base/common/platform'; suite('Debug - Link Detector', () => { diff --git a/src/vs/workbench/contrib/debug/test/common/debugSource.test.ts b/src/vs/workbench/contrib/debug/test/common/debugSource.test.ts index 807a2c0ba03..4fcfdc46c00 100644 --- a/src/vs/workbench/contrib/debug/test/common/debugSource.test.ts +++ b/src/vs/workbench/contrib/debug/test/common/debugSource.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { URI as uri } from 'vs/base/common/uri'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { normalize } from 'vs/base/common/paths'; suite('Debug - Source', () => { diff --git a/src/vs/workbench/contrib/debug/test/common/debugUtils.test.ts b/src/vs/workbench/contrib/debug/test/common/debugUtils.test.ts index 8d953ae7052..3be8b8cf1a0 100644 --- a/src/vs/workbench/contrib/debug/test/common/debugUtils.test.ts +++ b/src/vs/workbench/contrib/debug/test/common/debugUtils.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { formatPII, getExactExpressionStartAndEnd } from 'vs/workbench/parts/debug/common/debugUtils'; +import { formatPII, getExactExpressionStartAndEnd } from 'vs/workbench/contrib/debug/common/debugUtils'; suite('Debug - Utils', () => { test('formatPII', () => { diff --git a/src/vs/workbench/contrib/debug/test/common/debugViewModel.test.ts b/src/vs/workbench/contrib/debug/test/common/debugViewModel.test.ts index a466b211fe4..4998c79b5d2 100644 --- a/src/vs/workbench/contrib/debug/test/common/debugViewModel.test.ts +++ b/src/vs/workbench/contrib/debug/test/common/debugViewModel.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { ViewModel } from 'vs/workbench/parts/debug/common/debugViewModel'; -import { StackFrame, Expression, Thread } from 'vs/workbench/parts/debug/common/debugModel'; -import { MockSession } from 'vs/workbench/parts/debug/test/common/mockDebug'; +import { ViewModel } from 'vs/workbench/contrib/debug/common/debugViewModel'; +import { StackFrame, Expression, Thread } from 'vs/workbench/contrib/debug/common/debugModel'; +import { MockSession } from 'vs/workbench/contrib/debug/test/common/mockDebug'; import { MockContextKeyService } from 'vs/platform/keybinding/test/common/mockKeybindingService'; suite('Debug - View Model', () => { diff --git a/src/vs/workbench/contrib/debug/test/common/mockDebug.ts b/src/vs/workbench/contrib/debug/test/common/mockDebug.ts index 73359d78946..d7b4cc2ab76 100644 --- a/src/vs/workbench/contrib/debug/test/common/mockDebug.ts +++ b/src/vs/workbench/contrib/debug/test/common/mockDebug.ts @@ -7,8 +7,8 @@ import { URI as uri } from 'vs/base/common/uri'; import { Event } from 'vs/base/common/event'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { Position } from 'vs/editor/common/core/position'; -import { ILaunch, IDebugService, State, IDebugSession, IConfigurationManager, IStackFrame, IBreakpointData, IBreakpointUpdateData, IConfig, IDebugModel, IViewModel, IBreakpoint, LoadedSourceEvent, IThread, IRawModelUpdate, IFunctionBreakpoint, IExceptionBreakpoint, IDebugger, IExceptionInfo, AdapterEndEvent, IReplElement, IExpression, IReplElementSource } from 'vs/workbench/parts/debug/common/debug'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; +import { ILaunch, IDebugService, State, IDebugSession, IConfigurationManager, IStackFrame, IBreakpointData, IBreakpointUpdateData, IConfig, IDebugModel, IViewModel, IBreakpoint, LoadedSourceEvent, IThread, IRawModelUpdate, IFunctionBreakpoint, IExceptionBreakpoint, IDebugger, IExceptionInfo, AdapterEndEvent, IReplElement, IExpression, IReplElementSource } from 'vs/workbench/contrib/debug/common/debug'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; import { CompletionItem } from 'vs/editor/common/modes'; import Severity from 'vs/base/common/severity'; diff --git a/src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts b/src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts index 2fe1f43a733..03ae2794d6d 100644 --- a/src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts +++ b/src/vs/workbench/contrib/debug/test/electron-browser/debugModel.test.ts @@ -6,12 +6,12 @@ import * as assert from 'assert'; import { URI as uri } from 'vs/base/common/uri'; import severity from 'vs/base/common/severity'; -import { SimpleReplElement, DebugModel, Expression, RawObjectReplElement, StackFrame, Thread } from 'vs/workbench/parts/debug/common/debugModel'; +import { SimpleReplElement, DebugModel, Expression, RawObjectReplElement, StackFrame, Thread } from 'vs/workbench/contrib/debug/common/debugModel'; import * as sinon from 'sinon'; -import { MockRawSession } from 'vs/workbench/parts/debug/test/common/mockDebug'; -import { Source } from 'vs/workbench/parts/debug/common/debugSource'; -import { DebugSession } from 'vs/workbench/parts/debug/electron-browser/debugSession'; -import { ReplModel } from 'vs/workbench/parts/debug/common/replModel'; +import { MockRawSession } from 'vs/workbench/contrib/debug/test/common/mockDebug'; +import { Source } from 'vs/workbench/contrib/debug/common/debugSource'; +import { DebugSession } from 'vs/workbench/contrib/debug/electron-browser/debugSession'; +import { ReplModel } from 'vs/workbench/contrib/debug/common/replModel'; suite('Debug - Model', () => { let model: DebugModel; diff --git a/src/vs/workbench/contrib/debug/test/node/debugger.test.ts b/src/vs/workbench/contrib/debug/test/node/debugger.test.ts index 936bd120a7a..38c87d51175 100644 --- a/src/vs/workbench/contrib/debug/test/node/debugger.test.ts +++ b/src/vs/workbench/contrib/debug/test/node/debugger.test.ts @@ -6,11 +6,11 @@ import * as assert from 'assert'; import * as paths from 'vs/base/common/paths'; import * as platform from 'vs/base/common/platform'; -import { IDebugAdapterExecutable, IConfigurationManager, IConfig, IDebugSession } from 'vs/workbench/parts/debug/common/debug'; -import { Debugger } from 'vs/workbench/parts/debug/node/debugger'; +import { IDebugAdapterExecutable, IConfigurationManager, IConfig, IDebugSession } from 'vs/workbench/contrib/debug/common/debug'; +import { Debugger } from 'vs/workbench/contrib/debug/node/debugger'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { URI } from 'vs/base/common/uri'; -import { ExecutableDebugAdapter } from 'vs/workbench/parts/debug/node/debugAdapter'; +import { ExecutableDebugAdapter } from 'vs/workbench/contrib/debug/node/debugAdapter'; import { TestTextResourcePropertiesService } from 'vs/workbench/test/workbenchTestServices'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/emmet/electron-browser/actions/expandAbbreviation.ts b/src/vs/workbench/contrib/emmet/electron-browser/actions/expandAbbreviation.ts index 7788fa68469..72c5ed4a9c4 100644 --- a/src/vs/workbench/contrib/emmet/electron-browser/actions/expandAbbreviation.ts +++ b/src/vs/workbench/contrib/emmet/electron-browser/actions/expandAbbreviation.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as nls from 'vs/nls'; -import { EmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; +import { EmmetEditorAction } from 'vs/workbench/contrib/emmet/electron-browser/emmetActions'; import { registerEditorAction } from 'vs/editor/browser/editorExtensions'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { KeyCode } from 'vs/base/common/keyCodes'; diff --git a/src/vs/workbench/contrib/emmet/test/electron-browser/emmetAction.test.ts b/src/vs/workbench/contrib/emmet/test/electron-browser/emmetAction.test.ts index bd34d063500..7aefb85575b 100644 --- a/src/vs/workbench/contrib/emmet/test/electron-browser/emmetAction.test.ts +++ b/src/vs/workbench/contrib/emmet/test/electron-browser/emmetAction.test.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { IGrammarContributions, ILanguageIdentifierResolver, EmmetEditorAction } from 'vs/workbench/parts/emmet/electron-browser/emmetActions'; +import { IGrammarContributions, ILanguageIdentifierResolver, EmmetEditorAction } from 'vs/workbench/contrib/emmet/electron-browser/emmetActions'; import { withTestCodeEditor } from 'vs/editor/test/browser/testCodeEditor'; import * as assert from 'assert'; import { LanguageId, LanguageIdentifier } from 'vs/editor/common/modes'; diff --git a/src/vs/workbench/contrib/execution/electron-browser/execution.contribution.ts b/src/vs/workbench/contrib/execution/electron-browser/execution.contribution.ts index 3d0f476ddec..f23572852da 100644 --- a/src/vs/workbench/contrib/execution/electron-browser/execution.contribution.ts +++ b/src/vs/workbench/contrib/execution/electron-browser/execution.contribution.ts @@ -10,19 +10,19 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import * as paths from 'vs/base/common/paths'; import { URI as uri } from 'vs/base/common/uri'; -import { ITerminalService } from 'vs/workbench/parts/execution/common/execution'; +import { ITerminalService } from 'vs/workbench/contrib/execution/common/execution'; import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { Extensions, IConfigurationRegistry, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { ITerminalService as IIntegratedTerminalService, KEYBINDING_CONTEXT_TERMINAL_NOT_FOCUSED } from 'vs/workbench/parts/terminal/common/terminal'; -import { getDefaultTerminalWindows, getDefaultTerminalLinuxReady, DEFAULT_TERMINAL_OSX, ITerminalConfiguration } from 'vs/workbench/parts/execution/electron-browser/terminal'; -import { WinTerminalService, MacTerminalService, LinuxTerminalService } from 'vs/workbench/parts/execution/electron-browser/terminalService'; +import { ITerminalService as IIntegratedTerminalService, KEYBINDING_CONTEXT_TERMINAL_NOT_FOCUSED } from 'vs/workbench/contrib/terminal/common/terminal'; +import { getDefaultTerminalWindows, getDefaultTerminalLinuxReady, DEFAULT_TERMINAL_OSX, ITerminalConfiguration } from 'vs/workbench/contrib/execution/electron-browser/terminal'; +import { WinTerminalService, MacTerminalService, LinuxTerminalService } from 'vs/workbench/contrib/execution/electron-browser/terminalService'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; import { ResourceContextKey } from 'vs/workbench/common/resources'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IFileService } from 'vs/platform/files/common/files'; import { IListService } from 'vs/platform/list/browser/listService'; -import { getMultiSelectedResources } from 'vs/workbench/parts/files/browser/files'; +import { getMultiSelectedResources } from 'vs/workbench/contrib/files/browser/files'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { Schemas } from 'vs/base/common/network'; import { distinct } from 'vs/base/common/arrays'; diff --git a/src/vs/workbench/contrib/execution/electron-browser/terminalService.ts b/src/vs/workbench/contrib/execution/electron-browser/terminalService.ts index 5b361d842fd..498a5f9b578 100644 --- a/src/vs/workbench/contrib/execution/electron-browser/terminalService.ts +++ b/src/vs/workbench/contrib/execution/electron-browser/terminalService.ts @@ -8,9 +8,9 @@ import * as path from 'path'; import * as processes from 'vs/base/node/processes'; import * as nls from 'vs/nls'; import { assign } from 'vs/base/common/objects'; -import { ITerminalService } from 'vs/workbench/parts/execution/common/execution'; +import { ITerminalService } from 'vs/workbench/contrib/execution/common/execution'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITerminalConfiguration, getDefaultTerminalWindows, getDefaultTerminalLinuxReady, DEFAULT_TERMINAL_OSX } from 'vs/workbench/parts/execution/electron-browser/terminal'; +import { ITerminalConfiguration, getDefaultTerminalWindows, getDefaultTerminalLinuxReady, DEFAULT_TERMINAL_OSX } from 'vs/workbench/contrib/execution/electron-browser/terminal'; import { IProcessEnvironment } from 'vs/base/common/platform'; import { getPathFromAmdModule } from 'vs/base/common/amd'; @@ -142,7 +142,7 @@ export class MacTerminalService implements ITerminalService { // and then launches the program inside that window. const script = terminalApp === DEFAULT_TERMINAL_OSX ? 'TerminalHelper' : 'iTermHelper'; - const scriptpath = getPathFromAmdModule(require, `vs/workbench/parts/execution/electron-browser/${script}.scpt`); + const scriptpath = getPathFromAmdModule(require, `vs/workbench/contrib/execution/electron-browser/${script}.scpt`); const osaArgs = [ scriptpath, diff --git a/src/vs/workbench/contrib/execution/test/electron-browser/terminalService.test.ts b/src/vs/workbench/contrib/execution/test/electron-browser/terminalService.test.ts index 7f290ababec..7795082c1fa 100644 --- a/src/vs/workbench/contrib/execution/test/electron-browser/terminalService.test.ts +++ b/src/vs/workbench/contrib/execution/test/electron-browser/terminalService.test.ts @@ -4,8 +4,8 @@ *--------------------------------------------------------------------------------------------*/ import { deepEqual, equal } from 'assert'; -import { WinTerminalService, LinuxTerminalService, MacTerminalService } from 'vs/workbench/parts/execution/electron-browser/terminalService'; -import { getDefaultTerminalWindows, getDefaultTerminalLinuxReady, DEFAULT_TERMINAL_OSX } from 'vs/workbench/parts/execution/electron-browser/terminal'; +import { WinTerminalService, LinuxTerminalService, MacTerminalService } from 'vs/workbench/contrib/execution/electron-browser/terminalService'; +import { getDefaultTerminalWindows, getDefaultTerminalLinuxReady, DEFAULT_TERMINAL_OSX } from 'vs/workbench/contrib/execution/electron-browser/terminal'; suite('Execution - TerminalService', () => { let mockOnExit: Function; diff --git a/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts b/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts index 17e312c7221..60396f96a64 100644 --- a/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts +++ b/src/vs/workbench/contrib/experiments/electron-browser/experimentalPrompt.ts @@ -5,9 +5,9 @@ import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { INotificationService, Severity, IPromptChoice } from 'vs/platform/notification/common/notification'; -import { IExperimentService, IExperiment, ExperimentActionType, IExperimentActionPromptProperties, IExperimentActionPromptCommand, ExperimentState } from 'vs/workbench/parts/experiments/node/experimentService'; +import { IExperimentService, IExperiment, ExperimentActionType, IExperimentActionPromptProperties, IExperimentActionPromptCommand, ExperimentState } from 'vs/workbench/contrib/experiments/node/experimentService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { Disposable, IDisposable, dispose } from 'vs/base/common/lifecycle'; import { language } from 'vs/base/common/platform'; diff --git a/src/vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts b/src/vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts index db03272bfcb..b11ad64d0ce 100644 --- a/src/vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts +++ b/src/vs/workbench/contrib/experiments/electron-browser/experiments.contribution.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IExperimentService, ExperimentService } from 'vs/workbench/parts/experiments/node/experimentService'; +import { IExperimentService, ExperimentService } from 'vs/workbench/contrib/experiments/node/experimentService'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; -import { ExperimentalPrompts } from 'vs/workbench/parts/experiments/electron-browser/experimentalPrompt'; +import { ExperimentalPrompts } from 'vs/workbench/contrib/experiments/electron-browser/experimentalPrompt'; registerSingleton(IExperimentService, ExperimentService, true); diff --git a/src/vs/workbench/contrib/experiments/node/experimentService.ts b/src/vs/workbench/contrib/experiments/node/experimentService.ts index c1829068d55..da83c12b268 100644 --- a/src/vs/workbench/contrib/experiments/node/experimentService.ts +++ b/src/vs/workbench/contrib/experiments/node/experimentService.ts @@ -19,7 +19,7 @@ import { match } from 'vs/base/common/glob'; import { asJson } from 'vs/base/node/request'; import { Emitter, Event } from 'vs/base/common/event'; import { ITextFileService, StateChange } from 'vs/workbench/services/textfile/common/textfiles'; -import { WorkspaceStats } from 'vs/workbench/parts/stats/node/workspaceStats'; +import { WorkspaceStats } from 'vs/workbench/contrib/stats/node/workspaceStats'; import { CancellationToken } from 'vs/base/common/cancellation'; import { distinct } from 'vs/base/common/arrays'; import { lastSessionDateStorageKey } from 'vs/platform/telemetry/node/workbenchCommonProperties'; diff --git a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts index b9f252d30d1..d1a6f49b1c2 100644 --- a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts +++ b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentService.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { ExperimentService, ExperimentActionType, ExperimentState, IExperiment } from 'vs/workbench/parts/experiments/node/experimentService'; +import { ExperimentService, ExperimentActionType, ExperimentState, IExperiment } from 'vs/workbench/contrib/experiments/node/experimentService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices'; diff --git a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts index dc7d5a00b94..34e838f7df7 100644 --- a/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts +++ b/src/vs/workbench/contrib/experiments/test/electron-browser/experimentalPrompts.test.ts @@ -12,9 +12,9 @@ import { TestNotificationService } from 'vs/platform/notification/test/common/te import { IStorageService } from 'vs/platform/storage/common/storage'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { ExperimentalPrompts } from 'vs/workbench/parts/experiments/electron-browser/experimentalPrompt'; -import { ExperimentActionType, ExperimentState, IExperiment, IExperimentActionPromptProperties, IExperimentService } from 'vs/workbench/parts/experiments/node/experimentService'; -import { TestExperimentService } from 'vs/workbench/parts/experiments/test/electron-browser/experimentService.test'; +import { ExperimentalPrompts } from 'vs/workbench/contrib/experiments/electron-browser/experimentalPrompt'; +import { ExperimentActionType, ExperimentState, IExperiment, IExperimentActionPromptProperties, IExperimentService } from 'vs/workbench/contrib/experiments/node/experimentService'; +import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; import { TestLifecycleService } from 'vs/workbench/test/workbenchTestServices'; suite('Experimental Prompts', () => { diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts b/src/vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts index 7ab0213525c..b337e054cc5 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsQuickOpen.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import { IAutoFocus, Mode, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler } from 'vs/workbench/browser/quickopen'; -import { IExtensionsViewlet, VIEWLET_ID } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsViewlet, VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IExtensionGalleryService, IExtensionManagementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts b/src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts index 55891efe29b..1f022b51b7e 100644 --- a/src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts +++ b/src/vs/workbench/contrib/extensions/browser/extensionsViewer.ts @@ -9,7 +9,7 @@ import { IMouseEvent } from 'vs/base/browser/mouseEvent'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IDataSource, ITree, IRenderer } from 'vs/base/parts/tree/browser/tree'; import { Action } from 'vs/base/common/actions'; -import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/contrib/extensions/common/extensions'; import { Event } from 'vs/base/common/event'; import { domEvent } from 'vs/base/browser/event'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/extensions/common/extensionsInput.ts b/src/vs/workbench/contrib/extensions/common/extensionsInput.ts index 7ca9f6ec200..c845f7e9cba 100644 --- a/src/vs/workbench/contrib/extensions/common/extensionsInput.ts +++ b/src/vs/workbench/contrib/extensions/common/extensionsInput.ts @@ -5,7 +5,7 @@ import { localize } from 'vs/nls'; import { EditorInput } from 'vs/workbench/common/editor'; -import { IExtension } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtension } from 'vs/workbench/contrib/extensions/common/extensions'; import { URI } from 'vs/base/common/uri'; export class ExtensionsInput extends EditorInput { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts index 826a108b8c5..46f1a2dc0bd 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionEditor.ts @@ -23,13 +23,13 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati import { IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IExtensionManifest, IKeyBinding, IView, IViewContainer, ExtensionType } from 'vs/platform/extensions/common/extensions'; import { ResolvedKeybinding, KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; -import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, IExtensionDependencies, ExtensionContainers } from 'vs/workbench/parts/extensions/common/extensions'; -import { RatingsWidget, InstallCountWidget, RemoteBadgeWidget } from 'vs/workbench/parts/extensions/electron-browser/extensionsWidgets'; +import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; +import { IExtensionsWorkbenchService, IExtensionsViewlet, VIEWLET_ID, IExtension, IExtensionDependencies, ExtensionContainers } from 'vs/workbench/contrib/extensions/common/extensions'; +import { RatingsWidget, InstallCountWidget, RemoteBadgeWidget } from 'vs/workbench/contrib/extensions/electron-browser/extensionsWidgets'; import { EditorOptions } from 'vs/workbench/common/editor'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction, StatusLabelAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; -import { WebviewElement } from 'vs/workbench/parts/webview/electron-browser/webviewElement'; +import { CombinedInstallAction, UpdateAction, ExtensionEditorDropDownAction, ReloadAction, MaliciousStatusLabelAction, IgnoreExtensionRecommendationAction, UndoIgnoreExtensionRecommendationAction, EnableDropDownAction, DisableDropDownAction, StatusLabelAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; +import { WebviewElement } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement'; import { IOpenerService } from 'vs/platform/opener/common/opener'; @@ -45,8 +45,8 @@ import { Color } from 'vs/base/common/color'; import { assign } from 'vs/base/common/objects'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { ExtensionsTree, IExtensionData } from 'vs/workbench/parts/extensions/browser/extensionsViewer'; -import { ShowCurrentReleaseNotesAction } from 'vs/workbench/parts/update/electron-browser/update'; +import { ExtensionsTree, IExtensionData } from 'vs/workbench/contrib/extensions/browser/extensionsViewer'; +import { ShowCurrentReleaseNotesAction } from 'vs/workbench/contrib/update/electron-browser/update'; import { KeybindingParser } from 'vs/base/common/keybindingParser'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts index 40e96dba898..36b76f71fcd 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionProfileService.ts @@ -13,7 +13,7 @@ import { append, $, addDisposableListener } from 'vs/base/browser/dom'; import { IStatusbarRegistry, StatusbarItemDescriptor, Extensions, IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { Registry } from 'vs/platform/registry/common/platform'; -import { IExtensionHostProfileService, ProfileSessionState } from 'vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor'; +import { IExtensionHostProfileService, ProfileSessionState } from 'vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts index ca8b7f45b26..32adbff953d 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionTipsService.ts @@ -18,11 +18,11 @@ import { ITextModel } from 'vs/editor/common/model'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import product from 'vs/platform/node/product'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { ShowRecommendedExtensionsAction, InstallWorkspaceRecommendedExtensionsAction, InstallRecommendedExtensionAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +import { ShowRecommendedExtensionsAction, InstallWorkspaceRecommendedExtensionsAction, InstallRecommendedExtensionAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; import Severity from 'vs/base/common/severity'; import { IWorkspaceContextService, IWorkspaceFolder, IWorkspace, IWorkspaceFoldersChangeEvent, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IFileService } from 'vs/platform/files/common/files'; -import { IExtensionsConfiguration, ConfigurationKey, ShowRecommendationsOnlyOnDemandKey, IExtensionsViewlet, IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsConfiguration, ConfigurationKey, ShowRecommendationsOnlyOnDemandKey, IExtensionsViewlet, IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import * as pfs from 'vs/base/node/pfs'; @@ -31,7 +31,7 @@ import { flatten, distinct, shuffle, coalesce } from 'vs/base/common/arrays'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { guessMimeTypes, MIME_UNKNOWN } from 'vs/base/common/mime'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; -import { getHashedRemotesFromUri } from 'vs/workbench/parts/stats/node/workspaceStats'; +import { getHashedRemotesFromUri } from 'vs/workbench/contrib/stats/node/workspaceStats'; import { IRequestService } from 'vs/platform/request/node/request'; import { asJson } from 'vs/base/node/request'; import { isNumber } from 'vs/base/common/types'; @@ -41,9 +41,9 @@ import { Emitter, Event } from 'vs/base/common/event'; import { assign } from 'vs/base/common/objects'; import { URI } from 'vs/base/common/uri'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { IExperimentService, ExperimentActionType, ExperimentState } from 'vs/workbench/parts/experiments/node/experimentService'; +import { IExperimentService, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/node/experimentService'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { getKeywordsForExtension } from 'vs/workbench/parts/extensions/electron-browser/extensionsUtils'; +import { getKeywordsForExtension } from 'vs/workbench/contrib/extensions/electron-browser/extensionsUtils'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; const milliSecondsInADay = 1000 * 60 * 60 * 24; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts index 9d5f08e733b..5c136213b98 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensions.contribution.ts @@ -12,40 +12,40 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IExtensionTipsService, ExtensionsLabel, ExtensionsChannelId, PreferencesLabel } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; -import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-browser/extensionTipsService'; +import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/parts/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExtensions } from 'vs/workbench/contrib/output/common/output'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { VIEWLET_ID, IExtensionsWorkbenchService } from '../common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/node/extensionsWorkbenchService'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; import { OpenExtensionsViewletAction, InstallExtensionsAction, ShowOutdatedExtensionsAction, ShowRecommendedExtensionsAction, ShowRecommendedKeymapExtensionsAction, ShowPopularExtensionsAction, ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowDisabledExtensionsAction, ShowBuiltInExtensionsAction, UpdateAllAction, EnableAllAction, EnableAllWorkpsaceAction, DisableAllAction, DisableAllWorkpsaceAction, CheckForUpdatesAction, ShowLanguageExtensionsAction, ShowAzureExtensionsAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ConfigureRecommendedExtensionsCommandsContributor, OpenExtensionsFolderAction, InstallVSIXAction, ReinstallAction, InstallSpecificVersionOfExtensionAction -} from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; -import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; +} from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; +import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor } from 'vs/workbench/browser/viewlet'; -import { ExtensionEditor } from 'vs/workbench/parts/extensions/electron-browser/extensionEditor'; -import { StatusUpdater, ExtensionsViewlet, MaliciousExtensionChecker, ExtensionsViewletViewsContribution } from 'vs/workbench/parts/extensions/electron-browser/extensionsViewlet'; +import { ExtensionEditor } from 'vs/workbench/contrib/extensions/electron-browser/extensionEditor'; +import { StatusUpdater, ExtensionsViewlet, MaliciousExtensionChecker, ExtensionsViewletViewsContribution } from 'vs/workbench/contrib/extensions/electron-browser/extensionsViewlet'; import { IQuickOpenRegistry, Extensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; import * as jsonContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry'; -import { ExtensionsConfigurationSchema, ExtensionsConfigurationSchemaId } from 'vs/workbench/parts/extensions/common/extensionsFileTemplate'; +import { ExtensionsConfigurationSchema, ExtensionsConfigurationSchemaId } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { KeymapExtensions } from 'vs/workbench/parts/extensions/electron-browser/extensionsUtils'; +import { KeymapExtensions } from 'vs/workbench/contrib/extensions/electron-browser/extensionsUtils'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { GalleryExtensionsHandler, ExtensionsHandler } from 'vs/workbench/parts/extensions/browser/extensionsQuickOpen'; +import { GalleryExtensionsHandler, ExtensionsHandler } from 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; import { EditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; -import { RuntimeExtensionsEditor, ShowRuntimeExtensionsAction, IExtensionHostProfileService, DebugExtensionHostAction, StartExtensionHostProfileAction, StopExtensionHostProfileAction, CONTEXT_PROFILE_SESSION_STATE, SaveExtensionHostProfileAction, CONTEXT_EXTENSION_HOST_PROFILE_RECORDED } from 'vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor'; +import { RuntimeExtensionsEditor, ShowRuntimeExtensionsAction, IExtensionHostProfileService, DebugExtensionHostAction, StartExtensionHostProfileAction, StopExtensionHostProfileAction, CONTEXT_PROFILE_SESSION_STATE, SaveExtensionHostProfileAction, CONTEXT_EXTENSION_HOST_PROFILE_RECORDED } from 'vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor'; import { EditorInput, IEditorInputFactory, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions, ActiveEditorContext } from 'vs/workbench/common/editor'; -import { ExtensionHostProfileService } from 'vs/workbench/parts/extensions/electron-browser/extensionProfileService'; +import { ExtensionHostProfileService } from 'vs/workbench/contrib/extensions/electron-browser/extensionProfileService'; import { RuntimeExtensionsInput } from 'vs/workbench/services/extensions/electron-browser/runtimeExtensionsInput'; import { URI } from 'vs/base/common/uri'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { ExtensionActivationProgress } from 'vs/workbench/parts/extensions/electron-browser/extensionsActivationProgress'; -import { ExtensionsAutoProfiler } from 'vs/workbench/parts/extensions/electron-browser/extensionsAutoProfiler'; +import { ExtensionActivationProgress } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActivationProgress'; +import { ExtensionsAutoProfiler } from 'vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler'; // Singletons registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService); @@ -323,8 +323,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: DebugExtensionHostAction.ID, title: DebugExtensionHostAction.LABEL, iconLocation: { - dark: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/start-inverse.svg`)), - light: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/start.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/start-inverse.svg`)), + light: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/start.svg`)), } }, group: 'navigation', @@ -336,8 +336,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: StartExtensionHostProfileAction.ID, title: StartExtensionHostProfileAction.LABEL, iconLocation: { - dark: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/profile-start-inverse.svg`)), - light: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/profile-start.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/profile-start-inverse.svg`)), + light: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/profile-start.svg`)), } }, group: 'navigation', @@ -349,8 +349,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: StopExtensionHostProfileAction.ID, title: StopExtensionHostProfileAction.LABEL, iconLocation: { - dark: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/profile-stop-inverse.svg`)), - light: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/profile-stop.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/profile-stop-inverse.svg`)), + light: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/profile-stop.svg`)), } }, group: 'navigation', @@ -362,8 +362,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: SaveExtensionHostProfileAction.ID, title: SaveExtensionHostProfileAction.LABEL, iconLocation: { - dark: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/save-inverse.svg`)), - light: URI.parse(require.toUrl(`vs/workbench/parts/extensions/electron-browser/media/save.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/save-inverse.svg`)), + light: URI.parse(require.toUrl(`vs/workbench/contrib/extensions/electron-browser/media/save.svg`)), }, precondition: CONTEXT_EXTENSION_HOST_PROFILE_RECORDED }, diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts index 2998e2f0086..d2d3fe1a303 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsActions.ts @@ -14,15 +14,15 @@ import * as json from 'vs/base/common/json'; import { ActionItem, Separator, IActionItemOptions } from 'vs/base/browser/ui/actionbar/actionbar'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; -import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer } from 'vs/workbench/parts/extensions/common/extensions'; -import { ExtensionsConfigurationInitialContent } from 'vs/workbench/parts/extensions/common/extensionsFileTemplate'; +import { IExtension, ExtensionState, IExtensionsWorkbenchService, VIEWLET_ID, IExtensionsViewlet, AutoUpdateConfigurationKey, IExtensionContainer } from 'vs/workbench/contrib/extensions/common/extensions'; +import { ExtensionsConfigurationInitialContent } from 'vs/workbench/contrib/extensions/common/extensionsFileTemplate'; import { IExtensionEnablementService, IExtensionTipsService, EnablementState, ExtensionsLabel, IExtensionRecommendation, IGalleryExtension, IExtensionsConfigContent, IExtensionGalleryService, INSTALL_ERROR_MALICIOUS, INSTALL_ERROR_INCOMPATIBLE, IGalleryExtensionVersion, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionType, ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ShowViewletAction } from 'vs/workbench/browser/viewlet'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { Query } from 'vs/workbench/parts/extensions/common/extensionQuery'; +import { Query } from 'vs/workbench/contrib/extensions/common/extensionQuery'; import { IFileService, IContent } from 'vs/platform/files/common/files'; import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; @@ -47,7 +47,7 @@ import { mnemonicButtonLabel } from 'vs/base/common/labels'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; -import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; +import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import product from 'vs/platform/node/product'; import { IQuickPickItem, IQuickInputService } from 'vs/platform/quickinput/common/quickInput'; import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts index eed49b380a6..9e1fd882810 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsAutoProfiler.ts @@ -13,13 +13,13 @@ import { onUnexpectedError } from 'vs/base/common/errors'; import { tmpdir } from 'os'; import { join } from 'path'; import { writeFile } from 'vs/base/node/pfs'; -import { IExtensionHostProfileService, ReportExtensionIssueAction } from 'vs/workbench/parts/extensions/electron-browser/runtimeExtensionsEditor'; +import { IExtensionHostProfileService, ReportExtensionIssueAction } from 'vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { localize } from 'vs/nls'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { RuntimeExtensionsInput } from 'vs/workbench/services/extensions/electron-browser/runtimeExtensionsInput'; import { generateUuid } from 'vs/base/common/uuid'; -import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; export class ExtensionsAutoProfiler extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts index 24c894eca8c..75a817b8b41 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsList.ts @@ -12,10 +12,10 @@ import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { IPagedRenderer } from 'vs/base/browser/ui/list/listPaging'; import { Event } from 'vs/base/common/event'; import { domEvent } from 'vs/base/browser/event'; -import { IExtension, IExtensionsWorkbenchService, ExtensionContainers } from 'vs/workbench/parts/extensions/common/extensions'; -import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionItem, StatusLabelAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +import { IExtension, IExtensionsWorkbenchService, ExtensionContainers } from 'vs/workbench/contrib/extensions/common/extensions'; +import { InstallAction, UpdateAction, ManageExtensionAction, ReloadAction, MaliciousStatusLabelAction, ExtensionActionItem, StatusLabelAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { Label, RatingsWidget, InstallCountWidget, RecommendationWidget, RemoteBadgeWidget } from 'vs/workbench/parts/extensions/electron-browser/extensionsWidgets'; +import { Label, RatingsWidget, InstallCountWidget, RecommendationWidget, RemoteBadgeWidget } from 'vs/workbench/contrib/extensions/electron-browser/extensionsWidgets'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IExtensionManagementServerService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts index 352820e161a..85c5123b9d5 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViewlet.ts @@ -23,11 +23,11 @@ import { ShowEnabledExtensionsAction, ShowInstalledExtensionsAction, ShowRecommendedExtensionsAction, ShowPopularExtensionsAction, ShowDisabledExtensionsAction, ShowOutdatedExtensionsAction, ClearExtensionsInputAction, ChangeSortAction, UpdateAllAction, CheckForUpdatesAction, DisableAllAction, EnableAllAction, EnableAutoUpdateAction, DisableAutoUpdateAction, ShowBuiltInExtensionsAction, InstallVSIXAction -} from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +} from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; import { IExtensionManagementService, IExtensionManagementServerService, IExtensionManagementServer, EnablementState } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; +import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import { ExtensionsListView, EnabledExtensionsView, DisabledExtensionsView, RecommendedExtensionsView, WorkspaceRecommendedExtensionsView, BuiltInExtensionsView, BuiltInThemesExtensionsView, BuiltInBasicsExtensionsView, GroupByServerExtensionsView, DefaultRecommendedExtensionsView } from './extensionsViews'; -import { OpenGlobalSettingsAction } from 'vs/workbench/parts/preferences/browser/preferencesActions'; +import { OpenGlobalSettingsAction } from 'vs/workbench/contrib/preferences/browser/preferencesActions'; import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import Severity from 'vs/base/common/severity'; @@ -47,8 +47,8 @@ import { IWindowService } from 'vs/platform/windows/common/windows'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IAddedViewDescriptorRef } from 'vs/workbench/browser/parts/views/views'; import { ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; -import { Query } from 'vs/workbench/parts/extensions/common/extensionQuery'; -import { SuggestEnabledInput, attachSuggestEnabledInputBoxStyler } from 'vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput'; +import { Query } from 'vs/workbench/contrib/extensions/common/extensionQuery'; +import { SuggestEnabledInput, attachSuggestEnabledInputBoxStyler } from 'vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput'; import { alert } from 'vs/base/browser/ui/aria/aria'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts index 58e70c850e1..849f8161da7 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsViews.ts @@ -15,32 +15,32 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { append, $, toggleClass } from 'vs/base/browser/dom'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { Delegate, Renderer, IExtensionsViewState } from 'vs/workbench/parts/extensions/electron-browser/extensionsList'; +import { Delegate, Renderer, IExtensionsViewState } from 'vs/workbench/contrib/extensions/electron-browser/extensionsList'; import { IExtension, IExtensionsWorkbenchService } from '../common/extensions'; import { Query } from '../common/extensionQuery'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; -import { OpenGlobalSettingsAction } from 'vs/workbench/parts/preferences/browser/preferencesActions'; +import { OpenGlobalSettingsAction } from 'vs/workbench/contrib/preferences/browser/preferencesActions'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IModeService } from 'vs/editor/common/services/modeService'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { ActionBar, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; -import { InstallWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction, ManageExtensionAction } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +import { InstallWorkspaceRecommendedExtensionsAction, ConfigureWorkspaceFolderRecommendedExtensionsAction, ManageExtensionAction } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; import { WorkbenchPagedList } from 'vs/platform/list/browser/listService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { distinct } from 'vs/base/common/arrays'; -import { IExperimentService, IExperiment, ExperimentActionType } from 'vs/workbench/parts/experiments/node/experimentService'; +import { IExperimentService, IExperiment, ExperimentActionType } from 'vs/workbench/contrib/experiments/node/experimentService'; import { alert } from 'vs/base/browser/ui/aria/aria'; import { IListContextMenuEvent } from 'vs/base/browser/ui/list/list'; import { createErrorWithActions } from 'vs/base/common/errorsWithActions'; import { CancellationToken } from 'vs/base/common/cancellation'; -import { getKeywordsForExtension } from 'vs/workbench/parts/extensions/electron-browser/extensionsUtils'; +import { getKeywordsForExtension } from 'vs/workbench/contrib/extensions/electron-browser/extensionsUtils'; import { IAction } from 'vs/base/common/actions'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts b/src/vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts index 09f35375ec2..6a8df74d64a 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/extensionsWidgets.ts @@ -11,7 +11,7 @@ import * as platform from 'vs/base/common/platform'; import { localize } from 'vs/nls'; import { IExtensionManagementServerService, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ILabelService } from 'vs/platform/label/common/label'; -import { extensionButtonProminentBackground, extensionButtonProminentForeground } from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; +import { extensionButtonProminentBackground, extensionButtonProminentForeground } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { STATUS_BAR_HOST_NAME_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; diff --git a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts index d8b3b30fe8b..357adbe4cf0 100644 --- a/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts +++ b/src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsEditor.ts @@ -12,7 +12,7 @@ import { Action, IAction } from 'vs/base/common/actions'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation'; -import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsWorkbenchService, IExtension } from 'vs/workbench/contrib/extensions/common/extensions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IExtensionService, IExtensionDescription, IExtensionsStatus, IExtensionHostProfile } from 'vs/workbench/services/extensions/common/extensions'; @@ -33,7 +33,7 @@ import { isNonEmptyArray } from 'vs/base/common/arrays'; import { Event } from 'vs/base/common/event'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { RuntimeExtensionsInput } from 'vs/workbench/services/extensions/electron-browser/runtimeExtensionsInput'; -import { IDebugService } from 'vs/workbench/parts/debug/common/debug'; +import { IDebugService } from 'vs/workbench/contrib/debug/common/debug'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { randomPort } from 'vs/base/node/ports'; import { IContextKeyService, RawContextKey, IContextKey } from 'vs/platform/contextkey/common/contextkey'; diff --git a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts index 3a5c4e528c9..d096b50e2b5 100644 --- a/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/contrib/extensions/node/extensionsWorkbenchService.ts @@ -22,10 +22,10 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IWindowService } from 'vs/platform/windows/common/windows'; import Severity from 'vs/base/common/severity'; import { URI } from 'vs/base/common/uri'; -import { IExtension, IExtensionDependencies, ExtensionState, IExtensionsWorkbenchService, AutoUpdateConfigurationKey, AutoCheckUpdatesConfigurationKey } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtension, IExtensionDependencies, ExtensionState, IExtensionsWorkbenchService, AutoUpdateConfigurationKey, AutoCheckUpdatesConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { IURLService, IURLHandler } from 'vs/platform/url/common/url'; -import { ExtensionsInput } from 'vs/workbench/parts/extensions/common/extensionsInput'; +import { ExtensionsInput } from 'vs/workbench/contrib/extensions/common/extensionsInput'; import product from 'vs/platform/node/product'; import { ILogService } from 'vs/platform/log/common/log'; import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress'; diff --git a/src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts b/src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts index 0b631635e5f..c998dc997d5 100644 --- a/src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts +++ b/src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { Query } from 'vs/workbench/parts/extensions/common/extensionQuery'; +import { Query } from 'vs/workbench/contrib/extensions/common/extensionQuery'; suite('Extension query', () => { test('parse', () => { diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts index 3cebcc96d55..8f631fb0220 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsActions.test.ts @@ -6,16 +6,16 @@ import * as assert from 'assert'; import { assign } from 'vs/base/common/objects'; import { generateUuid } from 'vs/base/common/uuid'; -import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; -import * as ExtensionsActions from 'vs/workbench/parts/extensions/electron-browser/extensionsActions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/node/extensionsWorkbenchService'; +import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; +import * as ExtensionsActions from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, EnablementState, InstallOperation, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/platform/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-browser/extensionTipsService'; +import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService'; import { IURLService } from 'vs/platform/url/common/url'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts index 64a23326120..00a577f03d5 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsTipsService.test.ts @@ -14,7 +14,7 @@ import { IExtensionGalleryService, IGalleryExtensionAssets, IGalleryExtension, IExtensionManagementService, IExtensionEnablementService, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-browser/extensionTipsService'; +import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { Emitter } from 'vs/base/common/event'; @@ -34,7 +34,7 @@ import { IPager } from 'vs/base/common/paging'; import { assign } from 'vs/base/common/objects'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; -import { ConfigurationKey } from 'vs/workbench/parts/extensions/common/extensions'; +import { ConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test'; import { IURLService } from 'vs/platform/url/common/url'; @@ -44,8 +44,8 @@ import { IModelService } from 'vs/editor/common/services/modelService'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { INotificationService, Severity, IPromptChoice, IPromptOptions } from 'vs/platform/notification/common/notification'; import { URLService } from 'vs/platform/url/common/urlService'; -import { IExperimentService } from 'vs/workbench/parts/experiments/node/experimentService'; -import { TestExperimentService } from 'vs/workbench/parts/experiments/test/electron-browser/experimentService.test'; +import { IExperimentService } from 'vs/workbench/contrib/experiments/node/experimentService'; +import { TestExperimentService } from 'vs/workbench/contrib/experiments/test/electron-browser/experimentService.test'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts index 72ca6a677ea..0a1f69387ab 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsViews.test.ts @@ -6,17 +6,17 @@ import * as assert from 'assert'; import { assign } from 'vs/base/common/objects'; import { generateUuid } from 'vs/base/common/uuid'; -import { ExtensionsListView } from 'vs/workbench/parts/extensions/electron-browser/extensionsViews'; +import { ExtensionsListView } from 'vs/workbench/contrib/extensions/electron-browser/extensionsViews'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/node/extensionsWorkbenchService'; +import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, IQueryOptions, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IExtensionIdentifier, IExtensionManagementServerService, IExtensionManagementServer, EnablementState, ExtensionRecommendationReason, SortBy } from 'vs/platform/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-browser/extensionTipsService'; +import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService'; import { IURLService } from 'vs/platform/url/common/url'; @@ -34,7 +34,7 @@ import { URLService } from 'vs/platform/url/common/urlService'; import { URI } from 'vs/base/common/uri'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { SinonStub } from 'sinon'; -import { IExperimentService, ExperimentService, ExperimentState, ExperimentActionType } from 'vs/workbench/parts/experiments/node/experimentService'; +import { IExperimentService, ExperimentService, ExperimentState, ExperimentActionType } from 'vs/workbench/contrib/experiments/node/experimentService'; import { IRemoteAgentService } from 'vs/workbench/services/remote/node/remoteAgentService'; import { RemoteAgentService } from 'vs/workbench/services/remote/electron-browser/remoteAgentServiceImpl'; import { ExtensionManagementServerService } from 'vs/workbench/services/extensions/node/extensionManagementServerService'; diff --git a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts index 2abd6bb2a40..12aaa830bf9 100644 --- a/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts +++ b/src/vs/workbench/contrib/extensions/test/electron-browser/extensionsWorkbenchService.test.ts @@ -8,15 +8,15 @@ import * as assert from 'assert'; import * as fs from 'fs'; import { assign } from 'vs/base/common/objects'; import { generateUuid } from 'vs/base/common/uuid'; -import { IExtensionsWorkbenchService, ExtensionState, AutoCheckUpdatesConfigurationKey, AutoUpdateConfigurationKey } from 'vs/workbench/parts/extensions/common/extensions'; -import { ExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/node/extensionsWorkbenchService'; +import { IExtensionsWorkbenchService, ExtensionState, AutoCheckUpdatesConfigurationKey, AutoUpdateConfigurationKey } from 'vs/workbench/contrib/extensions/common/extensions'; +import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/node/extensionsWorkbenchService'; import { IExtensionManagementService, IExtensionGalleryService, IExtensionEnablementService, IExtensionTipsService, ILocalExtension, IGalleryExtension, DidInstallExtensionEvent, DidUninstallExtensionEvent, InstallExtensionEvent, IGalleryExtensionAssets, IExtensionIdentifier, EnablementState, InstallOperation, IExtensionManagementServerService, IExtensionManagementServer } from 'vs/platform/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { ExtensionManagementService } from 'vs/platform/extensionManagement/node/extensionManagementService'; -import { ExtensionTipsService } from 'vs/workbench/parts/extensions/electron-browser/extensionTipsService'; +import { ExtensionTipsService } from 'vs/workbench/contrib/extensions/electron-browser/extensionTipsService'; import { TestExtensionEnablementService } from 'vs/platform/extensionManagement/test/electron-browser/extensionEnablementService.test'; import { ExtensionGalleryService } from 'vs/platform/extensionManagement/node/extensionGalleryService'; import { IURLService } from 'vs/platform/url/common/url'; diff --git a/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts b/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts index ef27bf5a6e8..42adc6b0d99 100644 --- a/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts +++ b/src/vs/workbench/contrib/feedback/electron-browser/feedback.contribution.ts @@ -6,7 +6,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IStatusbarRegistry, Extensions, StatusbarItemDescriptor } from 'vs/workbench/browser/parts/statusbar/statusbar'; import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; -import { FeedbackStatusbarItem } from 'vs/workbench/parts/feedback/electron-browser/feedbackStatusbarItem'; +import { FeedbackStatusbarItem } from 'vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem'; import { localize } from 'vs/nls'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; diff --git a/src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts b/src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts index 05db4b3c1db..ab3448d9b61 100644 --- a/src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts +++ b/src/vs/workbench/contrib/feedback/electron-browser/feedbackStatusbarItem.ts @@ -5,7 +5,7 @@ import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar'; -import { FeedbackDropdown, IFeedback, IFeedbackDelegate, FEEDBACK_VISIBLE_CONFIG, IFeedbackDropdownOptions } from 'vs/workbench/parts/feedback/electron-browser/feedback'; +import { FeedbackDropdown, IFeedback, IFeedbackDelegate, FEEDBACK_VISIBLE_CONFIG, IFeedbackDropdownOptions } from 'vs/workbench/contrib/feedback/electron-browser/feedback'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import product from 'vs/platform/node/product'; diff --git a/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts b/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts index bb43de19df7..a928e36712a 100644 --- a/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts +++ b/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.ts @@ -9,9 +9,9 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { EditorInput, EditorOptions } from 'vs/workbench/common/editor'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { URI } from 'vs/base/common/uri'; -import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; +import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/contrib/files/common/files'; import { IFileService } from 'vs/platform/files/common/files'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IStorageService } from 'vs/platform/storage/common/storage'; diff --git a/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts index 3bcdf9b9fdc..4d1c172e8c4 100644 --- a/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts +++ b/src/vs/workbench/contrib/files/browser/editors/fileEditorTracker.ts @@ -10,7 +10,7 @@ import { IEditorViewState } from 'vs/editor/common/editorCommon'; import { toResource, SideBySideEditorInput, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { ITextFileService, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles'; import { FileOperationEvent, FileOperation, IFileService, FileChangeType, FileChangesEvent } from 'vs/platform/files/common/files'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { Disposable } from 'vs/base/common/lifecycle'; import { distinct } from 'vs/base/common/arrays'; @@ -22,7 +22,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { isCodeEditor } from 'vs/editor/browser/editorBrowser'; import { SideBySideEditor } from 'vs/workbench/browser/parts/editor/sideBySideEditor'; import { IWindowService } from 'vs/platform/windows/common/windows'; -import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; +import { BINARY_FILE_EDITOR_ID } from 'vs/workbench/contrib/files/common/files'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService'; import { ResourceQueue, timeout } from 'vs/base/common/async'; diff --git a/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts index acc992e3cae..9c89c868bfc 100644 --- a/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts +++ b/src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts @@ -8,12 +8,12 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import * as types from 'vs/base/common/types'; import * as paths from 'vs/base/common/paths'; import { Action } from 'vs/base/common/actions'; -import { VIEWLET_ID, TEXT_FILE_EDITOR_ID, IExplorerService } from 'vs/workbench/parts/files/common/files'; +import { VIEWLET_ID, TEXT_FILE_EDITOR_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files'; import { ITextFileEditorModel, ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { BaseTextEditor, IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor'; import { EditorOptions, TextEditorOptions, IEditorCloseEvent } from 'vs/workbench/common/editor'; import { BinaryEditorModel } from 'vs/workbench/common/editor/binaryEditorModel'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { FileOperationError, FileOperationResult, FileChangesEvent, IFileService, FALLBACK_MAX_MEMORY_SIZE_MB, MIN_MAX_MEMORY_SIZE_MB } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; diff --git a/src/vs/workbench/contrib/files/browser/files.ts b/src/vs/workbench/contrib/files/browser/files.ts index 006ae8c00db..73428f84eda 100644 --- a/src/vs/workbench/contrib/files/browser/files.ts +++ b/src/vs/workbench/contrib/files/browser/files.ts @@ -5,11 +5,11 @@ import { URI } from 'vs/base/common/uri'; import { IListService, WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService'; -import { OpenEditor } from 'vs/workbench/parts/files/common/files'; +import { OpenEditor } from 'vs/workbench/contrib/files/common/files'; import { toResource } from 'vs/workbench/common/editor'; import { List } from 'vs/base/browser/ui/list/listWidget'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; +import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { coalesce } from 'vs/base/common/arrays'; // Commands can get exeucted from a command pallete, from a context menu or from some list using a keybinding diff --git a/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts b/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts index 4ab6e130c6a..201452f8d45 100644 --- a/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts +++ b/src/vs/workbench/contrib/files/common/dirtyFilesTracker.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { VIEWLET_ID } from 'vs/workbench/parts/files/common/files'; +import { VIEWLET_ID } from 'vs/workbench/contrib/files/common/files'; import { TextFileModelChangeEvent, ITextFileService, AutoSaveMode, ModelState } from 'vs/workbench/services/textfile/common/textfiles'; import { platform, Platform } from 'vs/base/common/platform'; import { IWindowService } from 'vs/platform/windows/common/windows'; diff --git a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts index 78c08b20065..5d141dac753 100644 --- a/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts +++ b/src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts @@ -18,7 +18,7 @@ import { IReference } from 'vs/base/common/lifecycle'; import { telemetryURIDescriptor } from 'vs/platform/telemetry/common/telemetryUtils'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; -import { FILE_EDITOR_INPUT_ID, TEXT_FILE_EDITOR_ID, BINARY_FILE_EDITOR_ID } from 'vs/workbench/parts/files/common/files'; +import { FILE_EDITOR_INPUT_ID, TEXT_FILE_EDITOR_ID, BINARY_FILE_EDITOR_ID } from 'vs/workbench/contrib/files/common/files'; import { ILabelService } from 'vs/platform/label/common/label'; /** diff --git a/src/vs/workbench/contrib/files/common/files.ts b/src/vs/workbench/contrib/files/common/files.ts index 9b8cbdf5d29..c2009aa0295 100644 --- a/src/vs/workbench/contrib/files/common/files.ts +++ b/src/vs/workbench/contrib/files/common/files.ts @@ -21,7 +21,7 @@ import { IViewContainersRegistry, Extensions as ViewContainerExtensions, ViewCon import { Schemas } from 'vs/base/common/network'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService'; -import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; +import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; /** * Explorer viewlet id. diff --git a/src/vs/workbench/contrib/files/electron-browser/explorerService.ts b/src/vs/workbench/contrib/files/electron-browser/explorerService.ts index 036e6690269..a4e4689adb7 100644 --- a/src/vs/workbench/contrib/files/electron-browser/explorerService.ts +++ b/src/vs/workbench/contrib/files/electron-browser/explorerService.ts @@ -6,8 +6,8 @@ import { Event, Emitter } from 'vs/base/common/event'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { IExplorerService, IEditableData, IFilesConfiguration, SortOrder, SortOrderConfiguration } from 'vs/workbench/parts/files/common/files'; -import { ExplorerItem, ExplorerModel } from 'vs/workbench/parts/files/common/explorerModel'; +import { IExplorerService, IEditableData, IFilesConfiguration, SortOrder, SortOrderConfiguration } from 'vs/workbench/contrib/files/common/files'; +import { ExplorerItem, ExplorerModel } from 'vs/workbench/contrib/files/common/explorerModel'; import { URI } from 'vs/base/common/uri'; import { FileOperationEvent, FileOperation, IFileStat, IFileService, FileChangesEvent, FILES_EXCLUDE_CONFIG, FileChangeType, IResolveFileOptions } from 'vs/platform/files/common/files'; import { dirname } from 'vs/base/common/resources'; diff --git a/src/vs/workbench/contrib/files/electron-browser/explorerViewlet.ts b/src/vs/workbench/contrib/files/electron-browser/explorerViewlet.ts index 5d546ccb1a6..b6728c210d8 100644 --- a/src/vs/workbench/contrib/files/electron-browser/explorerViewlet.ts +++ b/src/vs/workbench/contrib/files/electron-browser/explorerViewlet.ts @@ -6,12 +6,12 @@ import 'vs/css!./media/explorerviewlet'; import { localize } from 'vs/nls'; import * as DOM from 'vs/base/browser/dom'; -import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration, OpenEditorsVisibleContext, OpenEditorsVisibleCondition, VIEW_CONTAINER } from 'vs/workbench/parts/files/common/files'; +import { VIEWLET_ID, ExplorerViewletVisibleContext, IFilesConfiguration, OpenEditorsVisibleContext, OpenEditorsVisibleCondition, VIEW_CONTAINER } from 'vs/workbench/contrib/files/common/files'; import { ViewContainerViewlet, IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewlet'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; -import { ExplorerView } from 'vs/workbench/parts/files/electron-browser/views/explorerView'; -import { EmptyView } from 'vs/workbench/parts/files/electron-browser/views/emptyView'; -import { OpenEditorsView } from 'vs/workbench/parts/files/electron-browser/views/openEditorsView'; +import { ExplorerView } from 'vs/workbench/contrib/files/electron-browser/views/explorerView'; +import { EmptyView } from 'vs/workbench/contrib/files/electron-browser/views/emptyView'; +import { OpenEditorsView } from 'vs/workbench/contrib/files/electron-browser/views/openEditorsView'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts b/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts index 3a75d49e119..c9be944b28f 100644 --- a/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts +++ b/src/vs/workbench/contrib/files/electron-browser/fileActions.contribution.ts @@ -5,17 +5,17 @@ import * as nls from 'vs/nls'; import { Registry } from 'vs/platform/registry/common/platform'; -import { ToggleAutoSaveAction, GlobalNewUntitledFileAction, ShowOpenedFileInNewWindow, FocusFilesExplorer, GlobalCompareResourcesAction, SaveAllAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView, CompareWithClipboardAction, NEW_FILE_COMMAND_ID, NEW_FILE_LABEL, NEW_FOLDER_COMMAND_ID, NEW_FOLDER_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, renameHandler, moveFileToTrashHandler, copyFileHandler, pasteFileHandler, deleteFileHandler, cutFileHandler } from 'vs/workbench/parts/files/electron-browser/fileActions'; -import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vs/workbench/parts/files/electron-browser/saveErrorHandler'; +import { ToggleAutoSaveAction, GlobalNewUntitledFileAction, ShowOpenedFileInNewWindow, FocusFilesExplorer, GlobalCompareResourcesAction, SaveAllAction, ShowActiveFileInExplorer, CollapseExplorerView, RefreshExplorerView, CompareWithClipboardAction, NEW_FILE_COMMAND_ID, NEW_FILE_LABEL, NEW_FOLDER_COMMAND_ID, NEW_FOLDER_LABEL, TRIGGER_RENAME_LABEL, MOVE_FILE_TO_TRASH_LABEL, COPY_FILE_LABEL, PASTE_FILE_LABEL, FileCopiedContext, renameHandler, moveFileToTrashHandler, copyFileHandler, pasteFileHandler, deleteFileHandler, cutFileHandler } from 'vs/workbench/contrib/files/electron-browser/fileActions'; +import { revertLocalChangesCommand, acceptLocalChangesCommand, CONFLICT_RESOLUTION_CONTEXT } from 'vs/workbench/contrib/files/electron-browser/saveErrorHandler'; import { SyncActionDescriptor, MenuId, MenuRegistry, ILocalizedString } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes'; -import { openWindowCommand, REVEAL_IN_OS_COMMAND_ID, COPY_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_TO_SIDE_COMMAND_ID, REVERT_FILE_COMMAND_ID, SAVE_FILE_COMMAND_ID, SAVE_FILE_LABEL, SAVE_FILE_AS_COMMAND_ID, SAVE_FILE_AS_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID, OpenEditorsGroupContext, COMPARE_WITH_SAVED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, REVEAL_IN_OS_LABEL, DirtyEditorContext, COMPARE_SELECTED_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, REMOVE_ROOT_FOLDER_LABEL, SAVE_FILES_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_LABEL } from 'vs/workbench/parts/files/electron-browser/fileCommands'; +import { openWindowCommand, REVEAL_IN_OS_COMMAND_ID, COPY_PATH_COMMAND_ID, REVEAL_IN_EXPLORER_COMMAND_ID, OPEN_TO_SIDE_COMMAND_ID, REVERT_FILE_COMMAND_ID, SAVE_FILE_COMMAND_ID, SAVE_FILE_LABEL, SAVE_FILE_AS_COMMAND_ID, SAVE_FILE_AS_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID, OpenEditorsGroupContext, COMPARE_WITH_SAVED_COMMAND_ID, COMPARE_RESOURCE_COMMAND_ID, SELECT_FOR_COMPARE_COMMAND_ID, ResourceSelectedForCompareContext, REVEAL_IN_OS_LABEL, DirtyEditorContext, COMPARE_SELECTED_COMMAND_ID, REMOVE_ROOT_FOLDER_COMMAND_ID, REMOVE_ROOT_FOLDER_LABEL, SAVE_FILES_COMMAND_ID, COPY_RELATIVE_PATH_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_COMMAND_ID, SAVE_FILE_WITHOUT_FORMATTING_LABEL } from 'vs/workbench/contrib/files/electron-browser/fileCommands'; import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { isWindows, isMacintosh } from 'vs/base/common/platform'; -import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerFolderContext, ExplorerResourceNotReadonlyContext, ExplorerResourceCut, IExplorerService } from 'vs/workbench/parts/files/common/files'; +import { FilesExplorerFocusCondition, ExplorerRootContext, ExplorerFolderContext, ExplorerResourceNotReadonlyContext, ExplorerResourceCut, IExplorerService } from 'vs/workbench/contrib/files/common/files'; import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL } from 'vs/workbench/browser/actions/workspaceCommands'; import { CLOSE_SAVED_EDITORS_COMMAND_ID, CLOSE_EDITORS_IN_GROUP_COMMAND_ID, CLOSE_EDITOR_COMMAND_ID, CLOSE_OTHER_EDITORS_IN_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands'; import { AutoSaveContext } from 'vs/workbench/services/textfile/common/textfiles'; @@ -159,12 +159,12 @@ function appendEditorTitleContextMenuItem(id: string, title: string, when: Conte // Editor Title Menu for Conflict Resolution appendSaveConflictEditorTitleAction('workbench.files.action.acceptLocalChanges', nls.localize('acceptLocalChanges', "Use your changes and overwrite disk contents"), { - light: URI.parse(require.toUrl(`vs/workbench/parts/files/electron-browser/media/check.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/files/electron-browser/media/check-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/files/electron-browser/media/check.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/files/electron-browser/media/check-inverse.svg`)) }, -10, acceptLocalChangesCommand); appendSaveConflictEditorTitleAction('workbench.files.action.revertLocalChanges', nls.localize('revertLocalChanges', "Discard your changes and revert to content on disk"), { - light: URI.parse(require.toUrl(`vs/workbench/parts/files/electron-browser/media/undo.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/files/electron-browser/media/undo-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/files/electron-browser/media/undo.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/files/electron-browser/media/undo-inverse.svg`)) }, -9, revertLocalChangesCommand); function appendSaveConflictEditorTitleAction(id: string, title: string, iconLocation: { dark: URI; light?: URI; }, order: number, command: ICommandHandler): void { diff --git a/src/vs/workbench/contrib/files/electron-browser/fileActions.ts b/src/vs/workbench/contrib/files/electron-browser/fileActions.ts index 420a845ae97..0f81c91f750 100644 --- a/src/vs/workbench/contrib/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/contrib/files/electron-browser/fileActions.ts @@ -14,18 +14,18 @@ import { toErrorMessage } from 'vs/base/common/errorMessage'; import * as strings from 'vs/base/common/strings'; import { Action } from 'vs/base/common/actions'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { VIEWLET_ID, IExplorerService } from 'vs/workbench/parts/files/common/files'; +import { VIEWLET_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IFileService, AutoSaveConfiguration } from 'vs/platform/files/common/files'; import { toResource, IUntitledResourceInput } from 'vs/workbench/common/editor'; -import { ExplorerViewlet } from 'vs/workbench/parts/files/electron-browser/explorerViewlet'; +import { ExplorerViewlet } from 'vs/workbench/contrib/files/electron-browser/explorerViewlet'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IInstantiationService, ServicesAccessor, IConstructorSignature1 } from 'vs/platform/instantiation/common/instantiation'; import { ITextModel } from 'vs/editor/common/model'; import { IWindowService } from 'vs/platform/windows/common/windows'; -import { REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID } from 'vs/workbench/parts/files/electron-browser/fileCommands'; +import { REVEAL_IN_EXPLORER_COMMAND_ID, SAVE_ALL_COMMAND_ID, SAVE_ALL_LABEL, SAVE_ALL_IN_GROUP_COMMAND_ID } from 'vs/workbench/contrib/files/electron-browser/fileCommands'; import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; @@ -43,7 +43,7 @@ import { CLOSE_EDITORS_AND_GROUP_COMMAND_ID } from 'vs/workbench/browser/parts/e import { IViewlet } from 'vs/workbench/common/viewlet'; import { coalesce } from 'vs/base/common/arrays'; import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree'; -import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; +import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { onUnexpectedError } from 'vs/base/common/errors'; import { sequence } from 'vs/base/common/async'; diff --git a/src/vs/workbench/contrib/files/electron-browser/fileCommands.ts b/src/vs/workbench/contrib/files/electron-browser/fileCommands.ts index 0bd9b93fcc5..4ad9285800d 100644 --- a/src/vs/workbench/contrib/files/electron-browser/fileCommands.ts +++ b/src/vs/workbench/contrib/files/electron-browser/fileCommands.ts @@ -11,8 +11,8 @@ import { IWindowsService, IWindowService } from 'vs/platform/windows/common/wind import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ExplorerFocusCondition, FileOnDiskContentProvider, VIEWLET_ID, IExplorerService } from 'vs/workbench/parts/files/common/files'; -import { ExplorerViewlet } from 'vs/workbench/parts/files/electron-browser/explorerViewlet'; +import { ExplorerFocusCondition, FileOnDiskContentProvider, VIEWLET_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files'; +import { ExplorerViewlet } from 'vs/workbench/contrib/files/electron-browser/explorerViewlet'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { ITextFileService, ISaveOptions } from 'vs/workbench/services/textfile/common/textfiles'; import { toErrorMessage } from 'vs/base/common/errorMessage'; @@ -29,7 +29,7 @@ import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; import { isWindows, isMacintosh } from 'vs/base/common/platform'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { sequence } from 'vs/base/common/async'; -import { getResourceForCommand, getMultiSelectedResources } from 'vs/workbench/parts/files/browser/files'; +import { getResourceForCommand, getMultiSelectedResources } from 'vs/workbench/contrib/files/browser/files'; import { IWorkspaceEditingService } from 'vs/workbench/services/workspace/common/workspaceEditing'; import { getMultiSelectedEditorContexts } from 'vs/workbench/browser/parts/editor/editorCommands'; import { Schemas } from 'vs/base/common/network'; diff --git a/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts b/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts index a0bfe75ae60..f4caea0d086 100644 --- a/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts +++ b/src/vs/workbench/contrib/files/electron-browser/files.contribution.ts @@ -13,20 +13,20 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IEditorInputFactory, EditorInput, IFileEditorInput, IEditorInputFactoryRegistry, Extensions as EditorInputExtensions } from 'vs/workbench/common/editor'; import { AutoSaveConfiguration, HotExitConfiguration, SUPPORTED_ENCODINGS } from 'vs/platform/files/common/files'; -import { VIEWLET_ID, SortOrderConfiguration, FILE_EDITOR_INPUT_ID, IExplorerService } from 'vs/workbench/parts/files/common/files'; -import { FileEditorTracker } from 'vs/workbench/parts/files/browser/editors/fileEditorTracker'; -import { SaveErrorHandler } from 'vs/workbench/parts/files/electron-browser/saveErrorHandler'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; -import { TextFileEditor } from 'vs/workbench/parts/files/browser/editors/textFileEditor'; -import { BinaryFileEditor } from 'vs/workbench/parts/files/browser/editors/binaryFileEditor'; +import { VIEWLET_ID, SortOrderConfiguration, FILE_EDITOR_INPUT_ID, IExplorerService } from 'vs/workbench/contrib/files/common/files'; +import { FileEditorTracker } from 'vs/workbench/contrib/files/browser/editors/fileEditorTracker'; +import { SaveErrorHandler } from 'vs/workbench/contrib/files/electron-browser/saveErrorHandler'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; +import { TextFileEditor } from 'vs/workbench/contrib/files/browser/editors/textFileEditor'; +import { BinaryFileEditor } from 'vs/workbench/contrib/files/browser/editors/binaryFileEditor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import * as platform from 'vs/base/common/platform'; -import { DirtyFilesTracker } from 'vs/workbench/parts/files/common/dirtyFilesTracker'; -import { ExplorerViewlet, ExplorerViewletViewsContribution } from 'vs/workbench/parts/files/electron-browser/explorerViewlet'; +import { DirtyFilesTracker } from 'vs/workbench/contrib/files/common/dirtyFilesTracker'; +import { ExplorerViewlet, ExplorerViewletViewsContribution } from 'vs/workbench/contrib/files/electron-browser/explorerViewlet'; import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; import { DataUriEditorInput } from 'vs/workbench/common/editor/dataUriEditorInput'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; @@ -36,7 +36,7 @@ import { ILabelService } from 'vs/platform/label/common/label'; import { nativeSep } from 'vs/base/common/paths'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { ExplorerService } from 'vs/workbench/parts/files/electron-browser/explorerService'; +import { ExplorerService } from 'vs/workbench/contrib/files/electron-browser/explorerService'; // Viewlet Action export class OpenExplorerViewletAction extends ShowViewletAction { diff --git a/src/vs/workbench/contrib/files/electron-browser/saveErrorHandler.ts b/src/vs/workbench/contrib/files/electron-browser/saveErrorHandler.ts index 896fe0e9717..c6ebe282cac 100644 --- a/src/vs/workbench/contrib/files/electron-browser/saveErrorHandler.ts +++ b/src/vs/workbench/contrib/files/electron-browser/saveErrorHandler.ts @@ -19,10 +19,10 @@ import { ResourceMap } from 'vs/base/common/map'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorInput'; import { IContextKeyService, IContextKey, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; -import { FileOnDiskContentProvider } from 'vs/workbench/parts/files/common/files'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import { FileOnDiskContentProvider } from 'vs/workbench/contrib/files/common/files'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { SAVE_FILE_COMMAND_ID, REVERT_FILE_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_FILE_AS_LABEL } from 'vs/workbench/parts/files/electron-browser/fileCommands'; +import { SAVE_FILE_COMMAND_ID, REVERT_FILE_COMMAND_ID, SAVE_FILE_AS_COMMAND_ID, SAVE_FILE_AS_LABEL } from 'vs/workbench/contrib/files/electron-browser/fileCommands'; import { createTextBufferFactoryFromSnapshot } from 'vs/editor/common/model/textModel'; import { INotificationService, INotificationHandle, INotificationActions, Severity } from 'vs/platform/notification/common/notification'; import { IOpenerService } from 'vs/platform/opener/common/opener'; diff --git a/src/vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts index 46cc8f53195..f6c4e49f923 100644 --- a/src/vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts +++ b/src/vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider.ts @@ -11,7 +11,7 @@ import { IDecorationsProvider, IDecorationData } from 'vs/workbench/services/dec import { listInvalidItemForeground } from 'vs/platform/theme/common/colorRegistry'; import { IDisposable } from 'vscode-xterm'; import { dispose } from 'vs/base/common/lifecycle'; -import { IExplorerService } from 'vs/workbench/parts/files/common/files'; +import { IExplorerService } from 'vs/workbench/contrib/files/common/files'; export class ExplorerDecorationsProvider implements IDecorationsProvider { readonly label: string = localize('label', "Explorer"); diff --git a/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts index f42a9d00cce..af6e35beda5 100644 --- a/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts @@ -9,14 +9,14 @@ import * as perf from 'vs/base/common/performance'; import { sequence } from 'vs/base/common/async'; import { Action, IAction } from 'vs/base/common/actions'; import { memoize } from 'vs/base/common/decorators'; -import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, IExplorerService, ExplorerResourceCut } from 'vs/workbench/parts/files/common/files'; -import { NewFolderAction, NewFileAction, FileCopiedContext, RefreshExplorerView } from 'vs/workbench/parts/files/electron-browser/fileActions'; +import { IFilesConfiguration, ExplorerFolderContext, FilesExplorerFocusedContext, ExplorerFocusedContext, ExplorerRootContext, ExplorerResourceReadonlyContext, IExplorerService, ExplorerResourceCut } from 'vs/workbench/contrib/files/common/files'; +import { NewFolderAction, NewFileAction, FileCopiedContext, RefreshExplorerView } from 'vs/workbench/contrib/files/electron-browser/fileActions'; import { toResource } from 'vs/workbench/common/editor'; import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput'; import * as DOM from 'vs/base/browser/dom'; import { CollapseAction2 } from 'vs/workbench/browser/viewlet'; import { IPartService } from 'vs/workbench/services/part/common/partService'; -import { ExplorerDecorationsProvider } from 'vs/workbench/parts/files/electron-browser/views/explorerDecorationsProvider'; +import { ExplorerDecorationsProvider } from 'vs/workbench/contrib/files/electron-browser/views/explorerDecorationsProvider'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; @@ -31,14 +31,14 @@ import { DelayedDragHandler } from 'vs/base/browser/dnd'; import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { IViewletPanelOptions, ViewletPanel } from 'vs/workbench/browser/parts/views/panelViewlet'; import { ILabelService } from 'vs/platform/label/common/label'; -import { ExplorerDelegate, ExplorerAccessibilityProvider, ExplorerDataSource, FilesRenderer, FilesFilter, FileSorter, FileDragAndDrop } from 'vs/workbench/parts/files/electron-browser/views/explorerViewer'; +import { ExplorerDelegate, ExplorerAccessibilityProvider, ExplorerDataSource, FilesRenderer, FilesFilter, FileSorter, FileDragAndDrop } from 'vs/workbench/contrib/files/electron-browser/views/explorerViewer'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { ITreeContextMenuEvent } from 'vs/base/browser/ui/tree/tree'; import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions'; import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemActionItem'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; +import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { onUnexpectedError } from 'vs/base/common/errors'; import { ResourceLabels, IResourceLabelsContainer } from 'vs/workbench/browser/labels'; import { createFileIconThemableTreeContainerScope } from 'vs/workbench/browser/parts/views/views'; diff --git a/src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts index 09a81cbd485..cc9213badac 100644 --- a/src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/electron-browser/views/explorerViewer.ts @@ -19,7 +19,7 @@ import { ITreeRenderer, ITreeNode, ITreeFilter, TreeVisibility, TreeFilterResult import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { IFilesConfiguration, IExplorerService, IEditableData } from 'vs/workbench/parts/files/common/files'; +import { IFilesConfiguration, IExplorerService, IEditableData } from 'vs/workbench/contrib/files/common/files'; import { dirname, joinPath, isEqualOrParent, basename, hasToIgnoreCase, distinctParents } from 'vs/base/common/resources'; import { InputBox, MessageType } from 'vs/base/browser/ui/inputbox/inputBox'; import { localize } from 'vs/nls'; @@ -29,7 +29,7 @@ import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { normalize } from 'vs/base/common/paths'; import { equals, deepClone } from 'vs/base/common/objects'; import * as path from 'path'; -import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; +import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; import { compareFileExtensions, compareFileNames } from 'vs/base/common/comparers'; import { fillResourceDataTransfers, CodeDataTransfers, extractResources } from 'vs/workbench/browser/dnd'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; @@ -45,7 +45,7 @@ import { URI } from 'vs/base/common/uri'; import { ITask, sequence } from 'vs/base/common/async'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; -import { findValidPasteFileTarget } from 'vs/workbench/parts/files/electron-browser/fileActions'; +import { findValidPasteFileTarget } from 'vs/workbench/contrib/files/electron-browser/fileActions'; import { FuzzyScore, createMatches } from 'vs/base/common/filters'; export class ExplorerDelegate implements IListVirtualDelegate { diff --git a/src/vs/workbench/contrib/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/contrib/files/electron-browser/views/openEditorsView.ts index 58e99c7a4e0..1e400d8e966 100644 --- a/src/vs/workbench/contrib/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/contrib/files/electron-browser/views/openEditorsView.ts @@ -13,8 +13,8 @@ import { IEditorGroupsService, IEditorGroup, GroupChangeKind, GroupsOrder } from import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { IEditorInput } from 'vs/workbench/common/editor'; -import { SaveAllAction, SaveAllInGroupAction, CloseGroupAction } from 'vs/workbench/parts/files/electron-browser/fileActions'; -import { OpenEditorsFocusedContext, ExplorerFocusedContext, IFilesConfiguration, OpenEditor } from 'vs/workbench/parts/files/common/files'; +import { SaveAllAction, SaveAllInGroupAction, CloseGroupAction } from 'vs/workbench/contrib/files/electron-browser/fileActions'; +import { OpenEditorsFocusedContext, ExplorerFocusedContext, IFilesConfiguration, OpenEditor } from 'vs/workbench/contrib/files/common/files'; import { ITextFileService, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles'; import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService'; import { CloseAllEditorsAction, CloseEditorAction } from 'vs/workbench/browser/parts/editor/editorActions'; @@ -32,7 +32,7 @@ import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { fillInContextMenuActions } from 'vs/platform/actions/browser/menuItemActionItem'; import { IMenuService, MenuId, IMenu } from 'vs/platform/actions/common/actions'; -import { DirtyEditorContext, OpenEditorsGroupContext } from 'vs/workbench/parts/files/electron-browser/fileCommands'; +import { DirtyEditorContext, OpenEditorsGroupContext } from 'vs/workbench/contrib/files/electron-browser/fileCommands'; import { ResourceContextKey } from 'vs/workbench/common/resources'; import { ResourcesDropHandler, fillResourceDataTransfers, CodeDataTransfers } from 'vs/workbench/browser/dnd'; import { ViewletPanel, IViewletPanelOptions } from 'vs/workbench/browser/parts/views/panelViewlet'; diff --git a/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts index 2e5676deab9..45881b72ff9 100644 --- a/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/fileEditorInput.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { join } from 'vs/base/common/paths'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { workbenchInstantiationService, TestTextFileService } from 'vs/workbench/test/workbenchTestServices'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; diff --git a/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts b/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts index 9bbe10b1640..364e35d5f1e 100644 --- a/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts +++ b/src/vs/workbench/contrib/files/test/browser/fileEditorTracker.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { FileEditorTracker } from 'vs/workbench/parts/files/browser/editors/fileEditorTracker'; +import { FileEditorTracker } from 'vs/workbench/contrib/files/browser/editors/fileEditorTracker'; import { URI } from 'vs/base/common/uri'; import { join } from 'vs/base/common/paths'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; diff --git a/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts b/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts index c7dc1ab2380..255aa26b5c3 100644 --- a/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts +++ b/src/vs/workbench/contrib/files/test/electron-browser/explorerModel.test.ts @@ -7,8 +7,8 @@ import * as assert from 'assert'; import { isLinux, isWindows } from 'vs/base/common/platform'; import { URI } from 'vs/base/common/uri'; import { join } from 'vs/base/common/paths'; -import { validateFileName } from 'vs/workbench/parts/files/electron-browser/fileActions'; -import { ExplorerItem } from 'vs/workbench/parts/files/common/explorerModel'; +import { validateFileName } from 'vs/workbench/contrib/files/electron-browser/fileActions'; +import { ExplorerItem } from 'vs/workbench/contrib/files/common/explorerModel'; function createStat(path: string, name: string, isFolder: boolean, hasChildren: boolean, size: number, mtime: number): ExplorerItem { return new ExplorerItem(toResource(path), null, isFolder, false, false, name, mtime); diff --git a/src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts b/src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts index 9e81712e79c..c0235370147 100644 --- a/src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts +++ b/src/vs/workbench/contrib/files/test/electron-browser/fileActions.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { incrementFileName } from 'vs/workbench/parts/files/electron-browser/fileActions'; +import { incrementFileName } from 'vs/workbench/contrib/files/electron-browser/fileActions'; suite('Files - Increment file name', () => { diff --git a/src/vs/workbench/contrib/html/electron-browser/html.contribution.ts b/src/vs/workbench/contrib/html/electron-browser/html.contribution.ts index 52d81834f51..eb5a030c6a9 100644 --- a/src/vs/workbench/contrib/html/electron-browser/html.contribution.ts +++ b/src/vs/workbench/contrib/html/electron-browser/html.contribution.ts @@ -14,9 +14,9 @@ import { HtmlPreviewPart } from './htmlPreviewPart'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService'; -import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; +import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { IEditorRegistry, EditorDescriptor, Extensions as EditorExtensions } from 'vs/workbench/browser/editor'; -import { registerWebViewCommands } from 'vs/workbench/parts/webview/electron-browser/webview.contribution'; +import { registerWebViewCommands } from 'vs/workbench/contrib/webview/electron-browser/webview.contribution'; // --- Register Editor diff --git a/src/vs/workbench/contrib/html/electron-browser/htmlPreviewPart.ts b/src/vs/workbench/contrib/html/electron-browser/htmlPreviewPart.ts index bc5959209a4..27a927a0bc6 100644 --- a/src/vs/workbench/contrib/html/electron-browser/htmlPreviewPart.ts +++ b/src/vs/workbench/contrib/html/electron-browser/htmlPreviewPart.ts @@ -8,7 +8,7 @@ import { Disposable, IDisposable, dispose, IReference } from 'vs/base/common/lif import { EditorOptions, EditorInput, IEditorMemento } from 'vs/workbench/common/editor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { BaseTextEditorModel } from 'vs/workbench/common/editor/textEditorModel'; -import { HtmlInput, HtmlInputOptions, areHtmlInputOptionsEqual } from 'vs/workbench/parts/html/common/htmlInput'; +import { HtmlInput, HtmlInputOptions, areHtmlInputOptionsEqual } from 'vs/workbench/contrib/html/common/htmlInput'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { ITextModelService, ITextEditorModel } from 'vs/editor/common/services/resolverService'; @@ -16,8 +16,8 @@ import { Parts, IPartService } from 'vs/workbench/services/part/common/partServi import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { Dimension } from 'vs/base/browser/dom'; -import { BaseWebviewEditor } from 'vs/workbench/parts/webview/electron-browser/baseWebviewEditor'; -import { WebviewElement, WebviewOptions } from 'vs/workbench/parts/webview/electron-browser/webviewElement'; +import { BaseWebviewEditor } from 'vs/workbench/contrib/webview/electron-browser/baseWebviewEditor'; +import { WebviewElement, WebviewOptions } from 'vs/workbench/contrib/webview/electron-browser/webviewElement'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService'; import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts b/src/vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts index f1d45ce3caa..5f18522d574 100644 --- a/src/vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts +++ b/src/vs/workbench/contrib/localizations/electron-browser/localizations.contribution.ts @@ -10,7 +10,7 @@ import { IJSONContributionRegistry, Extensions as JSONExtensions } from 'vs/plat import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { Disposable } from 'vs/base/common/lifecycle'; -import { ConfigureLocaleAction } from 'vs/workbench/parts/localizations/electron-browser/localizationsActions'; +import { ConfigureLocaleAction } from 'vs/workbench/contrib/localizations/electron-browser/localizationsActions'; import { ExtensionsRegistry } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { ILocalizationsService } from 'vs/platform/localizations/common/localizations'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; @@ -25,7 +25,7 @@ import { join } from 'vs/base/common/paths'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { VIEWLET_ID as EXTENSIONS_VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions'; +import { VIEWLET_ID as EXTENSIONS_VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions'; import { minimumTranslatedStrings } from 'vs/platform/node/minimalTranslations'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/contrib/logs/electron-browser/logs.contribution.ts b/src/vs/workbench/contrib/logs/electron-browser/logs.contribution.ts index 4015c9cd5de..c68dc48444b 100644 --- a/src/vs/workbench/contrib/logs/electron-browser/logs.contribution.ts +++ b/src/vs/workbench/contrib/logs/electron-browser/logs.contribution.ts @@ -7,16 +7,16 @@ import * as nls from 'vs/nls'; import { join } from 'vs/base/common/paths'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IOutputChannelRegistry, Extensions as OutputExt, } from 'vs/workbench/parts/output/common/output'; +import { IOutputChannelRegistry, Extensions as OutputExt, } from 'vs/workbench/contrib/output/common/output'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IWindowService } from 'vs/platform/windows/common/windows'; import { Disposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; -import * as Constants from 'vs/workbench/parts/logs/common/logConstants'; +import * as Constants from 'vs/workbench/contrib/logs/common/logConstants'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { OpenLogsFolderAction, SetLogLevelAction } from 'vs/workbench/parts/logs/electron-browser/logsActions'; +import { OpenLogsFolderAction, SetLogLevelAction } from 'vs/workbench/contrib/logs/electron-browser/logsActions'; import { ILogService, LogLevel } from 'vs/platform/log/common/log'; class LogOutputChannels extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/contrib/markers/electron-browser/markers.contribution.ts b/src/vs/workbench/contrib/markers/electron-browser/markers.contribution.ts index 765a7908f83..3b0941c9085 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markers.contribution.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markers.contribution.ts @@ -12,16 +12,16 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor import { KeybindingsRegistry, KeybindingWeight, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { localize } from 'vs/nls'; -import { Marker, RelatedInformation } from 'vs/workbench/parts/markers/electron-browser/markersModel'; -import { MarkersPanel } from 'vs/workbench/parts/markers/electron-browser/markersPanel'; +import { Marker, RelatedInformation } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; +import { MarkersPanel } from 'vs/workbench/contrib/markers/electron-browser/markersPanel'; import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel'; import { Registry } from 'vs/platform/registry/common/platform'; -import { ToggleMarkersPanelAction, ShowProblemsPanelAction } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; -import Constants from 'vs/workbench/parts/markers/electron-browser/constants'; -import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; +import { ToggleMarkersPanelAction, ShowProblemsPanelAction } from 'vs/workbench/contrib/markers/electron-browser/markersPanelActions'; +import Constants from 'vs/workbench/contrib/markers/electron-browser/constants'; +import Messages from 'vs/workbench/contrib/markers/electron-browser/messages'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { IMarkersWorkbenchService, MarkersWorkbenchService, ActivityUpdater } from 'vs/workbench/parts/markers/electron-browser/markers'; +import { IMarkersWorkbenchService, MarkersWorkbenchService, ActivityUpdater } from 'vs/workbench/contrib/markers/electron-browser/markers'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts b/src/vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts index aa198c662d9..d60a281553c 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersFilterOptions.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; +import Messages from 'vs/workbench/contrib/markers/electron-browser/messages'; import { IFilter, matchesPrefix, matchesFuzzy, matchesFuzzy2 } from 'vs/base/common/filters'; import { ParsedExpression, IExpression, splitGlobAware, getEmptyExpression, parse } from 'vs/base/common/glob'; import * as strings from 'vs/base/common/strings'; diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts index 0ab6213601a..47bd53267b6 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts @@ -11,16 +11,16 @@ import { IAction, IActionItem, Action } from 'vs/base/common/actions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { Panel } from 'vs/workbench/browser/panel'; import { IEditorService, SIDE_GROUP, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import Constants from 'vs/workbench/parts/markers/electron-browser/constants'; -import { Marker, ResourceMarkers, RelatedInformation, MarkersModel } from 'vs/workbench/parts/markers/electron-browser/markersModel'; +import Constants from 'vs/workbench/contrib/markers/electron-browser/constants'; +import { Marker, ResourceMarkers, RelatedInformation, MarkersModel } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { MarkersFilterActionItem, MarkersFilterAction, IMarkersFilterActionChangeEvent, IMarkerFilterController } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; +import { MarkersFilterActionItem, MarkersFilterAction, IMarkersFilterActionChangeEvent, IMarkerFilterController } from 'vs/workbench/contrib/markers/electron-browser/markersPanelActions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; +import Messages from 'vs/workbench/contrib/markers/electron-browser/messages'; import { RangeHighlightDecorations } from 'vs/workbench/browser/parts/editor/rangeDecorations'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/electron-browser/markers'; +import { IMarkersWorkbenchService } from 'vs/workbench/contrib/markers/electron-browser/markers'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { localize } from 'vs/nls'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; @@ -28,12 +28,12 @@ import { Iterator } from 'vs/base/common/iterator'; import { ITreeElement, ITreeNode, ITreeContextMenuEvent } from 'vs/base/browser/ui/tree/tree'; import { Relay, Event, Emitter } from 'vs/base/common/event'; import { WorkbenchObjectTree, TreeResourceNavigator2 } from 'vs/platform/list/browser/listService'; -import { FilterOptions } from 'vs/workbench/parts/markers/electron-browser/markersFilterOptions'; +import { FilterOptions } from 'vs/workbench/contrib/markers/electron-browser/markersFilterOptions'; import { IExpression, getEmptyExpression } from 'vs/base/common/glob'; import { mixin, deepClone } from 'vs/base/common/objects'; import { IWorkspaceFolder, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { isAbsolute, join } from 'vs/base/common/paths'; -import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, TreeElement, MarkersTreeAccessibilityProvider, MarkersViewModel, ResourceDragAndDrop } from 'vs/workbench/parts/markers/electron-browser/markersTreeViewer'; +import { FilterData, Filter, VirtualDelegate, ResourceMarkersRenderer, MarkerRenderer, RelatedInformationRenderer, TreeElement, MarkersTreeAccessibilityProvider, MarkersViewModel, ResourceDragAndDrop } from 'vs/workbench/contrib/markers/electron-browser/markersTreeViewer'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { Separator, ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IMenuService, MenuId } from 'vs/platform/actions/common/actions'; diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts index 64e32b349b1..31a2a425faf 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts @@ -11,13 +11,13 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { IContextViewService, IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { TogglePanelAction } from 'vs/workbench/browser/panel'; -import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; -import Constants from 'vs/workbench/parts/markers/electron-browser/constants'; +import Messages from 'vs/workbench/contrib/markers/electron-browser/messages'; +import Constants from 'vs/workbench/contrib/markers/electron-browser/constants'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { attachInputBoxStyler, attachStylerCallback, attachCheckboxStyler } from 'vs/platform/theme/common/styler'; -import { IMarkersWorkbenchService } from 'vs/workbench/parts/markers/electron-browser/markers'; +import { IMarkersWorkbenchService } from 'vs/workbench/contrib/markers/electron-browser/markers'; import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { BaseActionItem, ActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { badgeBackground, badgeForeground, contrastBorder } from 'vs/platform/theme/common/colorRegistry'; @@ -25,12 +25,12 @@ import { localize } from 'vs/nls'; import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ContextScopedHistoryInputBox } from 'vs/platform/widget/browser/contextScopedHistoryWidget'; -import { Marker } from 'vs/workbench/parts/markers/electron-browser/markersModel'; +import { Marker } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; import { IModelService } from 'vs/editor/common/services/modelService'; import { isEqual } from 'vs/base/common/resources'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Event, Emitter } from 'vs/base/common/event'; -import { FilterOptions } from 'vs/workbench/parts/markers/electron-browser/markersFilterOptions'; +import { FilterOptions } from 'vs/workbench/contrib/markers/electron-browser/markersFilterOptions'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; export class ToggleMarkersPanelAction extends TogglePanelAction { diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts b/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts index 60902ef381b..b0d2488be69 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts @@ -10,19 +10,19 @@ import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { ResourceLabels, IResourceLabel } from 'vs/workbench/browser/labels'; import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel'; import { IMarker, MarkerSeverity } from 'vs/platform/markers/common/markers'; -import { ResourceMarkers, Marker, RelatedInformation } from 'vs/workbench/parts/markers/electron-browser/markersModel'; -import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; +import { ResourceMarkers, Marker, RelatedInformation } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; +import Messages from 'vs/workbench/contrib/markers/electron-browser/messages'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/lifecycle'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; -import { QuickFixAction, QuickFixActionItem } from 'vs/workbench/parts/markers/electron-browser/markersPanelActions'; +import { QuickFixAction, QuickFixActionItem } from 'vs/workbench/contrib/markers/electron-browser/markersPanelActions'; import { ILabelService } from 'vs/platform/label/common/label'; import { dirname, basename } from 'vs/base/common/resources'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { ITreeFilter, TreeVisibility, TreeFilterResult, ITreeRenderer, ITreeNode, ITreeDragAndDrop, ITreeDragOverReaction } from 'vs/base/browser/ui/tree/tree'; -import { FilterOptions } from 'vs/workbench/parts/markers/electron-browser/markersFilterOptions'; +import { FilterOptions } from 'vs/workbench/contrib/markers/electron-browser/markersFilterOptions'; import { IMatch } from 'vs/base/common/filters'; import { Event, Emitter } from 'vs/base/common/event'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; diff --git a/src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts b/src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts index 34eb1dfe3fc..c94ed7d2d1e 100644 --- a/src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts +++ b/src/vs/workbench/contrib/markers/test/electron-browser/markersModel.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { IMarker, MarkerSeverity, IRelatedInformation } from 'vs/platform/markers/common/markers'; -import { MarkersModel, Marker, ResourceMarkers, RelatedInformation } from 'vs/workbench/parts/markers/electron-browser/markersModel'; +import { MarkersModel, Marker, ResourceMarkers, RelatedInformation } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; import { groupBy } from 'vs/base/common/collections'; class TestMarkersModel extends MarkersModel { diff --git a/src/vs/workbench/contrib/outline/electron-browser/outline.contribution.ts b/src/vs/workbench/contrib/outline/electron-browser/outline.contribution.ts index 4b85e7261a2..00467761391 100644 --- a/src/vs/workbench/contrib/outline/electron-browser/outline.contribution.ts +++ b/src/vs/workbench/contrib/outline/electron-browser/outline.contribution.ts @@ -6,10 +6,10 @@ import { localize } from 'vs/nls'; import { ViewsRegistry, IViewDescriptor } from 'vs/workbench/common/views'; import { OutlinePanel } from './outlinePanel'; -import { VIEW_CONTAINER } from 'vs/workbench/parts/files/common/files'; +import { VIEW_CONTAINER } from 'vs/workbench/contrib/files/common/files'; import { Registry } from 'vs/platform/registry/common/platform'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; -import { OutlineConfigKeys, OutlineViewId } from 'vs/workbench/parts/outline/electron-browser/outline'; +import { OutlineConfigKeys, OutlineViewId } from 'vs/workbench/contrib/outline/electron-browser/outline'; const _outlineDesc = { id: OutlineViewId, diff --git a/src/vs/workbench/contrib/output/browser/logViewer.ts b/src/vs/workbench/contrib/output/browser/logViewer.ts index 12786761194..6840a247d61 100644 --- a/src/vs/workbench/contrib/output/browser/logViewer.ts +++ b/src/vs/workbench/contrib/output/browser/logViewer.ts @@ -17,7 +17,7 @@ import { ResourceEditorInput } from 'vs/workbench/common/editor/resourceEditorIn import { URI } from 'vs/base/common/uri'; import { ITextModelService } from 'vs/editor/common/services/resolverService'; import { IHashService } from 'vs/workbench/services/hash/common/hashService'; -import { LOG_SCHEME, IOutputChannelDescriptor } from 'vs/workbench/parts/output/common/output'; +import { LOG_SCHEME, IOutputChannelDescriptor } from 'vs/workbench/contrib/output/common/output'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWindowService } from 'vs/platform/windows/common/windows'; diff --git a/src/vs/workbench/contrib/output/browser/outputActions.ts b/src/vs/workbench/contrib/output/browser/outputActions.ts index f895e0bb3b0..fb0cfa131c7 100644 --- a/src/vs/workbench/contrib/output/browser/outputActions.ts +++ b/src/vs/workbench/contrib/output/browser/outputActions.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import * as aria from 'vs/base/browser/ui/aria/aria'; import { IAction, Action } from 'vs/base/common/actions'; -import { IOutputService, OUTPUT_PANEL_ID, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannelDescriptor } from 'vs/workbench/parts/output/common/output'; +import { IOutputService, OUTPUT_PANEL_ID, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannelDescriptor } from 'vs/workbench/contrib/output/common/output'; import { SelectActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; @@ -20,7 +20,7 @@ import { groupBy } from 'vs/base/common/arrays'; import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { LogViewerInput } from 'vs/workbench/parts/output/browser/logViewer'; +import { LogViewerInput } from 'vs/workbench/contrib/output/browser/logViewer'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; export class ToggleOutputAction extends TogglePanelAction { diff --git a/src/vs/workbench/contrib/output/browser/outputPanel.ts b/src/vs/workbench/contrib/output/browser/outputPanel.ts index 6c469924c54..44300c8f4c3 100644 --- a/src/vs/workbench/contrib/output/browser/outputPanel.ts +++ b/src/vs/workbench/contrib/output/browser/outputPanel.ts @@ -17,8 +17,8 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { EditorInput, EditorOptions } from 'vs/workbench/common/editor'; import { AbstractTextResourceEditor } from 'vs/workbench/browser/parts/editor/textResourceEditor'; -import { OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/parts/output/common/output'; -import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOrSetOutputScrollLockAction, OpenLogOutputFile } from 'vs/workbench/parts/output/browser/outputActions'; +import { OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT } from 'vs/workbench/contrib/output/common/output'; +import { SwitchOutputAction, SwitchOutputActionItem, ClearOutputAction, ToggleOrSetOutputScrollLockAction, OpenLogOutputFile } from 'vs/workbench/contrib/output/browser/outputActions'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; diff --git a/src/vs/workbench/contrib/output/common/outputLinkProvider.ts b/src/vs/workbench/contrib/output/common/outputLinkProvider.ts index 6d9451401a2..efa955eb5c2 100644 --- a/src/vs/workbench/contrib/output/common/outputLinkProvider.ts +++ b/src/vs/workbench/contrib/output/common/outputLinkProvider.ts @@ -8,9 +8,9 @@ import { RunOnceScheduler } from 'vs/base/common/async'; import { IModelService } from 'vs/editor/common/services/modelService'; import { LinkProviderRegistry, ILink } from 'vs/editor/common/modes'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { OUTPUT_MODE_ID, LOG_MODE_ID } from 'vs/workbench/parts/output/common/output'; +import { OUTPUT_MODE_ID, LOG_MODE_ID } from 'vs/workbench/contrib/output/common/output'; import { MonacoWebWorker, createWebWorker } from 'vs/editor/common/services/webWorker'; -import { ICreateData, OutputLinkComputer } from 'vs/workbench/parts/output/common/outputLinkComputer'; +import { ICreateData, OutputLinkComputer } from 'vs/workbench/contrib/output/common/outputLinkComputer'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; export class OutputLinkProvider { @@ -65,7 +65,7 @@ export class OutputLinkProvider { }; this.worker = createWebWorker(this.modelService, { - moduleId: 'vs/workbench/parts/output/common/outputLinkComputer', + moduleId: 'vs/workbench/contrib/output/common/outputLinkComputer', createData, label: 'outputLinkComputer' }); diff --git a/src/vs/workbench/contrib/output/electron-browser/output.contribution.ts b/src/vs/workbench/contrib/output/electron-browser/output.contribution.ts index b653b93bb06..e72863b7840 100644 --- a/src/vs/workbench/contrib/output/electron-browser/output.contribution.ts +++ b/src/vs/workbench/contrib/output/electron-browser/output.contribution.ts @@ -11,15 +11,15 @@ import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/ import { KeybindingsRegistry, IKeybindings } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; -import { OutputService, LogContentProvider } from 'vs/workbench/parts/output/electron-browser/outputServices'; -import { ToggleOutputAction, ClearOutputAction, OpenLogOutputFile, ShowLogsOutputChannelAction, OpenOutputLogFileAction } from 'vs/workbench/parts/output/browser/outputActions'; -import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_SCHEME, LOG_MODE_ID, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT } from 'vs/workbench/parts/output/common/output'; +import { OutputService, LogContentProvider } from 'vs/workbench/contrib/output/electron-browser/outputServices'; +import { ToggleOutputAction, ClearOutputAction, OpenLogOutputFile, ShowLogsOutputChannelAction, OpenOutputLogFileAction } from 'vs/workbench/contrib/output/browser/outputActions'; +import { OUTPUT_MODE_ID, OUTPUT_MIME, OUTPUT_PANEL_ID, IOutputService, CONTEXT_IN_OUTPUT, LOG_SCHEME, LOG_MODE_ID, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT } from 'vs/workbench/contrib/output/common/output'; import { PanelRegistry, Extensions, PanelDescriptor } from 'vs/workbench/browser/panel'; import { CommandsRegistry, ICommandHandler } from 'vs/platform/commands/common/commands'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { OutputPanel } from 'vs/workbench/parts/output/browser/outputPanel'; +import { OutputPanel } from 'vs/workbench/contrib/output/browser/outputPanel'; import { IEditorRegistry, Extensions as EditorExtensions, EditorDescriptor } from 'vs/workbench/browser/editor'; -import { LogViewer, LogViewerInput } from 'vs/workbench/parts/output/browser/logViewer'; +import { LogViewer, LogViewerInput } from 'vs/workbench/contrib/output/browser/logViewer'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; diff --git a/src/vs/workbench/contrib/output/electron-browser/outputServices.ts b/src/vs/workbench/contrib/output/electron-browser/outputServices.ts index 586a275ebbc..6a9a65811a8 100644 --- a/src/vs/workbench/contrib/output/electron-browser/outputServices.ts +++ b/src/vs/workbench/contrib/output/electron-browser/outputServices.ts @@ -14,12 +14,12 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { Registry } from 'vs/platform/registry/common/platform'; import { EditorOptions } from 'vs/workbench/common/editor'; -import { IOutputChannelDescriptor, IOutputChannel, IOutputService, Extensions, OUTPUT_PANEL_ID, IOutputChannelRegistry, OUTPUT_SCHEME, OUTPUT_MIME, LOG_SCHEME, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT, MAX_OUTPUT_LENGTH } from 'vs/workbench/parts/output/common/output'; -import { OutputPanel } from 'vs/workbench/parts/output/browser/outputPanel'; +import { IOutputChannelDescriptor, IOutputChannel, IOutputService, Extensions, OUTPUT_PANEL_ID, IOutputChannelRegistry, OUTPUT_SCHEME, OUTPUT_MIME, LOG_SCHEME, LOG_MIME, CONTEXT_ACTIVE_LOG_OUTPUT, MAX_OUTPUT_LENGTH } from 'vs/workbench/contrib/output/common/output'; +import { OutputPanel } from 'vs/workbench/contrib/output/browser/outputPanel'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { OutputLinkProvider } from 'vs/workbench/parts/output/common/outputLinkProvider'; +import { OutputLinkProvider } from 'vs/workbench/contrib/output/common/outputLinkProvider'; import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { ITextModel } from 'vs/editor/common/model'; import { IModeService } from 'vs/editor/common/services/modeService'; diff --git a/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts b/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts index a974c7f6e67..3d455d5db3b 100644 --- a/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts +++ b/src/vs/workbench/contrib/output/test/outputLinkProvider.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { URI } from 'vs/base/common/uri'; import { isMacintosh, isLinux } from 'vs/base/common/platform'; -import { OutputLinkComputer } from 'vs/workbench/parts/output/common/outputLinkComputer'; +import { OutputLinkComputer } from 'vs/workbench/contrib/output/common/outputLinkComputer'; import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; function toOSPath(p: string): string { diff --git a/src/vs/workbench/contrib/performance/electron-browser/performance.contribution.ts b/src/vs/workbench/contrib/performance/electron-browser/performance.contribution.ts index 45434d18c48..af13ad4f69f 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/performance.contribution.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/performance.contribution.ts @@ -11,7 +11,7 @@ import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { Extensions as Input, IEditorInputFactory, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; -import { PerfviewContrib, PerfviewInput } from 'vs/workbench/parts/performance/electron-browser/perfviewEditor'; +import { PerfviewContrib, PerfviewInput } from 'vs/workbench/contrib/performance/electron-browser/perfviewEditor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { StartupProfiler } from './startupProfiler'; import { StartupTimings } from './startupTimings'; diff --git a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts index 016531777e8..9bb55a53b25 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/perfviewEditor.ts @@ -19,7 +19,7 @@ import { IExtensionService } from 'vs/workbench/services/extensions/common/exten import * as perf from 'vs/base/common/performance'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { writeTransientState } from 'vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap'; +import { writeTransientState } from 'vs/workbench/contrib/codeEditor/electron-browser/toggleWordWrap'; import { mergeSort } from 'vs/base/common/arrays'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import product from 'vs/platform/node/product'; diff --git a/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts b/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts index 86c0b153da5..c9ad9a6a401 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/startupProfiler.ts @@ -14,7 +14,7 @@ import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/ import product from 'vs/platform/node/product'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { PerfviewInput } from 'vs/workbench/parts/performance/electron-browser/perfviewEditor'; +import { PerfviewInput } from 'vs/workbench/contrib/performance/electron-browser/perfviewEditor'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; diff --git a/src/vs/workbench/contrib/performance/electron-browser/startupTimings.ts b/src/vs/workbench/contrib/performance/electron-browser/startupTimings.ts index 7b78b7764aa..e677f3cc55f 100644 --- a/src/vs/workbench/contrib/performance/electron-browser/startupTimings.ts +++ b/src/vs/workbench/contrib/performance/electron-browser/startupTimings.ts @@ -15,7 +15,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IUpdateService } from 'vs/platform/update/common/update'; import { IWindowsService } from 'vs/platform/windows/common/windows'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import * as files from 'vs/workbench/parts/files/common/files'; +import * as files from 'vs/workbench/contrib/files/common/files'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { didUseCachedData, ITimerService } from 'vs/workbench/services/timer/electron-browser/timerService'; diff --git a/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts index 38ce9d93477..15374d83530 100644 --- a/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.ts @@ -22,7 +22,7 @@ import { attachInputBoxStyler, attachStylerCallback } from 'vs/platform/theme/co import { IThemeService } from 'vs/platform/theme/common/themeService'; import { editorWidgetBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry'; import { ScrollType } from 'vs/editor/common/editorCommon'; -import { SearchWidget, SearchOptions } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; +import { SearchWidget, SearchOptions } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; export interface KeybindingsSearchOptions extends SearchOptions { recordEnter?: boolean; diff --git a/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts index 71f261fc2f6..32ceacbb842 100644 --- a/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts +++ b/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.ts @@ -21,12 +21,12 @@ import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService import { KeybindingsEditorModel, IKeybindingItemEntry, IListEntry, KEYBINDING_ENTRY_TEMPLATE_ID } from 'vs/workbench/services/preferences/common/keybindingsEditorModel'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IKeybindingService, IUserFriendlyKeybinding } from 'vs/platform/keybinding/common/keybinding'; -import { DefineKeybindingWidget, KeybindingsSearchWidget, KeybindingsSearchOptions } from 'vs/workbench/parts/preferences/browser/keybindingWidgets'; +import { DefineKeybindingWidget, KeybindingsSearchWidget, KeybindingsSearchOptions } from 'vs/workbench/contrib/preferences/browser/keybindingWidgets'; import { IKeybindingsEditor, CONTEXT_KEYBINDING_FOCUS, CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS -} from 'vs/workbench/parts/preferences/common/preferences'; +} from 'vs/workbench/contrib/preferences/common/preferences'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IKeybindingEditingService } from 'vs/workbench/services/keybinding/common/keybindingEditing'; import { List } from 'vs/base/browser/ui/list/listWidget'; diff --git a/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts b/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts index 1a678f65c7b..eeac873c1d4 100644 --- a/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts +++ b/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.ts @@ -16,8 +16,8 @@ import * as editorCommon from 'vs/editor/common/editorCommon'; import { registerEditorContribution, ServicesAccessor, registerEditorCommand, EditorCommand } from 'vs/editor/browser/editorExtensions'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2'; -import { SmartSnippetInserter } from 'vs/workbench/parts/preferences/common/smartSnippetInserter'; -import { DefineKeybindingOverlayWidget } from 'vs/workbench/parts/preferences/browser/keybindingWidgets'; +import { SmartSnippetInserter } from 'vs/workbench/contrib/preferences/common/smartSnippetInserter'; +import { DefineKeybindingOverlayWidget } from 'vs/workbench/contrib/preferences/browser/keybindingWidgets'; import { FloatingClickWidget } from 'vs/workbench/browser/parts/editor/editorWidgets'; import { parseTree, Node } from 'vs/base/common/json'; import { ScanCodeBinding } from 'vs/base/common/scanCode'; diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts index 8e8da3a6699..0190c12f9d9 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts @@ -44,9 +44,9 @@ import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { BaseTextEditor } from 'vs/workbench/browser/parts/editor/textEditor'; import { EditorInput, EditorOptions, IEditorControl } from 'vs/workbench/common/editor'; import { ResourceEditorModel } from 'vs/workbench/common/editor/resourceEditorModel'; -import { DefaultSettingsRenderer, FolderSettingsRenderer, IPreferencesRenderer, UserSettingsRenderer, WorkspaceSettingsRenderer } from 'vs/workbench/parts/preferences/browser/preferencesRenderers'; -import { SearchWidget, SettingsTarget, SettingsTargetsWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; -import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, IPreferencesSearchService, ISearchProvider, CONTEXT_SETTINGS_JSON_EDITOR } from 'vs/workbench/parts/preferences/common/preferences'; +import { DefaultSettingsRenderer, FolderSettingsRenderer, IPreferencesRenderer, UserSettingsRenderer, WorkspaceSettingsRenderer } from 'vs/workbench/contrib/preferences/browser/preferencesRenderers'; +import { SearchWidget, SettingsTarget, SettingsTargetsWidget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; +import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, IPreferencesSearchService, ISearchProvider, CONTEXT_SETTINGS_JSON_EDITOR } from 'vs/workbench/contrib/preferences/common/preferences'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import { IFilterResult, IPreferencesService, ISearchResult, ISetting, ISettingsEditorModel, ISettingsGroup, SettingsEditorOptions } from 'vs/workbench/services/preferences/common/preferences'; diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts index 0ba9ee2e032..2a41d7d7568 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.ts @@ -26,7 +26,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace'; import { RangeHighlightDecorations } from 'vs/workbench/browser/parts/editor/rangeDecorations'; -import { DefaultSettingsHeaderWidget, EditPreferenceWidget, SettingsGroupTitleWidget, SettingsHeaderWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; +import { DefaultSettingsHeaderWidget, EditPreferenceWidget, SettingsGroupTitleWidget, SettingsHeaderWidget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; import { IFilterResult, IPreferencesEditorModel, IPreferencesService, ISetting, ISettingsEditorModel, ISettingsGroup } from 'vs/workbench/services/preferences/common/preferences'; import { DefaultSettingsEditorModel, SettingsEditorModel, WorkspaceConfigurationEditorModel } from 'vs/workbench/services/preferences/common/preferencesModels'; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts index 67bc7db7bbe..2cf8a3ab2c2 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTree.ts @@ -41,10 +41,10 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { editorBackground, errorForeground, focusBorder, foreground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground } from 'vs/platform/theme/common/colorRegistry'; import { attachButtonStyler, attachInputBoxStyler, attachSelectBoxStyler, attachStyler } from 'vs/platform/theme/common/styler'; import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { ITOCEntry } from 'vs/workbench/parts/preferences/browser/settingsLayout'; -import { ISettingsEditorViewState, settingKeyToDisplayFormat, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeNewExtensionsElement, SettingsTreeSettingElement } from 'vs/workbench/parts/preferences/browser/settingsTreeModels'; -import { ExcludeSettingWidget, IExcludeChangeEvent, IExcludeDataItem, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground } from 'vs/workbench/parts/preferences/browser/settingsWidgets'; -import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/parts/preferences/common/preferences'; +import { ITOCEntry } from 'vs/workbench/contrib/preferences/browser/settingsLayout'; +import { ISettingsEditorViewState, settingKeyToDisplayFormat, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeNewExtensionsElement, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels'; +import { ExcludeSettingWidget, IExcludeChangeEvent, IExcludeDataItem, settingsHeaderForeground, settingsNumberInputBackground, settingsNumberInputBorder, settingsNumberInputForeground, settingsSelectBackground, settingsSelectBorder, settingsSelectForeground, settingsSelectListBorder, settingsTextInputBackground, settingsTextInputBorder, settingsTextInputForeground } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; +import { SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences'; import { ISetting, ISettingsGroup, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; const $ = DOM.$; diff --git a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts index 7deca62b6af..879d9a9e49f 100644 --- a/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts +++ b/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.ts @@ -9,10 +9,10 @@ import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; -import { SettingsTarget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; -import { ITOCEntry, knownAcronyms } from 'vs/workbench/parts/preferences/browser/settingsLayout'; +import { SettingsTarget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; +import { ITOCEntry, knownAcronyms } from 'vs/workbench/contrib/preferences/browser/settingsLayout'; import { IExtensionSetting, ISearchResult, ISetting, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; -import { MODIFIED_SETTING_TAG } from 'vs/workbench/parts/preferences/common/preferences'; +import { MODIFIED_SETTING_TAG } from 'vs/workbench/contrib/preferences/common/preferences'; export const ONLINE_SERVICES_SETTING_TAG = 'usesOnlineServices'; diff --git a/src/vs/workbench/contrib/preferences/browser/tocTree.ts b/src/vs/workbench/contrib/preferences/browser/tocTree.ts index ac87ea537d6..0928faa4d2b 100644 --- a/src/vs/workbench/contrib/preferences/browser/tocTree.ts +++ b/src/vs/workbench/contrib/preferences/browser/tocTree.ts @@ -13,9 +13,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti import { editorBackground } from 'vs/platform/theme/common/colorRegistry'; import { attachStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; -import { SettingsTreeFilter } from 'vs/workbench/parts/preferences/browser/settingsTree'; -import { ISettingsEditorViewState, SearchResultModel, SettingsTreeElement, SettingsTreeGroupElement, SettingsTreeSettingElement } from 'vs/workbench/parts/preferences/browser/settingsTreeModels'; -import { settingsHeaderForeground } from 'vs/workbench/parts/preferences/browser/settingsWidgets'; +import { SettingsTreeFilter } from 'vs/workbench/contrib/preferences/browser/settingsTree'; +import { ISettingsEditorViewState, SearchResultModel, SettingsTreeElement, SettingsTreeGroupElement, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels'; +import { settingsHeaderForeground } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; const $ = DOM.$; diff --git a/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts b/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts index 3e43d22c5e7..b1668428f7d 100644 --- a/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts +++ b/src/vs/workbench/contrib/preferences/electron-browser/preferences.contribution.ts @@ -26,17 +26,17 @@ import { Extensions, IWorkbenchActionRegistry } from 'vs/workbench/common/action import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { EditorInput, Extensions as EditorInputExtensions, IEditorInputFactory, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; import { ResourceContextKey } from 'vs/workbench/common/resources'; -import { KeybindingsEditor } from 'vs/workbench/parts/preferences/browser/keybindingsEditor'; -import { ConfigureLanguageBasedSettingsAction, OpenDefaultKeybindingsFileAction, OpenFolderSettingsAction, OpenGlobalKeybindingsAction, OpenGlobalKeybindingsFileAction, OpenGlobalSettingsAction, OpenRawDefaultSettingsAction, OpenSettings2Action, OpenSettingsJsonAction, OpenWorkspaceSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND, OPEN_FOLDER_SETTINGS_LABEL } from 'vs/workbench/parts/preferences/browser/preferencesActions'; -import { PreferencesEditor } from 'vs/workbench/parts/preferences/browser/preferencesEditor'; -import { CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, CONTEXT_KEYBINDING_FOCUS, CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_JSON_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IKeybindingsEditor, IPreferencesSearchService, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS, KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_SEARCH, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING, SETTINGS_EDITOR_COMMAND_FILTER_MODIFIED, SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, SETTINGS_EDITOR_COMMAND_FOCUS_FILE, SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST, SETTINGS_EDITOR_COMMAND_SEARCH, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU, SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON, SETTINGS_COMMAND_OPEN_SETTINGS } from 'vs/workbench/parts/preferences/common/preferences'; -import { PreferencesContribution } from 'vs/workbench/parts/preferences/common/preferencesContribution'; -import { PreferencesSearchService } from 'vs/workbench/parts/preferences/electron-browser/preferencesSearch'; -import { SettingsEditor2 } from 'vs/workbench/parts/preferences/electron-browser/settingsEditor2'; +import { KeybindingsEditor } from 'vs/workbench/contrib/preferences/browser/keybindingsEditor'; +import { ConfigureLanguageBasedSettingsAction, OpenDefaultKeybindingsFileAction, OpenFolderSettingsAction, OpenGlobalKeybindingsAction, OpenGlobalKeybindingsFileAction, OpenGlobalSettingsAction, OpenRawDefaultSettingsAction, OpenSettings2Action, OpenSettingsJsonAction, OpenWorkspaceSettingsAction, OPEN_FOLDER_SETTINGS_COMMAND, OPEN_FOLDER_SETTINGS_LABEL } from 'vs/workbench/contrib/preferences/browser/preferencesActions'; +import { PreferencesEditor } from 'vs/workbench/contrib/preferences/browser/preferencesEditor'; +import { CONTEXT_KEYBINDINGS_EDITOR, CONTEXT_KEYBINDINGS_SEARCH_FOCUS, CONTEXT_KEYBINDING_FOCUS, CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_JSON_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IKeybindingsEditor, IPreferencesSearchService, KEYBINDINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, KEYBINDINGS_EDITOR_COMMAND_COPY, KEYBINDINGS_EDITOR_COMMAND_COPY_COMMAND, KEYBINDINGS_EDITOR_COMMAND_DEFINE, KEYBINDINGS_EDITOR_COMMAND_FOCUS_KEYBINDINGS, KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS, KEYBINDINGS_EDITOR_COMMAND_REMOVE, KEYBINDINGS_EDITOR_COMMAND_RESET, KEYBINDINGS_EDITOR_COMMAND_SEARCH, KEYBINDINGS_EDITOR_COMMAND_SHOW_SIMILAR, KEYBINDINGS_EDITOR_COMMAND_SORTBY_PRECEDENCE, KEYBINDINGS_EDITOR_SHOW_DEFAULT_KEYBINDINGS, KEYBINDINGS_EDITOR_SHOW_USER_KEYBINDINGS, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_EDIT_FOCUSED_SETTING, SETTINGS_EDITOR_COMMAND_FILTER_MODIFIED, SETTINGS_EDITOR_COMMAND_FILTER_ONLINE, SETTINGS_EDITOR_COMMAND_FOCUS_FILE, SETTINGS_EDITOR_COMMAND_FOCUS_NEXT_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_PREVIOUS_SETTING, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_FROM_SEARCH, SETTINGS_EDITOR_COMMAND_FOCUS_SETTINGS_LIST, SETTINGS_EDITOR_COMMAND_SEARCH, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU, SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON, SETTINGS_COMMAND_OPEN_SETTINGS } from 'vs/workbench/contrib/preferences/common/preferences'; +import { PreferencesContribution } from 'vs/workbench/contrib/preferences/common/preferencesContribution'; +import { PreferencesSearchService } from 'vs/workbench/contrib/preferences/electron-browser/preferencesSearch'; +import { SettingsEditor2 } from 'vs/workbench/contrib/preferences/electron-browser/settingsEditor2'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences'; import { DefaultPreferencesEditorInput, KeybindingsEditorInput, PreferencesEditorInput, SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; -import { ExplorerRootContext, ExplorerFolderContext } from 'vs/workbench/parts/files/common/files'; +import { ExplorerRootContext, ExplorerFolderContext } from 'vs/workbench/contrib/files/common/files'; registerSingleton(IPreferencesSearchService, PreferencesSearchService, true); @@ -366,8 +366,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon id: OpenGlobalKeybindingsAction.ID, title: OpenGlobalKeybindingsAction.LABEL, iconLocation: { - light: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg`)) } }, when: ResourceContextKey.Resource.isEqualTo(URI.file(environmentService.appKeybindingsPath).toString()), @@ -382,8 +382,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon id: commandId, title: OpenSettings2Action.LABEL, iconLocation: { - light: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg`)) } }, when: ResourceContextKey.Resource.isEqualTo(URI.file(environmentService.appSettingsPath).toString()), @@ -406,8 +406,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon id: commandId, title: OpenSettings2Action.LABEL, iconLocation: { - light: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg`)) } }, when: ContextKeyExpr.and(ResourceContextKey.Resource.isEqualTo(this.preferencesService.workspaceSettingsResource.toString()), new RawContextKey('workbenchState', '').isEqualTo('workspace')), @@ -434,8 +434,8 @@ class PreferencesActionsContribution extends Disposable implements IWorkbenchCon id: commandId, title: OpenSettings2Action.LABEL, iconLocation: { - light: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/preferences-editor-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/preferences-editor-inverse.svg`)) } }, when: ContextKeyExpr.and(ResourceContextKey.Resource.isEqualTo(this.preferencesService.getFolderSettingsResource(folder.uri).toString())), @@ -499,8 +499,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: OpenGlobalKeybindingsFileAction.ID, title: OpenGlobalKeybindingsFileAction.LABEL, iconLocation: { - light: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/edit-json.svg`)), - dark: URI.parse(require.toUrl(`vs/workbench/parts/preferences/electron-browser/media/edit-json-inverse.svg`)) + light: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/edit-json.svg`)), + dark: URI.parse(require.toUrl(`vs/workbench/contrib/preferences/electron-browser/media/edit-json-inverse.svg`)) } }, when: ContextKeyExpr.and(CONTEXT_KEYBINDINGS_EDITOR), @@ -737,8 +737,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, { id: SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON, title: nls.localize('openSettingsJson', "Open Settings (JSON)"), iconLocation: { - dark: URI.parse(require.toUrl('vs/workbench/parts/preferences/electron-browser/media/edit-json-inverse.svg')), - light: URI.parse(require.toUrl('vs/workbench/parts/preferences/electron-browser/media/edit-json.svg')) + dark: URI.parse(require.toUrl('vs/workbench/contrib/preferences/electron-browser/media/edit-json-inverse.svg')), + light: URI.parse(require.toUrl('vs/workbench/contrib/preferences/electron-browser/media/edit-json.svg')) } }, group: 'navigation', diff --git a/src/vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts b/src/vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts index 3a6380c53e4..431ab1c2b3b 100644 --- a/src/vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts +++ b/src/vs/workbench/contrib/preferences/electron-browser/preferencesSearch.ts @@ -19,7 +19,7 @@ import { asJson } from 'vs/base/node/request'; import { Disposable } from 'vs/base/common/lifecycle'; import { IExtensionManagementService, ILocalExtension, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { ILogService } from 'vs/platform/log/common/log'; -import { IPreferencesSearchService, ISearchProvider, IWorkbenchSettingsConfiguration } from 'vs/workbench/parts/preferences/common/preferences'; +import { IPreferencesSearchService, ISearchProvider, IWorkbenchSettingsConfiguration } from 'vs/workbench/contrib/preferences/common/preferences'; import { CancellationToken } from 'vs/base/common/cancellation'; import { canceled } from 'vs/base/common/errors'; import { ExtensionType } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts b/src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts index bee9a940ba4..f35305c3f7d 100644 --- a/src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts +++ b/src/vs/workbench/contrib/preferences/electron-browser/settingsEditor2.ts @@ -28,14 +28,14 @@ import { attachStylerCallback } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { IEditor, IEditorMemento } from 'vs/workbench/common/editor'; -import { attachSuggestEnabledInputBoxStyler, SuggestEnabledInput } from 'vs/workbench/parts/codeEditor/electron-browser/suggestEnabledInput'; -import { SettingsTarget, SettingsTargetsWidget } from 'vs/workbench/parts/preferences/browser/preferencesWidgets'; -import { commonlyUsedData, tocData } from 'vs/workbench/parts/preferences/browser/settingsLayout'; -import { AbstractSettingRenderer, ISettingLinkClickEvent, ISettingOverrideClickEvent, resolveExtensionsSettings, resolveSettingsTree, SettingsTree, SettingTreeRenderers } from 'vs/workbench/parts/preferences/browser/settingsTree'; -import { ISettingsEditorViewState, parseQuery, SearchResultIdx, SearchResultModel, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeModel, SettingsTreeSettingElement } from 'vs/workbench/parts/preferences/browser/settingsTreeModels'; -import { settingsTextInputBorder } from 'vs/workbench/parts/preferences/browser/settingsWidgets'; -import { createTOCIterator, TOCTree, TOCTreeModel } from 'vs/workbench/parts/preferences/browser/tocTree'; -import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IPreferencesSearchService, ISearchProvider, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/parts/preferences/common/preferences'; +import { attachSuggestEnabledInputBoxStyler, SuggestEnabledInput } from 'vs/workbench/contrib/codeEditor/electron-browser/suggestEnabledInput'; +import { SettingsTarget, SettingsTargetsWidget } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets'; +import { commonlyUsedData, tocData } from 'vs/workbench/contrib/preferences/browser/settingsLayout'; +import { AbstractSettingRenderer, ISettingLinkClickEvent, ISettingOverrideClickEvent, resolveExtensionsSettings, resolveSettingsTree, SettingsTree, SettingTreeRenderers } from 'vs/workbench/contrib/preferences/browser/settingsTree'; +import { ISettingsEditorViewState, parseQuery, SearchResultIdx, SearchResultModel, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeModel, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels'; +import { settingsTextInputBorder } from 'vs/workbench/contrib/preferences/browser/settingsWidgets'; +import { createTOCIterator, TOCTree, TOCTreeModel } from 'vs/workbench/contrib/preferences/browser/tocTree'; +import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, IPreferencesSearchService, ISearchProvider, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; diff --git a/src/vs/workbench/contrib/preferences/test/browser/keybindingsEditorContribution.test.ts b/src/vs/workbench/contrib/preferences/test/browser/keybindingsEditorContribution.test.ts index 5c96f33b2f2..53b1167b8e8 100644 --- a/src/vs/workbench/contrib/preferences/test/browser/keybindingsEditorContribution.test.ts +++ b/src/vs/workbench/contrib/preferences/test/browser/keybindingsEditorContribution.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { KeybindingEditorDecorationsRenderer } from 'vs/workbench/parts/preferences/browser/keybindingsEditorContribution'; +import { KeybindingEditorDecorationsRenderer } from 'vs/workbench/contrib/preferences/browser/keybindingsEditorContribution'; suite('KeybindingsEditorContribution', () => { diff --git a/src/vs/workbench/contrib/preferences/test/browser/settingsTreeModels.test.ts b/src/vs/workbench/contrib/preferences/test/browser/settingsTreeModels.test.ts index 4765bd00733..0348c5e9dd8 100644 --- a/src/vs/workbench/contrib/preferences/test/browser/settingsTreeModels.test.ts +++ b/src/vs/workbench/contrib/preferences/test/browser/settingsTreeModels.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { settingKeyToDisplayFormat, parseQuery, IParsedQuery } from 'vs/workbench/parts/preferences/browser/settingsTreeModels'; +import { settingKeyToDisplayFormat, parseQuery, IParsedQuery } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels'; suite('SettingsTree', () => { test('settingKeyToDisplayFormat', () => { diff --git a/src/vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts b/src/vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts index a1dd85b4703..90a2e3a7bbb 100644 --- a/src/vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts +++ b/src/vs/workbench/contrib/preferences/test/common/smartSnippetInserter.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { SmartSnippetInserter } from 'vs/workbench/parts/preferences/common/smartSnippetInserter'; +import { SmartSnippetInserter } from 'vs/workbench/contrib/preferences/common/smartSnippetInserter'; import { TextModel } from 'vs/editor/common/model/textModel'; import { Position } from 'vs/editor/common/core/position'; diff --git a/src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts b/src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts index 967300cbf23..92f9b7cd868 100644 --- a/src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts +++ b/src/vs/workbench/contrib/quickopen/browser/quickopen.contribution.ts @@ -10,11 +10,11 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor, MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; -import { GotoSymbolAction, GOTO_SYMBOL_PREFIX, SCOPE_PREFIX, GotoSymbolHandler } from 'vs/workbench/parts/quickopen/browser/gotoSymbolHandler'; -import { ShowAllCommandsAction, ALL_COMMANDS_PREFIX, ClearCommandHistoryAction, CommandsHandler } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; -import { GotoLineAction, GOTO_LINE_PREFIX, GotoLineHandler } from 'vs/workbench/parts/quickopen/browser/gotoLineHandler'; -import { HELP_PREFIX, HelpHandler } from 'vs/workbench/parts/quickopen/browser/helpHandler'; -import { VIEW_PICKER_PREFIX, OpenViewPickerAction, QuickOpenViewPickerAction, ViewPickerHandler } from 'vs/workbench/parts/quickopen/browser/viewPickerHandler'; +import { GotoSymbolAction, GOTO_SYMBOL_PREFIX, SCOPE_PREFIX, GotoSymbolHandler } from 'vs/workbench/contrib/quickopen/browser/gotoSymbolHandler'; +import { ShowAllCommandsAction, ALL_COMMANDS_PREFIX, ClearCommandHistoryAction, CommandsHandler } from 'vs/workbench/contrib/quickopen/browser/commandsHandler'; +import { GotoLineAction, GOTO_LINE_PREFIX, GotoLineHandler } from 'vs/workbench/contrib/quickopen/browser/gotoLineHandler'; +import { HELP_PREFIX, HelpHandler } from 'vs/workbench/contrib/quickopen/browser/helpHandler'; +import { VIEW_PICKER_PREFIX, OpenViewPickerAction, QuickOpenViewPickerAction, ViewPickerHandler } from 'vs/workbench/contrib/quickopen/browser/viewPickerHandler'; import { inQuickOpenContext, getQuickNavigateHandler } from 'vs/workbench/browser/parts/quickopen/quickopen'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; diff --git a/src/vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts b/src/vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts index fe8cccaf627..c0f1cac747c 100644 --- a/src/vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts +++ b/src/vs/workbench/contrib/quickopen/browser/viewPickerHandler.ts @@ -8,8 +8,8 @@ import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel import { QuickOpenModel, QuickOpenEntryGroup, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler, QuickOpenAction } from 'vs/workbench/browser/quickopen'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; -import { IOutputService } from 'vs/workbench/parts/output/common/output'; -import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; +import { IOutputService } from 'vs/workbench/contrib/output/common/output'; +import { ITerminalService } from 'vs/workbench/contrib/terminal/common/terminal'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { Action } from 'vs/base/common/actions'; diff --git a/src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts b/src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts index aa04236bdca..f1016ee3294 100644 --- a/src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts +++ b/src/vs/workbench/contrib/scm/electron-browser/scm.contribution.ts @@ -8,13 +8,13 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { DirtyDiffWorkbenchController } from './dirtydiffDecorator'; import { ViewletRegistry, Extensions as ViewletExtensions, ViewletDescriptor, ShowViewletAction } from 'vs/workbench/browser/viewlet'; -import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm'; +import { VIEWLET_ID } from 'vs/workbench/contrib/scm/common/scm'; import { IWorkbenchActionRegistry, Extensions as WorkbenchActionExtensions } from 'vs/workbench/common/actions'; import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { StatusUpdater, StatusBarController } from './scmActivity'; -import { SCMViewlet } from 'vs/workbench/parts/scm/electron-browser/scmViewlet'; +import { SCMViewlet } from 'vs/workbench/contrib/scm/electron-browser/scmViewlet'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; diff --git a/src/vs/workbench/contrib/scm/electron-browser/scmActivity.ts b/src/vs/workbench/contrib/scm/electron-browser/scmActivity.ts index 17784ae69e5..795f77e8de8 100644 --- a/src/vs/workbench/contrib/scm/electron-browser/scmActivity.ts +++ b/src/vs/workbench/contrib/scm/electron-browser/scmActivity.ts @@ -7,7 +7,7 @@ import { localize } from 'vs/nls'; import { basename } from 'vs/base/common/paths'; import { IDisposable, dispose, Disposable, combinedDisposable } from 'vs/base/common/lifecycle'; import { Event } from 'vs/base/common/event'; -import { VIEWLET_ID } from 'vs/workbench/parts/scm/common/scm'; +import { VIEWLET_ID } from 'vs/workbench/contrib/scm/common/scm'; import { ISCMService, ISCMRepository } from 'vs/workbench/services/scm/common/scm'; import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; diff --git a/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts b/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts index 920cc42b0a6..1e2d7fc147c 100644 --- a/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts +++ b/src/vs/workbench/contrib/scm/electron-browser/scmViewlet.ts @@ -14,7 +14,7 @@ import { append, $, addClass, toggleClass, trackFocus, Dimension, addDisposableL import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { List } from 'vs/base/browser/ui/list/listWidget'; import { IListVirtualDelegate, IListRenderer, IListContextMenuEvent, IListEvent, IKeyboardNavigationLabelProvider, IIdentityProvider } from 'vs/base/browser/ui/list/list'; -import { VIEWLET_ID, VIEW_CONTAINER } from 'vs/workbench/parts/scm/common/scm'; +import { VIEWLET_ID, VIEW_CONTAINER } from 'vs/workbench/contrib/scm/common/scm'; import { ResourceLabels, IResourceLabel, IResourceLabelsContainer } from 'vs/workbench/browser/labels'; import { CountBadge } from 'vs/base/browser/ui/countBadge/countBadge'; import { ISCMService, ISCMRepository, ISCMResourceGroup, ISCMResource, InputValidationType } from 'vs/workbench/services/scm/common/scm'; diff --git a/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts b/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts index a20fe2e6f8b..765589cf209 100644 --- a/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts +++ b/src/vs/workbench/contrib/search/browser/openAnythingHandler.ts @@ -10,11 +10,11 @@ import * as types from 'vs/base/common/types'; import { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntry, QuickOpenModel, QuickOpenItemAccessor } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler } from 'vs/workbench/browser/quickopen'; -import { FileEntry, OpenFileHandler, FileQuickOpenModel } from 'vs/workbench/parts/search/browser/openFileHandler'; -import * as openSymbolHandler from 'vs/workbench/parts/search/browser/openSymbolHandler'; +import { FileEntry, OpenFileHandler, FileQuickOpenModel } from 'vs/workbench/contrib/search/browser/openFileHandler'; +import * as openSymbolHandler from 'vs/workbench/contrib/search/browser/openSymbolHandler'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkbenchSearchConfiguration } from 'vs/workbench/parts/search/common/search'; +import { IWorkbenchSearchConfiguration } from 'vs/workbench/contrib/search/common/search'; import { IRange } from 'vs/editor/common/core/range'; import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/contrib/search/browser/openFileHandler.ts b/src/vs/workbench/contrib/search/browser/openFileHandler.ts index 2d52f6f68b5..0434fc1c196 100644 --- a/src/vs/workbench/contrib/search/browser/openFileHandler.ts +++ b/src/vs/workbench/contrib/search/browser/openFileHandler.ts @@ -18,7 +18,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work import { IAutoFocus } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenEntry, QuickOpenModel } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler, EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen'; -import { QueryBuilder, IFileQueryBuilderOptions } from 'vs/workbench/parts/search/common/queryBuilder'; +import { QueryBuilder, IFileQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder'; import { EditorInput, IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor'; import { IResourceInput } from 'vs/platform/editor/common/editor'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; @@ -27,7 +27,7 @@ import { ISearchService, IFileSearchStats, IFileQuery, ISearchComplete } from 'v import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { IRange } from 'vs/editor/common/core/range'; -import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search'; +import { getOutOfWorkspaceEditorResources } from 'vs/workbench/contrib/search/common/search'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { prepareQuery, IPreparedQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer'; import { IFileService } from 'vs/platform/files/common/files'; diff --git a/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts index c57bea9b782..a5e2a7e7b59 100644 --- a/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/contrib/search/browser/openSymbolHandler.ts @@ -18,7 +18,7 @@ import { symbolKindToCssClass } from 'vs/editor/common/modes'; import { IResourceInput } from 'vs/platform/editor/common/editor'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { IWorkspaceSymbolProvider, getWorkspaceSymbols, IWorkspaceSymbol } from 'vs/workbench/parts/search/common/search'; +import { IWorkspaceSymbolProvider, getWorkspaceSymbols, IWorkspaceSymbol } from 'vs/workbench/contrib/search/common/search'; import { basename } from 'vs/base/common/paths'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ILabelService } from 'vs/platform/label/common/label'; diff --git a/src/vs/workbench/contrib/search/browser/replaceContributions.ts b/src/vs/workbench/contrib/search/browser/replaceContributions.ts index 85865f63594..23077d8d20a 100644 --- a/src/vs/workbench/contrib/search/browser/replaceContributions.ts +++ b/src/vs/workbench/contrib/search/browser/replaceContributions.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; -import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; -import { ReplaceService, ReplacePreviewContentProvider } from 'vs/workbench/parts/search/browser/replaceService'; +import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; +import { ReplaceService, ReplacePreviewContentProvider } from 'vs/workbench/contrib/search/browser/replaceService'; import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; diff --git a/src/vs/workbench/contrib/search/browser/replaceService.ts b/src/vs/workbench/contrib/search/browser/replaceService.ts index 1d003c86679..763ae2aa453 100644 --- a/src/vs/workbench/contrib/search/browser/replaceService.ts +++ b/src/vs/workbench/contrib/search/browser/replaceService.ts @@ -8,11 +8,11 @@ import * as errors from 'vs/base/common/errors'; import { URI } from 'vs/base/common/uri'; import * as network from 'vs/base/common/network'; import { Disposable } from 'vs/base/common/lifecycle'; -import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; +import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IModelService } from 'vs/editor/common/services/modelService'; import { IModeService } from 'vs/editor/common/services/modeService'; -import { Match, FileMatch, FileMatchOrMatch, ISearchWorkbenchService } from 'vs/workbench/parts/search/common/searchModel'; +import { Match, FileMatch, FileMatchOrMatch, ISearchWorkbenchService } from 'vs/workbench/contrib/search/common/searchModel'; import { IProgressRunner } from 'vs/platform/progress/common/progress'; import { ITextModelService, ITextModelContentProvider } from 'vs/editor/common/services/resolverService'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; diff --git a/src/vs/workbench/contrib/search/browser/searchActions.ts b/src/vs/workbench/contrib/search/browser/searchActions.ts index 3dde8d15063..4301fbbf881 100644 --- a/src/vs/workbench/contrib/search/browser/searchActions.ts +++ b/src/vs/workbench/contrib/search/browser/searchActions.ts @@ -22,10 +22,10 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { WorkbenchObjectTree } from 'vs/platform/list/browser/listService'; import { ISearchConfiguration, ISearchHistoryService, VIEW_ID } from 'vs/platform/search/common/search'; -import { SearchView } from 'vs/workbench/parts/search/browser/searchView'; -import * as Constants from 'vs/workbench/parts/search/common/constants'; -import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; -import { FileMatch, FileMatchOrMatch, FolderMatch, Match, RenderableMatch, searchMatchComparer, SearchResult } from 'vs/workbench/parts/search/common/searchModel'; +import { SearchView } from 'vs/workbench/contrib/search/browser/searchView'; +import * as Constants from 'vs/workbench/contrib/search/common/constants'; +import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; +import { FileMatch, FileMatchOrMatch, FolderMatch, Match, RenderableMatch, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; diff --git a/src/vs/workbench/contrib/search/browser/searchResultsView.ts b/src/vs/workbench/contrib/search/browser/searchResultsView.ts index de850b8c323..fb053f632e8 100644 --- a/src/vs/workbench/contrib/search/browser/searchResultsView.ts +++ b/src/vs/workbench/contrib/search/browser/searchResultsView.ts @@ -23,9 +23,9 @@ import { attachBadgeStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IResourceLabel, ResourceLabels } from 'vs/workbench/browser/labels'; -import { RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction } from 'vs/workbench/parts/search/browser/searchActions'; -import { SearchView } from 'vs/workbench/parts/search/browser/searchView'; -import { FileMatch, FolderMatch, Match, RenderableMatch, SearchModel, BaseFolderMatch } from 'vs/workbench/parts/search/common/searchModel'; +import { RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction } from 'vs/workbench/contrib/search/browser/searchActions'; +import { SearchView } from 'vs/workbench/contrib/search/browser/searchView'; +import { FileMatch, FolderMatch, Match, RenderableMatch, SearchModel, BaseFolderMatch } from 'vs/workbench/contrib/search/common/searchModel'; import { IDragAndDropData } from 'vs/base/browser/dnd'; import { fillResourceDataTransfers } from 'vs/workbench/browser/dnd'; import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts index 2c616389d02..3b57c981923 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -48,15 +48,15 @@ import { Viewlet } from 'vs/workbench/browser/viewlet'; import { IEditor } from 'vs/workbench/common/editor'; import { IPanel } from 'vs/workbench/common/panel'; import { IViewlet } from 'vs/workbench/common/viewlet'; -import { ExcludePatternInputWidget, PatternInputWidget } from 'vs/workbench/parts/search/browser/patternInputWidget'; -import { CancelSearchAction, ClearSearchResultsAction, CollapseDeepestExpandedLevelAction, getKeyboardEventForEditorOpen, RefreshAction } from 'vs/workbench/parts/search/browser/searchActions'; -import { FileMatchRenderer, FolderMatchRenderer, MatchRenderer, SearchAccessibilityProvider, SearchDelegate, SearchDND } from 'vs/workbench/parts/search/browser/searchResultsView'; -import { ISearchWidgetOptions, SearchWidget } from 'vs/workbench/parts/search/browser/searchWidget'; -import * as Constants from 'vs/workbench/parts/search/common/constants'; -import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder'; -import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; -import { getOutOfWorkspaceEditorResources } from 'vs/workbench/parts/search/common/search'; -import { FileMatch, FileMatchOrMatch, FolderMatch, IChangeEvent, ISearchWorkbenchService, Match, RenderableMatch, searchMatchComparer, SearchModel, SearchResult } from 'vs/workbench/parts/search/common/searchModel'; +import { ExcludePatternInputWidget, PatternInputWidget } from 'vs/workbench/contrib/search/browser/patternInputWidget'; +import { CancelSearchAction, ClearSearchResultsAction, CollapseDeepestExpandedLevelAction, getKeyboardEventForEditorOpen, RefreshAction } from 'vs/workbench/contrib/search/browser/searchActions'; +import { FileMatchRenderer, FolderMatchRenderer, MatchRenderer, SearchAccessibilityProvider, SearchDelegate, SearchDND } from 'vs/workbench/contrib/search/browser/searchResultsView'; +import { ISearchWidgetOptions, SearchWidget } from 'vs/workbench/contrib/search/browser/searchWidget'; +import * as Constants from 'vs/workbench/contrib/search/common/constants'; +import { ITextQueryBuilderOptions, QueryBuilder } from 'vs/workbench/contrib/search/common/queryBuilder'; +import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; +import { getOutOfWorkspaceEditorResources } from 'vs/workbench/contrib/search/common/search'; +import { FileMatch, FileMatchOrMatch, FolderMatch, IChangeEvent, ISearchWorkbenchService, Match, RenderableMatch, searchMatchComparer, SearchModel, SearchResult } from 'vs/workbench/contrib/search/common/searchModel'; import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; diff --git a/src/vs/workbench/contrib/search/browser/searchWidget.ts b/src/vs/workbench/contrib/search/browser/searchWidget.ts index c40fdd82fb6..3aee389d753 100644 --- a/src/vs/workbench/contrib/search/browser/searchWidget.ts +++ b/src/vs/workbench/contrib/search/browser/searchWidget.ts @@ -29,8 +29,8 @@ import { ISearchConfigurationProperties } from 'vs/platform/search/common/search import { attachFindInputBoxStyler, attachInputBoxStyler } from 'vs/platform/theme/common/styler'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { ContextScopedFindInput, ContextScopedHistoryInputBox } from 'vs/platform/widget/browser/contextScopedHistoryWidget'; -import { appendKeyBindingLabel, isSearchViewFocused } from 'vs/workbench/parts/search/browser/searchActions'; -import * as Constants from 'vs/workbench/parts/search/common/constants'; +import { appendKeyBindingLabel, isSearchViewFocused } from 'vs/workbench/contrib/search/browser/searchActions'; +import * as Constants from 'vs/workbench/contrib/search/common/constants'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; diff --git a/src/vs/workbench/contrib/search/common/replace.ts b/src/vs/workbench/contrib/search/common/replace.ts index 2f42429068b..13db8de0277 100644 --- a/src/vs/workbench/contrib/search/common/replace.ts +++ b/src/vs/workbench/contrib/search/common/replace.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { Match, FileMatch, FileMatchOrMatch } from 'vs/workbench/parts/search/common/searchModel'; +import { Match, FileMatch, FileMatchOrMatch } from 'vs/workbench/contrib/search/common/searchModel'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { IProgressRunner } from 'vs/platform/progress/common/progress'; diff --git a/src/vs/workbench/contrib/search/common/searchModel.ts b/src/vs/workbench/contrib/search/common/searchModel.ts index b700671faa0..1e020ef4531 100644 --- a/src/vs/workbench/contrib/search/common/searchModel.ts +++ b/src/vs/workbench/contrib/search/common/searchModel.ts @@ -24,7 +24,7 @@ import { IFileMatch, IPatternInfo, ISearchComplete, ISearchProgressItem, ISearch import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { overviewRulerFindMatchForeground } from 'vs/platform/theme/common/colorRegistry'; import { themeColorFromId } from 'vs/platform/theme/common/themeService'; -import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; +import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; import { editorMatchesToTextSearchResults } from 'vs/workbench/services/search/common/searchHelpers'; export class Match { diff --git a/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts b/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts index f02e746e251..8f8d622cb86 100644 --- a/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts +++ b/src/vs/workbench/contrib/search/electron-browser/search.contribution.ts @@ -38,22 +38,22 @@ import { Extensions as QuickOpenExtensions, IQuickOpenRegistry, QuickOpenHandler import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { ResourceContextKey } from 'vs/workbench/common/resources'; -import { getMultiSelectedResources } from 'vs/workbench/parts/files/browser/files'; -import { ExplorerFolderContext, ExplorerRootContext, FilesExplorerFocusCondition } from 'vs/workbench/parts/files/common/files'; -import { OpenAnythingHandler } from 'vs/workbench/parts/search/browser/openAnythingHandler'; -import { OpenSymbolHandler } from 'vs/workbench/parts/search/browser/openSymbolHandler'; -import { registerContributions as replaceContributions } from 'vs/workbench/parts/search/browser/replaceContributions'; -import { clearHistoryCommand, ClearSearchResultsAction, CloseReplaceAction, CollapseDeepestExpandedLevelAction, copyAllCommand, copyMatchCommand, copyPathCommand, FindInFilesAction, FocusNextInputAction, FocusNextSearchResultAction, FocusPreviousInputAction, FocusPreviousSearchResultAction, focusSearchListCommand, getSearchView, openSearchView, OpenSearchViewletAction, RefreshAction, RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction, ReplaceInFilesAction, toggleCaseSensitiveCommand, toggleRegexCommand, toggleWholeWordCommand } from 'vs/workbench/parts/search/browser/searchActions'; -import { registerContributions as searchWidgetContributions } from 'vs/workbench/parts/search/browser/searchWidget'; -import * as Constants from 'vs/workbench/parts/search/common/constants'; -import { getWorkspaceSymbols } from 'vs/workbench/parts/search/common/search'; -import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService } from 'vs/workbench/parts/search/common/searchModel'; +import { getMultiSelectedResources } from 'vs/workbench/contrib/files/browser/files'; +import { ExplorerFolderContext, ExplorerRootContext, FilesExplorerFocusCondition } from 'vs/workbench/contrib/files/common/files'; +import { OpenAnythingHandler } from 'vs/workbench/contrib/search/browser/openAnythingHandler'; +import { OpenSymbolHandler } from 'vs/workbench/contrib/search/browser/openSymbolHandler'; +import { registerContributions as replaceContributions } from 'vs/workbench/contrib/search/browser/replaceContributions'; +import { clearHistoryCommand, ClearSearchResultsAction, CloseReplaceAction, CollapseDeepestExpandedLevelAction, copyAllCommand, copyMatchCommand, copyPathCommand, FindInFilesAction, FocusNextInputAction, FocusNextSearchResultAction, FocusPreviousInputAction, FocusPreviousSearchResultAction, focusSearchListCommand, getSearchView, openSearchView, OpenSearchViewletAction, RefreshAction, RemoveAction, ReplaceAction, ReplaceAllAction, ReplaceAllInFolderAction, ReplaceInFilesAction, toggleCaseSensitiveCommand, toggleRegexCommand, toggleWholeWordCommand } from 'vs/workbench/contrib/search/browser/searchActions'; +import { registerContributions as searchWidgetContributions } from 'vs/workbench/contrib/search/browser/searchWidget'; +import * as Constants from 'vs/workbench/contrib/search/common/constants'; +import { getWorkspaceSymbols } from 'vs/workbench/contrib/search/common/search'; +import { FileMatchOrMatch, ISearchWorkbenchService, RenderableMatch, SearchWorkbenchService } from 'vs/workbench/contrib/search/common/searchModel'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { PanelRegistry, Extensions as PanelExtensions, PanelDescriptor } from 'vs/workbench/browser/panel'; import { ViewletDescriptor, ViewletRegistry, Extensions as ViewletExtensions } from 'vs/workbench/browser/viewlet'; -import { SearchView } from 'vs/workbench/parts/search/browser/searchView'; +import { SearchView } from 'vs/workbench/contrib/search/browser/searchView'; registerSingleton(ISearchWorkbenchService, SearchWorkbenchService, true); replaceContributions(); diff --git a/src/vs/workbench/contrib/search/test/browser/openFileHandler.test.ts b/src/vs/workbench/contrib/search/test/browser/openFileHandler.test.ts index e9d82ebec33..97eebd7be8e 100644 --- a/src/vs/workbench/contrib/search/test/browser/openFileHandler.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/openFileHandler.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import * as errors from 'vs/base/common/errors'; import * as objects from 'vs/base/common/objects'; -import { CacheState } from 'vs/workbench/parts/search/browser/openFileHandler'; +import { CacheState } from 'vs/workbench/contrib/search/browser/openFileHandler'; import { DeferredPromise } from 'vs/base/test/common/utils'; import { QueryType, IFileQuery } from 'vs/platform/search/common/search'; diff --git a/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts b/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts index 26dbb0d902c..452302f9df3 100644 --- a/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/searchActions.test.ts @@ -15,9 +15,9 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; import { USLayoutResolvedKeybinding } from 'vs/platform/keybinding/common/usLayoutResolvedKeybinding'; import { IFileMatch } from 'vs/platform/search/common/search'; -import { ReplaceAction } from 'vs/workbench/parts/search/browser/searchActions'; -import { FileMatch, FileMatchOrMatch, Match } from 'vs/workbench/parts/search/common/searchModel'; -import { MockObjectTree } from 'vs/workbench/parts/search/test/browser/mockSearchTree'; +import { ReplaceAction } from 'vs/workbench/contrib/search/browser/searchActions'; +import { FileMatch, FileMatchOrMatch, Match } from 'vs/workbench/contrib/search/common/searchModel'; +import { MockObjectTree } from 'vs/workbench/contrib/search/test/browser/mockSearchTree'; suite('Search Actions', () => { diff --git a/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts index 24925478596..7e4e27f20b6 100644 --- a/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts +++ b/src/vs/workbench/contrib/search/test/browser/searchViewlet.test.ts @@ -12,7 +12,7 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IFileMatch, ITextSearchMatch, OneLineRange, QueryType } from 'vs/platform/search/common/search'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { TestWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; -import { FileMatch, Match, searchMatchComparer, SearchResult } from 'vs/workbench/parts/search/common/searchModel'; +import { FileMatch, Match, searchMatchComparer, SearchResult } from 'vs/workbench/contrib/search/common/searchModel'; import { TestContextService } from 'vs/workbench/test/workbenchTestServices'; suite('Search - Viewlet', () => { diff --git a/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts b/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts index 310e3b4d731..a698314ec1f 100644 --- a/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts +++ b/src/vs/workbench/contrib/search/test/common/queryBuilder.test.ts @@ -12,7 +12,7 @@ import { IEnvironmentService } from 'vs/platform/environment/common/environment' import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { IFolderQuery, IPatternInfo, QueryType, ITextQuery, IFileQuery } from 'vs/platform/search/common/search'; import { IWorkspaceContextService, toWorkspaceFolders, Workspace } from 'vs/platform/workspace/common/workspace'; -import { ISearchPathsResult, QueryBuilder } from 'vs/workbench/parts/search/common/queryBuilder'; +import { ISearchPathsResult, QueryBuilder } from 'vs/workbench/contrib/search/common/queryBuilder'; import { TestContextService, TestEnvironmentService } from 'vs/workbench/test/workbenchTestServices'; const DEFAULT_EDITOR_CONFIG = {}; diff --git a/src/vs/workbench/contrib/search/test/common/searchModel.test.ts b/src/vs/workbench/contrib/search/test/common/searchModel.test.ts index 3e20387d40a..753daca49ba 100644 --- a/src/vs/workbench/contrib/search/test/common/searchModel.test.ts +++ b/src/vs/workbench/contrib/search/test/common/searchModel.test.ts @@ -17,7 +17,7 @@ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/ import { IFileMatch, IFileSearchStats, IFolderQuery, ISearchComplete, ISearchProgressItem, ISearchQuery, ISearchService, ITextSearchMatch, OneLineRange, TextSearchMatch } from 'vs/platform/search/common/search'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils'; -import { SearchModel } from 'vs/workbench/parts/search/common/searchModel'; +import { SearchModel } from 'vs/workbench/contrib/search/common/searchModel'; const nullEvent = new class { id: number; diff --git a/src/vs/workbench/contrib/search/test/common/searchResult.test.ts b/src/vs/workbench/contrib/search/test/common/searchResult.test.ts index 61421c17c10..5824e9476b9 100644 --- a/src/vs/workbench/contrib/search/test/common/searchResult.test.ts +++ b/src/vs/workbench/contrib/search/test/common/searchResult.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import * as sinon from 'sinon'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; -import { Match, FileMatch, SearchResult, SearchModel } from 'vs/workbench/parts/search/common/searchModel'; +import { Match, FileMatch, SearchResult, SearchModel } from 'vs/workbench/contrib/search/common/searchModel'; import { URI } from 'vs/base/common/uri'; import { IFileMatch, TextSearchMatch, OneLineRange, ITextSearchMatch } from 'vs/platform/search/common/search'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; @@ -15,7 +15,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { IReplaceService } from 'vs/workbench/parts/search/common/replace'; +import { IReplaceService } from 'vs/workbench/contrib/search/common/replace'; const lineOneRange = new OneLineRange(1, 0, 1); diff --git a/src/vs/workbench/contrib/snippets/electron-browser/configureSnippets.ts b/src/vs/workbench/contrib/snippets/electron-browser/configureSnippets.ts index 9875977f27d..5c8d2d0fff1 100644 --- a/src/vs/workbench/contrib/snippets/electron-browser/configureSnippets.ts +++ b/src/vs/workbench/contrib/snippets/electron-browser/configureSnippets.ts @@ -13,10 +13,10 @@ import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { timeout } from 'vs/base/common/async'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { URI } from 'vs/base/common/uri'; -import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; import { values } from 'vs/base/common/map'; import { IQuickPickItem, IQuickInputService, QuickPickInput } from 'vs/platform/quickinput/common/quickInput'; -import { SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IFileService } from 'vs/platform/files/common/files'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/contrib/snippets/electron-browser/insertSnippet.ts b/src/vs/workbench/contrib/snippets/electron-browser/insertSnippet.ts index 26e465de1fa..c25feb0f293 100644 --- a/src/vs/workbench/contrib/snippets/electron-browser/insertSnippet.ts +++ b/src/vs/workbench/contrib/snippets/electron-browser/insertSnippet.ts @@ -8,11 +8,11 @@ import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/ import { IModeService } from 'vs/editor/common/services/modeService'; import { LanguageId } from 'vs/editor/common/modes'; import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Snippet, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { Snippet, SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; import { IQuickPickItem, IQuickInputService, QuickPickInput } from 'vs/platform/quickinput/common/quickInput'; interface ISnippetPick extends IQuickPickItem { diff --git a/src/vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider.ts index 8e8456fb85a..1804c78c6d4 100644 --- a/src/vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider.ts +++ b/src/vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider.ts @@ -12,8 +12,8 @@ import { CompletionItem, CompletionItemKind, CompletionItemProvider, CompletionL import { IModeService } from 'vs/editor/common/services/modeService'; import { SnippetParser } from 'vs/editor/contrib/snippet/snippetParser'; import { localize } from 'vs/nls'; -import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; -import { Snippet, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; +import { Snippet, SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; export class SnippetCompletion implements CompletionItem { diff --git a/src/vs/workbench/contrib/snippets/electron-browser/snippets.contribution.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippets.contribution.ts index 7683f6b1b3a..c8677f3e9f8 100644 --- a/src/vs/workbench/contrib/snippets/electron-browser/snippets.contribution.ts +++ b/src/vs/workbench/contrib/snippets/electron-browser/snippets.contribution.ts @@ -9,7 +9,7 @@ import * as JSONContributionRegistry from 'vs/platform/jsonschemas/common/jsonCo import * as nls from 'vs/nls'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; import { LanguageId } from 'vs/editor/common/modes'; -import { SnippetFile, Snippet } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { SnippetFile, Snippet } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; export const ISnippetsService = createDecorator('snippetService'); diff --git a/src/vs/workbench/contrib/snippets/electron-browser/snippetsService.ts b/src/vs/workbench/contrib/snippets/electron-browser/snippetsService.ts index 7a288503970..87a6d143f8d 100644 --- a/src/vs/workbench/contrib/snippets/electron-browser/snippetsService.ts +++ b/src/vs/workbench/contrib/snippets/electron-browser/snippetsService.ts @@ -21,8 +21,8 @@ import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { ILogService } from 'vs/platform/log/common/log'; import { IWorkspace, IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; -import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; -import { Snippet, SnippetFile, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; +import { Snippet, SnippetFile, SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; import { ExtensionsRegistry, IExtensionPointUser } from 'vs/workbench/services/extensions/common/extensionsRegistry'; import { languagesExtPoint } from 'vs/workbench/services/mode/common/workbenchModeService'; import { SnippetCompletionProvider } from './snippetCompletionProvider'; diff --git a/src/vs/workbench/contrib/snippets/electron-browser/tabCompletion.ts b/src/vs/workbench/contrib/snippets/electron-browser/tabCompletion.ts index 41affd11eb8..28f171af6b2 100644 --- a/src/vs/workbench/contrib/snippets/electron-browser/tabCompletion.ts +++ b/src/vs/workbench/contrib/snippets/electron-browser/tabCompletion.ts @@ -6,8 +6,8 @@ import { KeyCode } from 'vs/base/common/keyCodes'; import { RawContextKey, IContextKeyService, ContextKeyExpr, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; -import { getNonWhitespacePrefix } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; +import { getNonWhitespacePrefix } from 'vs/workbench/contrib/snippets/electron-browser/snippetsService'; import { endsWith } from 'vs/base/common/strings'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import * as editorCommon from 'vs/editor/common/editorCommon'; @@ -17,8 +17,8 @@ import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2 import { showSimpleSuggestions } from 'vs/editor/contrib/suggest/suggest'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; -import { Snippet } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; -import { SnippetCompletion } from 'vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider'; +import { Snippet } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; +import { SnippetCompletion } from 'vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider'; export class TabCompletionController implements editorCommon.IEditorContribution { diff --git a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetFile.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetFile.test.ts index bc798bf3433..2403cdb6634 100644 --- a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetFile.test.ts +++ b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetFile.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { SnippetFile, Snippet, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { SnippetFile, Snippet, SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; import { URI } from 'vs/base/common/uri'; suite('Snippets', function () { diff --git a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRegistry.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRegistry.test.ts index 8d2958b8275..ebfe3292282 100644 --- a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRegistry.test.ts +++ b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRegistry.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { getNonWhitespacePrefix } from 'vs/workbench/parts/snippets/electron-browser/snippetsService'; +import { getNonWhitespacePrefix } from 'vs/workbench/contrib/snippets/electron-browser/snippetsService'; import { Position } from 'vs/editor/common/core/position'; suite('getNonWhitespacePrefix', () => { diff --git a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRewrite.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRewrite.test.ts index 0d084d9d89c..9747e16114f 100644 --- a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRewrite.test.ts +++ b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsRewrite.test.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { Snippet, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { Snippet, SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; suite('SnippetRewrite', function () { diff --git a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsService.test.ts b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsService.test.ts index 2986d7a5e2e..d71653bfd19 100644 --- a/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsService.test.ts +++ b/src/vs/workbench/contrib/snippets/test/electron-browser/snippetsService.test.ts @@ -4,13 +4,13 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { SnippetCompletionProvider } from 'vs/workbench/parts/snippets/electron-browser/snippetCompletionProvider'; +import { SnippetCompletionProvider } from 'vs/workbench/contrib/snippets/electron-browser/snippetCompletionProvider'; import { Position } from 'vs/editor/common/core/position'; import { ModesRegistry } from 'vs/editor/common/modes/modesRegistry'; import { ModeServiceImpl } from 'vs/editor/common/services/modeServiceImpl'; import { TextModel } from 'vs/editor/common/model/textModel'; -import { ISnippetsService } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; -import { Snippet, SnippetSource } from 'vs/workbench/parts/snippets/electron-browser/snippetsFile'; +import { ISnippetsService } from 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; +import { Snippet, SnippetSource } from 'vs/workbench/contrib/snippets/electron-browser/snippetsFile'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { CompletionContext, CompletionTriggerKind } from 'vs/editor/common/modes'; diff --git a/src/vs/workbench/contrib/stats/node/stats.contribution.ts b/src/vs/workbench/contrib/stats/node/stats.contribution.ts index 89ae2b9c1d5..ee3b9b175d5 100644 --- a/src/vs/workbench/contrib/stats/node/stats.contribution.ts +++ b/src/vs/workbench/contrib/stats/node/stats.contribution.ts @@ -5,7 +5,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; -import { WorkspaceStats } from 'vs/workbench/parts/stats/node/workspaceStats'; +import { WorkspaceStats } from 'vs/workbench/contrib/stats/node/workspaceStats'; import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; // Register Workspace Stats Contribution diff --git a/src/vs/workbench/contrib/stats/test/workspaceStats.test.ts b/src/vs/workbench/contrib/stats/test/workspaceStats.test.ts index f85b99dfb05..3543931c185 100644 --- a/src/vs/workbench/contrib/stats/test/workspaceStats.test.ts +++ b/src/vs/workbench/contrib/stats/test/workspaceStats.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import * as crypto from 'crypto'; -import { getDomainsOfRemotes, getRemotes, getHashedRemotesFromConfig } from 'vs/workbench/parts/stats/node/workspaceStats'; +import { getDomainsOfRemotes, getRemotes, getHashedRemotesFromConfig } from 'vs/workbench/contrib/stats/node/workspaceStats'; function hash(value: string): string { return crypto.createHash('sha1').update(value.toString()).digest('hex'); diff --git a/src/vs/workbench/contrib/tasks/browser/quickOpen.ts b/src/vs/workbench/contrib/tasks/browser/quickOpen.ts index ab7796f27a5..8d7b2e358de 100644 --- a/src/vs/workbench/contrib/tasks/browser/quickOpen.ts +++ b/src/vs/workbench/contrib/tasks/browser/quickOpen.ts @@ -13,8 +13,8 @@ import * as QuickOpen from 'vs/base/parts/quickopen/common/quickOpen'; import * as Model from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { CustomTask, ContributedTask } from 'vs/workbench/parts/tasks/common/tasks'; -import { ITaskService, ProblemMatcherRunOptions } from 'vs/workbench/parts/tasks/common/taskService'; +import { CustomTask, ContributedTask } from 'vs/workbench/contrib/tasks/common/tasks'; +import { ITaskService, ProblemMatcherRunOptions } from 'vs/workbench/contrib/tasks/common/taskService'; import { ActionBarContributor, ContributableActionProvider } from 'vs/workbench/browser/actions'; import { CancellationToken } from 'vs/base/common/cancellation'; diff --git a/src/vs/workbench/contrib/tasks/browser/taskQuickOpen.ts b/src/vs/workbench/contrib/tasks/browser/taskQuickOpen.ts index 289ef28e7d1..c7cbb227b24 100644 --- a/src/vs/workbench/contrib/tasks/browser/taskQuickOpen.ts +++ b/src/vs/workbench/contrib/tasks/browser/taskQuickOpen.ts @@ -8,8 +8,8 @@ import * as QuickOpen from 'vs/base/parts/quickopen/common/quickOpen'; import * as Model from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; -import { CustomTask, ContributedTask } from 'vs/workbench/parts/tasks/common/tasks'; -import { ITaskService } from 'vs/workbench/parts/tasks/common/taskService'; +import { CustomTask, ContributedTask } from 'vs/workbench/contrib/tasks/common/tasks'; +import { ITaskService } from 'vs/workbench/contrib/tasks/common/taskService'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import * as base from './quickOpen'; diff --git a/src/vs/workbench/contrib/tasks/common/problemCollectors.ts b/src/vs/workbench/contrib/tasks/common/problemCollectors.ts index 39bdf7cc041..1e576997a74 100644 --- a/src/vs/workbench/contrib/tasks/common/problemCollectors.ts +++ b/src/vs/workbench/contrib/tasks/common/problemCollectors.ts @@ -10,7 +10,7 @@ import { IDisposable } from 'vs/base/common/lifecycle'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { ILineMatcher, createLineMatcher, ProblemMatcher, ProblemMatch, ApplyToKind, WatchingPattern, getResource } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ILineMatcher, createLineMatcher, ProblemMatcher, ProblemMatch, ApplyToKind, WatchingPattern, getResource } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IMarkerService, IMarkerData, MarkerSeverity } from 'vs/platform/markers/common/markers'; import { generateUuid } from 'vs/base/common/uuid'; diff --git a/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts b/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts index ab8a3a4231e..99aa431e562 100644 --- a/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts +++ b/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.ts @@ -11,7 +11,7 @@ import * as Objects from 'vs/base/common/objects'; import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/workbench/services/extensions/common/extensionsRegistry'; -import * as Tasks from 'vs/workbench/parts/tasks/common/tasks'; +import * as Tasks from 'vs/workbench/contrib/tasks/common/tasks'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/tasks/common/taskService.ts b/src/vs/workbench/contrib/tasks/common/taskService.ts index d67b31a8af0..48cc70b770c 100644 --- a/src/vs/workbench/contrib/tasks/common/taskService.ts +++ b/src/vs/workbench/contrib/tasks/common/taskService.ts @@ -10,8 +10,8 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' import { IDisposable } from 'vs/base/common/lifecycle'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { Task, ContributedTask, CustomTask, TaskSet, TaskSorter, TaskEvent, TaskIdentifier, ConfiguringTask, TaskRunSource } from 'vs/workbench/parts/tasks/common/tasks'; -import { ITaskSummary, TaskTerminateResponse, TaskSystemInfo } from 'vs/workbench/parts/tasks/common/taskSystem'; +import { Task, ContributedTask, CustomTask, TaskSet, TaskSorter, TaskEvent, TaskIdentifier, ConfiguringTask, TaskRunSource } from 'vs/workbench/contrib/tasks/common/tasks'; +import { ITaskSummary, TaskTerminateResponse, TaskSystemInfo } from 'vs/workbench/contrib/tasks/common/taskSystem'; import { IStringDictionary } from 'vs/base/common/collections'; export { ITaskSummary, Task, TaskTerminateResponse }; diff --git a/src/vs/workbench/contrib/tasks/common/tasks.ts b/src/vs/workbench/contrib/tasks/common/tasks.ts index 3b9248543fc..1b6177ee838 100644 --- a/src/vs/workbench/contrib/tasks/common/tasks.ts +++ b/src/vs/workbench/contrib/tasks/common/tasks.ts @@ -9,7 +9,7 @@ import * as Objects from 'vs/base/common/objects'; import { UriComponents } from 'vs/base/common/uri'; import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; -import { ProblemMatcher } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ProblemMatcher } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts index 7854bcdd093..89f5ef65397 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchemaCommon.ts @@ -6,7 +6,7 @@ import * as nls from 'vs/nls'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { Schemas } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { Schemas } from 'vs/workbench/contrib/tasks/common/problemMatcher'; const schema: IJSONSchema = { definitions: { diff --git a/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts index 2c4b0fbc2d6..e747be3976a 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v1.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import * as Objects from 'vs/base/common/objects'; import { IJSONSchema } from 'vs/base/common/jsonSchema'; -import { ProblemMatcherRegistry } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ProblemMatcherRegistry } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import commonSchema from './jsonSchemaCommon'; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts index 1f39e52033a..1543a793850 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/jsonSchema_v2.ts @@ -9,7 +9,7 @@ import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; import commonSchema from './jsonSchemaCommon'; -import { ProblemMatcherRegistry } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ProblemMatcherRegistry } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { TaskDefinitionRegistry } from '../common/taskDefinitionRegistry'; import * as ConfigurationResolverUtils from 'vs/workbench/services/configurationResolver/common/configurationResolverUtils'; import { inputsSchema } from 'vs/workbench/services/configurationResolver/common/configurationResolverSchema'; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts b/src/vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts index d4443610bd4..b3bccaf94e0 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks.ts @@ -6,9 +6,9 @@ import * as nls from 'vs/nls'; import { Disposable } from 'vs/base/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { ITaskService, WorkspaceFolderTaskResult } from 'vs/workbench/parts/tasks/common/taskService'; +import { ITaskService, WorkspaceFolderTaskResult } from 'vs/workbench/contrib/tasks/common/taskService'; import { forEach } from 'vs/base/common/collections'; -import { RunOnOptions, Task, TaskRunSource } from 'vs/workbench/parts/tasks/common/tasks'; +import { RunOnOptions, Task, TaskRunSource } from 'vs/workbench/contrib/tasks/common/tasks'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; import { Action } from 'vs/base/common/actions'; diff --git a/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts index 75a02655571..641dccb3fdb 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/task.contribution.ts @@ -8,7 +8,7 @@ import 'vs/css!./media/task.contribution'; import * as nls from 'vs/nls'; import * as semver from 'semver'; -import { QuickOpenHandler } from 'vs/workbench/parts/tasks/browser/taskQuickOpen'; +import { QuickOpenHandler } from 'vs/workbench/contrib/tasks/browser/taskQuickOpen'; import Severity from 'vs/base/common/severity'; import * as Objects from 'vs/base/common/objects'; import { URI } from 'vs/base/common/uri'; @@ -38,7 +38,7 @@ import { IFileService, IFileStat } from 'vs/platform/files/common/files'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ProblemMatcherRegistry, NamedProblemMatcher } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ProblemMatcherRegistry, NamedProblemMatcher } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IProgressService2, IProgressOptions, ProgressLocation } from 'vs/platform/progress/common/progress'; @@ -57,44 +57,44 @@ import { StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar'; import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; -import Constants from 'vs/workbench/parts/markers/electron-browser/constants'; +import Constants from 'vs/workbench/contrib/markers/electron-browser/constants'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles'; -import { IOutputService, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannel } from 'vs/workbench/parts/output/common/output'; +import { IOutputService, IOutputChannelRegistry, Extensions as OutputExt, IOutputChannel } from 'vs/workbench/contrib/output/common/output'; import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; -import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService } from 'vs/workbench/contrib/terminal/common/terminal'; -import { ITaskSystem, ITaskResolver, ITaskSummary, TaskExecuteKind, TaskError, TaskErrors, TaskTerminateResponse, TaskSystemInfo, ITaskExecuteResult } from 'vs/workbench/parts/tasks/common/taskSystem'; +import { ITaskSystem, ITaskResolver, ITaskSummary, TaskExecuteKind, TaskError, TaskErrors, TaskTerminateResponse, TaskSystemInfo, ITaskExecuteResult } from 'vs/workbench/contrib/tasks/common/taskSystem'; import { Task, CustomTask, ConfiguringTask, ContributedTask, InMemoryTask, TaskEvent, TaskEventKind, TaskSet, TaskGroup, GroupType, ExecutionEngine, JsonSchemaVersion, TaskSourceKind, TaskSorter, TaskIdentifier, KeyedTaskIdentifier, TASK_RUNNING_STATE, TaskRunSource -} from 'vs/workbench/parts/tasks/common/tasks'; -import { ITaskService, ITaskProvider, ProblemMatcherRunOptions, CustomizationProperties, TaskFilter, WorkspaceFolderTaskResult } from 'vs/workbench/parts/tasks/common/taskService'; -import { getTemplates as getTaskTemplates } from 'vs/workbench/parts/tasks/common/taskTemplates'; +} from 'vs/workbench/contrib/tasks/common/tasks'; +import { ITaskService, ITaskProvider, ProblemMatcherRunOptions, CustomizationProperties, TaskFilter, WorkspaceFolderTaskResult } from 'vs/workbench/contrib/tasks/common/taskService'; +import { getTemplates as getTaskTemplates } from 'vs/workbench/contrib/tasks/common/taskTemplates'; -import { KeyedTaskIdentifier as NKeyedTaskIdentifier, TaskDefinition } from 'vs/workbench/parts/tasks/node/tasks'; +import { KeyedTaskIdentifier as NKeyedTaskIdentifier, TaskDefinition } from 'vs/workbench/contrib/tasks/node/tasks'; import * as TaskConfig from '../node/taskConfiguration'; -import { ProcessTaskSystem } from 'vs/workbench/parts/tasks/node/processTaskSystem'; +import { ProcessTaskSystem } from 'vs/workbench/contrib/tasks/node/processTaskSystem'; import { TerminalTaskSystem } from './terminalTaskSystem'; -import { ProcessRunnerDetector } from 'vs/workbench/parts/tasks/node/processRunnerDetector'; +import { ProcessRunnerDetector } from 'vs/workbench/contrib/tasks/node/processRunnerDetector'; import { QuickOpenActionContributor } from '../browser/quickOpen'; import { Themable, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IQuickInputService, IQuickPickItem, QuickPickInput } from 'vs/platform/quickinput/common/quickInput'; -import { TaskDefinitionRegistry } from 'vs/workbench/parts/tasks/common/taskDefinitionRegistry'; +import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; -import { RunAutomaticTasks, AllowAutomaticTaskRunning, DisallowAutomaticTaskRunning } from 'vs/workbench/parts/tasks/electron-browser/runAutomaticTasks'; +import { RunAutomaticTasks, AllowAutomaticTaskRunning, DisallowAutomaticTaskRunning } from 'vs/workbench/contrib/tasks/electron-browser/runAutomaticTasks'; let tasksCategory = nls.localize('tasksCategory', "Tasks"); diff --git a/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts b/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts index a0b4c778c8d..5f53e551e05 100644 --- a/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/electron-browser/terminalTaskSystem.ts @@ -22,22 +22,22 @@ import { win32 } from 'vs/base/node/processes'; import { IMarkerService, MarkerSeverity } from 'vs/platform/markers/common/markers'; 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'; +import { ProblemMatcher, ProblemMatcherRegistry /*, ProblemPattern, getResource */ } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; -import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; -import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common/output'; -import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind } from 'vs/workbench/parts/tasks/common/problemCollectors'; +import { ITerminalService, ITerminalInstance, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; +import { IOutputService, IOutputChannel } from 'vs/workbench/contrib/output/common/output'; +import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind } from 'vs/workbench/contrib/tasks/common/problemCollectors'; import { Task, CustomTask, ContributedTask, RevealKind, CommandOptions, ShellConfiguration, RuntimeType, PanelKind, TaskEvent, TaskEventKind, ShellQuotingOptions, ShellQuoting, CommandString, CommandConfiguration, ExtensionTaskSource, TaskScope -} from 'vs/workbench/parts/tasks/common/tasks'; +} from 'vs/workbench/contrib/tasks/common/tasks'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, ITaskResolver, TelemetryEvent, Triggers, TaskTerminateResponse, TaskSystemInfoResovler, TaskSystemInfo, ResolveSet, ResolvedVariables -} from 'vs/workbench/parts/tasks/common/taskSystem'; +} from 'vs/workbench/contrib/tasks/common/taskSystem'; interface TerminalData { terminal: ITerminalInstance; diff --git a/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts index 1a5f7caec5c..6098accc28c 100644 --- a/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts +++ b/src/vs/workbench/contrib/tasks/node/processTaskSystem.ts @@ -15,23 +15,23 @@ import { Event, Emitter } from 'vs/base/common/event'; import { SuccessData, ErrorData } from 'vs/base/common/processes'; import { LineProcess, LineData } from 'vs/base/node/processes'; -import { IOutputService, IOutputChannel } from 'vs/workbench/parts/output/common/output'; +import { IOutputService, IOutputChannel } from 'vs/workbench/contrib/output/common/output'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IMarkerService } from 'vs/platform/markers/common/markers'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { ProblemMatcher, ProblemMatcherRegistry } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ProblemMatcher, ProblemMatcherRegistry } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind } from 'vs/workbench/parts/tasks/common/problemCollectors'; +import { StartStopProblemCollector, WatchingProblemCollector, ProblemCollectorEventKind } from 'vs/workbench/contrib/tasks/common/problemCollectors'; import { ITaskSystem, ITaskSummary, ITaskExecuteResult, TaskExecuteKind, TaskError, TaskErrors, TelemetryEvent, Triggers, TaskTerminateResponse -} from 'vs/workbench/parts/tasks/common/taskSystem'; +} from 'vs/workbench/contrib/tasks/common/taskSystem'; import { Task, CustomTask, CommandOptions, RevealKind, CommandConfiguration, RuntimeType, TaskEvent, TaskEventKind -} from 'vs/workbench/parts/tasks/common/tasks'; +} from 'vs/workbench/contrib/tasks/common/tasks'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/contrib/tasks/node/taskConfiguration.ts b/src/vs/workbench/contrib/tasks/node/taskConfiguration.ts index afb7a097daf..5ca07aafbc8 100644 --- a/src/vs/workbench/contrib/tasks/node/taskConfiguration.ts +++ b/src/vs/workbench/contrib/tasks/node/taskConfiguration.ts @@ -15,14 +15,14 @@ import { ValidationStatus, IProblemReporter as IProblemReporterBase } from 'vs/b import { NamedProblemMatcher, ProblemMatcher, ProblemMatcherParser, Config as ProblemMatcherConfig, isNamedProblemMatcher, ProblemMatcherRegistry -} from 'vs/workbench/parts/tasks/common/problemMatcher'; +} from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import * as Tasks from '../common/tasks'; import { TaskDefinitionRegistry } from '../common/taskDefinitionRegistry'; -import { TaskDefinition } from 'vs/workbench/parts/tasks/node/tasks'; +import { TaskDefinition } from 'vs/workbench/contrib/tasks/node/tasks'; import { ConfiguredInput } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; export const enum ShellQuoting { diff --git a/src/vs/workbench/contrib/tasks/node/tasks.ts b/src/vs/workbench/contrib/tasks/node/tasks.ts index 4a794eed8d8..f22fd29b0d7 100644 --- a/src/vs/workbench/contrib/tasks/node/tasks.ts +++ b/src/vs/workbench/contrib/tasks/node/tasks.ts @@ -9,8 +9,8 @@ import * as crypto from 'crypto'; import * as Objects from 'vs/base/common/objects'; -import { TaskIdentifier, KeyedTaskIdentifier, TaskDefinition } from 'vs/workbench/parts/tasks/common/tasks'; -import { TaskDefinitionRegistry } from 'vs/workbench/parts/tasks/common/taskDefinitionRegistry'; +import { TaskIdentifier, KeyedTaskIdentifier, TaskDefinition } from 'vs/workbench/contrib/tasks/common/tasks'; +import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry'; namespace KeyedTaskIdentifier { export function create(value: TaskIdentifier): KeyedTaskIdentifier { diff --git a/src/vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts b/src/vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts index 264f564a245..c88c97c5bb9 100644 --- a/src/vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts +++ b/src/vs/workbench/contrib/tasks/test/common/problemMatcher.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import * as matchers from 'vs/workbench/parts/tasks/common/problemMatcher'; +import * as matchers from 'vs/workbench/contrib/tasks/common/problemMatcher'; import * as assert from 'assert'; import { ValidationState, IProblemReporter, ValidationStatus } from 'vs/base/common/parsers'; diff --git a/src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts b/src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts index 30591e7eef1..181f65485d3 100644 --- a/src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts +++ b/src/vs/workbench/contrib/tasks/test/electron-browser/configuration.test.ts @@ -9,11 +9,11 @@ import * as UUID from 'vs/base/common/uuid'; import * as Platform from 'vs/base/common/platform'; import { ValidationStatus } from 'vs/base/common/parsers'; -import { ProblemMatcher, FileLocationKind, ProblemPattern, ApplyToKind } from 'vs/workbench/parts/tasks/common/problemMatcher'; +import { ProblemMatcher, FileLocationKind, ProblemPattern, ApplyToKind } from 'vs/workbench/contrib/tasks/common/problemMatcher'; import { IWorkspaceFolder, WorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import * as Tasks from 'vs/workbench/parts/tasks/common/tasks'; -import { parse, ParseResult, IProblemReporter, ExternalTaskRunnerConfiguration, CustomTask } from 'vs/workbench/parts/tasks/node/taskConfiguration'; +import * as Tasks from 'vs/workbench/contrib/tasks/common/tasks'; +import { parse, ParseResult, IProblemReporter, ExternalTaskRunnerConfiguration, CustomTask } from 'vs/workbench/contrib/tasks/node/taskConfiguration'; const workspaceFolder: IWorkspaceFolder = new WorkspaceFolder({ uri: URI.file('/workspace/folderOne'), diff --git a/src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts b/src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts index 37fab124afc..e5a54d0ba74 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalFindWidget.ts @@ -6,7 +6,7 @@ import 'vs/css!./terminalFindWidget'; import { SimpleFindWidget } from 'vs/editor/contrib/find/simpleFindWidget'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; -import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_INPUT_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_INPUT_FOCUSED, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED } from 'vs/workbench/contrib/terminal/common/terminal'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts b/src/vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts index a2000fb85fb..5a86378ef50 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalQuickOpen.ts @@ -7,7 +7,7 @@ import * as nls from 'vs/nls'; import { Mode, IEntryRunContext, IAutoFocus, IQuickNavigateConfiguration, IModel } from 'vs/base/parts/quickopen/common/quickOpen'; import { QuickOpenModel, QuickOpenEntry } from 'vs/base/parts/quickopen/browser/quickOpenModel'; import { QuickOpenHandler } from 'vs/workbench/browser/quickopen'; -import { ITerminalService, ITerminalInstance } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, ITerminalInstance } from 'vs/workbench/contrib/terminal/common/terminal'; import { ContributableActionProvider } from 'vs/workbench/browser/actions'; import { stripWildcards } from 'vs/base/common/strings'; import { matchesFuzzy } from 'vs/base/common/filters'; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts index 0a57c99c16d..af2e15641c1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalTab.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalTab.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import * as aria from 'vs/base/browser/ui/aria/aria'; import * as nls from 'vs/nls'; -import { ITerminalInstance, IShellLaunchConfig, ITerminalTab, Direction, ITerminalService, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalInstance, IShellLaunchConfig, ITerminalTab, Direction, ITerminalService, ITerminalConfigHelper } from 'vs/workbench/contrib/terminal/common/terminal'; import { IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { Event, Emitter } from 'vs/base/common/event'; import { IDisposable, Disposable } from 'vs/base/common/lifecycle'; diff --git a/src/vs/workbench/contrib/terminal/common/terminalCommands.ts b/src/vs/workbench/contrib/terminal/common/terminalCommands.ts index c9d27764e85..92580041923 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalCommands.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalCommands.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; -import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService } from 'vs/workbench/contrib/terminal/common/terminal'; export const enum TERMINAL_COMMAND_ID { FIND_NEXT = 'workbench.action.terminal.findNext', diff --git a/src/vs/workbench/contrib/terminal/common/terminalMenu.ts b/src/vs/workbench/contrib/terminal/common/terminalMenu.ts index 873c8c688a5..7493d800d2d 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalMenu.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalMenu.ts @@ -5,7 +5,7 @@ import * as nls from 'vs/nls'; import { MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; +import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminalCommands'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; export function setupTerminalMenu() { diff --git a/src/vs/workbench/contrib/terminal/common/terminalService.ts b/src/vs/workbench/contrib/terminal/common/terminalService.ts index 9728d8318fa..2af5a375481 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalService.ts @@ -8,7 +8,7 @@ import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/c import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; -import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TERMINAL_PANEL_ID, ITerminalTab, ITerminalProcessExtHostProxy, ITerminalProcessExtHostRequest, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, ITerminalInstance, IShellLaunchConfig, ITerminalConfigHelper, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TERMINAL_PANEL_ID, ITerminalTab, ITerminalProcessExtHostProxy, ITerminalProcessExtHostRequest, KEYBINDING_CONTEXT_TERMINAL_IS_OPEN } from 'vs/workbench/contrib/terminal/common/terminal'; import { IStorageService } from 'vs/platform/storage/common/storage'; import { URI } from 'vs/base/common/uri'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts index fb600958c8b..1f3cf1d3b57 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminal.contribution.ts @@ -11,28 +11,28 @@ import * as nls from 'vs/nls'; import * as panel from 'vs/workbench/browser/panel'; import * as platform from 'vs/base/common/platform'; import { Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry'; -import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TerminalCursorStyle, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE, DEFAULT_LINE_HEIGHT, DEFAULT_LETTER_SPACING, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED } from 'vs/workbench/parts/terminal/common/terminal'; -import { getDefaultShell } from 'vs/workbench/parts/terminal/node/terminal'; +import { ITerminalService, KEYBINDING_CONTEXT_TERMINAL_FOCUS, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, TERMINAL_PANEL_ID, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE, TerminalCursorStyle, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_NOT_VISIBLE, DEFAULT_LINE_HEIGHT, DEFAULT_LETTER_SPACING, KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_FOCUSED } from 'vs/workbench/contrib/terminal/common/terminal'; +import { getDefaultShell } from 'vs/workbench/contrib/terminal/node/terminal'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { KeyCode, KeyMod } from 'vs/base/common/keyCodes'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; -import { KillTerminalAction, ClearSelectionTerminalAction, CopyTerminalSelectionAction, CreateNewTerminalAction, CreateNewInActiveWorkspaceTerminalAction, FocusActiveTerminalAction, FocusNextTerminalAction, FocusPreviousTerminalAction, SelectDefaultShellWindowsTerminalAction, RunSelectedTextInTerminalAction, RunActiveFileInTerminalAction, ScrollDownTerminalAction, ScrollDownPageTerminalAction, ScrollToBottomTerminalAction, ScrollUpTerminalAction, ScrollUpPageTerminalAction, ScrollToTopTerminalAction, TerminalPasteAction, ToggleTerminalAction, ClearTerminalAction, AllowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand, RenameTerminalAction, SelectAllTerminalAction, FocusTerminalFindWidgetAction, HideTerminalFindWidgetAction, DeleteWordLeftTerminalAction, DeleteWordRightTerminalAction, QuickOpenActionTermContributor, QuickOpenTermAction, TERMINAL_PICKER_PREFIX, MoveToLineStartTerminalAction, MoveToLineEndTerminalAction, SplitTerminalAction, SplitInActiveWorkspaceTerminalAction, FocusPreviousPaneTerminalAction, FocusNextPaneTerminalAction, ResizePaneLeftTerminalAction, ResizePaneRightTerminalAction, ResizePaneUpTerminalAction, ResizePaneDownTerminalAction, ScrollToPreviousCommandAction, ScrollToNextCommandAction, SelectToPreviousCommandAction, SelectToNextCommandAction, SelectToPreviousLineAction, SelectToNextLineAction, ToggleEscapeSequenceLoggingAction, SendSequenceTerminalCommand, ToggleRegexCommand, ToggleWholeWordCommand, ToggleCaseSensitiveCommand, FindNext, FindPrevious, DeleteToLineStartTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; +import { KillTerminalAction, ClearSelectionTerminalAction, CopyTerminalSelectionAction, CreateNewTerminalAction, CreateNewInActiveWorkspaceTerminalAction, FocusActiveTerminalAction, FocusNextTerminalAction, FocusPreviousTerminalAction, SelectDefaultShellWindowsTerminalAction, RunSelectedTextInTerminalAction, RunActiveFileInTerminalAction, ScrollDownTerminalAction, ScrollDownPageTerminalAction, ScrollToBottomTerminalAction, ScrollUpTerminalAction, ScrollUpPageTerminalAction, ScrollToTopTerminalAction, TerminalPasteAction, ToggleTerminalAction, ClearTerminalAction, AllowWorkspaceShellTerminalCommand, DisallowWorkspaceShellTerminalCommand, RenameTerminalAction, SelectAllTerminalAction, FocusTerminalFindWidgetAction, HideTerminalFindWidgetAction, DeleteWordLeftTerminalAction, DeleteWordRightTerminalAction, QuickOpenActionTermContributor, QuickOpenTermAction, TERMINAL_PICKER_PREFIX, MoveToLineStartTerminalAction, MoveToLineEndTerminalAction, SplitTerminalAction, SplitInActiveWorkspaceTerminalAction, FocusPreviousPaneTerminalAction, FocusNextPaneTerminalAction, ResizePaneLeftTerminalAction, ResizePaneRightTerminalAction, ResizePaneUpTerminalAction, ResizePaneDownTerminalAction, ScrollToPreviousCommandAction, ScrollToNextCommandAction, SelectToPreviousCommandAction, SelectToNextCommandAction, SelectToPreviousLineAction, SelectToNextLineAction, ToggleEscapeSequenceLoggingAction, SendSequenceTerminalCommand, ToggleRegexCommand, ToggleWholeWordCommand, ToggleCaseSensitiveCommand, FindNext, FindPrevious, DeleteToLineStartTerminalAction } from 'vs/workbench/contrib/terminal/electron-browser/terminalActions'; import { Registry } from 'vs/platform/registry/common/platform'; import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; -import { TerminalService } from 'vs/workbench/parts/terminal/electron-browser/terminalService'; +import { TerminalService } from 'vs/workbench/contrib/terminal/electron-browser/terminalService'; import { registerSingleton } from 'vs/platform/instantiation/common/extensions'; import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; -import { registerColors } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; +import { registerColors } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { getQuickNavigateHandler } from 'vs/workbench/browser/parts/quickopen/quickopen'; import { IQuickOpenRegistry, Extensions as QuickOpenExtensions, QuickOpenHandlerDescriptor } from 'vs/workbench/browser/quickopen'; import { Scope, IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions'; import { CommandsRegistry } from 'vs/platform/commands/common/commands'; -import { TerminalPanel } from 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; -import { TerminalPickerHandler } from 'vs/workbench/parts/terminal/browser/terminalQuickOpen'; -import { setupTerminalCommands, TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; -import { setupTerminalMenu } from 'vs/workbench/parts/terminal/common/terminalMenu'; -import { DEFAULT_COMMANDS_TO_SKIP_SHELL } from 'vs/workbench/parts/terminal/electron-browser/terminalInstance'; +import { TerminalPanel } from 'vs/workbench/contrib/terminal/electron-browser/terminalPanel'; +import { TerminalPickerHandler } from 'vs/workbench/contrib/terminal/browser/terminalQuickOpen'; +import { setupTerminalCommands, TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminalCommands'; +import { setupTerminalMenu } from 'vs/workbench/contrib/terminal/common/terminalMenu'; +import { DEFAULT_COMMANDS_TO_SKIP_SHELL } from 'vs/workbench/contrib/terminal/electron-browser/terminalInstance'; const quickOpenRegistry = (Registry.as(QuickOpenExtensions.Quickopen)); diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts index 4252f8fa3df..67965756849 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalActions.ts @@ -8,7 +8,7 @@ import * as os from 'os'; import { Action, IAction } from 'vs/base/common/actions'; import { EndOfLinePreference } from 'vs/editor/common/model'; import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService'; -import { ITerminalService, TERMINAL_PANEL_ID, ITerminalInstance, Direction, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, TERMINAL_PANEL_ID, ITerminalInstance, Direction, ITerminalConfigHelper } from 'vs/workbench/contrib/terminal/common/terminal'; import { SelectActionItem } from 'vs/base/browser/ui/actionbar/actionbar'; import { TogglePanelAction } from 'vs/workbench/browser/panel'; import { IPartService } from 'vs/workbench/services/part/common/partService'; @@ -18,14 +18,14 @@ import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen'; import { IQuickInputService, IPickOptions, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput'; import { ActionBarContributor } from 'vs/workbench/browser/actions'; -import { TerminalEntry } from 'vs/workbench/parts/terminal/browser/terminalQuickOpen'; +import { TerminalEntry } from 'vs/workbench/contrib/terminal/browser/terminalQuickOpen'; import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { IContextViewService } from 'vs/platform/contextview/browser/contextView'; import { ICommandService } from 'vs/platform/commands/common/commands'; import { IWorkspaceContextService, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; import { PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands'; import { INotificationService } from 'vs/platform/notification/common/notification'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; +import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminalCommands'; import { Command } from 'vs/editor/browser/editorExtensions'; import { timeout } from 'vs/base/common/async'; import { FindReplaceState } from 'vs/editor/contrib/find/findState'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts index 10bb8f9723e..a6d3638f943 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper.ts @@ -10,9 +10,9 @@ import { EDITOR_FONT_DEFAULTS, IEditorOptions } from 'vs/editor/common/config/ed import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { ITerminalConfiguration, ITerminalConfigHelper, ITerminalFont, IShellLaunchConfig, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, TERMINAL_CONFIG_SECTION, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, MINIMUM_LETTER_SPACING } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalConfiguration, ITerminalConfigHelper, ITerminalFont, IShellLaunchConfig, IS_WORKSPACE_SHELL_ALLOWED_STORAGE_KEY, TERMINAL_CONFIG_SECTION, DEFAULT_LETTER_SPACING, DEFAULT_LINE_HEIGHT, MINIMUM_LETTER_SPACING } from 'vs/workbench/contrib/terminal/common/terminal'; import Severity from 'vs/base/common/severity'; -import { isFedora, isUbuntu } from 'vs/workbench/parts/terminal/node/terminal'; +import { isFedora, isUbuntu } from 'vs/workbench/contrib/terminal/node/terminal'; import { Terminal as XTermTerminal } from 'vscode-xterm'; import { INotificationService } from 'vs/platform/notification/common/notification'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts index 15cc76a4fc3..b9ca8a82b51 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalInstance.ts @@ -28,15 +28,15 @@ import { IStorageService, StorageScope } from 'vs/platform/storage/common/storag import { activeContrastBorder, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground } from 'vs/platform/theme/common/colorRegistry'; import { ICssStyleCollector, ITheme, IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { PANEL_BACKGROUND } from 'vs/workbench/common/theme'; -import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; -import { IShellLaunchConfig, ITerminalDimensions, ITerminalInstance, ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; -import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; -import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; -import { TerminalLinkHandler } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; -import { TerminalProcessManager } from 'vs/workbench/parts/terminal/electron-browser/terminalProcessManager'; -import { TerminalCommandTracker } from 'vs/workbench/parts/terminal/node/terminalCommandTracker'; -import { WindowsShellHelper } from 'vs/workbench/parts/terminal/node/windowsShellHelper'; +import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/terminalWidgetManager'; +import { IShellLaunchConfig, ITerminalDimensions, ITerminalInstance, ITerminalProcessManager, KEYBINDING_CONTEXT_TERMINAL_TEXT_SELECTED, NEVER_MEASURE_RENDER_TIME_STORAGE_KEY, ProcessState, TERMINAL_PANEL_ID } from 'vs/workbench/contrib/terminal/common/terminal'; +import { ansiColorIdentifiers, TERMINAL_BACKGROUND_COLOR, TERMINAL_CURSOR_BACKGROUND_COLOR, TERMINAL_CURSOR_FOREGROUND_COLOR, TERMINAL_FOREGROUND_COLOR, TERMINAL_SELECTION_BACKGROUND_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; +import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminalCommands'; +import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper'; +import { TerminalLinkHandler } from 'vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler'; +import { TerminalProcessManager } from 'vs/workbench/contrib/terminal/electron-browser/terminalProcessManager'; +import { TerminalCommandTracker } from 'vs/workbench/contrib/terminal/node/terminalCommandTracker'; +import { WindowsShellHelper } from 'vs/workbench/contrib/terminal/node/windowsShellHelper'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { ISearchOptions, Terminal as XTermTerminal } from 'vscode-xterm'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts index 993b6e548fa..e0d59d335ac 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler.ts @@ -10,9 +10,9 @@ import * as pfs from 'vs/base/node/pfs'; import { URI as Uri } from 'vs/base/common/uri'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; import { IOpenerService } from 'vs/platform/opener/common/opener'; -import { TerminalWidgetManager } from 'vs/workbench/parts/terminal/browser/terminalWidgetManager'; +import { TerminalWidgetManager } from 'vs/workbench/contrib/terminal/browser/terminalWidgetManager'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; -import { ITerminalService } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService } from 'vs/workbench/contrib/terminal/common/terminal'; import { ITextEditorSelection } from 'vs/platform/editor/common/editor'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { ILinkMatcherOptions } from 'vscode-xterm'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts index 6395712ee95..efdff455b8c 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalPanel.ts @@ -6,25 +6,25 @@ import * as dom from 'vs/base/browser/dom'; import * as nls from 'vs/nls'; import * as platform from 'vs/base/common/platform'; -import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; +import * as terminalEnvironment from 'vs/workbench/contrib/terminal/node/terminalEnvironment'; import { Action, IAction } from 'vs/base/common/actions'; import { IActionItem, Separator } from 'vs/base/browser/ui/actionbar/actionbar'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IContextMenuService } from 'vs/platform/contextview/browser/contextView'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { ITerminalService, TERMINAL_PANEL_ID } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, TERMINAL_PANEL_ID } from 'vs/workbench/contrib/terminal/common/terminal'; import { IThemeService, ITheme, registerThemingParticipant, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; -import { TerminalFindWidget } from 'vs/workbench/parts/terminal/browser/terminalFindWidget'; +import { TerminalFindWidget } from 'vs/workbench/contrib/terminal/browser/terminalFindWidget'; import { editorHoverBackground, editorHoverBorder, editorForeground } from 'vs/platform/theme/common/colorRegistry'; -import { KillTerminalAction, SwitchTerminalAction, SwitchTerminalActionItem, CopyTerminalSelectionAction, TerminalPasteAction, ClearTerminalAction, SelectAllTerminalAction, CreateNewTerminalAction, SplitTerminalAction } from 'vs/workbench/parts/terminal/electron-browser/terminalActions'; +import { KillTerminalAction, SwitchTerminalAction, SwitchTerminalActionItem, CopyTerminalSelectionAction, TerminalPasteAction, ClearTerminalAction, SelectAllTerminalAction, CreateNewTerminalAction, SplitTerminalAction } from 'vs/workbench/contrib/terminal/electron-browser/terminalActions'; import { Panel } from 'vs/workbench/browser/panel'; import { StandardMouseEvent } from 'vs/base/browser/mouseEvent'; import { URI } from 'vs/base/common/uri'; -import { TERMINAL_BACKGROUND_COLOR, TERMINAL_BORDER_COLOR } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; +import { TERMINAL_BACKGROUND_COLOR, TERMINAL_BORDER_COLOR } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { DataTransfers } from 'vs/base/browser/dnd'; import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification'; -import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; +import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper'; import { IStorageService } from 'vs/platform/storage/common/storage'; const FIND_FOCUS_CLASS = 'find-focused'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts index 466e6e7326d..5e4413adf68 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalProcessManager.ts @@ -4,16 +4,16 @@ *--------------------------------------------------------------------------------------------*/ import * as platform from 'vs/base/common/platform'; -import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; +import * as terminalEnvironment from 'vs/workbench/contrib/terminal/node/terminalEnvironment'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { ProcessState, ITerminalProcessManager, IShellLaunchConfig, ITerminalConfigHelper } from 'vs/workbench/parts/terminal/common/terminal'; +import { ProcessState, ITerminalProcessManager, IShellLaunchConfig, ITerminalConfigHelper } from 'vs/workbench/contrib/terminal/common/terminal'; import { ILogService } from 'vs/platform/log/common/log'; import { Emitter, Event } from 'vs/base/common/event'; import { IHistoryService } from 'vs/workbench/services/history/common/history'; -import { ITerminalChildProcess } from 'vs/workbench/parts/terminal/node/terminal'; -import { TerminalProcessExtHostProxy } from 'vs/workbench/parts/terminal/node/terminalProcessExtHostProxy'; +import { ITerminalChildProcess } from 'vs/workbench/contrib/terminal/node/terminal'; +import { TerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { TerminalProcess } from 'vs/workbench/parts/terminal/node/terminalProcess'; +import { TerminalProcess } from 'vs/workbench/contrib/terminal/node/terminalProcess'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; import { IWindowService } from 'vs/platform/windows/common/windows'; diff --git a/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts b/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts index 53a7eaecb0a..fbace8ec6fb 100644 --- a/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts +++ b/src/vs/workbench/contrib/terminal/electron-browser/terminalService.ts @@ -12,19 +12,19 @@ import { ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration'; -import { ITerminalInstance, ITerminalService, IShellLaunchConfig, ITerminalConfigHelper, NEVER_SUGGEST_SELECT_WINDOWS_SHELL_STORAGE_KEY, TERMINAL_PANEL_ID, ITerminalProcessExtHostProxy } from 'vs/workbench/parts/terminal/common/terminal'; -import { TerminalService as AbstractTerminalService } from 'vs/workbench/parts/terminal/common/terminalService'; -import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; +import { ITerminalInstance, ITerminalService, IShellLaunchConfig, ITerminalConfigHelper, NEVER_SUGGEST_SELECT_WINDOWS_SHELL_STORAGE_KEY, TERMINAL_PANEL_ID, ITerminalProcessExtHostProxy } from 'vs/workbench/contrib/terminal/common/terminal'; +import { TerminalService as AbstractTerminalService } from 'vs/workbench/contrib/terminal/common/terminalService'; +import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper'; import Severity from 'vs/base/common/severity'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { getDefaultShell } from 'vs/workbench/parts/terminal/node/terminal'; -import { TerminalPanel } from 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; -import { TerminalTab } from 'vs/workbench/parts/terminal/browser/terminalTab'; +import { getDefaultShell } from 'vs/workbench/contrib/terminal/node/terminal'; +import { TerminalPanel } from 'vs/workbench/contrib/terminal/electron-browser/terminalPanel'; +import { TerminalTab } from 'vs/workbench/contrib/terminal/browser/terminalTab'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; import { INotificationService } from 'vs/platform/notification/common/notification'; import { ipcRenderer as ipc } from 'electron'; import { IOpenFileRequest, IWindowService } from 'vs/platform/windows/common/windows'; -import { TerminalInstance } from 'vs/workbench/parts/terminal/electron-browser/terminalInstance'; +import { TerminalInstance } from 'vs/workbench/contrib/terminal/electron-browser/terminalInstance'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; import { URI } from 'vs/base/common/uri'; import { IQuickInputService, IQuickPickItem, IPickOptions } from 'vs/platform/quickinput/common/quickInput'; diff --git a/src/vs/workbench/contrib/terminal/node/terminalCommandTracker.ts b/src/vs/workbench/contrib/terminal/node/terminalCommandTracker.ts index 7074ca39d1e..c7857624a7d 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalCommandTracker.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalCommandTracker.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Terminal, IMarker } from 'vscode-xterm'; -import { ITerminalCommandTracker } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalCommandTracker } from 'vs/workbench/contrib/terminal/common/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; /** diff --git a/src/vs/workbench/contrib/terminal/node/terminalEnvironment.ts b/src/vs/workbench/contrib/terminal/node/terminalEnvironment.ts index 7942c4c8700..bd134149555 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalEnvironment.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalEnvironment.ts @@ -9,7 +9,7 @@ import * as platform from 'vs/base/common/platform'; import pkg from 'vs/platform/node/package'; import { URI as Uri } from 'vs/base/common/uri'; import { IWorkspaceFolder } from 'vs/platform/workspace/common/workspace'; -import { IShellLaunchConfig, ITerminalEnvironment } from 'vs/workbench/parts/terminal/common/terminal'; +import { IShellLaunchConfig, ITerminalEnvironment } from 'vs/workbench/contrib/terminal/common/terminal'; import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver'; /** diff --git a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts index 16dfd0580b4..e1bd577ca28 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProcess.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProcess.ts @@ -8,9 +8,9 @@ import * as path from 'path'; import * as platform from 'vs/base/common/platform'; import * as pty from 'node-pty'; import { Event, Emitter } from 'vs/base/common/event'; -import { ITerminalChildProcess } from 'vs/workbench/parts/terminal/node/terminal'; +import { ITerminalChildProcess } from 'vs/workbench/contrib/terminal/node/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; -import { IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; +import { IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; import { exec } from 'child_process'; export class TerminalProcess implements ITerminalChildProcess, IDisposable { diff --git a/src/vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts b/src/vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts index dbf10b10214..5eb61629e48 100644 --- a/src/vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts +++ b/src/vs/workbench/contrib/terminal/node/terminalProcessExtHostProxy.ts @@ -3,9 +3,9 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { ITerminalChildProcess } from 'vs/workbench/parts/terminal/node/terminal'; +import { ITerminalChildProcess } from 'vs/workbench/contrib/terminal/node/terminal'; import { Event, Emitter } from 'vs/base/common/event'; -import { ITerminalService, ITerminalProcessExtHostProxy, IShellLaunchConfig } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalService, ITerminalProcessExtHostProxy, IShellLaunchConfig } from 'vs/workbench/contrib/terminal/common/terminal'; import { IDisposable } from 'vs/base/common/lifecycle'; import { URI } from 'vs/base/common/uri'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts b/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts index 3365163c107..80233f87d4d 100644 --- a/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts +++ b/src/vs/workbench/contrib/terminal/node/windowsShellHelper.ts @@ -5,7 +5,7 @@ import * as platform from 'vs/base/common/platform'; import { Emitter, Event } from 'vs/base/common/event'; -import { ITerminalInstance } from 'vs/workbench/parts/terminal/common/terminal'; +import { ITerminalInstance } from 'vs/workbench/contrib/terminal/common/terminal'; import { Terminal as XTermTerminal } from 'vscode-xterm'; import WindowsProcessTreeType = require('windows-process-tree'); diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts index 6da31f8e1b9..d38607acc5d 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalColorRegistry.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import { Extensions as ThemeingExtensions, IColorRegistry, ColorIdentifier } from 'vs/platform/theme/common/colorRegistry'; import { Registry } from 'vs/platform/registry/common/platform'; -import { ansiColorIdentifiers, registerColors } from 'vs/workbench/parts/terminal/common/terminalColorRegistry'; +import { ansiColorIdentifiers, registerColors } from 'vs/workbench/contrib/terminal/common/terminalColorRegistry'; import { ITheme, ThemeType } from 'vs/platform/theme/common/themeService'; import { Color } from 'vs/base/common/color'; diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts index ae957e55949..4ee63fee360 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalConfigHelper.test.ts @@ -4,9 +4,9 @@ *--------------------------------------------------------------------------------------------*/ import * as assert from 'assert'; -import { TerminalConfigHelper } from 'vs/workbench/parts/terminal/electron-browser/terminalConfigHelper'; +import { TerminalConfigHelper } from 'vs/workbench/contrib/terminal/electron-browser/terminalConfigHelper'; import { EDITOR_FONT_DEFAULTS } from 'vs/editor/common/config/editorOptions'; -import { isFedora, isUbuntu } from 'vs/workbench/parts/terminal/node/terminal'; +import { isFedora, isUbuntu } from 'vs/workbench/contrib/terminal/node/terminal'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; suite('Workbench - TerminalConfigHelper', () => { diff --git a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts index a15fe4cf18d..ea0d7c93361 100644 --- a/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts +++ b/src/vs/workbench/contrib/terminal/test/electron-browser/terminalLinkHandler.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { Platform } from 'vs/base/common/platform'; -import { TerminalLinkHandler, LineColumnInfo } from 'vs/workbench/parts/terminal/electron-browser/terminalLinkHandler'; +import { TerminalLinkHandler, LineColumnInfo } from 'vs/workbench/contrib/terminal/electron-browser/terminalLinkHandler'; import * as strings from 'vs/base/common/strings'; import * as path from 'path'; import * as sinon from 'sinon'; diff --git a/src/vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts b/src/vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts index 495ffc45da2..324781f164c 100644 --- a/src/vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts +++ b/src/vs/workbench/contrib/terminal/test/node/terminalCommandTracker.test.ts @@ -5,7 +5,7 @@ import * as assert from 'assert'; import { Terminal, TerminalCore } from 'vscode-xterm'; -import { TerminalCommandTracker } from 'vs/workbench/parts/terminal/node/terminalCommandTracker'; +import { TerminalCommandTracker } from 'vs/workbench/contrib/terminal/node/terminalCommandTracker'; import { isWindows } from 'vs/base/common/platform'; interface TestTerminalCore extends TerminalCore { diff --git a/src/vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts b/src/vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts index db8533967d8..0f9ecc1299a 100644 --- a/src/vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts +++ b/src/vs/workbench/contrib/terminal/test/node/terminalEnvironment.test.ts @@ -6,7 +6,7 @@ import * as assert from 'assert'; import * as os from 'os'; import * as platform from 'vs/base/common/platform'; -import * as terminalEnvironment from 'vs/workbench/parts/terminal/node/terminalEnvironment'; +import * as terminalEnvironment from 'vs/workbench/contrib/terminal/node/terminalEnvironment'; import { URI as Uri } from 'vs/base/common/uri'; import { IStringDictionary } from 'vs/base/common/collections'; diff --git a/src/vs/workbench/contrib/themes/electron-browser/themes.contribution.ts b/src/vs/workbench/contrib/themes/electron-browser/themes.contribution.ts index 7a9c717f891..47a9776b807 100644 --- a/src/vs/workbench/contrib/themes/electron-browser/themes.contribution.ts +++ b/src/vs/workbench/contrib/themes/electron-browser/themes.contribution.ts @@ -11,7 +11,7 @@ import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/ import { Registry } from 'vs/platform/registry/common/platform'; import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions'; import { IWorkbenchThemeService, COLOR_THEME_SETTING, ICON_THEME_SETTING, IColorTheme, IFileIconTheme } from 'vs/workbench/services/themes/common/workbenchThemeService'; -import { VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/parts/extensions/common/extensions'; +import { VIEWLET_ID, IExtensionsViewlet } from 'vs/workbench/contrib/extensions/common/extensions'; import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; import { IViewletService } from 'vs/workbench/services/viewlet/browser/viewlet'; import { Delayer } from 'vs/base/common/async'; diff --git a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts index 94afb719e64..5ebb5c8a1f4 100644 --- a/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts +++ b/src/vs/workbench/contrib/update/electron-browser/releaseNotesEditor.ts @@ -20,9 +20,9 @@ import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IRequestService } from 'vs/platform/request/node/request'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { addGAParameters } from 'vs/platform/telemetry/node/telemetryNodeUtils'; -import { IWebviewEditorService } from 'vs/workbench/parts/webview/electron-browser/webviewEditorService'; +import { IWebviewEditorService } from 'vs/workbench/contrib/webview/electron-browser/webviewEditorService'; import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { WebviewEditorInput } from 'vs/workbench/parts/webview/electron-browser/webviewEditorInput'; +import { WebviewEditorInput } from 'vs/workbench/contrib/webview/electron-browser/webviewEditorInput'; import { KeybindingParser } from 'vs/base/common/keybindingParser'; import { CancellationToken } from 'vs/base/common/cancellation'; import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/contrib/watermark/electron-browser/watermark.ts b/src/vs/workbench/contrib/watermark/electron-browser/watermark.ts index 07b562b3156..4a0f500840e 100644 --- a/src/vs/workbench/contrib/watermark/electron-browser/watermark.ts +++ b/src/vs/workbench/contrib/watermark/electron-browser/watermark.ts @@ -16,14 +16,14 @@ import { IWorkbenchContribution, IWorkbenchContributionsRegistry, Extensions as import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { OpenRecentAction } from 'vs/workbench/electron-browser/actions/windowActions'; -import { GlobalNewUntitledFileAction } from 'vs/workbench/parts/files/electron-browser/fileActions'; +import { GlobalNewUntitledFileAction } from 'vs/workbench/contrib/files/electron-browser/fileActions'; import { OpenFolderAction, OpenFileFolderAction, OpenFileAction } from 'vs/workbench/browser/actions/workspaceActions'; -import { ShowAllCommandsAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; +import { ShowAllCommandsAction } from 'vs/workbench/contrib/quickopen/browser/commandsHandler'; import { Parts, IPartService, IDimension } from 'vs/workbench/services/part/common/partService'; -import { StartAction } from 'vs/workbench/parts/debug/browser/debugActions'; -import { FindInFilesActionId } from 'vs/workbench/parts/search/common/constants'; +import { StartAction } from 'vs/workbench/contrib/debug/browser/debugActions'; +import { FindInFilesActionId } from 'vs/workbench/contrib/search/common/constants'; import { QUICKOPEN_ACTION_ID } from 'vs/workbench/browser/parts/quickopen/quickopen'; -import { TERMINAL_COMMAND_ID } from 'vs/workbench/parts/terminal/common/terminalCommands'; +import { TERMINAL_COMMAND_ID } from 'vs/workbench/contrib/terminal/common/terminalCommands'; import * as dom from 'vs/base/browser/dom'; import { KeybindingLabel } from 'vs/base/browser/ui/keybindingLabel/keybindingLabel'; diff --git a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts index 033bd98d007..c186624c3d3 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webview.contribution.ts @@ -14,7 +14,7 @@ import { Registry } from 'vs/platform/registry/common/platform'; import { EditorDescriptor, Extensions as EditorExtensions, IEditorRegistry } from 'vs/workbench/browser/editor'; import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions'; import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; -import { WebviewEditorInputFactory } from 'vs/workbench/parts/webview/electron-browser/webviewEditorInputFactory'; +import { WebviewEditorInputFactory } from 'vs/workbench/contrib/webview/electron-browser/webviewEditorInputFactory'; import { KEYBINDING_CONTEXT_WEBVIEW_FIND_WIDGET_VISIBLE } from './baseWebviewEditor'; import { HideWebViewEditorFindCommand, OpenWebviewDeveloperToolsAction, ReloadWebviewAction, ShowWebViewEditorFindWidgetCommand, SelectAllWebviewEditorCommand, CopyWebviewEditorCommand, PasteWebviewEditorCommand, CutWebviewEditorCommand, UndoWebviewEditorCommand, RedoWebviewEditorCommand } from './webviewCommands'; import { WebviewEditor } from './webviewEditor'; diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewEditor.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewEditor.ts index dbf7c661978..78abe8ffa76 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewEditor.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewEditor.ts @@ -14,7 +14,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { EditorOptions } from 'vs/workbench/common/editor'; -import { WebviewEditorInput } from 'vs/workbench/parts/webview/electron-browser/webviewEditorInput'; +import { WebviewEditorInput } from 'vs/workbench/contrib/webview/electron-browser/webviewEditorInput'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroup } from 'vs/workbench/services/group/common/editorGroupsService'; import { IPartService, Parts } from 'vs/workbench/services/part/common/partService'; diff --git a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts index 1727708a5c2..89ae486f958 100644 --- a/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts +++ b/src/vs/workbench/contrib/webview/electron-browser/webviewElement.ts @@ -12,7 +12,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import * as colorRegistry from 'vs/platform/theme/common/colorRegistry'; import { DARK, ITheme, IThemeService, LIGHT } from 'vs/platform/theme/common/themeService'; -import { registerFileProtocol, WebviewProtocol } from 'vs/workbench/parts/webview/electron-browser/webviewProtocols'; +import { registerFileProtocol, WebviewProtocol } from 'vs/workbench/contrib/webview/electron-browser/webviewProtocols'; import { areWebviewInputOptionsEqual } from './webviewEditorService'; import { WebviewFindWidget } from './webviewFindWidget'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; diff --git a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts index 38add0516f9..6d876b4faa6 100644 --- a/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts +++ b/src/vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut.ts @@ -13,7 +13,7 @@ import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { onUnexpectedError } from 'vs/base/common/errors'; import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows'; -import { IExperimentService, ExperimentState } from 'vs/workbench/parts/experiments/node/experimentService'; +import { IExperimentService, ExperimentState } from 'vs/workbench/contrib/experiments/node/experimentService'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { language, locale } from 'vs/base/common/platform'; import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement'; @@ -95,7 +95,7 @@ export class TelemetryOptOut implements IWorkbenchContribution { return this.galleryService.getCoreTranslation(extensionToFetchTranslationsFrom, locale!) .then(translation => { - const translationsFromPack = translation && translation.contents ? translation.contents['vs/workbench/parts/welcome/gettingStarted/electron-browser/telemetryOptOut'] : {}; + const translationsFromPack = translation && translation.contents ? translation.contents['vs/workbench/contrib/welcome/gettingStarted/electron-browser/telemetryOptOut'] : {}; if (!!translationsFromPack[promptMessageKey] && !!translationsFromPack[yesLabelKey] && !!translationsFromPack[noLabelKey]) { promptMessage = translationsFromPack[promptMessageKey].replace('{0}', this.privacyUrl) + ' (Please help Microsoft improve Visual Studio Code by allowing the collection of usage data.)'; yesLabel = translationsFromPack[yesLabelKey] + ' (Yes)'; diff --git a/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts b/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts index 0a68077357a..531629e54dd 100644 --- a/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts +++ b/src/vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay.ts @@ -7,7 +7,7 @@ import 'vs/css!./welcomeOverlay'; import * as dom from 'vs/base/browser/dom'; import { Registry } from 'vs/platform/registry/common/platform'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding'; -import { ShowAllCommandsAction } from 'vs/workbench/parts/quickopen/browser/commandsHandler'; +import { ShowAllCommandsAction } from 'vs/workbench/contrib/quickopen/browser/commandsHandler'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { Parts, IPartService } from 'vs/workbench/services/part/common/partService'; import { localize } from 'vs/nls'; diff --git a/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution.ts b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution.ts index a6f7737259c..3346ebedbe3 100644 --- a/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution.ts +++ b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution.ts @@ -6,7 +6,7 @@ import { localize } from 'vs/nls'; import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions'; import { Registry } from 'vs/platform/registry/common/platform'; -import { WelcomePageContribution, WelcomePageAction, WelcomeInputFactory } from 'vs/workbench/parts/welcome/page/electron-browser/welcomePage'; +import { WelcomePageContribution, WelcomePageAction, WelcomeInputFactory } from 'vs/workbench/contrib/welcome/page/electron-browser/welcomePage'; import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions'; import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions'; import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry'; diff --git a/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.ts b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.ts index 9a60c85c0e6..421d4717907 100644 --- a/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.ts +++ b/src/vs/workbench/contrib/welcome/page/electron-browser/welcomePage.ts @@ -9,7 +9,7 @@ import * as strings from 'vs/base/common/strings'; import * as path from 'path'; import { ICommandService } from 'vs/platform/commands/common/commands'; import * as arrays from 'vs/base/common/arrays'; -import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; +import { WalkThroughInput } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughInput'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; @@ -23,16 +23,16 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { Schemas } from 'vs/base/common/network'; import { IBackupFileService } from 'vs/workbench/services/backup/common/backup'; -import { getInstalledExtensions, IExtensionStatus, onExtensionChanged, isKeymapExtension } from 'vs/workbench/parts/extensions/electron-browser/extensionsUtils'; +import { getInstalledExtensions, IExtensionStatus, onExtensionChanged, isKeymapExtension } from 'vs/workbench/contrib/extensions/electron-browser/extensionsUtils'; import { IExtensionEnablementService, IExtensionManagementService, IExtensionGalleryService, IExtensionTipsService, EnablementState, ILocalExtension } from 'vs/platform/extensionManagement/common/extensionManagement'; -import { used } from 'vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page'; +import { used } from 'vs/workbench/contrib/welcome/page/electron-browser/vs_code_welcome_page'; import { ILifecycleService, StartupKind } from 'vs/platform/lifecycle/common/lifecycle'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { tildify, getBaseLabel } from 'vs/base/common/labels'; import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { registerColor, focusBorder, textLinkForeground, textLinkActiveForeground, foreground, descriptionForeground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; -import { getExtraColor } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils'; -import { IExtensionsWorkbenchService } from 'vs/workbench/parts/extensions/common/extensions'; +import { getExtraColor } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughUtils'; +import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions'; import { IWorkspaceIdentifier, ISingleFolderWorkspaceIdentifier, isSingleFolderWorkspaceIdentifier, isWorkspaceIdentifier } from 'vs/platform/workspaces/common/workspaces'; import { IEditorInputFactory, EditorInput } from 'vs/workbench/common/editor'; import { INotificationService, Severity } from 'vs/platform/notification/common/notification'; @@ -275,7 +275,7 @@ class WelcomePage { const resource = URI.parse(require.toUrl('./vs_code_welcome_page')) .with({ scheme: Schemas.walkThrough, - query: JSON.stringify({ moduleId: 'vs/workbench/parts/welcome/page/electron-browser/vs_code_welcome_page' }) + query: JSON.stringify({ moduleId: 'vs/workbench/contrib/welcome/page/electron-browser/vs_code_welcome_page' }) }); this.editorInput = this.instantiationService.createInstance(WalkThroughInput, { typeId: welcomeInputTypeId, diff --git a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts index e32d38a80fd..3d69628cdbe 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough.ts @@ -8,7 +8,7 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic import { Action } from 'vs/base/common/actions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { URI } from 'vs/base/common/uri'; -import { WalkThroughInput, WalkThroughInputOptions } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; +import { WalkThroughInput, WalkThroughInputOptions } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughInput'; import { Schemas } from 'vs/base/common/network'; import { IEditorInputFactory, EditorInput } from 'vs/workbench/common/editor'; diff --git a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution.ts index 1cfec792a9f..8d508626bdb 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution.ts @@ -4,11 +4,11 @@ *--------------------------------------------------------------------------------------------*/ import { localize } from 'vs/nls'; -import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; -import { WalkThroughPart } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart'; -import { WalkThroughArrowUp, WalkThroughArrowDown, WalkThroughPageUp, WalkThroughPageDown } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughActions'; -import { WalkThroughContentProvider, WalkThroughSnippetContentProvider } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughContentProvider'; -import { EditorWalkThroughAction, EditorWalkThroughInputFactory } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/editor/editorWalkThrough'; +import { WalkThroughInput } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughInput'; +import { WalkThroughPart } from 'vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart'; +import { WalkThroughArrowUp, WalkThroughArrowDown, WalkThroughPageUp, WalkThroughPageDown } from 'vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions'; +import { WalkThroughContentProvider, WalkThroughSnippetContentProvider } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughContentProvider'; +import { EditorWalkThroughAction, EditorWalkThroughInputFactory } from 'vs/workbench/contrib/welcome/walkThrough/electron-browser/editor/editorWalkThrough'; import { Registry } from 'vs/platform/registry/common/platform'; import { Extensions as EditorInputExtensions, IEditorInputFactoryRegistry } from 'vs/workbench/common/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; diff --git a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions.ts index c6ba185e6da..95ba85eb935 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughActions.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; -import { WalkThroughPart, WALK_THROUGH_FOCUS } from 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThroughPart'; +import { WalkThroughPart, WALK_THROUGH_FOCUS } from 'vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart'; import { ICommandAndKeybindingRule, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { EditorContextKeys } from 'vs/editor/common/editorContextKeys'; import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey'; diff --git a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.ts b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.ts index ed99e06ee17..1170047f3ad 100644 --- a/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.ts +++ b/src/vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThroughPart.ts @@ -12,7 +12,7 @@ import { IDisposable, dispose, toDisposable } from 'vs/base/common/lifecycle'; import { EditorOptions, IEditorMemento } from 'vs/workbench/common/editor'; import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; -import { WalkThroughInput } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughInput'; +import { WalkThroughInput } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughInput'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import * as marked from 'vs/base/common/marked/marked'; import { IModelService } from 'vs/editor/common/services/modelService'; @@ -29,7 +29,7 @@ import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { IEditorOptions } from 'vs/editor/common/config/editorOptions'; import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService'; import { registerColor, focusBorder, textLinkForeground, textLinkActiveForeground, textPreformatForeground, contrastBorder, textBlockQuoteBackground, textBlockQuoteBorder } from 'vs/platform/theme/common/colorRegistry'; -import { getExtraColor } from 'vs/workbench/parts/welcome/walkThrough/node/walkThroughUtils'; +import { getExtraColor } from 'vs/workbench/contrib/welcome/walkThrough/node/walkThroughUtils'; import { UILabelProvider } from 'vs/base/common/keybindingLabels'; import { OS, OperatingSystem } from 'vs/base/common/platform'; import { deepClone } from 'vs/base/common/objects'; diff --git a/src/vs/workbench/services/editor/test/browser/editorService.test.ts b/src/vs/workbench/services/editor/test/browser/editorService.test.ts index 45cbfeb9953..d81af815d6f 100644 --- a/src/vs/workbench/services/editor/test/browser/editorService.test.ts +++ b/src/vs/workbench/services/editor/test/browser/editorService.test.ts @@ -22,7 +22,7 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil import { IEditorRegistry, EditorDescriptor, Extensions } from 'vs/workbench/browser/editor'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; import { Registry } from 'vs/platform/registry/common/platform'; -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorInput'; import { EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor'; import { CancellationToken } from 'vs/base/common/cancellation'; 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 3d51de87db9..68935f5ec7c 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts @@ -27,7 +27,7 @@ import { MainContext, ExtHostContext } from 'vs/workbench/api/node/extHost.proto import { ExtHostDiagnostics } from 'vs/workbench/api/node/extHostDiagnostics'; import * as vscode from 'vscode'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import 'vs/workbench/parts/search/electron-browser/search.contribution'; +import 'vs/workbench/contrib/search/electron-browser/search.contribution'; import { NullLogService } from 'vs/platform/log/common/log'; import { ITextModel } from 'vs/editor/common/model'; import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions'; diff --git a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts index 225cc4abbb5..4d0352a0b27 100644 --- a/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts +++ b/src/vs/workbench/test/electron-browser/api/extHostLanguageFeatures.test.ts @@ -29,7 +29,7 @@ import { getHover } from 'vs/editor/contrib/hover/getHover'; import { getOccurrencesAtPosition } from 'vs/editor/contrib/wordHighlighter/wordHighlighter'; import { provideReferences } from 'vs/editor/contrib/referenceSearch/referenceSearch'; import { getCodeActions } from 'vs/editor/contrib/codeAction/codeAction'; -import { getWorkspaceSymbols } from 'vs/workbench/parts/search/common/search'; +import { getWorkspaceSymbols } from 'vs/workbench/contrib/search/common/search'; import { rename } from 'vs/editor/contrib/rename/rename'; import { provideSignatureHelp } from 'vs/editor/contrib/parameterHints/provideSignatureHelp'; import { provideSuggestionItems } from 'vs/editor/contrib/suggest/suggest'; diff --git a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts index 2102637ea09..3f3ce4c78da 100644 --- a/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts @@ -23,7 +23,7 @@ import { ITelemetryInfo, ITelemetryService } from 'vs/platform/telemetry/common/ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; import { Extensions, IQuickOpenRegistry } from 'vs/workbench/browser/quickopen'; -import 'vs/workbench/parts/search/electron-browser/search.contribution'; // load contributions +import 'vs/workbench/contrib/search/electron-browser/search.contribution'; // load contributions import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService'; import { SearchService } from 'vs/workbench/services/search/node/searchService'; diff --git a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts index 31cc900cda4..2dcb135cadb 100644 --- a/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts +++ b/src/vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/workbench/parts/search/electron-browser/search.contribution'; // load contributions +import 'vs/workbench/contrib/search/electron-browser/search.contribution'; // load contributions import * as assert from 'assert'; import * as fs from 'fs'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; @@ -26,8 +26,8 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { IModelService } from 'vs/editor/common/services/modelService'; -import { SearchModel } from 'vs/workbench/parts/search/common/searchModel'; -import { QueryBuilder, ITextQueryBuilderOptions } from 'vs/workbench/parts/search/common/queryBuilder'; +import { SearchModel } from 'vs/workbench/contrib/search/common/searchModel'; +import { QueryBuilder, ITextQueryBuilderOptions } from 'vs/workbench/contrib/search/common/queryBuilder'; import { Event, Emitter } from 'vs/base/common/event'; import { testWorkspace } from 'vs/platform/workspace/test/common/testWorkspace'; diff --git a/src/vs/workbench/test/workbenchTestServices.ts b/src/vs/workbench/test/workbenchTestServices.ts index 283fcce77f2..f6d391c5480 100644 --- a/src/vs/workbench/test/workbenchTestServices.ts +++ b/src/vs/workbench/test/workbenchTestServices.ts @@ -3,8 +3,8 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import 'vs/workbench/parts/files/electron-browser/files.contribution'; // load our contribution into the test -import { FileEditorInput } from 'vs/workbench/parts/files/common/editors/fileEditorInput'; +import 'vs/workbench/contrib/files/electron-browser/files.contribution'; // load our contribution into the test +import { FileEditorInput } from 'vs/workbench/contrib/files/common/editors/fileEditorInput'; import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import * as paths from 'vs/base/common/paths'; import * as resources from 'vs/base/common/resources'; diff --git a/src/vs/workbench/workbench.main.ts b/src/vs/workbench/workbench.main.ts index 1ad274696dc..307396fcf64 100644 --- a/src/vs/workbench/workbench.main.ts +++ b/src/vs/workbench/workbench.main.ts @@ -44,135 +44,135 @@ import 'vs/workbench/services/bulkEdit/electron-browser/bulkEditService'; //#endregion -//#region --- workbench parts +//#region --- workbench contributions // Localizations -import 'vs/workbench/parts/localizations/electron-browser/localizations.contribution'; +import 'vs/workbench/contrib/localizations/electron-browser/localizations.contribution'; // Preferences -import 'vs/workbench/parts/preferences/electron-browser/preferences.contribution'; -import 'vs/workbench/parts/preferences/browser/keybindingsEditorContribution'; +import 'vs/workbench/contrib/preferences/electron-browser/preferences.contribution'; +import 'vs/workbench/contrib/preferences/browser/keybindingsEditorContribution'; // Logs -import 'vs/workbench/parts/logs/electron-browser/logs.contribution'; +import 'vs/workbench/contrib/logs/electron-browser/logs.contribution'; // Quick Open Handlers -import 'vs/workbench/parts/quickopen/browser/quickopen.contribution'; +import 'vs/workbench/contrib/quickopen/browser/quickopen.contribution'; // Explorer -import 'vs/workbench/parts/files/electron-browser/explorerViewlet'; -import 'vs/workbench/parts/files/electron-browser/fileActions.contribution'; -import 'vs/workbench/parts/files/electron-browser/files.contribution'; +import 'vs/workbench/contrib/files/electron-browser/explorerViewlet'; +import 'vs/workbench/contrib/files/electron-browser/fileActions.contribution'; +import 'vs/workbench/contrib/files/electron-browser/files.contribution'; // Backup -import 'vs/workbench/parts/backup/common/backup.contribution'; +import 'vs/workbench/contrib/backup/common/backup.contribution'; // Stats -import 'vs/workbench/parts/stats/node/stats.contribution'; +import 'vs/workbench/contrib/stats/node/stats.contribution'; // Rapid Render Splash -import 'vs/workbench/parts/splash/electron-browser/partsSplash.contribution'; +import 'vs/workbench/contrib/splash/electron-browser/partsSplash.contribution'; // Search -import 'vs/workbench/parts/search/electron-browser/search.contribution'; -import 'vs/workbench/parts/search/browser/searchView'; -import 'vs/workbench/parts/search/browser/openAnythingHandler'; +import 'vs/workbench/contrib/search/electron-browser/search.contribution'; +import 'vs/workbench/contrib/search/browser/searchView'; +import 'vs/workbench/contrib/search/browser/openAnythingHandler'; // SCM -import 'vs/workbench/parts/scm/electron-browser/scm.contribution'; -import 'vs/workbench/parts/scm/electron-browser/scmViewlet'; +import 'vs/workbench/contrib/scm/electron-browser/scm.contribution'; +import 'vs/workbench/contrib/scm/electron-browser/scmViewlet'; // Debug -import 'vs/workbench/parts/debug/electron-browser/debug.contribution'; -import 'vs/workbench/parts/debug/browser/debugQuickOpen'; -import 'vs/workbench/parts/debug/electron-browser/repl'; -import 'vs/workbench/parts/debug/browser/debugViewlet'; +import 'vs/workbench/contrib/debug/electron-browser/debug.contribution'; +import 'vs/workbench/contrib/debug/browser/debugQuickOpen'; +import 'vs/workbench/contrib/debug/electron-browser/repl'; +import 'vs/workbench/contrib/debug/browser/debugViewlet'; // Markers -import 'vs/workbench/parts/markers/electron-browser/markers.contribution'; +import 'vs/workbench/contrib/markers/electron-browser/markers.contribution'; // Comments -import 'vs/workbench/parts/comments/electron-browser/comments.contribution'; +import 'vs/workbench/contrib/comments/electron-browser/comments.contribution'; // HTML Preview -import 'vs/workbench/parts/html/electron-browser/html.contribution'; +import 'vs/workbench/contrib/html/electron-browser/html.contribution'; // URL Support -import 'vs/workbench/parts/url/electron-browser/url.contribution'; +import 'vs/workbench/contrib/url/electron-browser/url.contribution'; // Webview -import 'vs/workbench/parts/webview/electron-browser/webview.contribution'; +import 'vs/workbench/contrib/webview/electron-browser/webview.contribution'; // Extensions Management -import 'vs/workbench/parts/extensions/electron-browser/extensions.contribution'; -import 'vs/workbench/parts/extensions/browser/extensionsQuickOpen'; -import 'vs/workbench/parts/extensions/electron-browser/extensionsViewlet'; +import 'vs/workbench/contrib/extensions/electron-browser/extensions.contribution'; +import 'vs/workbench/contrib/extensions/browser/extensionsQuickOpen'; +import 'vs/workbench/contrib/extensions/electron-browser/extensionsViewlet'; // Output Panel -import 'vs/workbench/parts/output/electron-browser/output.contribution'; -import 'vs/workbench/parts/output/browser/outputPanel'; +import 'vs/workbench/contrib/output/electron-browser/output.contribution'; +import 'vs/workbench/contrib/output/browser/outputPanel'; // Terminal -import 'vs/workbench/parts/terminal/electron-browser/terminal.contribution'; -import 'vs/workbench/parts/terminal/browser/terminalQuickOpen'; -import 'vs/workbench/parts/terminal/electron-browser/terminalPanel'; +import 'vs/workbench/contrib/terminal/electron-browser/terminal.contribution'; +import 'vs/workbench/contrib/terminal/browser/terminalQuickOpen'; +import 'vs/workbench/contrib/terminal/electron-browser/terminalPanel'; // Relauncher -import 'vs/workbench/parts/relauncher/electron-browser/relauncher.contribution'; +import 'vs/workbench/contrib/relauncher/electron-browser/relauncher.contribution'; // Tasks -import 'vs/workbench/parts/tasks/electron-browser/task.contribution'; +import 'vs/workbench/contrib/tasks/electron-browser/task.contribution'; // Emmet -import 'vs/workbench/parts/emmet/browser/emmet.browser.contribution'; -import 'vs/workbench/parts/emmet/electron-browser/emmet.contribution'; +import 'vs/workbench/contrib/emmet/browser/emmet.browser.contribution'; +import 'vs/workbench/contrib/emmet/electron-browser/emmet.contribution'; // CodeEditor Contributions -import 'vs/workbench/parts/codeEditor/electron-browser/codeEditor.contribution'; +import 'vs/workbench/contrib/codeEditor/electron-browser/codeEditor.contribution'; // Execution -import 'vs/workbench/parts/execution/electron-browser/execution.contribution'; +import 'vs/workbench/contrib/execution/electron-browser/execution.contribution'; // Snippets -import 'vs/workbench/parts/snippets/electron-browser/snippets.contribution'; -import 'vs/workbench/parts/snippets/electron-browser/snippetsService'; -import 'vs/workbench/parts/snippets/electron-browser/insertSnippet'; -import 'vs/workbench/parts/snippets/electron-browser/configureSnippets'; -import 'vs/workbench/parts/snippets/electron-browser/tabCompletion'; +import 'vs/workbench/contrib/snippets/electron-browser/snippets.contribution'; +import 'vs/workbench/contrib/snippets/electron-browser/snippetsService'; +import 'vs/workbench/contrib/snippets/electron-browser/insertSnippet'; +import 'vs/workbench/contrib/snippets/electron-browser/configureSnippets'; +import 'vs/workbench/contrib/snippets/electron-browser/tabCompletion'; // Send a Smile -import 'vs/workbench/parts/feedback/electron-browser/feedback.contribution'; +import 'vs/workbench/contrib/feedback/electron-browser/feedback.contribution'; // Update -import 'vs/workbench/parts/update/electron-browser/update.contribution'; +import 'vs/workbench/contrib/update/electron-browser/update.contribution'; // Surveys -import 'vs/workbench/parts/surveys/electron-browser/nps.contribution'; -import 'vs/workbench/parts/surveys/electron-browser/languageSurveys.contribution'; +import 'vs/workbench/contrib/surveys/electron-browser/nps.contribution'; +import 'vs/workbench/contrib/surveys/electron-browser/languageSurveys.contribution'; // Performance -import 'vs/workbench/parts/performance/electron-browser/performance.contribution'; +import 'vs/workbench/contrib/performance/electron-browser/performance.contribution'; // CLI -import 'vs/workbench/parts/cli/electron-browser/cli.contribution'; +import 'vs/workbench/contrib/cli/electron-browser/cli.contribution'; // Themes Support -import 'vs/workbench/parts/themes/electron-browser/themes.contribution'; -import 'vs/workbench/parts/themes/test/electron-browser/themes.test.contribution'; +import 'vs/workbench/contrib/themes/electron-browser/themes.contribution'; +import 'vs/workbench/contrib/themes/test/electron-browser/themes.test.contribution'; // Watermark -import 'vs/workbench/parts/watermark/electron-browser/watermark'; +import 'vs/workbench/contrib/watermark/electron-browser/watermark'; // Welcome -import 'vs/workbench/parts/welcome/walkThrough/electron-browser/walkThrough.contribution'; -import 'vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.contribution'; -import 'vs/workbench/parts/welcome/overlay/browser/welcomeOverlay'; -import 'vs/workbench/parts/welcome/page/electron-browser/welcomePage.contribution'; +import 'vs/workbench/contrib/welcome/walkThrough/electron-browser/walkThrough.contribution'; +import 'vs/workbench/contrib/welcome/gettingStarted/electron-browser/gettingStarted.contribution'; +import 'vs/workbench/contrib/welcome/overlay/browser/welcomeOverlay'; +import 'vs/workbench/contrib/welcome/page/electron-browser/welcomePage.contribution'; // Outline -import 'vs/workbench/parts/outline/electron-browser/outline.contribution'; +import 'vs/workbench/contrib/outline/electron-browser/outline.contribution'; // Experiments -import 'vs/workbench/parts/experiments/electron-browser/experiments.contribution'; +import 'vs/workbench/contrib/experiments/electron-browser/experiments.contribution'; //#endregion \ No newline at end of file diff --git a/tslint.json b/tslint.json index 3d7876e972d..fb3b2dc5a97 100644 --- a/tslint.json +++ b/tslint.json @@ -402,7 +402,7 @@ "**/vs/platform/**", "**/vs/editor/**", "**/vs/workbench/{common,browser,node,electron-browser}/**", - "vs/workbench/parts/files/common/editors/fileEditorInput", + "vs/workbench/contrib/files/common/editors/fileEditorInput", "**/vs/workbench/services/**", "**/vs/workbench/test/**", "*" // node modules @@ -458,7 +458,7 @@ ] }, { - "target": "**/vs/workbench/parts/files/common/**", + "target": "**/vs/workbench/contrib/files/common/**", "restrictions": [ "vs/nls", "**/vs/base/common/**", @@ -468,12 +468,12 @@ "**/vs/editor/contrib/*/common/**", "**/vs/workbench/common/**", "**/vs/workbench/services/*/common/**", - "**/vs/workbench/parts/files/common/**", + "**/vs/workbench/contrib/files/common/**", "assert" ] }, { - "target": "**/vs/workbench/parts/files/browser/**", + "target": "**/vs/workbench/contrib/files/browser/**", "restrictions": [ "vs/nls", "vs/css!./**/*", @@ -484,12 +484,12 @@ "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention "**/vs/workbench/{common,browser}/**", "**/vs/workbench/services/*/{common,browser}/**", - "**/vs/workbench/parts/files/{common,browser}/**", + "**/vs/workbench/contrib/files/{common,browser}/**", "assert" ] }, { - "target": "**/vs/workbench/parts/files/electron-browser/**", + "target": "**/vs/workbench/contrib/files/electron-browser/**", "restrictions": [ "vs/nls", "vs/css!./**/*", @@ -501,7 +501,7 @@ "**/vs/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention "**/vs/workbench/{common,browser,node,electron-browser,api}/**", "**/vs/workbench/services/*/{common,browser,node,electron-browser}/**", - "**/vs/workbench/parts/files/{common,browser,node,electron-browser}/**", + "**/vs/workbench/contrib/files/{common,browser,node,electron-browser}/**", "*" // node modules ] }, From 752bfd12467a7ee4c2c8ce3d2d775e333de4eba5 Mon Sep 17 00:00:00 2001 From: Hugo Sartori Date: Thu, 7 Feb 2019 11:57:34 +0100 Subject: [PATCH 425/429] Added "_" prefix in private methods. --- src/vs/editor/browser/view/viewController.ts | 66 ++++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/vs/editor/browser/view/viewController.ts b/src/vs/editor/browser/view/viewController.ts index 0279da56704..0e9eec2e01c 100644 --- a/src/vs/editor/browser/view/viewController.ts +++ b/src/vs/editor/browser/view/viewController.ts @@ -132,7 +132,7 @@ export class ViewController { public dispatchMouse(data: IMouseDispatchData): void { if (data.middleButton) { if (data.inSelectionMode) { - this.columnSelect(data.position, data.mouseColumn); + this._columnSelect(data.position, data.mouseColumn); } else { this.moveTo(data.position); } @@ -140,60 +140,60 @@ export class ViewController { // If the dragging started on the gutter, then have operations work on the entire line if (this._hasMulticursorModifier(data)) { if (data.inSelectionMode) { - this.lastCursorLineSelect(data.position); + this._lastCursorLineSelect(data.position); } else { - this.createCursor(data.position, true); + this._createCursor(data.position, true); } } else { if (data.inSelectionMode) { - this.lineSelectDrag(data.position); + this._lineSelectDrag(data.position); } else { - this.lineSelect(data.position); + this._lineSelect(data.position); } } } else if (data.mouseDownCount >= 4) { - this.selectAll(); + this._selectAll(); } else if (data.mouseDownCount === 3) { if (this._hasMulticursorModifier(data)) { if (data.inSelectionMode) { - this.lastCursorLineSelectDrag(data.position); + this._lastCursorLineSelectDrag(data.position); } else { - this.lastCursorLineSelect(data.position); + this._lastCursorLineSelect(data.position); } } else { if (data.inSelectionMode) { - this.lineSelectDrag(data.position); + this._lineSelectDrag(data.position); } else { - this.lineSelect(data.position); + this._lineSelect(data.position); } } } else if (data.mouseDownCount === 2) { if (this._hasMulticursorModifier(data)) { - this.lastCursorWordSelect(data.position); + this._lastCursorWordSelect(data.position); } else { if (data.inSelectionMode) { - this.wordSelectDrag(data.position); + this._wordSelectDrag(data.position); } else { - this.wordSelect(data.position); + this._wordSelect(data.position); } } } else { if (this._hasMulticursorModifier(data)) { if (!this._hasNonMulticursorModifier(data)) { if (data.shiftKey) { - this.columnSelect(data.position, data.mouseColumn); + this._columnSelect(data.position, data.mouseColumn); } else { // Do multi-cursor operations only when purely alt is pressed if (data.inSelectionMode) { - this.lastCursorMoveToSelect(data.position); + this._lastCursorMoveToSelect(data.position); } else { - this.createCursor(data.position, false); + this._createCursor(data.position, false); } } } } else { if (data.inSelectionMode) { - this.moveToSelect(data.position); + this._moveToSelect(data.position); } else { this.moveTo(data.position); } @@ -204,7 +204,7 @@ export class ViewController { private _usualArgs(viewPosition: Position) { viewPosition = this._validateViewColumn(viewPosition); return { - position: this.convertViewToModelPosition(viewPosition), + position: this._convertViewToModelPosition(viewPosition), viewPosition: viewPosition }; } @@ -213,67 +213,67 @@ export class ViewController { this._execMouseCommand(CoreNavigationCommands.MoveTo, this._usualArgs(viewPosition)); } - private moveToSelect(viewPosition: Position): void { + private _moveToSelect(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.MoveToSelect, this._usualArgs(viewPosition)); } - private columnSelect(viewPosition: Position, mouseColumn: number): void { + private _columnSelect(viewPosition: Position, mouseColumn: number): void { viewPosition = this._validateViewColumn(viewPosition); this._execMouseCommand(CoreNavigationCommands.ColumnSelect, { - position: this.convertViewToModelPosition(viewPosition), + position: this._convertViewToModelPosition(viewPosition), viewPosition: viewPosition, mouseColumn: mouseColumn }); } - private createCursor(viewPosition: Position, wholeLine: boolean): void { + private _createCursor(viewPosition: Position, wholeLine: boolean): void { viewPosition = this._validateViewColumn(viewPosition); this._execMouseCommand(CoreNavigationCommands.CreateCursor, { - position: this.convertViewToModelPosition(viewPosition), + position: this._convertViewToModelPosition(viewPosition), viewPosition: viewPosition, wholeLine: wholeLine }); } - private lastCursorMoveToSelect(viewPosition: Position): void { + private _lastCursorMoveToSelect(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.LastCursorMoveToSelect, this._usualArgs(viewPosition)); } - private wordSelect(viewPosition: Position): void { + private _wordSelect(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.WordSelect, this._usualArgs(viewPosition)); } - private wordSelectDrag(viewPosition: Position): void { + private _wordSelectDrag(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.WordSelectDrag, this._usualArgs(viewPosition)); } - private lastCursorWordSelect(viewPosition: Position): void { + private _lastCursorWordSelect(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.LastCursorWordSelect, this._usualArgs(viewPosition)); } - private lineSelect(viewPosition: Position): void { + private _lineSelect(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.LineSelect, this._usualArgs(viewPosition)); } - private lineSelectDrag(viewPosition: Position): void { + private _lineSelectDrag(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.LineSelectDrag, this._usualArgs(viewPosition)); } - private lastCursorLineSelect(viewPosition: Position): void { + private _lastCursorLineSelect(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.LastCursorLineSelect, this._usualArgs(viewPosition)); } - private lastCursorLineSelectDrag(viewPosition: Position): void { + private _lastCursorLineSelectDrag(viewPosition: Position): void { this._execMouseCommand(CoreNavigationCommands.LastCursorLineSelectDrag, this._usualArgs(viewPosition)); } - private selectAll(): void { + private _selectAll(): void { this._execMouseCommand(CoreNavigationCommands.SelectAll, {}); } // ---------------------- - private convertViewToModelPosition(viewPosition: Position): Position { + private _convertViewToModelPosition(viewPosition: Position): Position { return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(viewPosition); } From f73ee4be3399f952ee76be204483a7e92e512eb3 Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 7 Feb 2019 12:06:58 +0100 Subject: [PATCH 426/429] tree,list: ignore pointer events on input elements fixes #68016 --- src/vs/base/browser/ui/list/listWidget.ts | 8 ++++++++ src/vs/base/browser/ui/tree/abstractTree.ts | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index 0f4c0798f67..fed74faefa2 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -559,6 +559,10 @@ export class MouseController implements IDisposable { } protected onPointer(e: IListMouseEvent): void { + if (isInputElement(e.browserEvent.target as HTMLElement)) { + return; + } + let reference = this.list.getFocus()[0]; const selection = this.list.getSelection(); reference = reference === undefined ? selection[0] : reference; @@ -591,6 +595,10 @@ export class MouseController implements IDisposable { } private onDoubleClick(e: IListMouseEvent): void { + if (isInputElement(e.browserEvent.target as HTMLElement)) { + return; + } + if (this.multipleSelectionSupport && this.isSelectionChangeEvent(e)) { return; } diff --git a/src/vs/base/browser/ui/tree/abstractTree.ts b/src/vs/base/browser/ui/tree/abstractTree.ts index 9f30d9f0ab4..ca9bf9d311e 100644 --- a/src/vs/base/browser/ui/tree/abstractTree.ts +++ b/src/vs/base/browser/ui/tree/abstractTree.ts @@ -805,6 +805,10 @@ class TreeNodeListMouseController extends MouseController< } protected onPointer(e: IListMouseEvent>): void { + if (isInputElement(e.browserEvent.target as HTMLElement)) { + return; + } + const node = e.element; if (!node) { From 36e8e30695e9d69e3447eb2991b826d1f3b21a2a Mon Sep 17 00:00:00 2001 From: Joao Moreno Date: Thu, 7 Feb 2019 12:30:19 +0100 Subject: [PATCH 427/429] new tree should handle middle click fixes #68063 --- src/vs/base/browser/ui/list/listWidget.ts | 1 + src/vs/platform/list/browser/listService.ts | 5 +++-- .../contrib/files/electron-browser/views/explorerView.ts | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/vs/base/browser/ui/list/listWidget.ts b/src/vs/base/browser/ui/list/listWidget.ts index fed74faefa2..1d2c65d40d2 100644 --- a/src/vs/base/browser/ui/list/listWidget.ts +++ b/src/vs/base/browser/ui/list/listWidget.ts @@ -521,6 +521,7 @@ export class MouseController implements IDisposable { list.onMouseDown(this.onMouseDown, this, this.disposables); list.onContextMenu(this.onContextMenu, this, this.disposables); list.onMouseClick(this.onPointer, this, this.disposables); + list.onMouseMiddleClick(this.onPointer, this, this.disposables); list.onMouseDblClick(this.onDoubleClick, this, this.disposables); list.onTouchStart(this.onMouseDown, this, this.disposables); list.onTap(this.onPointer, this, this.disposables); diff --git a/src/vs/platform/list/browser/listService.ts b/src/vs/platform/list/browser/listService.ts index 0a26a9aebf4..43eaa56afa9 100644 --- a/src/vs/platform/list/browser/listService.ts +++ b/src/vs/platform/list/browser/listService.ts @@ -181,12 +181,13 @@ class WorkbenchOpenController extends Disposable implements IOpenController { shouldOpen(event: UIEvent): boolean { if (event instanceof MouseEvent) { + const isLeftButton = event.button === 0; const isDoubleClick = event.detail === 2; - if (!this.openOnSingleClick && !isDoubleClick) { + if (isLeftButton && !this.openOnSingleClick && !isDoubleClick) { return false; } - if (event.button === 0 /* left mouse button */ || event.button === 1 /* middle mouse button */) { + if (isLeftButton /* left mouse button */ || event.button === 1 /* middle mouse button */) { return this.existingOpenController ? this.existingOpenController.shouldOpen(event) : true; } diff --git a/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts b/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts index af6e35beda5..04251ca5fb9 100644 --- a/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/contrib/files/electron-browser/views/explorerView.ts @@ -342,12 +342,13 @@ export class ExplorerView extends ViewletPanel { if (e.browserEvent instanceof MouseEvent) { isDoubleClick = e.browserEvent.detail === 2; + isMiddleClick = e.browserEvent.button === 1; + const isLeftButton = e.browserEvent.button === 0; - if (!this.tree.openOnSingleClick && !isDoubleClick) { + if (isLeftButton && !this.tree.openOnSingleClick && !isDoubleClick) { return; } - isMiddleClick = e.browserEvent.button === 1; sideBySide = this.tree.useAltAsMultipleSelectionModifier ? (e.browserEvent.ctrlKey || e.browserEvent.metaKey) : e.browserEvent.altKey; } From 79b9a50bc021d56f71c3c705ce0765c43b962fe5 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 7 Feb 2019 12:24:31 +0100 Subject: [PATCH 428/429] Fix #67694 --- .../markers/electron-browser/markers.ts | 123 +-------------- .../markers/electron-browser/markersPanel.ts | 55 ++++--- .../electron-browser/markersPanelActions.ts | 44 ++---- .../electron-browser/markersTreeViewer.ts | 145 +++++++++++++++++- 4 files changed, 193 insertions(+), 174 deletions(-) diff --git a/src/vs/workbench/contrib/markers/electron-browser/markers.ts b/src/vs/workbench/contrib/markers/electron-browser/markers.ts index 2ae1c928903..706cd7ba117 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markers.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markers.ts @@ -4,26 +4,15 @@ *--------------------------------------------------------------------------------------------*/ import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import { MarkersModel, compareMarkersByUri, Marker } from './markersModel'; +import { MarkersModel, compareMarkersByUri } from './markersModel'; import { Disposable } from 'vs/base/common/lifecycle'; -import { IMarkerService, MarkerSeverity, IMarker, IMarkerData } from 'vs/platform/markers/common/markers'; +import { IMarkerService, MarkerSeverity, IMarker } from 'vs/platform/markers/common/markers'; import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity'; import { localize } from 'vs/nls'; import Constants from './constants'; import { URI } from 'vs/base/common/uri'; import { groupBy } from 'vs/base/common/arrays'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; -import { IAction, Action } from 'vs/base/common/actions'; -import { applyCodeAction } from 'vs/editor/contrib/codeAction/codeActionCommands'; -import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; -import { ICommandService } from 'vs/platform/commands/common/commands'; -import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { CodeAction } from 'vs/editor/common/modes'; -import { Range } from 'vs/editor/common/core/range'; -import { getCodeActions } from 'vs/editor/contrib/codeAction/codeAction'; -import { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger'; -import { timeout, CancelablePromise, createCancelablePromise } from 'vs/base/common/async'; export const IMarkersWorkbenchService = createDecorator('markersWorkbenchService'); @@ -35,8 +24,6 @@ export interface IFilter { export interface IMarkersWorkbenchService { _serviceBrand: any; readonly markersModel: MarkersModel; - hasQuickFixes(marker: Marker): Promise; - getQuickFixActions(marker: Marker): Promise; } export class MarkersWorkbenchService extends Disposable implements IMarkersWorkbenchService { @@ -44,17 +31,9 @@ export class MarkersWorkbenchService extends Disposable implements IMarkersWorkb readonly markersModel: MarkersModel; - private readonly allFixesCache: Map> = new Map>(); - private readonly codeActionsPromises: Map>> = new Map>>(); - private readonly codeActions: Map> = new Map>(); - constructor( @IMarkerService private readonly markerService: IMarkerService, @IInstantiationService instantiationService: IInstantiationService, - @IBulkEditService private readonly bulkEditService: IBulkEditService, - @ICommandService private readonly commandService: ICommandService, - @IEditorService private readonly editorService: IEditorService, - @IModelService private readonly modelService: IModelService ) { super(); this.markersModel = this._register(instantiationService.createInstance(MarkersModel, this.readMarkers())); @@ -68,17 +47,6 @@ export class MarkersWorkbenchService extends Disposable implements IMarkersWorkb private onMarkerChanged(resources: URI[]): void { for (const resource of resources) { - const allFixes = this.allFixesCache.get(resource.toString()); - if (allFixes) { - allFixes.cancel(); - this.allFixesCache.delete(resource.toString()); - } - const codeActions = this.codeActionsPromises.get(resource.toString()); - if (codeActions) { - codeActions.forEach(promise => promise.cancel()); - this.codeActionsPromises.delete(resource.toString()); - } - this.codeActions.delete(resource.toString()); this.markersModel.setResourceMarkers(resource, this.readMarkers(resource)); } } @@ -87,93 +55,6 @@ export class MarkersWorkbenchService extends Disposable implements IMarkersWorkb return this.markerService.read({ resource, severities: MarkerSeverity.Error | MarkerSeverity.Warning | MarkerSeverity.Info }); } - getQuickFixActions(marker: Marker): Promise { - const markerKey = IMarkerData.makeKey(marker.marker); - let codeActionsPerMarker = this.codeActions.get(marker.resource.toString()); - if (!codeActionsPerMarker) { - codeActionsPerMarker = new Map(); - this.codeActions.set(marker.resource.toString(), codeActionsPerMarker); - } - const codeActions = codeActionsPerMarker.get(markerKey); - if (codeActions) { - return Promise.resolve(this.toActions(codeActions, marker)); - } else { - let codeActionsPromisesPerMarker = this.codeActionsPromises.get(marker.resource.toString()); - if (!codeActionsPromisesPerMarker) { - codeActionsPromisesPerMarker = new Map>(); - this.codeActionsPromises.set(marker.resource.toString(), codeActionsPromisesPerMarker); - } - if (!codeActionsPromisesPerMarker.has(markerKey)) { - const codeActionsPromise = this.getFixes(marker); - codeActionsPromisesPerMarker.set(markerKey, codeActionsPromise); - codeActionsPromise.then(codeActions => codeActionsPerMarker!.set(markerKey, codeActions)); - } - // Wait for 100ms for code actions fetching. - return timeout(100).then(() => this.toActions(codeActionsPerMarker!.get(markerKey) || [], marker)); - } - } - - private toActions(codeActions: CodeAction[], marker: Marker): IAction[] { - return codeActions.map(codeAction => new Action( - codeAction.command ? codeAction.command.id : codeAction.title, - codeAction.title, - undefined, - true, - () => { - return this.openFileAtMarker(marker) - .then(() => applyCodeAction(codeAction, this.bulkEditService, this.commandService)); - })); - } - - async hasQuickFixes(marker: Marker): Promise { - if (!this.modelService.getModel(marker.resource)) { - // Return early, If the model is not yet created - return false; - } - let allFixesPromise = this.allFixesCache.get(marker.resource.toString()); - if (!allFixesPromise) { - allFixesPromise = this._getFixes(marker.resource); - this.allFixesCache.set(marker.resource.toString(), allFixesPromise); - } - const allFixes = await allFixesPromise; - if (allFixes.length) { - const markerKey = IMarkerData.makeKey(marker.marker); - for (const fix of allFixes) { - if (fix.diagnostics && fix.diagnostics.some(d => IMarkerData.makeKey(d) === markerKey)) { - return true; - } - } - } - return false; - } - - private openFileAtMarker(element: Marker): Promise { - const { resource, selection } = { resource: element.resource, selection: element.range }; - return this.editorService.openEditor({ - resource, - options: { - selection, - preserveFocus: true, - pinned: false, - revealIfVisible: true - }, - }, ACTIVE_GROUP).then(() => undefined); - } - - private getFixes(marker: Marker): CancelablePromise { - return this._getFixes(marker.resource, new Range(marker.range.startLineNumber, marker.range.startColumn, marker.range.endLineNumber, marker.range.endColumn)); - } - - private _getFixes(uri: URI, range?: Range): CancelablePromise { - return createCancelablePromise(cancellationToken => { - const model = this.modelService.getModel(uri); - if (model) { - return getCodeActions(model, range ? range : model.getFullModelRange(), { type: 'manual', filter: { kind: CodeActionKind.QuickFix } }, cancellationToken); - } - return Promise.resolve([]); - }); - } - } export class ActivityUpdater extends Disposable implements IWorkbenchContribution { diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts index 47bd53267b6..ff973cff879 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersPanel.ts @@ -385,6 +385,18 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { this.filterInputActionItem.focus(); } })); + + this._register(Event.any(this.tree.onDidChangeSelection, this.tree.onDidChangeFocus)(() => { + const elements: TreeElement[] = [...this.tree.getSelection(), ...this.tree.getFocus()]; + for (const element of elements) { + if (element instanceof Marker) { + const viewModel = this.markersViewModel.getViewModel(element); + if (viewModel) { + viewModel.showLightBulb(); + } + } + } + })); } private createActions(): void { @@ -611,34 +623,35 @@ export class MarkersPanel extends Panel implements IMarkerFilterController { e.browserEvent.preventDefault(); e.browserEvent.stopPropagation(); - this._getMenuActions(e.element).then(actions => { - this.contextMenuService.showContextMenu({ - getAnchor: () => e.anchor, - getActions: () => actions, - getActionItem: (action) => { - const keybinding = this.keybindingService.lookupKeybinding(action.id); - if (keybinding) { - return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); - } - return null; - }, - onHide: (wasCancelled?: boolean) => { - if (wasCancelled) { - this.tree.domFocus(); - } + this.contextMenuService.showContextMenu({ + getAnchor: () => e.anchor, + getActions: () => this.getMenuActions(e.element), + getActionItem: (action) => { + const keybinding = this.keybindingService.lookupKeybinding(action.id); + if (keybinding) { + return new ActionItem(action, action, { label: true, keybinding: keybinding.getLabel() }); } - }); + return null; + }, + onHide: (wasCancelled?: boolean) => { + if (wasCancelled) { + this.tree.domFocus(); + } + } }); } - private async _getMenuActions(element: TreeElement): Promise { + private getMenuActions(element: TreeElement): IAction[] { const result: IAction[] = []; if (element instanceof Marker) { - const quickFixActions = await this.markersWorkbenchService.getQuickFixActions(element); - if (quickFixActions.length) { - result.push(...quickFixActions); - result.push(new Separator()); + const viewModel = this.markersViewModel.getViewModel(element); + if (viewModel) { + const quickFixActions = viewModel.quickFixAction.quickFixes; + if (quickFixActions.length) { + result.push(...quickFixActions); + result.push(new Separator()); + } } } diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts index 31a2a425faf..e05f65c46e3 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts @@ -5,7 +5,7 @@ import { Delayer } from 'vs/base/common/async'; import * as DOM from 'vs/base/browser/dom'; -import { Action, IActionChangeEvent } from 'vs/base/common/actions'; +import { Action, IActionChangeEvent, IAction } from 'vs/base/common/actions'; import { HistoryInputBox } from 'vs/base/browser/ui/inputbox/inputBox'; import { KeyCode } from 'vs/base/common/keyCodes'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; @@ -25,9 +25,7 @@ import { localize } from 'vs/nls'; import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ContextScopedHistoryInputBox } from 'vs/platform/widget/browser/contextScopedHistoryWidget'; -import { Marker } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; -import { IModelService } from 'vs/editor/common/services/modelService'; -import { isEqual } from 'vs/base/common/resources'; +import { Marker } from 'vs/workbench/parts/markers/electron-browser/markersModel'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Event, Emitter } from 'vs/base/common/event'; import { FilterOptions } from 'vs/workbench/contrib/markers/electron-browser/markersFilterOptions'; @@ -296,28 +294,25 @@ export class QuickFixAction extends Action { public static readonly ID: string = 'workbench.actions.problems.quickfix'; - private updated: boolean = false; private disposables: IDisposable[] = []; private readonly _onShowQuickFixes: Emitter = new Emitter(); readonly onShowQuickFixes: Event = this._onShowQuickFixes.event; + private _quickFixes: IAction[] = []; + get quickFixes(): IAction[] { + return this._quickFixes; + } + set quickFixes(quickFixes: IAction[]) { + this._quickFixes = quickFixes; + this.enabled = this._quickFixes.length > 0; + } + + constructor( readonly marker: Marker, - @IModelService modelService: IModelService, - @IMarkersWorkbenchService private readonly markerWorkbenchService: IMarkersWorkbenchService, ) { super(QuickFixAction.ID, Messages.MARKERS_PANEL_ACTION_TOOLTIP_QUICKFIX, 'markers-panel-action-quickfix', false); - this.disposables.push(this._onShowQuickFixes); - if (modelService.getModel(this.marker.resource)) { - this.update(); - } else { - modelService.onModelAdded(model => { - if (isEqual(model.uri, marker.resource)) { - this.update(); - } - }, this, this.disposables); - } } run(): Promise { @@ -325,13 +320,6 @@ export class QuickFixAction extends Action { return Promise.resolve(); } - private update(): void { - if (!this.updated) { - this.markerWorkbenchService.hasQuickFixes(this.marker).then(hasFixes => this.enabled = hasFixes); - this.updated = true; - } - } - dispose(): void { dispose(this.disposables); super.dispose(); @@ -342,7 +330,6 @@ export class QuickFixActionItem extends ActionItem { constructor(action: QuickFixAction, @IContextMenuService private readonly contextMenuService: IContextMenuService, - @IMarkersWorkbenchService private readonly markerWorkbenchService: IMarkersWorkbenchService ) { super(null, action, { icon: true, label: false }); } @@ -360,11 +347,12 @@ export class QuickFixActionItem extends ActionItem { return; } const elementPosition = DOM.getDomNodePagePosition(this.element); - this.markerWorkbenchService.getQuickFixActions((this.getAction()).marker).then(actions => { + const quickFixes = (this.getAction()).quickFixes; + if (quickFixes.length) { this.contextMenuService.showContextMenu({ getAnchor: () => ({ x: elementPosition.left + 10, y: elementPosition.top + elementPosition.height + 4 }), - getActions: () => actions + getActions: () => quickFixes }); - }); + } } } diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts b/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts index b0d2488be69..c68847f9ea4 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersTreeViewer.ts @@ -19,7 +19,7 @@ import { IDisposable, dispose, Disposable, toDisposable } from 'vs/base/common/l import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { QuickFixAction, QuickFixActionItem } from 'vs/workbench/contrib/markers/electron-browser/markersPanelActions'; import { ILabelService } from 'vs/platform/label/common/label'; -import { dirname, basename } from 'vs/base/common/resources'; +import { dirname, basename, isEqual } from 'vs/base/common/resources'; import { IListVirtualDelegate } from 'vs/base/browser/ui/list/list'; import { ITreeFilter, TreeVisibility, TreeFilterResult, ITreeRenderer, ITreeNode, ITreeDragAndDrop, ITreeDragOverReaction } from 'vs/base/browser/ui/tree/tree'; import { FilterOptions } from 'vs/workbench/contrib/markers/electron-browser/markersFilterOptions'; @@ -28,11 +28,22 @@ import { Event, Emitter } from 'vs/base/common/event'; import { IAccessibilityProvider } from 'vs/base/browser/ui/list/listWidget'; import { isUndefinedOrNull } from 'vs/base/common/types'; import { URI } from 'vs/base/common/uri'; -import { Action } from 'vs/base/common/actions'; +import { Action, IAction } from 'vs/base/common/actions'; import { localize } from 'vs/nls'; import { IDragAndDropData } from 'vs/base/browser/dnd'; import { ElementsDragAndDropData } from 'vs/base/browser/ui/list/listView'; import { fillResourceDataTransfers } from 'vs/workbench/browser/dnd'; +import { CancelablePromise, createCancelablePromise, Delayer } from 'vs/base/common/async'; +import { IModelService } from 'vs/editor/common/services/modelService'; +import { Range } from 'vs/editor/common/core/range'; +import { getCodeActions } from 'vs/editor/contrib/codeAction/codeAction'; +import { CodeActionKind } from 'vs/editor/contrib/codeAction/codeActionTrigger'; +import { ITextModel } from 'vs/editor/common/model'; +import { CodeAction } from 'vs/editor/common/modes'; +import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService'; +import { ICommandService } from 'vs/platform/commands/common/commands'; +import { IEditorService, ACTIVE_GROUP } from 'vs/workbench/services/editor/common/editorService'; +import { applyCodeAction } from 'vs/editor/contrib/codeAction/codeActionCommands'; export type TreeElement = ResourceMarkers | Marker | RelatedInformation; @@ -235,7 +246,7 @@ class MarkerWidget extends Disposable { private disposables: IDisposable[] = []; constructor( - parent: HTMLElement, + private parent: HTMLElement, private readonly markersViewModel: MarkersViewModel, instantiationService: IInstantiationService ) { @@ -262,6 +273,8 @@ class MarkerWidget extends Disposable { this.renderMultilineActionbar(element); this.renderMessageAndDetails(element, filterData); + this.disposables.push(dom.addDisposableListener(this.parent, dom.EventType.MOUSE_OVER, () => this.markersViewModel.onMarkerMouseHover(element))); + this.disposables.push(dom.addDisposableListener(this.parent, dom.EventType.MOUSE_LEAVE, () => this.markersViewModel.onMarkerMouseLeave(element))); } private renderQuickfixActionbar(marker: Marker): void { @@ -474,11 +487,26 @@ export class MarkerViewModel extends Disposable { private readonly _onDidChange: Emitter = this._register(new Emitter()); readonly onDidChange: Event = this._onDidChange.event; + private modelPromise: CancelablePromise | null = null; + private codeActionsPromise: CancelablePromise | null = null; + constructor( private readonly marker: Marker, - @IInstantiationService private instantiationService: IInstantiationService + @IModelService private modelService: IModelService, + @IInstantiationService private instantiationService: IInstantiationService, + @IBulkEditService private readonly bulkEditService: IBulkEditService, + @ICommandService private readonly commandService: ICommandService, + @IEditorService private readonly editorService: IEditorService ) { super(); + this._register(toDisposable(() => { + if (this.modelPromise) { + this.modelPromise.cancel(); + } + if (this.codeActionsPromise) { + this.codeActionsPromise.cancel(); + } + })); } private _multiline: boolean = true; @@ -500,6 +528,91 @@ export class MarkerViewModel extends Disposable { } return this._quickFixAction; } + + showLightBulb(): void { + this.setQuickFixes(true); + } + + showQuickfixes(): void { + this.setQuickFixes(false).then(() => this.quickFixAction.run()); + } + + async getQuickFixes(waitForModel: boolean): Promise { + const codeActions = await this.getCodeActions(waitForModel); + return codeActions ? this.toActions(codeActions) : []; + } + + private async setQuickFixes(waitForModel: boolean): Promise { + const quickFixes = await this.getQuickFixes(waitForModel); + this.quickFixAction.quickFixes = quickFixes; + } + + private getCodeActions(waitForModel: boolean): Promise { + if (this.codeActionsPromise !== null) { + return this.codeActionsPromise; + } + return this.getModel(waitForModel) + .then(model => { + if (model) { + if (!this.codeActionsPromise) { + this.codeActionsPromise = createCancelablePromise(cancellationToken => { + console.log('Fetching code actions for ', this.marker.marker.message); + return getCodeActions(model, new Range(this.marker.range.startLineNumber, this.marker.range.startColumn, this.marker.range.endLineNumber, this.marker.range.endColumn), { type: 'manual', filter: { kind: CodeActionKind.QuickFix } }, cancellationToken); + }); + } + return this.codeActionsPromise; + } + return null; + }); + } + + private toActions(codeActions: CodeAction[]): IAction[] { + return codeActions.map(codeAction => new Action( + codeAction.command ? codeAction.command.id : codeAction.title, + codeAction.title, + undefined, + true, + () => { + return this.openFileAtMarker(this.marker) + .then(() => applyCodeAction(codeAction, this.bulkEditService, this.commandService)); + })); + } + + private openFileAtMarker(element: Marker): Promise { + const { resource, selection } = { resource: element.resource, selection: element.range }; + return this.editorService.openEditor({ + resource, + options: { + selection, + preserveFocus: true, + pinned: false, + revealIfVisible: true + }, + }, ACTIVE_GROUP).then(() => undefined); + } + + private getModel(waitForModel: boolean): Promise { + const model = this.modelService.getModel(this.marker.resource); + if (model) { + return Promise.resolve(model); + } + if (waitForModel) { + if (this.modelPromise === null) { + this.modelPromise = createCancelablePromise(cancellationToken => { + return new Promise((c) => { + this._register(this.modelService.onModelAdded(model => { + if (isEqual(model.uri, this.marker.resource)) { + c(model); + } + })); + }); + }); + } + return this.modelPromise; + } + return Promise.resolve(null); + } + } export class MarkersViewModel extends Disposable { @@ -512,6 +625,9 @@ export class MarkersViewModel extends Disposable { private bulkUpdate: boolean = false; + private hoveredMarker: Marker; + private hoverDelayer: Delayer = new Delayer(300); + constructor( multiline: boolean = true, @IInstantiationService private instantiationService: IInstantiationService @@ -546,6 +662,9 @@ export class MarkersViewModel extends Disposable { dispose(value.disposables); } this.markersViewStates.delete(marker.hash); + if (this.hoveredMarker === marker) { + this.hoveredMarker = null; + } } this.markersPerResource.delete(resource.toString()); } @@ -555,6 +674,24 @@ export class MarkersViewModel extends Disposable { return value ? value.viewModel : null; } + onMarkerMouseHover(marker: Marker): void { + this.hoveredMarker = marker; + this.hoverDelayer.trigger(() => { + if (this.hoveredMarker) { + const model = this.getViewModel(this.hoveredMarker); + if (model) { + model.showLightBulb(); + } + } + }); + } + + onMarkerMouseLeave(marker: Marker): void { + if (this.hoveredMarker === marker) { + this.hoveredMarker = null; + } + } + private _multiline: boolean = true; get multiline(): boolean { return this._multiline; From 23ff9a7fc1e4dce8e2a2a8d799e3d03ac03871a0 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Thu, 7 Feb 2019 12:33:24 +0100 Subject: [PATCH 429/429] fix compilation error --- .../contrib/markers/electron-browser/markersPanelActions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts index e05f65c46e3..2d305d300ae 100644 --- a/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts +++ b/src/vs/workbench/contrib/markers/electron-browser/markersPanelActions.ts @@ -25,7 +25,7 @@ import { localize } from 'vs/nls'; import { Checkbox } from 'vs/base/browser/ui/checkbox/checkbox'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ContextScopedHistoryInputBox } from 'vs/platform/widget/browser/contextScopedHistoryWidget'; -import { Marker } from 'vs/workbench/parts/markers/electron-browser/markersModel'; +import { Marker } from 'vs/workbench/contrib/markers/electron-browser/markersModel'; import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; import { Event, Emitter } from 'vs/base/common/event'; import { FilterOptions } from 'vs/workbench/contrib/markers/electron-browser/markersFilterOptions';