mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-31 09:35:39 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -11,15 +11,15 @@ import URI from 'vs/base/common/uri';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWindowService, IWindowsService, MenuBarVisibility } from 'vs/platform/windows/common/windows';
|
||||
import nls = require('vs/nls');
|
||||
import * as nls from 'vs/nls';
|
||||
import product from 'vs/platform/node/product';
|
||||
import pkg from 'vs/platform/node/package';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import paths = require('vs/base/common/paths');
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import { isMacintosh, isLinux } from 'vs/base/common/platform';
|
||||
import { IQuickOpenService, IFilePickOpenEntry, ISeparator, IPickOpenAction, IPickOpenItem } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
@@ -871,6 +871,24 @@ export class OpenIssueReporterAction extends Action {
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenProcessExplorer extends Action {
|
||||
public static readonly ID = 'workbench.action.openProcessExplorer';
|
||||
public static readonly LABEL = nls.localize('openProcessExplorer', "Open Process Explorer");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkbenchIssueService private issueService: IWorkbenchIssueService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(): TPromise<boolean> {
|
||||
return this.issueService.openProcessExplorer()
|
||||
.then(() => true);
|
||||
}
|
||||
}
|
||||
|
||||
export class ReportPerformanceIssueUsingReporterAction extends Action {
|
||||
public static readonly ID = 'workbench.action.reportPerformanceIssueUsingReporter';
|
||||
public static readonly LABEL = nls.localize('reportPerformanceIssue', "Report Performance Issue");
|
||||
|
||||
@@ -28,9 +28,11 @@ process.lazyEnv = new Promise(function (resolve) {
|
||||
assign(process.env, shellEnv);
|
||||
resolve(process.env);
|
||||
});
|
||||
ipc.send('vscode:fetchShellEnv', remote.getCurrentWindow().id);
|
||||
ipc.send('vscode:fetchShellEnv');
|
||||
});
|
||||
|
||||
Error.stackTraceLimit = 100; // increase number of stack frames (from 10, https://github.com/v8/v8/wiki/Stack-Trace-API)
|
||||
|
||||
function onError(error, enableDeveloperTools) {
|
||||
if (enableDeveloperTools) {
|
||||
remote.getCurrentWebContents().openDevTools();
|
||||
@@ -160,10 +162,10 @@ function main() {
|
||||
const NODE_MODULES_ASAR_PATH = NODE_MODULES_PATH + '.asar';
|
||||
|
||||
const originalResolveLookupPaths = Module._resolveLookupPaths;
|
||||
Module._resolveLookupPaths = function (request, parent) {
|
||||
const result = originalResolveLookupPaths(request, parent);
|
||||
Module._resolveLookupPaths = function (request, parent, newReturn) {
|
||||
const result = originalResolveLookupPaths(request, parent, newReturn);
|
||||
|
||||
const paths = result[1];
|
||||
const paths = newReturn ? result : result[1];
|
||||
for (let i = 0, len = paths.length; i < len; i++) {
|
||||
if (paths[i] === NODE_MODULES_PATH) {
|
||||
paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
|
||||
@@ -204,7 +206,7 @@ function main() {
|
||||
bundles[bundle] = json;
|
||||
cb(undefined, json);
|
||||
})
|
||||
.catch(cb);
|
||||
.catch(cb);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import nls = require('vs/nls');
|
||||
import * as nls from 'vs/nls';
|
||||
import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
@@ -13,12 +13,12 @@ import { IPartService } from 'vs/workbench/services/part/common/partService';
|
||||
import { NoEditorsVisibleContext, InZenModeContext } from 'vs/workbench/electron-browser/workbench';
|
||||
import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { IEditorOptions, Position as EditorPosition } from 'vs/platform/editor/common/editor';
|
||||
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey } from 'vs/platform/list/browser/listService';
|
||||
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget } from 'vs/platform/list/browser/listService';
|
||||
import { PagedList } from 'vs/base/browser/ui/list/listPaging';
|
||||
import { range } from 'vs/base/common/arrays';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -26,12 +26,25 @@ import { ITree } from 'vs/base/parts/tree/browser/tree';
|
||||
|
||||
// --- List Commands
|
||||
|
||||
function ensureDOMFocus(widget: ListWidget): void {
|
||||
// it can happen that one of the commands is executed while
|
||||
// DOM focus is within another focusable control within the
|
||||
// list/tree item. therefor we should ensure that the
|
||||
// list/tree has DOM focus again after the command ran.
|
||||
if (widget && !widget.isDOMFocused()) {
|
||||
widget.domFocus();
|
||||
}
|
||||
}
|
||||
|
||||
export function registerCommands(): void {
|
||||
|
||||
function focusDown(accessor: ServicesAccessor, arg2?: number): void {
|
||||
const focused = accessor.get(IListService).lastFocusedList;
|
||||
const count = typeof arg2 === 'number' ? arg2 : 1;
|
||||
|
||||
// Ensure DOM Focus
|
||||
ensureDOMFocus(focused);
|
||||
|
||||
// List
|
||||
if (focused instanceof List || focused instanceof PagedList) {
|
||||
const list = focused;
|
||||
@@ -131,6 +144,9 @@ export function registerCommands(): void {
|
||||
const focused = accessor.get(IListService).lastFocusedList;
|
||||
const count = typeof arg2 === 'number' ? arg2 : 1;
|
||||
|
||||
// Ensure DOM Focus
|
||||
ensureDOMFocus(focused);
|
||||
|
||||
// List
|
||||
if (focused instanceof List || focused instanceof PagedList) {
|
||||
const list = focused;
|
||||
@@ -261,6 +277,9 @@ export function registerCommands(): void {
|
||||
handler: (accessor) => {
|
||||
const focused = accessor.get(IListService).lastFocusedList;
|
||||
|
||||
// Ensure DOM Focus
|
||||
ensureDOMFocus(focused);
|
||||
|
||||
// List
|
||||
if (focused instanceof List || focused instanceof PagedList) {
|
||||
const list = focused;
|
||||
@@ -287,6 +306,9 @@ export function registerCommands(): void {
|
||||
handler: (accessor) => {
|
||||
const focused = accessor.get(IListService).lastFocusedList;
|
||||
|
||||
// Ensure DOM Focus
|
||||
ensureDOMFocus(focused);
|
||||
|
||||
// List
|
||||
if (focused instanceof List || focused instanceof PagedList) {
|
||||
const list = focused;
|
||||
@@ -324,6 +346,9 @@ export function registerCommands(): void {
|
||||
function listFocusFirst(accessor: ServicesAccessor, options?: { fromFocused: boolean }): void {
|
||||
const focused = accessor.get(IListService).lastFocusedList;
|
||||
|
||||
// Ensure DOM Focus
|
||||
ensureDOMFocus(focused);
|
||||
|
||||
// List
|
||||
if (focused instanceof List || focused instanceof PagedList) {
|
||||
const list = focused;
|
||||
@@ -360,6 +385,9 @@ export function registerCommands(): void {
|
||||
function listFocusLast(accessor: ServicesAccessor, options?: { fromFocused: boolean }): void {
|
||||
const focused = accessor.get(IListService).lastFocusedList;
|
||||
|
||||
// Ensure DOM Focus
|
||||
ensureDOMFocus(focused);
|
||||
|
||||
// List
|
||||
if (focused instanceof List || focused instanceof PagedList) {
|
||||
const list = focused;
|
||||
|
||||
@@ -6,20 +6,22 @@
|
||||
'use strict';
|
||||
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import nls = require('vs/nls');
|
||||
import * as nls from 'vs/nls';
|
||||
import product from 'vs/platform/node/product';
|
||||
import * as os from 'os';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
|
||||
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||
import { KeyMod, KeyChord, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { isWindows, isLinux, isMacintosh } from 'vs/base/common/platform';
|
||||
import { KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, OpenTipsAndTricksUrlAction, OpenIssueReporterAction, ReportPerformanceIssueUsingReporterAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseWorkspaceAction, CloseCurrentWindowAction, SwitchWindow, NewWindowAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction, QuickSwitchWindow, QuickOpenRecentAction, inRecentFilesPickerContextKey, ShowAboutDialogAction, InspectContextKeysAction } from 'vs/workbench/electron-browser/actions';
|
||||
import { KeybindingsReferenceAction, OpenDocumentationUrlAction, OpenIntroductoryVideosUrlAction, OpenTipsAndTricksUrlAction, OpenIssueReporterAction, ReportPerformanceIssueUsingReporterAction, ZoomResetAction, ZoomOutAction, ZoomInAction, ToggleFullScreenAction, ToggleMenuBarAction, CloseWorkspaceAction, CloseCurrentWindowAction, SwitchWindow, NewWindowAction, NavigateUpAction, NavigateDownAction, NavigateLeftAction, NavigateRightAction, IncreaseViewSizeAction, DecreaseViewSizeAction, ShowStartupPerformance, ToggleSharedProcessAction, QuickSwitchWindow, QuickOpenRecentAction, inRecentFilesPickerContextKey, ShowAboutDialogAction, InspectContextKeysAction, OpenProcessExplorer } from 'vs/workbench/electron-browser/actions';
|
||||
import { registerCommands } from 'vs/workbench/electron-browser/commands';
|
||||
import { AddRootFolderAction, GlobalRemoveRootFolderAction, OpenWorkspaceAction, SaveWorkspaceAsAction, OpenWorkspaceConfigFileAction, OpenFolderAsWorkspaceInNewWindowAction, OpenFileFolderAction, OpenFileAction, OpenFolderAction } from 'vs/workbench/browser/actions/workspaceActions';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ContextKeyExpr, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { inQuickOpenContext, getQuickNavigateHandler } from 'vs/workbench/browser/parts/quickopen/quickopen';
|
||||
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
// Contribute Commands
|
||||
registerCommands();
|
||||
@@ -103,14 +105,25 @@ workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(AddRoo
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(GlobalRemoveRootFolderAction, GlobalRemoveRootFolderAction.ID, GlobalRemoveRootFolderAction.LABEL), 'Workspaces: Remove Folder from Workspace...', workspacesCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenWorkspaceAction, OpenWorkspaceAction.ID, OpenWorkspaceAction.LABEL), 'Workspaces: Open Workspace...', workspacesCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(SaveWorkspaceAsAction, SaveWorkspaceAsAction.ID, SaveWorkspaceAsAction.LABEL), 'Workspaces: Save Workspace As...', workspacesCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenWorkspaceConfigFileAction, OpenWorkspaceConfigFileAction.ID, OpenWorkspaceConfigFileAction.LABEL), 'Workspaces: Open Workspace Configuration File', workspacesCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenFolderAsWorkspaceInNewWindowAction, OpenFolderAsWorkspaceInNewWindowAction.ID, OpenFolderAsWorkspaceInNewWindowAction.LABEL), 'Workspaces: Open Folder as Workspace in New Window', workspacesCategory);
|
||||
|
||||
CommandsRegistry.registerCommand(OpenWorkspaceConfigFileAction.ID, serviceAccessor => {
|
||||
serviceAccessor.get(IInstantiationService).createInstance(OpenWorkspaceConfigFileAction, OpenWorkspaceConfigFileAction.ID, OpenWorkspaceConfigFileAction.LABEL).run();
|
||||
});
|
||||
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
|
||||
command: {
|
||||
id: OpenWorkspaceConfigFileAction.ID,
|
||||
title: `${workspacesCategory}: ${OpenWorkspaceConfigFileAction.LABEL}`,
|
||||
},
|
||||
when: new RawContextKey<string>('workbenchState', '').isEqualTo('workspace')
|
||||
});
|
||||
|
||||
// Developer related actions
|
||||
const developerCategory = nls.localize('developer', "Developer");
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ShowStartupPerformance, ShowStartupPerformance.ID, ShowStartupPerformance.LABEL), 'Developer: Startup Performance', developerCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleSharedProcessAction, ToggleSharedProcessAction.ID, ToggleSharedProcessAction.LABEL), 'Developer: Toggle Shared Process', developerCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(InspectContextKeysAction, InspectContextKeysAction.ID, InspectContextKeysAction.LABEL), 'Developer: Inspect Context Keys', developerCategory);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenProcessExplorer, OpenProcessExplorer.ID, OpenProcessExplorer.LABEL), 'Developer: Open Process Explorer', developerCategory);
|
||||
|
||||
const recentFilesPickerContext = ContextKeyExpr.and(inQuickOpenContext, ContextKeyExpr.has(inRecentFilesPickerContextKey));
|
||||
|
||||
@@ -293,11 +306,16 @@ configurationRegistry.registerConfiguration({
|
||||
'enumDescriptions': [
|
||||
nls.localize('window.openFilesInNewWindow.on', "Files will open in a new window"),
|
||||
nls.localize('window.openFilesInNewWindow.off', "Files will open in the window with the files' folder open or the last active window"),
|
||||
nls.localize('window.openFilesInNewWindow.default', "Files will open in the window with the files' folder open or the last active window unless opened via the dock or from finder (macOS only)")
|
||||
isMacintosh ?
|
||||
nls.localize('window.openFilesInNewWindow.defaultMac', "Files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder") :
|
||||
nls.localize('window.openFilesInNewWindow.default', "Files will open in a new window unless picked from within the application (e.g. via the File menu)")
|
||||
],
|
||||
'default': 'off',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description':
|
||||
nls.localize('openFilesInNewWindow', "Controls if files should open in a new window.\n- default: files will open in the window with the files' folder open or the last active window unless opened via the dock or from finder (macOS only)\n- on: files will open in a new window\n- off: files will open in the window with the files' folder open or the last active window\nNote that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).")
|
||||
isMacintosh ?
|
||||
nls.localize('openFilesInNewWindowMac', "Controls if files should open in a new window.\n- default: files will open in the window with the files' folder open or the last active window unless opened via the Dock or from Finder\n- on: files will open in a new window\n- off: files will open in the window with the files' folder open or the last active window\nNote that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).") :
|
||||
nls.localize('openFilesInNewWindow', "Controls if files should open in a new window.\n- default: files will open in a new window unless picked from within the application (e.g. via the File menu)\n- on: files will open in a new window\n- off: files will open in the window with the files' folder open or the last active window\nNote that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).")
|
||||
},
|
||||
'window.openFoldersInNewWindow': {
|
||||
'type': 'string',
|
||||
@@ -308,8 +326,20 @@ configurationRegistry.registerConfiguration({
|
||||
nls.localize('window.openFoldersInNewWindow.default', "Folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu)")
|
||||
],
|
||||
'default': 'default',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('openFoldersInNewWindow', "Controls if folders should open in a new window or replace the last active window.\n- default: folders will open in a new window unless a folder is picked from within the application (e.g. via the File menu)\n- on: folders will open in a new window\n- off: folders will replace the last active window\nNote that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).")
|
||||
},
|
||||
'window.openWithoutArgumentsInNewWindow': {
|
||||
'type': 'string',
|
||||
'enum': ['on', 'off'],
|
||||
'enumDescriptions': [
|
||||
nls.localize('window.openWithoutArgumentsInNewWindow.on', "Open a new empty window"),
|
||||
nls.localize('window.openWithoutArgumentsInNewWindow.off', "Focus the last active running instance")
|
||||
],
|
||||
'default': isMacintosh ? 'off' : 'on',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('openWithoutArgumentsInNewWindow', "Controls if a new empty window should open when starting a second instance without arguments or if the last running instance should get focus.\n- on: open a new empty window\n- off: the last active running instance will get focus\nNote that there can still be cases where this setting is ignored (e.g. when using the -new-window or -reuse-window command line option).")
|
||||
},
|
||||
'window.restoreWindows': {
|
||||
'type': 'string',
|
||||
'enum': ['all', 'folders', 'one', 'none'],
|
||||
@@ -320,11 +350,13 @@ configurationRegistry.registerConfiguration({
|
||||
nls.localize('window.reopenFolders.none', "Never reopen a window. Always start with an empty one.")
|
||||
],
|
||||
'default': 'one',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('restoreWindows', "Controls how windows are being reopened after a restart. Select 'none' to always start with an empty workspace, 'one' to reopen the last window you worked on, 'folders' to reopen all windows that had folders opened or 'all' to reopen all windows of your last session.")
|
||||
},
|
||||
'window.restoreFullscreen': {
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('restoreFullscreen', "Controls if a window should restore to full screen mode if it was exited in full screen mode.")
|
||||
},
|
||||
'window.zoomLevel': {
|
||||
@@ -336,7 +368,7 @@ configurationRegistry.registerConfiguration({
|
||||
'type': 'string',
|
||||
'default': isMacintosh ? '${activeEditorShort}${separator}${rootName}' : '${dirty}${activeEditorShort}${separator}${rootName}${separator}${appName}',
|
||||
'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by parenthesis are not to be translated.'], key: 'title' },
|
||||
"Controls the window title based on the active editor. Variables are substituted based on the context:\n\${activeEditorShort}: the file name (e.g. myFile.txt)\n\${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFile.txt)\n\${activeEditorLong}: the full path of the file (e.g. /Users/Development/myProject/myFolder/myFile.txt)\n\${folderName}: name of the workspace folder the file is contained in (e.g. myFolder)\n\${folderPath}: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)\n\${rootName}: name of the workspace (e.g. myFolder or myWorkspace)\n\${rootPath}: file path of the workspace (e.g. /Users/Development/myWorkspace)\n\${appName}: e.g. VS Code\n\${dirty}: a dirty indicator if the active editor is dirty\n\${separator}: a conditional separator (\" - \") that only shows when surrounded by variables with values")
|
||||
"Controls the window title based on the active editor. Variables are substituted based on the context:\n\${activeEditorShort}: the file name (e.g. myFile.txt)\n\${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFile.txt)\n\${activeEditorLong}: the full path of the file (e.g. /Users/Development/myProject/myFolder/myFile.txt)\n\${folderName}: name of the workspace folder the file is contained in (e.g. myFolder)\n\${folderPath}: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)\n\${rootName}: name of the workspace (e.g. myFolder or myWorkspace)\n\${rootPath}: file path of the workspace (e.g. /Users/Development/myWorkspace)\n\${appName}: e.g. VS Code\n\${dirty}: a dirty indicator if the active editor is dirty\n\${separator}: a conditional separator (\" - \") that only shows when surrounded by variables with values or static text")
|
||||
},
|
||||
'window.newWindowDimensions': {
|
||||
'type': 'string',
|
||||
@@ -348,6 +380,7 @@ configurationRegistry.registerConfiguration({
|
||||
nls.localize('window.newWindowDimensions.fullscreen', "Open new windows in full screen mode.")
|
||||
],
|
||||
'default': 'default',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('newWindowDimensions', "Controls the dimensions of opening a new window when at least one window is already opened. By default, a new window will open in the center of the screen with small dimensions. When set to 'inherit', the window will get the same dimensions as the last window that was active. When set to 'maximized', the window will open maximized and fullscreen if configured to 'fullscreen'. Note that this setting does not have an impact on the first window that is opened. The first window will always restore the size and location as you left it before closing.")
|
||||
},
|
||||
'window.closeWhenEmpty': {
|
||||
@@ -365,12 +398,14 @@ configurationRegistry.registerConfiguration({
|
||||
nls.localize('window.menuBarVisibility.hidden', "Menu is always hidden.")
|
||||
],
|
||||
'default': 'default',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('menuBarVisibility', "Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. By default, the menu bar will be visible, unless the window is full screen."),
|
||||
'included': isWindows || isLinux
|
||||
},
|
||||
'window.enableMenuBarMnemonics': {
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('enableMenuBarMnemonics', "If enabled, the main menus can be opened via Alt-key shortcuts. Disabling mnemonics allows to bind these Alt-key shortcuts to editor commands instead."),
|
||||
'included': isWindows || isLinux
|
||||
},
|
||||
@@ -384,14 +419,30 @@ configurationRegistry.registerConfiguration({
|
||||
'type': 'string',
|
||||
'enum': ['native', 'custom'],
|
||||
'default': 'custom',
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('titleBarStyle', "Adjust the appearance of the window title bar. Changes require a full restart to apply."),
|
||||
'included': isMacintosh
|
||||
},
|
||||
'window.nativeTabs': {
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('window.nativeTabs', "Enables macOS Sierra window tabs. Note that changes require a full restart to apply and that native tabs will disable a custom title bar style if configured."),
|
||||
'included': isMacintosh && parseFloat(os.release()) >= 16 // Minimum: macOS Sierra (10.12.x = darwin 16.x)
|
||||
},
|
||||
'window.smoothScrollingWorkaround': {
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('window.smoothScrollingWorkaround', "Enable this workaround if scrolling is no longer smooth after restoring a minimized VS Code window. This is a workaround for an issue (https://github.com/Microsoft/vscode/issues/13612) where scrolling starts to lag on devices with precision trackpads like the Surface devices from Microsoft. Enabling this workaround can result in a little bit of layout flickering after restoring the window from minimized state but is otherwise harmless."),
|
||||
'included': isWindows
|
||||
},
|
||||
'window.clickThroughInactive': {
|
||||
'type': 'boolean',
|
||||
'default': true,
|
||||
'scope': ConfigurationScope.APPLICATION,
|
||||
'description': nls.localize('window.clickThroughInactive', "If enabled, clicking on an inactive window will both activate the window and trigger the element under the mouse if it is clickable. If disabled, clicking anywhere on an inactive window will activate it only and a second click is required on the element."),
|
||||
'included': isMacintosh
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,25 +5,25 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import nls = require('vs/nls');
|
||||
import * as nls from 'vs/nls';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { WorkbenchShell } from 'vs/workbench/electron-browser/shell';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import { domContentLoaded } from 'vs/base/browser/dom';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import comparer = require('vs/base/common/comparers');
|
||||
import platform = require('vs/base/common/platform');
|
||||
import paths = require('vs/base/common/paths');
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import * as comparer from 'vs/base/common/comparers';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as paths from 'vs/base/common/paths';
|
||||
import uri from 'vs/base/common/uri';
|
||||
import strings = require('vs/base/common/strings');
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { IWorkspaceContextService, Workspace, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { WorkspaceService } from 'vs/workbench/services/configuration/node/configurationService';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { realpath } from 'vs/base/node/pfs';
|
||||
import { EnvironmentService } from 'vs/platform/environment/node/environmentService';
|
||||
import gracefulFs = require('graceful-fs');
|
||||
import * as gracefulFs from 'graceful-fs';
|
||||
import { IInitData } from 'vs/workbench/services/timer/common/timerService';
|
||||
import { TimerService } from 'vs/workbench/services/timer/node/timerService';
|
||||
import { KeyboardMapperFactory } from 'vs/workbench/services/keybinding/electron-browser/keybindingService';
|
||||
@@ -36,17 +36,18 @@ import { Client as ElectronIPCClient } from 'vs/base/parts/ipc/electron-browser/
|
||||
import { webFrame } from 'electron';
|
||||
import { UpdateChannelClient } from 'vs/platform/update/common/updateIpc';
|
||||
import { IUpdateService } from 'vs/platform/update/common/update';
|
||||
import { URLChannelClient } from 'vs/platform/url/common/urlIpc';
|
||||
import { URLHandlerChannel, URLServiceChannelClient } from 'vs/platform/url/common/urlIpc';
|
||||
import { IURLService } from 'vs/platform/url/common/url';
|
||||
import { WorkspacesChannelClient } from 'vs/platform/workspaces/common/workspacesIpc';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { createSpdLogService } from 'vs/platform/log/node/spdlogService';
|
||||
|
||||
import fs = require('fs');
|
||||
import * as fs from 'fs';
|
||||
import { ConsoleLogService, MultiplexLogService, ILogService } from 'vs/platform/log/common/log';
|
||||
import { IssueChannelClient } from 'vs/platform/issue/common/issueIpc';
|
||||
import { IIssueService } from 'vs/platform/issue/common/issue';
|
||||
import { LogLevelSetterChannelClient, FollowerLogService } from 'vs/platform/log/common/logIpc';
|
||||
import { RelayURLService } from 'vs/platform/url/common/urlService';
|
||||
|
||||
gracefulFs.gracefulify(fs); // enable gracefulFs
|
||||
|
||||
export function startup(configuration: IWindowConfiguration): TPromise<void> {
|
||||
@@ -72,7 +73,7 @@ export function startup(configuration: IWindowConfiguration): TPromise<void> {
|
||||
}
|
||||
|
||||
function openWorkbench(configuration: IWindowConfiguration): TPromise<void> {
|
||||
const mainProcessClient = new ElectronIPCClient(String(`window${configuration.windowId}`));
|
||||
const mainProcessClient = new ElectronIPCClient(`window:${configuration.windowId}`);
|
||||
const mainServices = createMainProcessServices(mainProcessClient, configuration);
|
||||
|
||||
const environmentService = new EnvironmentService(configuration, configuration.execPath);
|
||||
@@ -96,7 +97,7 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise<void> {
|
||||
logService,
|
||||
timerService,
|
||||
storageService
|
||||
}, mainServices, configuration);
|
||||
}, mainServices, mainProcessClient, configuration);
|
||||
shell.open();
|
||||
|
||||
// Inform user about loading issues from the loader
|
||||
@@ -216,7 +217,12 @@ function createMainProcessServices(mainProcessClient: ElectronIPCClient, configu
|
||||
serviceCollection.set(IUpdateService, new SyncDescriptor(UpdateChannelClient, updateChannel));
|
||||
|
||||
const urlChannel = mainProcessClient.getChannel('url');
|
||||
serviceCollection.set(IURLService, new SyncDescriptor(URLChannelClient, urlChannel, configuration.windowId));
|
||||
const mainUrlService = new URLServiceChannelClient(urlChannel);
|
||||
const urlService = new RelayURLService(mainUrlService);
|
||||
serviceCollection.set(IURLService, urlService);
|
||||
|
||||
const urlHandlerChannel = new URLHandlerChannel(urlService);
|
||||
mainProcessClient.registerChannel('urlHandler', urlHandlerChannel);
|
||||
|
||||
const issueChannel = mainProcessClient.getChannel('issue');
|
||||
serviceCollection.set(IIssueService, new SyncDescriptor(IssueChannelClient, issueChannel));
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
font-size: 11px;
|
||||
-webkit-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Font Families (with CJK support) */
|
||||
@@ -21,7 +21,6 @@
|
||||
.monaco-shell:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Meiryo", "Hiragino Kaku Gothic Pro", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", "Sazanami Gothic", "IPA Gothic", sans-serif; }
|
||||
.monaco-shell:lang(ko) { font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Noto Sans", "Malgun Gothic", "Nanum Gothic", "Dotom", "Apple SD Gothic Neo", "AppleGothic", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; }
|
||||
|
||||
@-webkit-keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
||||
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
||||
|
||||
.monaco-shell img {
|
||||
@@ -66,29 +65,12 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.monaco-shell input[type="search"]::-webkit-search-decoration,
|
||||
.monaco-shell input[type="search"]::-webkit-search-results-button,
|
||||
.monaco-shell input[type="search"]::-webkit-search-results-decoration {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.monaco-shell input[type="search"]::-webkit-search-cancel-button {
|
||||
-webkit-appearance: none;
|
||||
height: 18px;
|
||||
width: 18px;
|
||||
background-image: url('clear.svg');
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
/* START Keyboard Focus Indication Styles */
|
||||
|
||||
.monaco-shell [tabindex="0"]:focus,
|
||||
.monaco-shell .synthetic-focus,
|
||||
.monaco-shell select:focus,
|
||||
.monaco-shell input[type="button"]:focus,
|
||||
.monaco-shell input[type="submit"]:focus,
|
||||
.monaco-shell input[type="search"]:focus,
|
||||
.monaco-shell input[type="text"]:focus,
|
||||
.monaco-shell textarea:focus,
|
||||
.monaco-shell input[type="checkbox"]:focus {
|
||||
@@ -98,28 +80,23 @@
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.monaco-shell [tabindex="0"]:active,
|
||||
.monaco-shell select:active,
|
||||
.monaco-shell input[type="button"]:active,
|
||||
.monaco-shell input[type="checkbox"]:active,
|
||||
.monaco-shell .monaco-tree .monaco-tree-row
|
||||
.monaco-action-bar .action-item [tabindex="0"]:hover,
|
||||
.monaco-shell .monaco-tree.focused.no-focused-item:active:before {
|
||||
outline: 0 !important; /* fixes some flashing outlines from showing up when clicking */
|
||||
}
|
||||
|
||||
.monaco-shell .mac select:focus {
|
||||
border: none; /* outline is a square, but border has a radius, so we avoid this glitch when focused (https://github.com/Microsoft/vscode/issues/26045) */
|
||||
}
|
||||
|
||||
.monaco-shell.hc-black [tabindex="0"]:focus,
|
||||
.monaco-shell.hc-black .synthetic-focus,
|
||||
.monaco-shell.hc-black select:focus,
|
||||
.monaco-shell.hc-black input[type="button"]:focus,
|
||||
.monaco-shell.hc-black input[type="text"]:focus,
|
||||
.monaco-shell.hc-black textarea:focus,
|
||||
.monaco-shell.hc-black input[type="search"]:focus,
|
||||
.monaco-shell.hc-black input[type="checkbox"]:focus {
|
||||
outline-style: solid;
|
||||
outline-width: 1px;
|
||||
}
|
||||
|
||||
.monaco-shell.hc-black .synthetic-focus input {
|
||||
background: transparent; /* Search input focus fix when in high contrast */
|
||||
}
|
||||
|
||||
.monaco-shell.vs .monaco-tree.focused .monaco-tree-row.focused [tabindex="0"]:focus,
|
||||
.monaco-shell.vs-dark .monaco-tree.focused .monaco-tree-row.focused [tabindex="0"]:focus {
|
||||
.monaco-shell .monaco-tree.focused .monaco-tree-row.focused [tabindex="0"]:focus {
|
||||
outline-width: 1px; /* higher contrast color for focusable elements in a row that shows focus feedback */
|
||||
outline-style: solid;
|
||||
}
|
||||
@@ -140,11 +117,6 @@
|
||||
outline-offset: -1px;
|
||||
}
|
||||
|
||||
.monaco-shell.hc-black .monaco-tree.focused.no-focused-item:focus:before {
|
||||
outline-width: 1px;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.monaco-shell .synthetic-focus :focus {
|
||||
outline: 0 !important; /* elements within widgets that draw synthetic-focus should never show focus */
|
||||
}
|
||||
@@ -161,15 +133,4 @@
|
||||
.monaco-shell .monaco-tree.focused:focus,
|
||||
.monaco-shell .monaco-list:focus {
|
||||
outline: 0 !important; /* tree indicates focus not via outline but through the focused item */
|
||||
}
|
||||
|
||||
.monaco-shell [tabindex="0"]:active,
|
||||
.monaco-shell select:active,
|
||||
.monaco-shell input[type="button"]:active,
|
||||
.monaco-shell input[type="submit"]:active,
|
||||
.monaco-shell input[type="checkbox"]:active,
|
||||
.monaco-shell .monaco-tree .monaco-tree-row
|
||||
.monaco-action-bar .action-item [tabindex="0"]:hover,
|
||||
.monaco-shell .monaco-tree.focused.no-focused-item:active:before {
|
||||
outline: 0 !important; /* fixes some flashing outlines from showing up when clicking */
|
||||
}
|
||||
@@ -20,12 +20,12 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.monaco-workbench .monaco-action-bar .select-box {
|
||||
margin-top: 8px; /* Center the select box */
|
||||
.monaco-workbench .monaco-action-bar .monaco-select-box {
|
||||
margin-top: 10px; /* Center the select box */
|
||||
}
|
||||
|
||||
.monaco-workbench.windows .monaco-action-bar .select-box {
|
||||
margin-top: 7px; /* Center the select box */
|
||||
.monaco-workbench.windows .monaco-action-bar .monaco-select-box {
|
||||
margin-top: 8px; /* Center the select box */
|
||||
}
|
||||
|
||||
.monaco-font-aliasing-antialiased {
|
||||
@@ -40,4 +40,4 @@
|
||||
.monaco-font-aliasing-auto {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
'use strict';
|
||||
|
||||
import URI from 'vs/base/common/uri';
|
||||
import objects = require('vs/base/common/objects');
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
|
||||
import { ParsedExpression, IExpression, parse } from 'vs/base/common/glob';
|
||||
import { relative } from 'path';
|
||||
@@ -19,7 +19,7 @@ export class ResourceGlobMatcher {
|
||||
|
||||
private static readonly NO_ROOT: string = null;
|
||||
|
||||
private _onExpressionChange: Emitter<void>;
|
||||
private readonly _onExpressionChange: Emitter<void>;
|
||||
private toUnbind: IDisposable[];
|
||||
private mapRootToParsedExpression: Map<string, ParsedExpression>;
|
||||
private mapRootToExpressionConfig: Map<string, IExpression>;
|
||||
|
||||
@@ -9,11 +9,9 @@ import 'vs/css!./media/shell';
|
||||
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
import { Dimension, Builder, $ } from 'vs/base/browser/builder';
|
||||
import dom = require('vs/base/browser/dom');
|
||||
import aria = require('vs/base/browser/ui/aria/aria');
|
||||
import * as aria from 'vs/base/browser/ui/aria/aria';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import product from 'vs/platform/node/product';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
@@ -62,7 +60,7 @@ import { WorkbenchModeServiceImpl } from 'vs/workbench/services/mode/common/work
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IUntitledEditorService, UntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { ICrashReporterService, NullCrashReporterService, CrashReporterService } from 'vs/workbench/services/crashReporter/electron-browser/crashReporterService';
|
||||
import { getDelayedChannel } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { getDelayedChannel, IPCClient } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { connect as connectNet } from 'vs/base/parts/ipc/node/ipc.net';
|
||||
import { IExtensionManagementChannel, ExtensionManagementChannelClient } from 'vs/platform/extensionManagement/common/extensionManagementIpc';
|
||||
import { IExtensionManagementService, IExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
@@ -76,7 +74,7 @@ import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/work
|
||||
import { WorkbenchThemeService } from 'vs/workbench/services/themes/electron-browser/workbenchThemeService';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { TextResourceConfigurationService } from 'vs/editor/common/services/resourceConfigurationImpl';
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { foreground, selectionBackground, focusBorder, scrollbarShadow, scrollbarSliderActiveBackground, scrollbarSliderBackground, scrollbarSliderHoverBackground, listHighlightForeground, inputPlaceholderForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { TextMateService } from 'vs/workbench/services/textMate/electron-browser/TMSyntax';
|
||||
import { ITextMateService } from 'vs/workbench/services/textMate/electron-browser/textMateService';
|
||||
@@ -93,9 +91,10 @@ import { IWorkbenchIssueService } from 'vs/workbench/services/issue/common/issue
|
||||
import { WorkbenchIssueService } from 'vs/workbench/services/issue/electron-browser/workbenchIssueService';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { NotificationService } from 'vs/workbench/services/notification/common/notificationService';
|
||||
import { ChoiceChannel } from 'vs/platform/dialogs/common/choiceIpc';
|
||||
import { IChoiceService, IConfirmationService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { DialogService } from 'vs/workbench/services/dialogs/electron-browser/dialogs';
|
||||
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { DialogService } from 'vs/workbench/services/dialogs/electron-browser/dialogService';
|
||||
import { DialogChannel } from 'vs/platform/dialogs/common/dialogIpc';
|
||||
import { EventType, addDisposableListener, addClass, getClientArea } from 'vs/base/browser/dom';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
import { FileTelemetryService } from 'sql/platform/telemetry/fileTelemetryService';
|
||||
@@ -138,12 +137,12 @@ export class WorkbenchShell {
|
||||
private previousErrorValue: string;
|
||||
private previousErrorTime: number;
|
||||
private content: HTMLElement;
|
||||
private contentsContainer: Builder;
|
||||
private contentsContainer: HTMLElement;
|
||||
|
||||
private configuration: IWindowConfiguration;
|
||||
private workbench: Workbench;
|
||||
|
||||
constructor(container: HTMLElement, coreServices: ICoreServices, mainProcessServices: ServiceCollection, configuration: IWindowConfiguration) {
|
||||
constructor(container: HTMLElement, coreServices: ICoreServices, mainProcessServices: ServiceCollection, private mainProcessClient: IPCClient, configuration: IWindowConfiguration) {
|
||||
this.container = container;
|
||||
|
||||
this.configuration = configuration;
|
||||
@@ -161,19 +160,20 @@ export class WorkbenchShell {
|
||||
this.previousErrorTime = 0;
|
||||
}
|
||||
|
||||
private createContents(parent: Builder): Builder {
|
||||
private createContents(parent: HTMLElement): HTMLElement {
|
||||
|
||||
// ARIA
|
||||
aria.setARIAContainer(document.body);
|
||||
|
||||
// Workbench Container
|
||||
const workbenchContainer = $(parent).div();
|
||||
const workbenchContainer = document.createElement('div');
|
||||
parent.appendChild(workbenchContainer);
|
||||
|
||||
// Instantiation service with services
|
||||
const [instantiationService, serviceCollection] = this.initServiceCollection(parent.getHTMLElement());
|
||||
const [instantiationService, serviceCollection] = this.initServiceCollection(parent);
|
||||
|
||||
// Workbench
|
||||
this.workbench = this.createWorkbench(instantiationService, serviceCollection, parent.getHTMLElement(), workbenchContainer.getHTMLElement());
|
||||
this.workbench = this.createWorkbench(instantiationService, serviceCollection, parent, workbenchContainer);
|
||||
|
||||
// Window
|
||||
this.workbench.getInstantiationService().createInstance(ElectronWindow, this.container);
|
||||
@@ -192,7 +192,7 @@ export class WorkbenchShell {
|
||||
|
||||
private createWorkbench(instantiationService: IInstantiationService, serviceCollection: ServiceCollection, parent: HTMLElement, workbenchContainer: HTMLElement): Workbench {
|
||||
try {
|
||||
const workbench = instantiationService.createInstance(Workbench, parent, workbenchContainer, this.configuration, serviceCollection, this.lifecycleService);
|
||||
const workbench = instantiationService.createInstance(Workbench, parent, workbenchContainer, this.configuration, serviceCollection, this.lifecycleService, this.mainProcessClient);
|
||||
|
||||
// Set lifecycle phase to `Restoring`
|
||||
this.lifecycleService.phase = LifecyclePhase.Restoring;
|
||||
@@ -241,23 +241,23 @@ export class WorkbenchShell {
|
||||
/* __GDPR__
|
||||
"workspaceLoad" : {
|
||||
"userAgent" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"windowSize.innerHeight": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"windowSize.innerWidth": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"windowSize.outerHeight": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"windowSize.outerWidth": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"emptyWorkbench": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"workbench.filesToOpen": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"workbench.filesToCreate": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"workbench.filesToDiff": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"customKeybindingsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"windowSize.innerHeight": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"windowSize.innerWidth": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"windowSize.outerHeight": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"windowSize.outerWidth": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"emptyWorkbench": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"workbench.filesToOpen": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"workbench.filesToCreate": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"workbench.filesToDiff": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"customKeybindingsCount": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"theme": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"language": { "classification": "SystemMetaData", "purpose": "BusinessInsight" },
|
||||
"experiments": { "${inline}": [ "${IExperiments}" ] },
|
||||
"pinnedViewlets": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"restoredViewlet": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"restoredEditors": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"restoredEditors": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"pinnedViewlets": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
"startupKind": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('workspaceLoad', {
|
||||
@@ -315,14 +315,14 @@ export class WorkbenchShell {
|
||||
perf.mark('didStatLocalStorage');
|
||||
|
||||
/* __GDPR__
|
||||
"localStorageTimers" : {
|
||||
"statTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"accessTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"firstReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"subsequentReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"writeTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"keys" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
|
||||
"size": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
"localStorageTimers<NUMBER>" : {
|
||||
"statTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"accessTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"firstReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"subsequentReadTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"writeTime" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"keys" : { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
|
||||
"size": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('localStorageTimers2', {
|
||||
@@ -366,7 +366,7 @@ export class WorkbenchShell {
|
||||
.then(() => connectNet(this.environmentService.sharedIPCHandle, `window:${this.configuration.windowId}`));
|
||||
|
||||
sharedProcess
|
||||
.done(client => client.registerChannel('choice', instantiationService.createInstance(ChoiceChannel)));
|
||||
.done(client => client.registerChannel('dialog', instantiationService.createInstance(DialogChannel)));
|
||||
|
||||
// Warm up font cache information before building up too many dom elements
|
||||
restoreFontInfo(this.storageService);
|
||||
@@ -413,9 +413,7 @@ export class WorkbenchShell {
|
||||
}
|
||||
serviceCollection.set(ICrashReporterService, crashReporterService);
|
||||
|
||||
const dialog = instantiationService.createInstance(DialogService);
|
||||
serviceCollection.set(IChoiceService, dialog);
|
||||
serviceCollection.set(IConfirmationService, dialog);
|
||||
serviceCollection.set(IDialogService, instantiationService.createInstance(DialogService));
|
||||
|
||||
const lifecycleService = instantiationService.createInstance(LifecycleService);
|
||||
this.toUnbind.push(lifecycleService.onShutdown(reason => this.dispose(reason)));
|
||||
@@ -429,6 +427,8 @@ export class WorkbenchShell {
|
||||
serviceCollection.set(IExtensionEnablementService, extensionEnablementService);
|
||||
this.toUnbind.push(extensionEnablementService);
|
||||
|
||||
serviceCollection.set(IRequestService, new SyncDescriptor(RequestService));
|
||||
|
||||
this.extensionService = instantiationService.createInstance(ExtensionService);
|
||||
serviceCollection.set(IExtensionService, this.extensionService);
|
||||
|
||||
@@ -445,8 +445,6 @@ export class WorkbenchShell {
|
||||
this.contextViewService = instantiationService.createInstance(ContextViewService, this.container);
|
||||
serviceCollection.set(IContextViewService, this.contextViewService);
|
||||
|
||||
serviceCollection.set(IRequestService, new SyncDescriptor(RequestService));
|
||||
|
||||
serviceCollection.set(IMarkerService, new SyncDescriptor(MarkerService));
|
||||
|
||||
serviceCollection.set(IModeService, new SyncDescriptor(WorkbenchModeServiceImpl));
|
||||
@@ -483,13 +481,15 @@ export class WorkbenchShell {
|
||||
});
|
||||
|
||||
// Shell Class for CSS Scoping
|
||||
$(this.container).addClass('monaco-shell');
|
||||
addClass(this.container, 'monaco-shell');
|
||||
|
||||
// Controls
|
||||
this.content = $('.monaco-shell-content').appendTo(this.container).getHTMLElement();
|
||||
this.content = document.createElement('div');
|
||||
addClass(this.content, 'monaco-shell-content');
|
||||
this.container.appendChild(this.content);
|
||||
|
||||
// Create Contents
|
||||
this.contentsContainer = this.createContents($(this.content));
|
||||
this.contentsContainer = this.createContents(this.content);
|
||||
|
||||
// Layout
|
||||
this.layout();
|
||||
@@ -501,7 +501,7 @@ export class WorkbenchShell {
|
||||
private registerListeners(): void {
|
||||
|
||||
// Resize
|
||||
$(window).on(dom.EventType.RESIZE, () => this.layout(), this.toUnbind);
|
||||
this.toUnbind.push(addDisposableListener(window, EventType.RESIZE, () => this.layout()));
|
||||
}
|
||||
|
||||
public onUnexpectedError(error: any): void {
|
||||
@@ -528,10 +528,10 @@ export class WorkbenchShell {
|
||||
}
|
||||
|
||||
private layout(): void {
|
||||
const clArea = $(this.container).getClientArea();
|
||||
const clientArea = getClientArea(this.container);
|
||||
|
||||
const contentsSize = new Dimension(clArea.width, clArea.height);
|
||||
this.contentsContainer.size(contentsSize.width, contentsSize.height);
|
||||
this.contentsContainer.style.width = `${clientArea.width}px`;
|
||||
this.contentsContainer.style.height = `${clientArea.height}px`;
|
||||
|
||||
this.contextViewService.layout();
|
||||
this.workbench.layout();
|
||||
@@ -652,4 +652,29 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
}
|
||||
`);
|
||||
}
|
||||
|
||||
// High Contrast theme overwrites for outline
|
||||
if (theme.type === HIGH_CONTRAST) {
|
||||
collector.addRule(`
|
||||
.monaco-shell.hc-black [tabindex="0"]:focus,
|
||||
.monaco-shell.hc-black .synthetic-focus,
|
||||
.monaco-shell.hc-black select:focus,
|
||||
.monaco-shell.hc-black input[type="button"]:focus,
|
||||
.monaco-shell.hc-black input[type="text"]:focus,
|
||||
.monaco-shell.hc-black textarea:focus,
|
||||
.monaco-shell.hc-black input[type="checkbox"]:focus {
|
||||
outline-style: solid;
|
||||
outline-width: 1px;
|
||||
}
|
||||
|
||||
.monaco-shell.hc-black .monaco-tree.focused.no-focused-item:focus:before {
|
||||
outline-width: 1px;
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.monaco-shell.hc-black .synthetic-focus input {
|
||||
background: transparent; /* Search input focus fix when in high contrast */
|
||||
}
|
||||
`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
import nls = require('vs/nls');
|
||||
import * as nls from 'vs/nls';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import types = require('vs/base/common/types');
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import arrays = require('vs/base/common/arrays');
|
||||
import objects = require('vs/base/common/objects');
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import { AutoSaveConfiguration, IFileService } from 'vs/platform/files/common/files';
|
||||
@@ -131,7 +131,7 @@ export class ElectronWindow extends Themable {
|
||||
});
|
||||
|
||||
// Support runAction event
|
||||
ipc.on('vscode:runAction', (_event: any, request: IRunActionInWindowRequest) => {
|
||||
ipc.on('vscode:runAction', (event: any, request: IRunActionInWindowRequest) => {
|
||||
const args: any[] = [];
|
||||
|
||||
// If we run an action from the touchbar, we fill in the currently active resource
|
||||
@@ -162,7 +162,7 @@ export class ElectronWindow extends Themable {
|
||||
});
|
||||
|
||||
// Support resolve keybindings event
|
||||
ipc.on('vscode:resolveKeybindings', (_event: any, rawActionIds: string) => {
|
||||
ipc.on('vscode:resolveKeybindings', (event: any, rawActionIds: string) => {
|
||||
let actionIds: string[] = [];
|
||||
try {
|
||||
actionIds = JSON.parse(rawActionIds);
|
||||
@@ -178,7 +178,7 @@ export class ElectronWindow extends Themable {
|
||||
}, () => errors.onUnexpectedError);
|
||||
});
|
||||
|
||||
ipc.on('vscode:reportError', (_event: any, error: string) => {
|
||||
ipc.on('vscode:reportError', (event: any, error: string) => {
|
||||
if (error) {
|
||||
const errorParsed = JSON.parse(error);
|
||||
errorParsed.mainProcess = true;
|
||||
@@ -187,13 +187,13 @@ export class ElectronWindow extends Themable {
|
||||
});
|
||||
|
||||
// Support openFiles event for existing and new files
|
||||
ipc.on('vscode:openFiles', (_event: any, request: IOpenFileRequest) => this.onOpenFiles(request));
|
||||
ipc.on('vscode:openFiles', (event: any, request: IOpenFileRequest) => this.onOpenFiles(request));
|
||||
|
||||
// Support addFolders event if we have a workspace opened
|
||||
ipc.on('vscode:addFolders', (_event: any, request: IAddFoldersRequest) => this.onAddFoldersRequest(request));
|
||||
ipc.on('vscode:addFolders', (event: any, request: IAddFoldersRequest) => this.onAddFoldersRequest(request));
|
||||
|
||||
// Message support
|
||||
ipc.on('vscode:showInfoMessage', (_event: any, message: string) => {
|
||||
ipc.on('vscode:showInfoMessage', (event: any, message: string) => {
|
||||
this.notificationService.info(message);
|
||||
});
|
||||
|
||||
@@ -240,7 +240,7 @@ export class ElectronWindow extends Themable {
|
||||
});
|
||||
|
||||
// keyboard layout changed event
|
||||
ipc.on('vscode:accessibilitySupportChanged', (_event: any, accessibilitySupportEnabled: boolean) => {
|
||||
ipc.on('vscode:accessibilitySupportChanged', (event: any, accessibilitySupportEnabled: boolean) => {
|
||||
browser.setAccessibilitySupport(accessibilitySupportEnabled ? AccessibilitySupport.Enabled : AccessibilitySupport.Disabled);
|
||||
});
|
||||
|
||||
|
||||
@@ -10,13 +10,13 @@ import 'vs/css!./media/workbench';
|
||||
import { localize } from 'vs/nls';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Builder, $ } from 'vs/base/browser/builder';
|
||||
import { Delayer, RunOnceScheduler } from 'vs/base/common/async';
|
||||
import * as browser from 'vs/base/browser/browser';
|
||||
import * as perf from 'vs/base/common/performance';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
import { BackupFileService } from 'vs/workbench/services/backup/node/backupFileService';
|
||||
import { IBackupFileService } from 'vs/workbench/services/backup/common/backup';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -35,8 +35,10 @@ import { WorkbenchLayout } from 'vs/workbench/browser/layout';
|
||||
import { IActionBarRegistry, Extensions as ActionBarExtensions } from 'vs/workbench/browser/actions';
|
||||
import { PanelRegistry, Extensions as PanelExtensions } from 'vs/workbench/browser/panel';
|
||||
import { QuickOpenController } from 'vs/workbench/browser/parts/quickopen/quickOpenController';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { QuickInputService } from 'vs/workbench/browser/parts/quickinput/quickInput';
|
||||
import { getServices } from 'vs/platform/instantiation/common/extensions';
|
||||
import { Position, Parts, IPartService, ILayoutOptions, Dimension } from 'vs/workbench/services/part/common/partService';
|
||||
import { Position, Parts, IPartService, ILayoutOptions, IDimension } from 'vs/workbench/services/part/common/partService';
|
||||
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ContextMenuService } from 'vs/workbench/services/contextview/electron-browser/contextmenuService';
|
||||
@@ -95,7 +97,7 @@ import URI from 'vs/base/common/uri';
|
||||
import { IListService, ListService } from 'vs/platform/list/browser/listService';
|
||||
import { domEvent } from 'vs/base/browser/event';
|
||||
import { InputFocusedContext } from 'vs/platform/workbench/common/contextkeys';
|
||||
import { ICustomViewsService } from 'vs/workbench/common/views';
|
||||
import { IViewsService } from 'vs/workbench/common/views';
|
||||
import { CustomViewsService } from 'vs/workbench/browser/parts/views/customView';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { NotificationService } from 'vs/workbench/services/notification/common/notificationService';
|
||||
@@ -104,6 +106,11 @@ import { NotificationsAlerts } from 'vs/workbench/browser/parts/notifications/no
|
||||
import { NotificationsStatus } from 'vs/workbench/browser/parts/notifications/notificationsStatus';
|
||||
import { registerNotificationCommands } from 'vs/workbench/browser/parts/notifications/notificationsCommands';
|
||||
import { NotificationsToasts } from 'vs/workbench/browser/parts/notifications/notificationsToasts';
|
||||
import { IPCClient } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { registerWindowDriver } from 'vs/platform/driver/electron-browser/driver';
|
||||
import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences';
|
||||
import { PreferencesService } from 'vs/workbench/services/preferences/browser/preferencesService';
|
||||
import { IExtensionUrlHandler, ExtensionUrlHandler } from 'vs/platform/url/electron-browser/inactiveExtensionUrlHandler';
|
||||
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
@@ -187,6 +194,8 @@ export interface IWorkbenchStartedInfo {
|
||||
|
||||
type FontAliasingOption = 'default' | 'antialiased' | 'none' | 'auto';
|
||||
|
||||
const fontAliasingValues: FontAliasingOption[] = ['antialiased', 'none', 'auto'];
|
||||
|
||||
const Identifiers = {
|
||||
WORKBENCH_CONTAINER: 'workbench.main.container',
|
||||
TITLEBAR_PART: 'workbench.parts.titlebar',
|
||||
@@ -226,7 +235,7 @@ export class Workbench implements IPartService {
|
||||
|
||||
private static readonly fontAliasingConfigurationKey = 'workbench.fontAliasing';
|
||||
|
||||
private _onTitleBarVisibilityChange: Emitter<void>;
|
||||
private readonly _onTitleBarVisibilityChange: Emitter<void>;
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
@@ -251,6 +260,7 @@ export class Workbench implements IPartService {
|
||||
private editorPart: EditorPart;
|
||||
private statusbarPart: StatusbarPart;
|
||||
private quickOpen: QuickOpenController;
|
||||
private quickInput: QuickInputService;
|
||||
private notificationsCenter: NotificationsCenter;
|
||||
private notificationsToasts: NotificationsToasts;
|
||||
private workbenchLayout: WorkbenchLayout;
|
||||
@@ -280,9 +290,10 @@ export class Workbench implements IPartService {
|
||||
constructor(
|
||||
parent: HTMLElement,
|
||||
container: HTMLElement,
|
||||
configuration: IWindowConfiguration,
|
||||
private configuration: IWindowConfiguration,
|
||||
serviceCollection: ServiceCollection,
|
||||
private lifecycleService: LifecycleService,
|
||||
private mainProcessClient: IPCClient,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IWorkspaceContextService private contextService: IWorkspaceContextService,
|
||||
@IStorageService private storageService: IStorageService,
|
||||
@@ -316,7 +327,7 @@ export class Workbench implements IPartService {
|
||||
return this._onTitleBarVisibilityChange.event;
|
||||
}
|
||||
|
||||
public get onEditorLayout(): Event<Dimension> {
|
||||
public get onEditorLayout(): Event<IDimension> {
|
||||
return this.editorPart.onLayout;
|
||||
}
|
||||
|
||||
@@ -367,6 +378,12 @@ export class Workbench implements IPartService {
|
||||
// Workbench Layout
|
||||
this.createWorkbenchLayout();
|
||||
|
||||
// Driver
|
||||
if (this.environmentService.driverHandle) {
|
||||
registerWindowDriver(this.mainProcessClient, this.configuration.windowId, this.instantiationService)
|
||||
.then(disposable => this.toUnbind.push(disposable));
|
||||
}
|
||||
|
||||
// Restore Parts
|
||||
return this.restoreParts();
|
||||
}
|
||||
@@ -473,6 +490,7 @@ export class Workbench implements IPartService {
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ToggleDevToolsAction, ToggleDevToolsAction.ID, ToggleDevToolsAction.LABEL, isDeveloping ? { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_I, mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_I } } : void 0), 'Developer: Toggle Developer Tools', localize('developer', "Developer"));
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(OpenRecentAction, OpenRecentAction.ID, OpenRecentAction.LABEL, { primary: isDeveloping ? null : KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent...', localize('file', "File"));
|
||||
workbenchActionsRegistry.registerWorkbenchAction(new SyncActionDescriptor(ReloadWindowWithExtensionsDisabledAction, ReloadWindowWithExtensionsDisabledAction.ID, ReloadWindowWithExtensionsDisabledAction.LABEL), 'Reload Window Without Extensions');
|
||||
|
||||
// Actions for macOS native tabs management (only when enabled)
|
||||
const windowConfig = this.configurationService.getValue<IWindowConfiguration>();
|
||||
if (windowConfig && windowConfig.window && windowConfig.window.nativeTabs) {
|
||||
@@ -612,7 +630,7 @@ export class Workbench implements IPartService {
|
||||
|
||||
// Custom views service
|
||||
const customViewsService = this.instantiationService.createInstance(CustomViewsService);
|
||||
serviceCollection.set(ICustomViewsService, customViewsService);
|
||||
serviceCollection.set(IViewsService, customViewsService);
|
||||
|
||||
// Activity service (activitybar part)
|
||||
this.activitybarPart = this.instantiationService.createInstance(ActivitybarPart, Identifiers.ACTIVITYBAR_PART);
|
||||
@@ -623,7 +641,7 @@ export class Workbench implements IPartService {
|
||||
// File Service
|
||||
this.fileService = this.instantiationService.createInstance(RemoteFileService);
|
||||
serviceCollection.set(IFileService, this.fileService);
|
||||
this.toUnbind.push(this.fileService.onFileChanges(e => this.configurationService.handleWorkspaceFileEvents(e)));
|
||||
this.configurationService.acquireFileService(this.fileService);
|
||||
|
||||
// Editor service (editor part)
|
||||
this.editorPart = this.instantiationService.createInstance(EditorPart, Identifiers.EDITOR_PART, !this.hasFilesToCreateOpenOrDiff);
|
||||
@@ -653,6 +671,9 @@ export class Workbench implements IPartService {
|
||||
// SCM Service
|
||||
serviceCollection.set(ISCMService, new SyncDescriptor(SCMService));
|
||||
|
||||
// Inactive extension URL handler
|
||||
serviceCollection.set(IExtensionUrlHandler, new SyncDescriptor(ExtensionUrlHandler));
|
||||
|
||||
// Text Model Resolver Service
|
||||
serviceCollection.set(ITextModelService, new SyncDescriptor(TextModelResolverService));
|
||||
|
||||
@@ -718,6 +739,13 @@ export class Workbench implements IPartService {
|
||||
this.toUnbind.push({ dispose: () => connectionManagementService.shutdown() });
|
||||
this.toUnbind.push({ dispose: () => accountManagementService.shutdown() });
|
||||
this.toUnbind.push({ dispose: () => capabilitiesService.shutdown() });
|
||||
// Quick input service
|
||||
this.quickInput = this.instantiationService.createInstance(QuickInputService);
|
||||
this.toUnbind.push({ dispose: () => this.quickInput.shutdown() });
|
||||
serviceCollection.set(IQuickInputService, this.quickInput);
|
||||
|
||||
// PreferencesService
|
||||
serviceCollection.set(IPreferencesService, this.instantiationService.createInstance(PreferencesService));
|
||||
|
||||
// Contributed services
|
||||
const contributedServices = getServices();
|
||||
@@ -732,7 +760,7 @@ export class Workbench implements IPartService {
|
||||
|
||||
this.instantiationService.createInstance(DefaultConfigurationExportHelper);
|
||||
|
||||
this.configurationService.setInstantiationService(this.getInstantiationService());
|
||||
this.configurationService.acquireInstantiationService(this.getInstantiationService());
|
||||
}
|
||||
|
||||
private initSettings(): void {
|
||||
@@ -809,7 +837,7 @@ export class Workbench implements IPartService {
|
||||
}
|
||||
|
||||
public getContainer(part: Parts): HTMLElement {
|
||||
let container: Builder = null;
|
||||
let container: HTMLElement = null;
|
||||
switch (part) {
|
||||
case Parts.TITLEBAR_PART:
|
||||
container = this.titlebarPart.getContainer();
|
||||
@@ -830,7 +858,8 @@ export class Workbench implements IPartService {
|
||||
container = this.statusbarPart.getContainer();
|
||||
break;
|
||||
}
|
||||
return container && container.getHTMLElement();
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
public isVisible(part: Parts): boolean {
|
||||
@@ -1034,10 +1063,10 @@ export class Workbench implements IPartService {
|
||||
this.sideBarPosition = position;
|
||||
|
||||
// Adjust CSS
|
||||
this.activitybarPart.getContainer().removeClass(oldPositionValue);
|
||||
this.sidebarPart.getContainer().removeClass(oldPositionValue);
|
||||
this.activitybarPart.getContainer().addClass(newPositionValue);
|
||||
this.sidebarPart.getContainer().addClass(newPositionValue);
|
||||
DOM.removeClass(this.activitybarPart.getContainer(), oldPositionValue);
|
||||
DOM.removeClass(this.sidebarPart.getContainer(), oldPositionValue);
|
||||
DOM.addClass(this.activitybarPart.getContainer(), newPositionValue);
|
||||
DOM.addClass(this.sidebarPart.getContainer(), newPositionValue);
|
||||
|
||||
// Update Styles
|
||||
this.activitybarPart.updateStyles();
|
||||
@@ -1059,8 +1088,8 @@ export class Workbench implements IPartService {
|
||||
this.storageService.store(Workbench.panelPositionStorageKey, Position[this.panelPosition].toLowerCase(), StorageScope.WORKSPACE);
|
||||
|
||||
// Adjust CSS
|
||||
this.panelPart.getContainer().removeClass(oldPositionValue);
|
||||
this.panelPart.getContainer().addClass(newPositionValue);
|
||||
DOM.removeClass(this.panelPart.getContainer(), oldPositionValue);
|
||||
DOM.addClass(this.panelPart.getContainer(), newPositionValue);
|
||||
|
||||
// Update Styles
|
||||
this.panelPart.updateStyles();
|
||||
@@ -1072,13 +1101,12 @@ export class Workbench implements IPartService {
|
||||
|
||||
private setFontAliasing(aliasing: FontAliasingOption) {
|
||||
this.fontAliasing = aliasing;
|
||||
const fontAliasingClassNames = [
|
||||
'monaco-font-aliasing-antialiased',
|
||||
'monaco-font-aliasing-none',
|
||||
'monaco-font-aliasing-auto'
|
||||
];
|
||||
document.body.classList.remove(...fontAliasingClassNames);
|
||||
if (aliasing !== 'default') {
|
||||
|
||||
// Remove all
|
||||
document.body.classList.remove(...fontAliasingValues.map(value => `monaco-font-aliasing-${value}`));
|
||||
|
||||
// Add specific
|
||||
if (fontAliasingValues.some(option => option === aliasing)) {
|
||||
document.body.classList.add(`monaco-font-aliasing-${aliasing}`);
|
||||
}
|
||||
}
|
||||
@@ -1092,10 +1120,13 @@ export class Workbench implements IPartService {
|
||||
|
||||
// Preserve zen mode only on reload. Real quit gets out of zen mode so novice users do not get stuck in zen mode.
|
||||
const zenConfig = this.configurationService.getValue<IZenModeSettings>('zenMode');
|
||||
const zenModeActive = (zenConfig.restore || reason === ShutdownReason.RELOAD) && this.zenMode.active;
|
||||
if (zenModeActive) {
|
||||
const restoreZenMode = this.zenMode.active && (zenConfig.restore || reason === ShutdownReason.RELOAD);
|
||||
if (restoreZenMode) {
|
||||
this.storageService.store(Workbench.zenModeActiveStorageKey, true, StorageScope.WORKSPACE);
|
||||
} else {
|
||||
if (this.zenMode.active) {
|
||||
this.toggleZenMode(true);
|
||||
}
|
||||
this.storageService.remove(Workbench.zenModeActiveStorageKey, StorageScope.WORKSPACE);
|
||||
}
|
||||
|
||||
@@ -1198,10 +1229,10 @@ export class Workbench implements IPartService {
|
||||
const editorContainer = this.editorPart.getContainer();
|
||||
if (visibleEditors === 0) {
|
||||
this.editorsVisibleContext.reset();
|
||||
this.editorBackgroundDelayer.trigger(() => editorContainer.addClass('empty'));
|
||||
this.editorBackgroundDelayer.trigger(() => DOM.addClass(editorContainer, 'empty'));
|
||||
} else {
|
||||
this.editorsVisibleContext.set(true);
|
||||
this.editorBackgroundDelayer.trigger(() => editorContainer.removeClass('empty'));
|
||||
this.editorBackgroundDelayer.trigger(() => DOM.removeClass(editorContainer, 'empty'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1242,8 +1273,8 @@ export class Workbench implements IPartService {
|
||||
private createWorkbenchLayout(): void {
|
||||
this.workbenchLayout = this.instantiationService.createInstance(
|
||||
WorkbenchLayout,
|
||||
$(this.container), // Parent
|
||||
this.workbench, // Workbench Container
|
||||
this.container, // Parent
|
||||
this.workbench.getHTMLElement(), // Workbench Container
|
||||
{
|
||||
titlebar: this.titlebarPart, // Title Bar
|
||||
activitybar: this.activitybarPart, // Activity Bar
|
||||
@@ -1253,6 +1284,7 @@ export class Workbench implements IPartService {
|
||||
statusbar: this.statusbarPart, // Statusbar
|
||||
},
|
||||
this.quickOpen, // Quickopen
|
||||
this.quickInput, // QuickInput
|
||||
this.notificationsCenter, // Notifications Center
|
||||
this.notificationsToasts // Notifications Toasts
|
||||
);
|
||||
@@ -1307,7 +1339,7 @@ export class Workbench implements IPartService {
|
||||
role: 'contentinfo'
|
||||
});
|
||||
|
||||
this.titlebarPart.create(titlebarContainer);
|
||||
this.titlebarPart.create(titlebarContainer.getHTMLElement());
|
||||
}
|
||||
|
||||
private createActivityBarPart(): void {
|
||||
@@ -1318,7 +1350,7 @@ export class Workbench implements IPartService {
|
||||
role: 'navigation'
|
||||
});
|
||||
|
||||
this.activitybarPart.create(activitybarPartContainer);
|
||||
this.activitybarPart.create(activitybarPartContainer.getHTMLElement());
|
||||
}
|
||||
|
||||
private createSidebarPart(): void {
|
||||
@@ -1329,7 +1361,7 @@ export class Workbench implements IPartService {
|
||||
role: 'complementary'
|
||||
});
|
||||
|
||||
this.sidebarPart.create(sidebarPartContainer);
|
||||
this.sidebarPart.create(sidebarPartContainer.getHTMLElement());
|
||||
}
|
||||
|
||||
private createPanelPart(): void {
|
||||
@@ -1340,7 +1372,7 @@ export class Workbench implements IPartService {
|
||||
role: 'complementary'
|
||||
});
|
||||
|
||||
this.panelPart.create(panelPartContainer);
|
||||
this.panelPart.create(panelPartContainer.getHTMLElement());
|
||||
}
|
||||
|
||||
private createEditorPart(): void {
|
||||
@@ -1351,7 +1383,7 @@ export class Workbench implements IPartService {
|
||||
role: 'main'
|
||||
});
|
||||
|
||||
this.editorPart.create(editorContainer);
|
||||
this.editorPart.create(editorContainer.getHTMLElement());
|
||||
}
|
||||
|
||||
private createStatusbarPart(): void {
|
||||
@@ -1361,7 +1393,7 @@ export class Workbench implements IPartService {
|
||||
role: 'contentinfo'
|
||||
});
|
||||
|
||||
this.statusbarPart.create(statusbarContainer);
|
||||
this.statusbarPart.create(statusbarContainer.getHTMLElement());
|
||||
}
|
||||
|
||||
private createNotificationsHandlers(): void {
|
||||
@@ -1380,7 +1412,6 @@ export class Workbench implements IPartService {
|
||||
|
||||
// Notifications Status
|
||||
const notificationsStatus = this.instantiationService.createInstance(NotificationsStatus, this.notificationService.model);
|
||||
this.toUnbind.push(notificationsStatus);
|
||||
|
||||
// Eventing
|
||||
this.toUnbind.push(this.notificationsCenter.onDidChangeVisibility(() => {
|
||||
@@ -1422,13 +1453,11 @@ export class Workbench implements IPartService {
|
||||
// Check if zen mode transitioned to full screen and if now we are out of zen mode -> we need to go out of full screen
|
||||
let toggleFullScreen = false;
|
||||
// Same goes for the centered editor layout
|
||||
let toggleCenteredEditorLayout = false;
|
||||
if (this.zenMode.active) {
|
||||
const config = this.configurationService.getValue<IZenModeSettings>('zenMode');
|
||||
toggleFullScreen = !browser.isFullscreen() && config.fullScreen;
|
||||
this.zenMode.transitionedToFullScreen = toggleFullScreen;
|
||||
toggleCenteredEditorLayout = !this.isEditorLayoutCentered() && config.centerLayout;
|
||||
this.zenMode.transitionedToCenteredEditorLayout = toggleCenteredEditorLayout;
|
||||
this.zenMode.transitionedToCenteredEditorLayout = !this.isEditorLayoutCentered() && config.centerLayout;
|
||||
this.zenMode.wasSideBarVisible = this.isVisible(Parts.SIDEBAR_PART);
|
||||
this.zenMode.wasPanelVisible = this.isVisible(Parts.PANEL_PART);
|
||||
this.setPanelHidden(true, true).done(void 0, errors.onUnexpectedError);
|
||||
@@ -1445,14 +1474,20 @@ export class Workbench implements IPartService {
|
||||
if (config.hideTabs) {
|
||||
this.editorPart.hideTabs(true);
|
||||
}
|
||||
|
||||
if (config.centerLayout) {
|
||||
this.centerEditorLayout(true, true);
|
||||
}
|
||||
} else {
|
||||
if (this.zenMode.wasPanelVisible) {
|
||||
this.setPanelHidden(false, true).done(void 0, errors.onUnexpectedError);
|
||||
}
|
||||
|
||||
if (this.zenMode.wasSideBarVisible) {
|
||||
this.setSideBarHidden(false, true).done(void 0, errors.onUnexpectedError);
|
||||
}
|
||||
if (this.zenMode.transitionedToCenteredEditorLayout) {
|
||||
this.centerEditorLayout(false, true);
|
||||
}
|
||||
|
||||
// Status bar and activity bar visibility come from settings -> update their visibility.
|
||||
this.onDidUpdateConfiguration(true);
|
||||
@@ -1463,15 +1498,10 @@ export class Workbench implements IPartService {
|
||||
}
|
||||
|
||||
toggleFullScreen = this.zenMode.transitionedToFullScreen && browser.isFullscreen();
|
||||
toggleCenteredEditorLayout = this.zenMode.transitionedToCenteredEditorLayout && this.isEditorLayoutCentered();
|
||||
}
|
||||
|
||||
this.inZenMode.set(this.zenMode.active);
|
||||
|
||||
if (toggleCenteredEditorLayout) {
|
||||
this.toggleCenteredEditorLayout(true);
|
||||
}
|
||||
|
||||
if (!skipLayout) {
|
||||
this.layout();
|
||||
}
|
||||
@@ -1485,8 +1515,8 @@ export class Workbench implements IPartService {
|
||||
return this.centeredEditorLayoutActive;
|
||||
}
|
||||
|
||||
public toggleCenteredEditorLayout(skipLayout?: boolean): void {
|
||||
this.centeredEditorLayoutActive = !this.centeredEditorLayoutActive;
|
||||
public centerEditorLayout(active: boolean, skipLayout?: boolean): void {
|
||||
this.centeredEditorLayoutActive = active;
|
||||
this.storageService.store(Workbench.centeredEditorLayoutActiveStorageKey, this.centeredEditorLayoutActive, StorageScope.GLOBAL);
|
||||
|
||||
if (!skipLayout) {
|
||||
|
||||
Reference in New Issue
Block a user