diff --git a/build/gulpfile.vscode.js b/build/gulpfile.vscode.js index a2925ed93d1..46c045e0e89 100644 --- a/build/gulpfile.vscode.js +++ b/build/gulpfile.vscode.js @@ -350,6 +350,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')); @@ -357,6 +358,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 })); @@ -364,6 +366,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 61b29d260cf..ff4ba02d804 100644 --- a/build/gulpfile.vscode.linux.js +++ b/build/gulpfile.vscode.linux.js @@ -19,7 +19,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) { @@ -98,7 +98,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) { @@ -208,30 +208,39 @@ 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('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/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 diff --git a/extensions/typescript-language-features/src/features/languageConfiguration.ts b/extensions/typescript-language-features/src/features/languageConfiguration.ts index b7f9b1e083e..99515964e77 100644 --- a/extensions/typescript-language-features/src/features/languageConfiguration.ts +++ b/extensions/typescript-language-features/src/features/languageConfiguration.ts @@ -31,6 +31,7 @@ const jsTsLanguageConfiguration: vscode.LanguageConfiguration = { }, { // e.g. * ...| beforeText: /^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/, + oneLineAboveText: /^(\s*(\/\*\*|\*)).*/, action: { indentAction: vscode.IndentAction.None, appendText: '* ' } }, { // e.g. */| diff --git a/package.json b/package.json index b62444ae9c0..1e3462e0304 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,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/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/base/parts/tree/browser/treeView.ts b/src/vs/base/parts/tree/browser/treeView.ts index 05ee9f648b9..6bfc630030c 100644 --- a/src/vs/base/parts/tree/browser/treeView.ts +++ b/src/vs/base/parts/tree/browser/treeView.ts @@ -1674,7 +1674,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); 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); diff --git a/src/vs/code/electron-browser/workbench/workbench.js b/src/vs/code/electron-browser/workbench/workbench.js index daf601e7425..7fef22f3805 100644 --- a/src/vs/code/electron-browser/workbench/workbench.js +++ b/src/vs/code/electron-browser/workbench/workbench.js @@ -66,24 +66,31 @@ 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) + 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 +112,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 +138,4 @@ function getLazyEnv() { ipc.send('vscode:fetchShellEnv'); }); -} \ No newline at end of file +} diff --git a/src/vs/editor/common/modes/languageConfiguration.ts b/src/vs/editor/common/modes/languageConfiguration.ts index 1b5a057a8f6..d0f6b77d2b8 100644 --- a/src/vs/editor/common/modes/languageConfiguration.ts +++ b/src/vs/editor/common/modes/languageConfiguration.ts @@ -146,6 +146,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/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 diff --git a/src/vs/monaco.d.ts b/src/vs/monaco.d.ts index a95464e46ec..ad533ea43d5 100644 --- a/src/vs/monaco.d.ts +++ b/src/vs/monaco.d.ts @@ -4670,6 +4670,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/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); 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.`); } diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 9af3b33406e..c1f073939fe 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -3738,6 +3738,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 5d14ececf3d..98ba77076ab 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadLanguageFeatures.ts @@ -402,6 +402,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 fa9581beed1..002f815ac7b 100644 --- a/src/vs/workbench/api/node/extHost.protocol.ts +++ b/src/vs/workbench/api/node/extHost.protocol.ts @@ -226,6 +226,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 a5953b69584..fa47bf0e59e 100644 --- a/src/vs/workbench/api/node/extHostLanguageFeatures.ts +++ b/src/vs/workbench/api/node/extHostLanguageFeatures.ts @@ -1232,6 +1232,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 }; } 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(() => { 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( 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..4f511cf33a1 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,22 @@ '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'; +import { IEnvironmentService } from 'vs/platform/environment/common/environment'; class PartsSplash { @@ -26,18 +28,22 @@ class PartsSplash { private readonly _disposables: IDisposable[] = []; - private lastBaseTheme: string; - private lastBackground: string; + private _lastBaseTheme: string; + private _lastBackground: string; constructor( @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 ) { 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 +61,7 @@ class PartsSplash { statusBarBackground: this._getThemeColor(themes.STATUS_BAR_BACKGROUND), statusBarNoFolderBackground: this._getThemeColor(themes.STATUS_BAR_NO_FOLDER_BACKGROUND), }; - const layoutInfo = { + 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)), @@ -63,12 +69,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()); @@ -82,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) {