From 5412c42cbcd5b4c9372f3976efd7a1c387c6b901 Mon Sep 17 00:00:00 2001 From: Muhammad Azeem Date: Sat, 12 May 2018 20:12:42 +0800 Subject: [PATCH 01/15] Prevent scrollbar to be considered as a drop target for drag-and-drop --- src/vs/base/parts/tree/browser/treeView.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index 4f907123ed7..39178779b74 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -1645,7 +1645,7 @@ export class TreeView extends HeightMap { return candidate; } - if (element === document.body) { + if (element === this.scrollableElement.getDomNode() || element === document.body) { return null; } } while (element = element.parentElement); From 914c8789adc4ba94ac84b2fdc510b9756db6d1fb Mon Sep 17 00:00:00 2001 From: Beau Allison Date: Sun, 27 May 2018 11:16:57 +0100 Subject: [PATCH 02/15] Align GIT light colored check icon with dark --- extensions/git/resources/icons/light/check.svg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/git/resources/icons/light/check.svg b/extensions/git/resources/icons/light/check.svg index d45df06edf8..3f365c4800e 100644 --- a/extensions/git/resources/icons/light/check.svg +++ b/extensions/git/resources/icons/light/check.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file From 81f58337a9d6fe5a1c199417b17ba1ae150085e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=A0=E5=8F=A4?= Date: Mon, 11 Jun 2018 01:26:47 +0800 Subject: [PATCH 03/15] fixed:generator method of class autocomplete causes star(*) to be added to next line --- .../src/features/languageConfiguration.ts | 1 + .../common/modes/languageConfiguration.ts | 4 ++++ .../editor/common/modes/supports/onEnter.ts | 24 ++++++++++++------- src/vs/monaco.d.ts | 4 ++++ src/vs/vscode.d.ts | 4 ++++ .../mainThreadLanguageFeatures.ts | 1 + src/vs/workbench/api/node/extHost.protocol.ts | 1 + .../api/node/extHostLanguageFeatures.ts | 1 + 8 files changed, 32 insertions(+), 8 deletions(-) diff --git a/extensions/typescript-language-features/src/features/languageConfiguration.ts b/extensions/typescript-language-features/src/features/languageConfiguration.ts index b3eb4ef23dd..fc6fd3269eb 100644 --- a/extensions/typescript-language-features/src/features/languageConfiguration.ts +++ b/extensions/typescript-language-features/src/features/languageConfiguration.ts @@ -33,6 +33,7 @@ const jsTsLanguageConfiguration: vscode.LanguageConfiguration = { }, { // e.g. * ...| beforeText: /^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/, + oneLineAboveText: /^(\s*(\/\*\*|\*)).*/, action: { indentAction: vscode.IndentAction.None, appendText: '* ' } }, { // e.g. */| diff --git a/src/vs/editor/common/modes/languageConfiguration.ts b/src/vs/editor/common/modes/languageConfiguration.ts index aaf139ee7ba..410d5694d01 100644 --- a/src/vs/editor/common/modes/languageConfiguration.ts +++ b/src/vs/editor/common/modes/languageConfiguration.ts @@ -139,6 +139,10 @@ export interface OnEnterRule { * This rule will only execute if the text after the cursor matches this regular expression. */ afterText?: RegExp; + /** + * This rule will only execute if the text above the this line matches this regular expression. + */ + oneLineAboveText?: RegExp; /** * The action to execute. */ diff --git a/src/vs/editor/common/modes/supports/onEnter.ts b/src/vs/editor/common/modes/supports/onEnter.ts index b1b2c73250e..5b8d6fe455a 100644 --- a/src/vs/editor/common/modes/supports/onEnter.ts +++ b/src/vs/editor/common/modes/supports/onEnter.ts @@ -48,17 +48,25 @@ export class OnEnterSupport { // (1): `regExpRules` for (let i = 0, len = this._regExpRules.length; i < len; i++) { let rule = this._regExpRules[i]; - if (rule.beforeText.test(beforeEnterText)) { - if (rule.afterText) { - if (rule.afterText.test(afterEnterText)) { - return rule.action; - } - } else { - return rule.action; - } + const regResult = [{ + reg: rule.beforeText, + text: beforeEnterText + }, { + reg: rule.afterText, + text: afterEnterText + }, { + reg: rule.oneLineAboveText, + text: oneLineAboveText + }].every((obj): boolean => { + return obj.reg ? obj.reg.test(obj.text) : true; + }); + + if (regResult) { + return rule.action; } } + // (2): Special indent-outdent if (beforeEnterText.length > 0 && afterEnterText.length > 0) { for (let i = 0, len = this._brackets.length; i < len; i++) { diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index cf3df4c85bf..8a49ab1c4d4 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4497,6 +4497,10 @@ declare namespace monaco.languages { * This rule will only execute if the text after the cursor matches this regular expression. */ afterText?: RegExp; + /** + * This rule will only execute if the text above the this line matches this regular expression. + */ + oneLineAboveText?: RegExp; /** * The action to execute. */ diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index ce3a4ce74b5..c16e2810bca 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -3578,6 +3578,10 @@ declare module 'vscode' { * This rule will only execute if the text after the cursor matches this regular expression. */ afterText?: RegExp; + /** + * This rule will only execute if the text above the this line matches this regular expression. + */ + oneLineAboveText?: RegExp; /** * The action to execute. */ diff --git a/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts b/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts index f627075683c..cd3f6607fe2 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts @@ -394,6 +394,7 @@ export class MainThreadLanguageFeatures implements MainThreadLanguageFeaturesSha return { beforeText: MainThreadLanguageFeatures._reviveRegExp(onEnterRule.beforeText), afterText: MainThreadLanguageFeatures._reviveRegExp(onEnterRule.afterText), + oneLineAboveText: MainThreadLanguageFeatures._reviveRegExp(onEnterRule.oneLineAboveText), action: onEnterRule.action }; } diff --git a/src/vs/workbench/api/node/extHost.protocol.ts b/src/vs/workbench/api/node/extHost.protocol.ts index fc54283a008..3f9aa8b3f94 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -235,6 +235,7 @@ export interface ISerializedIndentationRule { export interface ISerializedOnEnterRule { beforeText: ISerializedRegExp; afterText?: ISerializedRegExp; + oneLineAboveText?: ISerializedRegExp; action: EnterAction; } export interface ISerializedLanguageConfiguration { diff --git a/src/vs/workbench/api/node/extHostLanguageFeatures.ts b/src/vs/workbench/api/node/extHostLanguageFeatures.ts index d79065d2a00..65a841ddd8b 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -1216,6 +1216,7 @@ export class ExtHostLanguageFeatures implements ExtHostLanguageFeaturesShape { return { beforeText: ExtHostLanguageFeatures._serializeRegExp(onEnterRule.beforeText), afterText: ExtHostLanguageFeatures._serializeRegExp(onEnterRule.afterText), + oneLineAboveText: ExtHostLanguageFeatures._serializeRegExp(onEnterRule.oneLineAboveText), action: onEnterRule.action }; } From 82c9dd333064232aa66a2c545907d1dedbad52ef Mon Sep 17 00:00:00 2001 From: ava1ar Date: Sun, 17 Jun 2018 02:51:24 -0400 Subject: [PATCH 04/15] Added ARM64 build support --- aarch64.patch | 109 +++++++++++++++++++++++++++++++++ build/gulpfile.vscode.js | 3 + build/gulpfile.vscode.linux.js | 10 +++ package.json | 2 +- test/smoke/package.json | 2 +- 5 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 aarch64.patch diff --git a/aarch64.patch b/aarch64.patch new file mode 100644 index 00000000000..4d06e96bcf9 --- /dev/null +++ b/aarch64.patch @@ -0,0 +1,109 @@ +diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js +index 30a1563d7b..d322365c4a 100644 +--- a/build/gulpfile.vscode.js ++++ b/build/gulpfile.vscode.js +@@ -371,6 +371,7 @@ 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'))); + + 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')); +@@ -378,6 +379,7 @@ gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTa + 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')); + + 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 })); +@@ -385,6 +387,7 @@ gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], package + 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 })); + + // Transifex Localizations + +diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js +index ecbc45df32..2c672ff81f 100644 +--- a/build/gulpfile.vscode.linux.js ++++ b/build/gulpfile.vscode.linux.js +@@ -207,33 +207,43 @@ function buildSnapPackage(arch) { + 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('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386')); + gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64')); + gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm')); ++gulp.task('clean-vscode-linux-arm64-flatpak', util.rimraf('.build/linux/flatpak/arm64')); + + 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-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-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-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')); +diff --git a/package.json b/package.json +index fa450aa293..bbce403e5e 100644 +--- a/package.json ++++ b/package.json +@@ -66,7 +66,7 @@ + "cson-parser": "^1.3.3", + "debounce": "^1.0.0", + "documentdb": "^1.5.1", +- "electron-mksnapshot": "~1.7.0", ++ "electron-mksnapshot": "2.0.0", + "eslint": "^3.4.0", + "event-stream": "^3.1.7", + "express": "^4.13.1", +@@ -137,4 +137,4 @@ + "windows-mutex": "^0.2.0", + "windows-process-tree": "0.2.2" + } +-} +\ No newline at end of file ++} +diff --git a/test/smoke/package.json b/test/smoke/package.json +index 0ce01ada8b..86ae18e2dd 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": "1.7.7", ++ "electron": "2.0.0", + "htmlparser2": "^3.9.2", + "mkdirp": "^0.5.1", + "mocha": "^5.2.0", diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index 30a1563d7b9..d322365c4aa 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -371,6 +371,7 @@ 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'))); 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')); @@ -378,6 +379,7 @@ gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTa 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')); 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 })); @@ -385,6 +387,7 @@ gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], package 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 })); // Transifex Localizations diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index ecbc45df320..2c672ff81f0 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -207,33 +207,43 @@ function buildSnapPackage(arch) { 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('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386')); gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64')); gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm')); +gulp.task('clean-vscode-linux-arm64-flatpak', util.rimraf('.build/linux/flatpak/arm64')); 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-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-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-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')); diff --git a/package.json b/package.json index fa450aa2930..886bce06aab 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "cson-parser": "^1.3.3", "debounce": "^1.0.0", "documentdb": "^1.5.1", - "electron-mksnapshot": "~1.7.0", + "electron-mksnapshot": "~2.0.0", "eslint": "^3.4.0", "event-stream": "^3.1.7", "express": "^4.13.1", diff --git a/test/smoke/package.json b/test/smoke/package.json index 0ce01ada8b8..826111609d6 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": "1.7.7", + "electron": "2.0.2", "htmlparser2": "^3.9.2", "mkdirp": "^0.5.1", "mocha": "^5.2.0", From 1e52a0c5bb2a6de55ec521972df7617e86c7a7d9 Mon Sep 17 00:00:00 2001 From: ava1ar Date: Sun, 17 Jun 2018 03:19:23 -0400 Subject: [PATCH 05/15] Removed unneeded patch file --- aarch64.patch | 109 -------------------------------------------------- 1 file changed, 109 deletions(-) delete mode 100644 aarch64.patch diff --git a/aarch64.patch b/aarch64.patch deleted file mode 100644 index 4d06e96bcf9..00000000000 --- a/aarch64.patch +++ /dev/null @@ -1,109 +0,0 @@ -diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js -index 30a1563d7b..d322365c4a 100644 ---- a/build/gulpfile.vscode.js -+++ b/build/gulpfile.vscode.js -@@ -371,6 +371,7 @@ 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'))); - - 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')); -@@ -378,6 +379,7 @@ gulp.task('vscode-darwin', ['optimize-vscode', 'clean-vscode-darwin'], packageTa - 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')); - - 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 })); -@@ -385,6 +387,7 @@ gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], package - 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 })); - - // Transifex Localizations - -diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js -index ecbc45df32..2c672ff81f 100644 ---- a/build/gulpfile.vscode.linux.js -+++ b/build/gulpfile.vscode.linux.js -@@ -207,33 +207,43 @@ function buildSnapPackage(arch) { - 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('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386')); - gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64')); - gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm')); -+gulp.task('clean-vscode-linux-arm64-flatpak', util.rimraf('.build/linux/flatpak/arm64')); - - 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-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-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-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')); -diff --git a/package.json b/package.json -index fa450aa293..bbce403e5e 100644 ---- a/package.json -+++ b/package.json -@@ -66,7 +66,7 @@ - "cson-parser": "^1.3.3", - "debounce": "^1.0.0", - "documentdb": "^1.5.1", -- "electron-mksnapshot": "~1.7.0", -+ "electron-mksnapshot": "2.0.0", - "eslint": "^3.4.0", - "event-stream": "^3.1.7", - "express": "^4.13.1", -@@ -137,4 +137,4 @@ - "windows-mutex": "^0.2.0", - "windows-process-tree": "0.2.2" - } --} -\ No newline at end of file -+} -diff --git a/test/smoke/package.json b/test/smoke/package.json -index 0ce01ada8b..86ae18e2dd 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": "1.7.7", -+ "electron": "2.0.0", - "htmlparser2": "^3.9.2", - "mkdirp": "^0.5.1", - "mocha": "^5.2.0", From 8d5401b33a908e5ac1d3134ade5180d53b1085c8 Mon Sep 17 00:00:00 2001 From: Aliaksandr Stelmachonak Date: Mon, 10 Sep 2018 11:09:51 -0400 Subject: [PATCH 06/15] Fix arm64 deb (thanks to @glebm for the hint) Removed unused flatpack clean task Updated electron version for tests --- build/gulpfile.vscode.linux.js | 8 ++------ test/smoke/package.json | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/build/gulpfile.vscode.linux.js b/build/gulpfile.vscode.linux.js index 2c672ff81f0..42f4ec4a5ef 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -22,7 +22,7 @@ const rpmDependencies = require('../resources/linux/rpm/dependencies.json'); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); function getDebPackageArch(arch) { - return { x64: 'amd64', ia32: 'i386', arm: 'armhf' }[arch]; + return { x64: 'amd64', ia32: 'i386', arm: 'armhf', arm64: "arm64" }[arch]; } function prepareDebPackage(arch) { @@ -99,7 +99,7 @@ function getRpmBuildPath(rpmArch) { } function getRpmPackageArch(arch) { - return { x64: 'x86_64', ia32: 'i386', arm: 'armhf' }[arch]; + return { x64: 'x86_64', ia32: 'i386', arm: 'armhf', arm64: "arm64" }[arch]; } function prepareRpmPackage(arch) { @@ -216,10 +216,6 @@ 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('clean-vscode-linux-ia32-flatpak', util.rimraf('.build/linux/flatpak/i386')); -gulp.task('clean-vscode-linux-x64-flatpak', util.rimraf('.build/linux/flatpak/x86_64')); -gulp.task('clean-vscode-linux-arm-flatpak', util.rimraf('.build/linux/flatpak/arm')); -gulp.task('clean-vscode-linux-arm64-flatpak', util.rimraf('.build/linux/flatpak/arm64')); 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')); diff --git a/test/smoke/package.json b/test/smoke/package.json index 826111609d6..c3d79b62111 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": "2.0.2", + "electron": "^2.0.6", "htmlparser2": "^3.9.2", "mkdirp": "^0.5.1", "mocha": "^5.2.0", From a3026efb1a5bff03e9e19b66f85d4b7908d6cac0 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 11 Sep 2018 15:24:25 +0200 Subject: [PATCH 07/15] debt - less WinJS.Promise usage --- .../parts/snippets/electron-browser/insertSnippet.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts index 062036e19b4..57b29e05e18 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts @@ -5,7 +5,6 @@ 'use strict'; import * as nls from 'vs/nls'; -import { TPromise } from 'vs/base/common/winjs.base'; import { registerEditorAction, ServicesAccessor, EditorAction } from 'vs/editor/browser/editorExtensions'; import { IModeService } from 'vs/editor/common/services/modeService'; import { LanguageId } from 'vs/editor/common/modes'; @@ -63,7 +62,7 @@ class InsertSnippetAction extends EditorAction { }); } - public run(accessor: ServicesAccessor, editor: ICodeEditor, arg: any): TPromise { + public run(accessor: ServicesAccessor, editor: ICodeEditor, arg: any): Promise { const modeService = accessor.get(IModeService); const snippetService = accessor.get(ISnippetsService); @@ -75,7 +74,7 @@ class InsertSnippetAction extends EditorAction { const { lineNumber, column } = editor.getPosition(); let { snippet, name, langId } = Args.fromUser(arg); - return new TPromise(async (resolve, reject) => { + return new Promise(async (resolve, reject) => { if (snippet) { return resolve(new Snippet( From 120fe2e1bcb140d056a2342ac29d449c5d84a5ac Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 11 Sep 2018 15:27:38 +0200 Subject: [PATCH 08/15] debt - less WinJS.Promise usage --- .../parts/performance/electron-browser/actions.ts | 10 ++++------ .../performance/electron-browser/startupProfiler.ts | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/parts/performance/electron-browser/actions.ts b/src/vs/workbench/parts/performance/electron-browser/actions.ts index 3b83b5a6287..00ca60d5e6d 100644 --- a/src/vs/workbench/parts/performance/electron-browser/actions.ts +++ b/src/vs/workbench/parts/performance/electron-browser/actions.ts @@ -5,7 +5,6 @@ 'use strict'; -import { TPromise } from 'vs/base/common/winjs.base'; import { Action } from 'vs/base/common/actions'; import { IWindowService } from 'vs/platform/windows/common/windows'; import * as nls from 'vs/nls'; @@ -25,7 +24,6 @@ import { SyncActionDescriptor } from 'vs/platform/actions/common/actions'; import { forEach } from 'vs/base/common/collections'; import { mergeSort } from 'vs/base/common/arrays'; - class Info { static getTimerInfo(metrics: IStartupMetrics, nodeModuleLoadTime?: number): { [name: string]: Info } { @@ -158,7 +156,7 @@ export class ShowStartupPerformance extends Action { super(id, label); } - run(): TPromise { + run(): Promise { // Show dev tools this.windowService.openDevTools(); @@ -217,7 +215,7 @@ export class ShowStartupPerformance extends Action { console.groupEnd(); }); - return TPromise.as(true); + return Promise.resolve(true); } } @@ -238,7 +236,7 @@ export class ReportPerformanceIssueAction extends Action { super(id, label); } - run(appendix?: string): TPromise { + run(appendix?: string): Promise { Promise.all([ this.timerService.startupMetrics, this.integrityService.isPure() @@ -248,7 +246,7 @@ export class ReportPerformanceIssueAction extends Action { window.open(issueUrl); }); - return TPromise.wrap(true); + return Promise.resolve(true); } private generatePerformanceIssueUrl(metrics: IStartupMetrics, baseUrl: string, name: string, version: string, _commit: string, _date: string, isPure: boolean, appendix?: string): string { diff --git a/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts b/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts index 545068b434e..52e522d7cb1 100644 --- a/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts +++ b/src/vs/workbench/parts/performance/electron-browser/startupProfiler.ts @@ -7,7 +7,6 @@ import { dirname, join } from 'path'; import { basename } from 'vs/base/common/paths'; -import { TPromise } from 'vs/base/common/winjs.base'; import { del, exists, readdir, readFile } from 'vs/base/node/pfs'; import { localize } from 'vs/nls'; import { IDialogService } from 'vs/platform/dialogs/common/dialogs'; @@ -80,7 +79,7 @@ class StartupProfiler implements IWorkbenchContribution { }).then(res => { if (res.confirmed) { const action = this._instantiationService.createInstance(ReportPerformanceIssueAction, ReportPerformanceIssueAction.ID, ReportPerformanceIssueAction.LABEL); - TPromise.join([ + Promise.all([ this._windowsService.showItemInFolder(join(dir, files[0])), action.run(`:warning: Make sure to **attach** these files from your *home*-directory: :warning:\n${files.map(file => `-\`${file}\``).join('\n')}`) ]).then(() => { From e6d95f460de70691d210e9b94577c4d94867ac12 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 11 Sep 2018 15:45:25 +0200 Subject: [PATCH 09/15] removeFromRecentlyOpened Command Broken. Fixes #58131 --- .../electron-main/historyMainService.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/vs/platform/history/electron-main/historyMainService.ts b/src/vs/platform/history/electron-main/historyMainService.ts index 555e4af8546..6655c03fe47 100644 --- a/src/vs/platform/history/electron-main/historyMainService.ts +++ b/src/vs/platform/history/electron-main/historyMainService.ts @@ -120,7 +120,7 @@ export class HistoryMainService implements IHistoryMainService { const mru = this.getRecentlyOpened(); let update = false; - pathsToRemove.forEach((pathToRemove => { + pathsToRemove.forEach(pathToRemove => { // Remove workspace let index = arrays.firstIndex(mru.workspaces, workspace => { @@ -132,7 +132,7 @@ export class HistoryMainService implements IHistoryMainService { } if (typeof pathToRemove === 'string') { if (isSingleFolderWorkspaceIdentifier(workspace)) { - return workspace.scheme === Schemas.file && areResourcesEqual(URI.file(pathToRemove), workspace); + return workspace.scheme === Schemas.file && isEqual(pathToRemove, workspace.fsPath, !isLinux /* ignorecase */); } if (isWorkspaceIdentifier(workspace)) { return isEqual(pathToRemove, workspace.configPath, !isLinux /* ignorecase */); @@ -146,15 +146,20 @@ export class HistoryMainService implements IHistoryMainService { } // Remove file - const pathToRemoveURI = pathToRemove instanceof URI ? pathToRemove : typeof pathToRemove === 'string' ? URI.file(pathToRemove) : null; - if (pathToRemoveURI) { - index = arrays.firstIndex(mru.files, file => areResourcesEqual(file, pathToRemoveURI)); - } + index = arrays.firstIndex(mru.files, file => { + if (pathToRemove instanceof URI) { + return areResourcesEqual(file, pathToRemove); + } else if (typeof pathToRemove === 'string') { + return isEqual(file.fsPath, pathToRemove, !isLinux /* ignorecase */); + } + return false; + }); + if (index >= 0) { mru.files.splice(index, 1); update = true; } - })); + }); if (update) { this.saveRecentlyOpened(mru); From ffa0993cb2d0dccb9de590617bfbe4757ef5f664 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 11 Sep 2018 16:01:17 +0200 Subject: [PATCH 10/15] fix #56245 --- src/vs/base/browser/browser.ts | 6 +-- .../electron-browser/workbench/workbench.js | 23 ++++++----- .../partsSplash.contribution.ts | 39 ++++++++++++------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/vs/base/browser/browser.ts b/src/vs/base/browser/browser.ts index 1c694eeac3f..772f12ef04b 100644 --- a/src/vs/base/browser/browser.ts +++ b/src/vs/base/browser/browser.ts @@ -125,9 +125,7 @@ export function setFullscreen(fullscreen: boolean): void { export function isFullscreen(): boolean { return WindowManager.INSTANCE.isFullscreen(); } -export function onDidChangeFullscreen(callback: () => void): IDisposable { - return WindowManager.INSTANCE.onDidChangeFullscreen(callback); -} +export const onDidChangeFullscreen = WindowManager.INSTANCE.onDidChangeFullscreen; export function setAccessibilitySupport(accessibilitySupport: Platform.AccessibilitySupport): void { WindowManager.INSTANCE.setAccessibilitySupport(accessibilitySupport); @@ -168,4 +166,4 @@ export function hasClipboardSupport() { } return true; -} \ No newline at end of file +} diff --git a/src/vs/code/electron-browser/workbench/workbench.js b/src/vs/code/electron-browser/workbench/workbench.js index daf601e7425..c94646d2163 100644 --- a/src/vs/code/electron-browser/workbench/workbench.js +++ b/src/vs/code/electron-browser/workbench/workbench.js @@ -71,19 +71,21 @@ function showPartsSplash(configuration) { data = void 0; } + // minimal color configuration (works with or without persisted data) + const baseTheme = data ? data.baseTheme : configuration.highContrast ? 'hc-black' : 'vs-dark'; + const shellBackground = data ? data.colorInfo.editorBackground : configuration.highContrast ? '#000000' : '#1E1E1E'; + const shellForeground = data ? data.colorInfo.foreground : configuration.highContrast ? '#FFFFFF' : '#CCCCCC'; const style = document.createElement('style'); document.head.appendChild(style); + document.body.className = `monaco-shell ${baseTheme}`; + style.innerHTML = `.monaco-shell { background-color: ${shellBackground}; color: ${shellForeground}; }`; - if (data) { - const { layoutInfo, colorInfo, baseTheme } = data; - - // set the theme base id used by images and some styles - document.body.className = `monaco-shell ${baseTheme}`; - // stylesheet that defines foreground and background color - style.innerHTML = `.monaco-shell { background-color: ${colorInfo.editorBackground}; color: ${colorInfo.foreground}; }`; + if (data && data.layoutInfo) { + // restore parts if possible (we might not always store layout info) + const { id, layoutInfo, colorInfo } = data; const splash = document.createElement('div'); - splash.id = data.id; + splash.id = id; // ensure there is enough space layoutInfo.sideBarWidth = Math.min(layoutInfo.sideBarWidth, window.innerWidth - (layoutInfo.activityBarWidth + layoutInfo.editorPartMinWidth)); @@ -105,9 +107,6 @@ function showPartsSplash(configuration) { `; } document.body.appendChild(splash); - } else { - document.body.className = `monaco-shell ${configuration.highContrast ? 'hc-black' : 'vs-dark'}`; - style.innerHTML = `.monaco-shell { background-color: ${configuration.highContrast ? '#000000' : '#1E1E1E'}; color: ${configuration.highContrast ? '#FFFFFF' : '#CCCCCC'}; }`; } perf.mark('didShowPartsSplash'); @@ -134,4 +133,4 @@ function getLazyEnv() { ipc.send('vscode:fetchShellEnv'); }); -} \ No newline at end of file +} 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 5f76b802ea5..67d65ca7f7c 100644 --- a/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts +++ b/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts @@ -5,20 +5,21 @@ 'use strict'; +import { onDidChangeFullscreen, isFullscreen } from 'vs/base/browser/browser'; import { getTotalHeight, getTotalWidth } from 'vs/base/browser/dom'; +import { Color } from 'vs/base/common/color'; +import { anyEvent, debounceEvent } from 'vs/base/common/event'; +import { dispose, IDisposable } from 'vs/base/common/lifecycle'; +import { IBroadcastService } from 'vs/platform/broadcast/electron-browser/broadcastService'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { Registry } from 'vs/platform/registry/common/platform'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; -import { IThemeService, getThemeTypeSelector } from 'vs/platform/theme/common/themeService'; -import { IBroadcastService } from 'vs/platform/broadcast/electron-browser/broadcastService'; +import { ColorIdentifier, editorBackground, foreground } from 'vs/platform/theme/common/colorRegistry'; +import { getThemeTypeSelector, IThemeService } from 'vs/platform/theme/common/themeService'; +import { DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor'; import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import * as themes from 'vs/workbench/common/theme'; import { IPartService, Parts, Position } from 'vs/workbench/services/part/common/partService'; -import { IDisposable, dispose } from 'vs/base/common/lifecycle'; -import { debounceEvent } from 'vs/base/common/event'; -import { DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor'; -import { ColorIdentifier, editorBackground, foreground } from 'vs/platform/theme/common/colorRegistry'; -import { Color } from 'vs/base/common/color'; class PartsSplash { @@ -26,8 +27,8 @@ class PartsSplash { private readonly _disposables: IDisposable[] = []; - private lastBaseTheme: string; - private lastBackground: string; + private _lastBaseTheme: string; + private _lastBackground: string; constructor( @IThemeService private readonly _themeService: IThemeService, @@ -37,7 +38,10 @@ class PartsSplash { @IBroadcastService private broadcastService: IBroadcastService ) { lifecycleService.when(LifecyclePhase.Running).then(_ => this._removePartsSplash()); - debounceEvent(_partService.onEditorLayout, () => { }, 50)(this._savePartsSplash, this, this._disposables); + debounceEvent(anyEvent( + onDidChangeFullscreen, + _partService.onEditorLayout + ), () => { }, 150)(this._savePartsSplash, this, this._disposables); } dispose(): void { @@ -55,7 +59,7 @@ class PartsSplash { statusBarBackground: this._getThemeColor(themes.STATUS_BAR_BACKGROUND), statusBarNoFolderBackground: this._getThemeColor(themes.STATUS_BAR_NO_FOLDER_BACKGROUND), }; - const layoutInfo = { + const layoutInfo = isFullscreen() ? undefined : { sideBarSide: this._partService.getSideBarPosition() === Position.RIGHT ? 'right' : 'left', editorPartMinWidth: DEFAULT_EDITOR_MIN_DIMENSIONS.width, titleBarHeight: getTotalHeight(this._partService.getContainer(Parts.TITLEBAR_PART)), @@ -63,12 +67,17 @@ class PartsSplash { 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, colorInfo, layoutInfo, baseTheme }), StorageScope.GLOBAL); + this._storageService.store('parts-splash-data', JSON.stringify({ + id: PartsSplash._splashElementId, + colorInfo, + layoutInfo, + baseTheme + }), StorageScope.GLOBAL); - if (baseTheme !== this.lastBaseTheme || colorInfo.editorBackground !== this.lastBackground) { + if (baseTheme !== this._lastBaseTheme || colorInfo.editorBackground !== this._lastBackground) { // notify the main window on background color changes: the main window sets the background color to new windows - this.lastBaseTheme = baseTheme; - this.lastBackground = colorInfo.editorBackground; + this._lastBaseTheme = baseTheme; + this._lastBackground = colorInfo.editorBackground; // the color needs to be in hex const backgroundColor = this._themeService.getTheme().getColor(editorBackground) || themes.WORKBENCH_BACKGROUND(this._themeService.getTheme()); From 0c68c6063f315e57a44893815bf5b65b9afd4d85 Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 11 Sep 2018 16:08:30 +0200 Subject: [PATCH 11/15] Add tests for oneLineAboveText and consolidate rules --- .../test/tokenSelectionSupport.test.ts | 31 +---- .../browser/commands/shiftCommand.test.ts | 31 +---- .../test/browser/controller/cursor.test.ts | 27 +--- .../modes/supports/javascriptOnEnterRules.ts | 34 +++++ .../common/modes/supports/onEnter.test.ts | 129 ++++++++++-------- 5 files changed, 109 insertions(+), 143 deletions(-) create mode 100644 src/vs/editor/test/common/modes/supports/javascriptOnEnterRules.ts diff --git a/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts b/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts index fb406b259ef..a291cc0dbf9 100644 --- a/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts @@ -9,12 +9,12 @@ import { URI } from 'vs/base/common/uri'; import { Range } from 'vs/editor/common/core/range'; import { Position } from 'vs/editor/common/core/position'; import { LanguageIdentifier } from 'vs/editor/common/modes'; -import { IndentAction } from 'vs/editor/common/modes/languageConfiguration'; import { TokenSelectionSupport } from 'vs/editor/contrib/smartSelect/tokenSelectionSupport'; import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { ModelServiceImpl } from 'vs/editor/common/services/modelServiceImpl'; import { TestConfigurationService } from 'vs/platform/configuration/test/common/testConfigurationService'; +import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/javascriptOnEnterRules'; class MockJSMode extends MockMode { @@ -30,34 +30,7 @@ class MockJSMode extends MockMode { ['[', ']'] ], - onEnterRules: [ - { - // e.g. /** | */ - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - afterText: /^\s*\*\/$/, - action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' } - }, - { - // e.g. /** ...| - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: IndentAction.None, appendText: ' * ' } - }, - { - // e.g. * ...| - beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: IndentAction.None, appendText: '* ' } - }, - { - // e.g. */| - beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - }, - { - // e.g. *-----*/| - beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - } - ] + onEnterRules: javascriptOnEnterRules })); } } diff --git a/src/vs/editor/test/browser/commands/shiftCommand.test.ts b/src/vs/editor/test/browser/commands/shiftCommand.test.ts index a0d28161b2f..777cadb2a27 100644 --- a/src/vs/editor/test/browser/commands/shiftCommand.test.ts +++ b/src/vs/editor/test/browser/commands/shiftCommand.test.ts @@ -9,12 +9,12 @@ import { ShiftCommand } from 'vs/editor/common/commands/shiftCommand'; import { Selection } from 'vs/editor/common/core/selection'; import { Range } from 'vs/editor/common/core/range'; import { IIdentifiedSingleEditOperation } from 'vs/editor/common/model'; -import { IndentAction } from 'vs/editor/common/modes/languageConfiguration'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { getEditOperation, testCommand } from 'vs/editor/test/browser/testCommand'; import { withEditorModel } from 'vs/editor/test/common/editorTestUtils'; import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; import { LanguageIdentifier } from 'vs/editor/common/modes'; +import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/javascriptOnEnterRules'; /** * Create single edit operation @@ -39,34 +39,7 @@ class DocBlockCommentMode extends MockMode { ['[', ']'] ], - onEnterRules: [ - { - // e.g. /** | */ - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - afterText: /^\s*\*\/$/, - action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' } - }, - { - // e.g. /** ...| - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: IndentAction.None, appendText: ' * ' } - }, - { - // e.g. * ...| - beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: IndentAction.None, appendText: '* ' } - }, - { - // e.g. */| - beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - }, - { - // e.g. *-----*/| - beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - } - ] + onEnterRules: javascriptOnEnterRules })); } } diff --git a/src/vs/editor/test/browser/controller/cursor.test.ts b/src/vs/editor/test/browser/controller/cursor.test.ts index d744095cd1e..3034ed1ee9d 100644 --- a/src/vs/editor/test/browser/controller/cursor.test.ts +++ b/src/vs/editor/test/browser/controller/cursor.test.ts @@ -25,6 +25,7 @@ import { ViewModel } from 'vs/editor/common/viewModel/viewModelImpl'; import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; import { createTextModel, IRelaxedTextModelCreationOptions } from 'vs/editor/test/common/editorTestUtils'; +import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/javascriptOnEnterRules'; const H = Handler; @@ -3517,31 +3518,7 @@ suite('Editor Controller - Indentation Rules', () => { // ^.*\{[^}"']*$ increaseIndentPattern: /^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/ }, - onEnterRules: [ - { - // e.g. /** | */ - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - afterText: /^\s*\*\/$/, - action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' } - }, { - // e.g. /** ...| - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: IndentAction.None, appendText: ' * ' } - }, { - // e.g. * ...| - beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: IndentAction.None, appendText: '* ' } - }, { - // e.g. */| - beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - }, - { - // e.g. *-----*/| - beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - } - ] + onEnterRules: javascriptOnEnterRules })); } } diff --git a/src/vs/editor/test/common/modes/supports/javascriptOnEnterRules.ts b/src/vs/editor/test/common/modes/supports/javascriptOnEnterRules.ts new file mode 100644 index 00000000000..e49bdf7d837 --- /dev/null +++ b/src/vs/editor/test/common/modes/supports/javascriptOnEnterRules.ts @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +'use strict'; + +import { IndentAction } from 'vs/editor/common/modes/languageConfiguration'; + +export const javascriptOnEnterRules = [ + { + // e.g. /** | */ + beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, + afterText: /^\s*\*\/$/, + action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' } + }, { + // e.g. /** ...| + beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, + action: { indentAction: IndentAction.None, appendText: ' * ' } + }, { + // e.g. * ...| + beforeText: /^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/, + oneLineAboveText: /^(\s*(\/\*\*|\*)).*/, + action: { indentAction: IndentAction.None, appendText: '* ' } + }, { + // e.g. */| + beforeText: /^(\t|[ ])*[ ]\*\/\s*$/, + action: { indentAction: IndentAction.None, removeText: 1 } + }, + { + // e.g. *-----*/| + beforeText: /^(\t|[ ])*[ ]\*[^/]*\*\/\s*$/, + action: { indentAction: IndentAction.None, removeText: 1 } + } +]; diff --git a/src/vs/editor/test/common/modes/supports/onEnter.test.ts b/src/vs/editor/test/common/modes/supports/onEnter.test.ts index a4f30233e67..1cedfbf6da7 100644 --- a/src/vs/editor/test/common/modes/supports/onEnter.test.ts +++ b/src/vs/editor/test/common/modes/supports/onEnter.test.ts @@ -7,6 +7,7 @@ import * as assert from 'assert'; import { CharacterPair, IndentAction } from 'vs/editor/common/modes/languageConfiguration'; import { OnEnterSupport } from 'vs/editor/common/modes/supports/onEnter'; +import { javascriptOnEnterRules } from 'vs/editor/test/common/modes/supports/javascriptOnEnterRules'; suite('OnEnter', () => { @@ -49,32 +50,10 @@ suite('OnEnter', () => { test('uses regExpRules', () => { let support = new OnEnterSupport({ - regExpRules: [ - { - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - afterText: /^\s*\*\/$/, - action: { indentAction: IndentAction.IndentOutdent, appendText: ' * ' } - }, - { - beforeText: /^\s*\/\*\*(?!\/)([^\*]|\*(?!\/))*$/, - action: { indentAction: IndentAction.None, appendText: ' * ' } - }, - { - beforeText: /^(\t|(\ \ ))*\ \*(\ ([^\*]|\*(?!\/))*)?$/, - action: { indentAction: IndentAction.None, appendText: '* ' } - }, - { - beforeText: /^(\t|(\ \ ))*\ \*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - }, - { - beforeText: /^(\t|(\ \ ))*\ \*[^/]*\*\/\s*$/, - action: { indentAction: IndentAction.None, removeText: 1 } - } - ] + regExpRules: javascriptOnEnterRules }); - let testIndentAction = (beforeText: string, afterText: string, expectedIndentAction: IndentAction, expectedAppendText: string, removeText: number = 0) => { - let actual = support.onEnter('', beforeText, afterText); + let testIndentAction = (oneLineAboveText: string, beforeText: string, afterText: string, expectedIndentAction: IndentAction, expectedAppendText: string, removeText: number = 0) => { + let actual = support.onEnter(oneLineAboveText, beforeText, afterText); if (expectedIndentAction === null) { assert.equal(actual, null, 'isNull:' + beforeText); } else { @@ -89,40 +68,70 @@ suite('OnEnter', () => { } }; - testIndentAction('\t/**', ' */', IndentAction.IndentOutdent, ' * '); - testIndentAction('\t/**', '', IndentAction.None, ' * '); - testIndentAction('\t/** * / * / * /', '', IndentAction.None, ' * '); - testIndentAction('\t/** /*', '', IndentAction.None, ' * '); - testIndentAction('/**', '', IndentAction.None, ' * '); - testIndentAction('\t/**/', '', null, null); - testIndentAction('\t/***/', '', null, null); - testIndentAction('\t/*******/', '', null, null); - testIndentAction('\t/** * * * * */', '', null, null); - testIndentAction('\t/** */', '', null, null); - testIndentAction('\t/** asdfg */', '', null, null); - testIndentAction('\t/* asdfg */', '', null, null); - testIndentAction('\t/* asdfg */', '', null, null); - testIndentAction('\t/** asdfg */', '', null, null); - testIndentAction('*/', '', null, null); - testIndentAction('\t/*', '', null, null); - testIndentAction('\t*', '', null, null); - testIndentAction('\t *', '', IndentAction.None, '* '); - testIndentAction('\t */', '', IndentAction.None, null, 1); - testIndentAction('\t * */', '', IndentAction.None, null, 1); - testIndentAction('\t * * / * / * / */', '', null, null); - testIndentAction('\t * ', '', IndentAction.None, '* '); - testIndentAction(' * ', '', IndentAction.None, '* '); - testIndentAction(' * asdfsfagadfg', '', IndentAction.None, '* '); - testIndentAction(' * asdfsfagadfg * * * ', '', IndentAction.None, '* '); - testIndentAction(' * /*', '', IndentAction.None, '* '); - testIndentAction(' * asdfsfagadfg * / * / * /', '', IndentAction.None, '* '); - testIndentAction(' * asdfsfagadfg * / * / * /*', '', IndentAction.None, '* '); - testIndentAction(' */', '', IndentAction.None, null, 1); - testIndentAction('\t */', '', IndentAction.None, null, 1); - testIndentAction('\t\t */', '', IndentAction.None, null, 1); - testIndentAction(' */', '', IndentAction.None, null, 1); - testIndentAction(' */', '', IndentAction.None, null, 1); - testIndentAction('\t */', '', IndentAction.None, null, 1); - testIndentAction(' *--------------------------------------------------------------------------------------------*/', '', IndentAction.None, null, 1); + testIndentAction('', '\t/**', ' */', IndentAction.IndentOutdent, ' * '); + testIndentAction('', '\t/**', '', IndentAction.None, ' * '); + testIndentAction('', '\t/** * / * / * /', '', IndentAction.None, ' * '); + testIndentAction('', '\t/** /*', '', IndentAction.None, ' * '); + testIndentAction('', '/**', '', IndentAction.None, ' * '); + testIndentAction('', '\t/**/', '', null, null); + testIndentAction('', '\t/***/', '', null, null); + testIndentAction('', '\t/*******/', '', null, null); + testIndentAction('', '\t/** * * * * */', '', null, null); + testIndentAction('', '\t/** */', '', null, null); + testIndentAction('', '\t/** asdfg */', '', null, null); + testIndentAction('', '\t/* asdfg */', '', null, null); + testIndentAction('', '\t/* asdfg */', '', null, null); + testIndentAction('', '\t/** asdfg */', '', null, null); + testIndentAction('', '*/', '', null, null); + testIndentAction('', '\t/*', '', null, null); + testIndentAction('', '\t*', '', null, null); + + testIndentAction('\t/**', '\t *', '', IndentAction.None, '* '); + testIndentAction('\t * something', '\t *', '', IndentAction.None, '* '); + testIndentAction('\t *', '\t *', '', IndentAction.None, '* '); + + testIndentAction('', '\t */', '', IndentAction.None, null, 1); + testIndentAction('', '\t * */', '', IndentAction.None, null, 1); + testIndentAction('', '\t * * / * / * / */', '', null, null); + + testIndentAction('\t/**', '\t * ', '', IndentAction.None, '* '); + testIndentAction('\t * something', '\t * ', '', IndentAction.None, '* '); + testIndentAction('\t *', '\t * ', '', IndentAction.None, '* '); + + testIndentAction('/**', ' * ', '', IndentAction.None, '* '); + testIndentAction(' * something', ' * ', '', IndentAction.None, '* '); + testIndentAction(' *', ' * asdfsfagadfg', '', IndentAction.None, '* '); + + testIndentAction('/**', ' * asdfsfagadfg * * * ', '', IndentAction.None, '* '); + testIndentAction(' * something', ' * asdfsfagadfg * * * ', '', IndentAction.None, '* '); + testIndentAction(' *', ' * asdfsfagadfg * * * ', '', IndentAction.None, '* '); + + testIndentAction('/**', ' * /*', '', IndentAction.None, '* '); + testIndentAction(' * something', ' * /*', '', IndentAction.None, '* '); + testIndentAction(' *', ' * /*', '', IndentAction.None, '* '); + + testIndentAction('/**', ' * asdfsfagadfg * / * / * /', '', IndentAction.None, '* '); + testIndentAction(' * something', ' * asdfsfagadfg * / * / * /', '', IndentAction.None, '* '); + testIndentAction(' *', ' * asdfsfagadfg * / * / * /', '', IndentAction.None, '* '); + + testIndentAction('/**', ' * asdfsfagadfg * / * / * /*', '', IndentAction.None, '* '); + testIndentAction(' * something', ' * asdfsfagadfg * / * / * /*', '', IndentAction.None, '* '); + testIndentAction(' *', ' * asdfsfagadfg * / * / * /*', '', IndentAction.None, '* '); + + testIndentAction('', ' */', '', IndentAction.None, null, 1); + testIndentAction('', '\t */', '', IndentAction.None, null, 1); + testIndentAction('', '\t\t */', '', IndentAction.None, null, 1); + testIndentAction('', ' */', '', IndentAction.None, null, 1); + testIndentAction('', ' */', '', IndentAction.None, null, 1); + testIndentAction('', '\t */', '', IndentAction.None, null, 1); + testIndentAction('', ' *--------------------------------------------------------------------------------------------*/', '', IndentAction.None, null, 1); + + // issue #43469 + testIndentAction('class A {', ' * test() {', '', IndentAction.Indent, null, 0); + testIndentAction('', ' * test() {', '', IndentAction.Indent, null, 0); + testIndentAction(' ', ' * test() {', '', IndentAction.Indent, null, 0); + testIndentAction('class A {', ' * test() {', '', IndentAction.Indent, null, 0); + testIndentAction('', ' * test() {', '', IndentAction.Indent, null, 0); + testIndentAction(' ', ' * test() {', '', IndentAction.Indent, null, 0); }); }); \ No newline at end of file From 2dd809dcb58dc3e638d1fc00c8c92fc8307781e4 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 11 Sep 2018 16:21:53 +0200 Subject: [PATCH 12/15] don't save parts layout when developing extensions, #55959 --- .../splash/electron-browser/partsSplash.contribution.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 67d65ca7f7c..4f511cf33a1 100644 --- a/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts +++ b/src/vs/workbench/parts/splash/electron-browser/partsSplash.contribution.ts @@ -20,6 +20,7 @@ import { DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor import { Extensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions'; import * as themes from 'vs/workbench/common/theme'; import { IPartService, Parts, Position } from 'vs/workbench/services/part/common/partService'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; class PartsSplash { @@ -34,6 +35,7 @@ class PartsSplash { @IThemeService private readonly _themeService: IThemeService, @IPartService private readonly _partService: IPartService, @IStorageService private readonly _storageService: IStorageService, + @IEnvironmentService private readonly _envService: IEnvironmentService, @ILifecycleService lifecycleService: ILifecycleService, @IBroadcastService private broadcastService: IBroadcastService ) { @@ -59,7 +61,7 @@ class PartsSplash { statusBarBackground: this._getThemeColor(themes.STATUS_BAR_BACKGROUND), statusBarNoFolderBackground: this._getThemeColor(themes.STATUS_BAR_NO_FOLDER_BACKGROUND), }; - const layoutInfo = isFullscreen() ? undefined : { + 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)), @@ -91,6 +93,10 @@ class PartsSplash { return color ? color.toString() : undefined; } + private _shouldSaveLayoutInfo(): boolean { + return !isFullscreen() && !this._envService.isExtensionDevelopment; + } + private _removePartsSplash(): void { let element = document.getElementById(PartsSplash._splashElementId); if (element) { From 798549bff79b9c81f70056d7c78c62dd3f89d4f5 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 11 Sep 2018 16:29:04 +0200 Subject: [PATCH 13/15] ignore layout info when developing an extension, #55959 --- src/vs/code/electron-browser/workbench/workbench.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/vs/code/electron-browser/workbench/workbench.js b/src/vs/code/electron-browser/workbench/workbench.js index c94646d2163..7fef22f3805 100644 --- a/src/vs/code/electron-browser/workbench/workbench.js +++ b/src/vs/code/electron-browser/workbench/workbench.js @@ -66,9 +66,14 @@ function showPartsSplash(configuration) { // ignore } - // high contrast mode has been turned on, ignore stored colors and layouts + // high contrast mode has been turned on from the outside, e.g OS -> ignore stored colors and layouts if (data && configuration.highContrast && data.baseTheme !== 'hc-black') { - data = void 0; + data = undefined; + } + + // developing an extension -> ignore stored layouts + if (data && configuration.extensionDevelopmentPath) { + data.layoutInfo = undefined; } // minimal color configuration (works with or without persisted data) From 78ba7cdccab1ad8a978a10739aa458660f835551 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 11 Sep 2018 16:47:31 +0200 Subject: [PATCH 14/15] Fix #58097 --- src/vs/platform/instantiation/common/instantiationService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vs/platform/instantiation/common/instantiationService.ts b/src/vs/platform/instantiation/common/instantiationService.ts index 8c0c2affb4a..3073b171ad7 100644 --- a/src/vs/platform/instantiation/common/instantiationService.ts +++ b/src/vs/platform/instantiation/common/instantiationService.ts @@ -157,7 +157,7 @@ export class InstantiationService implements IInstantiationService { for (let dependency of dependencies) { let instanceOrDesc = this._services.get(dependency.id); - if (!instanceOrDesc) { + if (!instanceOrDesc && !dependency.optional) { console.warn(`[createInstance] ${id} depends on ${dependency.id} which is NOT registered.`); } From 9982055873dd8d883ece2d74a703000d02e13619 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 11 Sep 2018 16:52:38 +0200 Subject: [PATCH 15/15] debt - replace winjs.promise#join with promise#all --- .../sharedProcess/contrib/nodeCachedDataCleaner.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts b/src/vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts index 9862698a9c9..0f464d600a3 100644 --- a/src/vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts +++ b/src/vs/code/electron-browser/sharedProcess/contrib/nodeCachedDataCleaner.ts @@ -7,7 +7,6 @@ import { basename, dirname, join } from 'path'; import { onUnexpectedError } from 'vs/base/common/errors'; import { dispose, IDisposable } from 'vs/base/common/lifecycle'; -import { TPromise } from 'vs/base/common/winjs.base'; import { readdir, rimraf, stat } from 'vs/base/node/pfs'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import product from 'vs/platform/node/product'; @@ -49,7 +48,7 @@ export class NodeCachedDataCleaner { readdir(nodeCachedDataRootDir).then(entries => { const now = Date.now(); - const deletes: TPromise[] = []; + const deletes: Thenable[] = []; entries.forEach(entry => { // name check @@ -72,7 +71,7 @@ export class NodeCachedDataCleaner { } }); - return TPromise.join(deletes); + return Promise.all(deletes); }).then(undefined, onUnexpectedError);