mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Initial VS Code 1.19 source merge (#571)
* Initial 1.19 xcopy * Fix yarn build * Fix numerous build breaks * Next batch of build break fixes * More build break fixes * Runtime breaks * Additional post merge fixes * Fix windows setup file * Fix test failures. * Update license header blocks to refer to source eula
This commit is contained in:
@@ -52,7 +52,7 @@ export abstract class BaseEditor extends Panel implements IEditor {
|
||||
this._input = input;
|
||||
this._options = options;
|
||||
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,7 +18,7 @@ import { BaseBinaryResourceEditor } from 'vs/workbench/browser/parts/editor/bina
|
||||
*/
|
||||
export class BinaryResourceDiffEditor extends SideBySideEditor {
|
||||
|
||||
public static ID = BINARY_DIFF_EDITOR_ID;
|
||||
public static readonly ID = BINARY_DIFF_EDITOR_ID;
|
||||
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
|
||||
@@ -68,7 +68,7 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor {
|
||||
// Return early for same input unless we force to open
|
||||
const forceOpen = options && options.forceOpen;
|
||||
if (!forceOpen && input.matches(this.input)) {
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
// Otherwise set input and resolve
|
||||
@@ -88,7 +88,7 @@ export abstract class BaseBinaryResourceEditor extends BaseEditor {
|
||||
// Render Input
|
||||
const model = <BinaryEditorModel>resolvedModel;
|
||||
ResourceViewer.show(
|
||||
{ name: model.getName(), resource: model.getResource(), size: model.getSize(), etag: model.getETag() },
|
||||
{ name: model.getName(), resource: model.getResource(), size: model.getSize(), etag: model.getETag(), mime: model.getMime() },
|
||||
this.binaryContainer,
|
||||
this.scrollbar,
|
||||
(resource: URI) => {
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
NavigateBetweenGroupsAction, FocusActiveGroupAction, FocusFirstGroupAction, FocusSecondGroupAction, FocusThirdGroupAction, EvenGroupWidthsAction, MaximizeGroupAction, MinimizeOtherGroupsAction, FocusPreviousGroup, FocusNextGroup, ShowEditorsInGroupOneAction,
|
||||
toEditorQuickOpenEntry, CloseLeftEditorsInGroupAction, CloseRightEditorsInGroupAction, CloseUnmodifiedEditorsInGroupAction, OpenNextEditor, OpenPreviousEditor, NavigateBackwardsAction, NavigateForwardAction, NavigateLastAction, ReopenClosedEditorAction, OpenPreviousRecentlyUsedEditorInGroupAction, NAVIGATE_IN_GROUP_ONE_PREFIX,
|
||||
OpenPreviousEditorFromHistoryAction, ShowAllEditorsAction, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, ClearEditorHistoryAction, ShowEditorsInGroupTwoAction, MoveEditorRightInGroupAction, OpenNextEditorInGroup, OpenPreviousEditorInGroup, OpenNextRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorAction,
|
||||
NAVIGATE_IN_GROUP_TWO_PREFIX, ShowEditorsInGroupThreeAction, NAVIGATE_IN_GROUP_THREE_PREFIX, FocusLastEditorInStackAction, OpenNextRecentlyUsedEditorInGroupAction, MoveEditorToPreviousGroupAction, MoveEditorToNextGroupAction, MoveEditorLeftInGroupAction, ClearRecentFilesAction
|
||||
NAVIGATE_IN_GROUP_TWO_PREFIX, ShowEditorsInGroupThreeAction, NAVIGATE_IN_GROUP_THREE_PREFIX, FocusLastEditorInStackAction, OpenNextRecentlyUsedEditorInGroupAction, MoveEditorToPreviousGroupAction, MoveEditorToNextGroupAction, MoveEditorLeftInGroupAction, ClearRecentFilesAction, OpenLastEditorInGroup
|
||||
} from 'vs/workbench/browser/parts/editor/editorActions';
|
||||
import * as editorCommands from 'vs/workbench/browser/parts/editor/editorCommands';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -332,6 +332,7 @@ Registry.as<IQuickOpenRegistry>(QuickOpenExtensions.Quickopen).registerQuickOpen
|
||||
const category = nls.localize('view', "View");
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextEditorInGroup, OpenNextEditorInGroup.ID, OpenNextEditorInGroup.LABEL), 'View: Open Next Editor in Group', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousEditorInGroup, OpenPreviousEditorInGroup.ID, OpenPreviousEditorInGroup.LABEL), 'View: Open Previous Editor in Group', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenLastEditorInGroup, OpenLastEditorInGroup.ID, OpenLastEditorInGroup.LABEL, { primary: KeyMod.CtrlCmd | KeyCode.KEY_9 }), 'View: Open Last Editor in Group', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenNextRecentlyUsedEditorAction, OpenNextRecentlyUsedEditorAction.ID, OpenNextRecentlyUsedEditorAction.LABEL), 'View: Open Next Recently Used Editor', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(OpenPreviousRecentlyUsedEditorAction, OpenPreviousRecentlyUsedEditorAction.ID, OpenPreviousRecentlyUsedEditorAction.LABEL), 'View: Open Previous Recently Used Editor', category);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ShowAllEditorsAction, ShowAllEditorsAction.ID, ShowAllEditorsAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.KEY_P), mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Tab } }), 'View: Show All Editors', category);
|
||||
|
||||
@@ -8,7 +8,7 @@ import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import nls = require('vs/nls');
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { EditorInput, TextEditorOptions, EditorOptions, IEditorIdentifier, IEditorContext, ActiveEditorMoveArguments, ActiveEditorMovePositioning, EditorCommands, ConfirmResult } from 'vs/workbench/common/editor';
|
||||
import { QuickOpenEntryGroup } from 'vs/base/parts/quickopen/browser/quickOpenModel';
|
||||
import { EditorQuickOpenEntry, EditorQuickOpenEntryGroup, IEditorQuickOpenEntry, QuickOpenAction } from 'vs/workbench/browser/quickopen';
|
||||
@@ -25,8 +25,8 @@ import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
|
||||
export class SplitEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.splitEditor';
|
||||
public static LABEL = nls.localize('splitEditor', "Split Editor");
|
||||
public static readonly ID = 'workbench.action.splitEditor';
|
||||
public static readonly LABEL = nls.localize('splitEditor', "Split Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -107,13 +107,12 @@ export class SplitEditorAction extends Action {
|
||||
|
||||
export class JoinTwoGroupsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.joinTwoGroups';
|
||||
public static LABEL = nls.localize('joinTwoGroups', "Join Editors of Two Groups");
|
||||
public static readonly ID = 'workbench.action.joinTwoGroups';
|
||||
public static readonly LABEL = nls.localize('joinTwoGroups', "Join Editors of Two Groups");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
|
||||
@IEditorGroupService private editorGroupService: IEditorGroupService
|
||||
) {
|
||||
super(id, label);
|
||||
@@ -172,8 +171,8 @@ export class JoinTwoGroupsAction extends Action {
|
||||
|
||||
export class NavigateBetweenGroupsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.navigateEditorGroups';
|
||||
public static LABEL = nls.localize('navigateEditorGroups', "Navigate Between Editor Groups");
|
||||
public static readonly ID = 'workbench.action.navigateEditorGroups';
|
||||
public static readonly LABEL = nls.localize('navigateEditorGroups', "Navigate Between Editor Groups");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -205,8 +204,8 @@ export class NavigateBetweenGroupsAction extends Action {
|
||||
|
||||
export class FocusActiveGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.focusActiveEditorGroup';
|
||||
public static LABEL = nls.localize('focusActiveEditorGroup', "Focus Active Editor Group");
|
||||
public static readonly ID = 'workbench.action.focusActiveEditorGroup';
|
||||
public static readonly LABEL = nls.localize('focusActiveEditorGroup', "Focus Active Editor Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -228,8 +227,8 @@ export class FocusActiveGroupAction extends Action {
|
||||
|
||||
export class FocusFirstGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.focusFirstEditorGroup';
|
||||
public static LABEL = nls.localize('focusFirstEditorGroup', "Focus First Editor Group");
|
||||
public static readonly ID = 'workbench.action.focusFirstEditorGroup';
|
||||
public static readonly LABEL = nls.localize('focusFirstEditorGroup', "Focus First Editor Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -324,11 +323,13 @@ export abstract class BaseFocusSideGroupAction extends Action {
|
||||
else if (referenceEditor) {
|
||||
const history = this.historyService.getHistory();
|
||||
for (let input of history) {
|
||||
if (input instanceof EditorInput && input.supportsSplitEditor()) {
|
||||
return this.editorService.openEditor(input, { pinned: true }, this.getTargetEditorSide());
|
||||
if (input instanceof EditorInput) {
|
||||
if (input.supportsSplitEditor()) {
|
||||
return this.editorService.openEditor(input, { pinned: true }, this.getTargetEditorSide());
|
||||
}
|
||||
} else {
|
||||
return this.editorService.openEditor({ resource: (input as IResourceInput).resource, options: { pinned: true } }, this.getTargetEditorSide());
|
||||
}
|
||||
|
||||
return this.editorService.openEditor({ resource: (input as IResourceInput).resource, options: { pinned: true } }, this.getTargetEditorSide());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,8 +339,8 @@ export abstract class BaseFocusSideGroupAction extends Action {
|
||||
|
||||
export class FocusSecondGroupAction extends BaseFocusSideGroupAction {
|
||||
|
||||
public static ID = 'workbench.action.focusSecondEditorGroup';
|
||||
public static LABEL = nls.localize('focusSecondEditorGroup', "Focus Second Editor Group");
|
||||
public static readonly ID = 'workbench.action.focusSecondEditorGroup';
|
||||
public static readonly LABEL = nls.localize('focusSecondEditorGroup', "Focus Second Editor Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -362,8 +363,8 @@ export class FocusSecondGroupAction extends BaseFocusSideGroupAction {
|
||||
|
||||
export class FocusThirdGroupAction extends BaseFocusSideGroupAction {
|
||||
|
||||
public static ID = 'workbench.action.focusThirdEditorGroup';
|
||||
public static LABEL = nls.localize('focusThirdEditorGroup', "Focus Third Editor Group");
|
||||
public static readonly ID = 'workbench.action.focusThirdEditorGroup';
|
||||
public static readonly LABEL = nls.localize('focusThirdEditorGroup', "Focus Third Editor Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -386,8 +387,8 @@ export class FocusThirdGroupAction extends BaseFocusSideGroupAction {
|
||||
|
||||
export class FocusPreviousGroup extends Action {
|
||||
|
||||
public static ID = 'workbench.action.focusPreviousGroup';
|
||||
public static LABEL = nls.localize('focusPreviousGroup', "Focus Previous Group");
|
||||
public static readonly ID = 'workbench.action.focusPreviousGroup';
|
||||
public static readonly LABEL = nls.localize('focusPreviousGroup', "Focus Previous Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -424,8 +425,8 @@ export class FocusPreviousGroup extends Action {
|
||||
|
||||
export class FocusNextGroup extends Action {
|
||||
|
||||
public static ID = 'workbench.action.focusNextGroup';
|
||||
public static LABEL = nls.localize('focusNextGroup', "Focus Next Group");
|
||||
public static readonly ID = 'workbench.action.focusNextGroup';
|
||||
public static readonly LABEL = nls.localize('focusNextGroup', "Focus Next Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -462,8 +463,8 @@ export class FocusNextGroup extends Action {
|
||||
|
||||
export class OpenToSideAction extends Action {
|
||||
|
||||
public static OPEN_TO_SIDE_ID = 'workbench.action.openToSide';
|
||||
public static OPEN_TO_SIDE_LABEL = nls.localize('openToSide', "Open to the Side");
|
||||
public static readonly OPEN_TO_SIDE_ID = 'workbench.action.openToSide';
|
||||
public static readonly OPEN_TO_SIDE_LABEL = nls.localize('openToSide', "Open to the Side");
|
||||
|
||||
constructor(
|
||||
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
|
||||
@@ -524,8 +525,8 @@ export function toEditorQuickOpenEntry(element: any): IEditorQuickOpenEntry {
|
||||
|
||||
export class CloseEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeActiveEditor';
|
||||
public static LABEL = nls.localize('closeEditor', "Close Editor");
|
||||
public static readonly ID = 'workbench.action.closeActiveEditor';
|
||||
public static readonly LABEL = nls.localize('closeEditor', "Close Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -567,8 +568,8 @@ export class CloseEditorAction extends Action {
|
||||
|
||||
export class RevertAndCloseEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.revertAndCloseActiveEditor';
|
||||
public static LABEL = nls.localize('revertAndCloseActiveEditor', "Revert and Close Editor");
|
||||
public static readonly ID = 'workbench.action.revertAndCloseActiveEditor';
|
||||
public static readonly LABEL = nls.localize('revertAndCloseActiveEditor', "Revert and Close Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -595,8 +596,8 @@ export class RevertAndCloseEditorAction extends Action {
|
||||
|
||||
export class CloseLeftEditorsInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeEditorsToTheLeft';
|
||||
public static LABEL = nls.localize('closeEditorsToTheLeft', "Close Editors to the Left");
|
||||
public static readonly ID = 'workbench.action.closeEditorsToTheLeft';
|
||||
public static readonly LABEL = nls.localize('closeEditorsToTheLeft', "Close Editors to the Left");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -619,8 +620,8 @@ export class CloseLeftEditorsInGroupAction extends Action {
|
||||
|
||||
export class CloseRightEditorsInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeEditorsToTheRight';
|
||||
public static LABEL = nls.localize('closeEditorsToTheRight', "Close Editors to the Right");
|
||||
public static readonly ID = 'workbench.action.closeEditorsToTheRight';
|
||||
public static readonly LABEL = nls.localize('closeEditorsToTheRight', "Close Editors to the Right");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -643,8 +644,8 @@ export class CloseRightEditorsInGroupAction extends Action {
|
||||
|
||||
export class CloseAllEditorsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeAllEditors';
|
||||
public static LABEL = nls.localize('closeAllEditors', "Close All Editors");
|
||||
public static readonly ID = 'workbench.action.closeAllEditors';
|
||||
public static readonly LABEL = nls.localize('closeAllEditors', "Close All Editors");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -687,8 +688,8 @@ export class CloseAllEditorsAction extends Action {
|
||||
|
||||
export class CloseUnmodifiedEditorsInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeUnmodifiedEditors';
|
||||
public static LABEL = nls.localize('closeUnmodifiedEditors', "Close Unmodified Editors in Group");
|
||||
public static readonly ID = 'workbench.action.closeUnmodifiedEditors';
|
||||
public static readonly LABEL = nls.localize('closeUnmodifiedEditors', "Close Unmodified Editors in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -720,8 +721,8 @@ export class CloseUnmodifiedEditorsInGroupAction extends Action {
|
||||
|
||||
export class CloseEditorsInOtherGroupsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeEditorsInOtherGroups';
|
||||
public static LABEL = nls.localize('closeEditorsInOtherGroups', "Close Editors in Other Groups");
|
||||
public static readonly ID = 'workbench.action.closeEditorsInOtherGroups';
|
||||
public static readonly LABEL = nls.localize('closeEditorsInOtherGroups', "Close Editors in Other Groups");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -751,8 +752,8 @@ export class CloseEditorsInOtherGroupsAction extends Action {
|
||||
|
||||
export class CloseOtherEditorsInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeOtherEditors';
|
||||
public static LABEL = nls.localize('closeOtherEditorsInGroup', "Close Other Editors");
|
||||
public static readonly ID = 'workbench.action.closeOtherEditors';
|
||||
public static readonly LABEL = nls.localize('closeOtherEditorsInGroup', "Close Other Editors");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -784,8 +785,8 @@ export class CloseOtherEditorsInGroupAction extends Action {
|
||||
|
||||
export class CloseEditorsInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.closeEditorsInGroup';
|
||||
public static LABEL = nls.localize('closeEditorsInGroup', "Close All Editors in Group");
|
||||
public static readonly ID = 'workbench.action.closeEditorsInGroup';
|
||||
public static readonly LABEL = nls.localize('closeEditorsInGroup', "Close All Editors in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -815,8 +816,8 @@ export class CloseEditorsInGroupAction extends Action {
|
||||
|
||||
export class MoveGroupLeftAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.moveActiveEditorGroupLeft';
|
||||
public static LABEL = nls.localize('moveActiveGroupLeft', "Move Editor Group Left");
|
||||
public static readonly ID = 'workbench.action.moveActiveEditorGroupLeft';
|
||||
public static readonly LABEL = nls.localize('moveActiveGroupLeft', "Move Editor Group Left");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -849,8 +850,8 @@ export class MoveGroupLeftAction extends Action {
|
||||
|
||||
export class MoveGroupRightAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.moveActiveEditorGroupRight';
|
||||
public static LABEL = nls.localize('moveActiveGroupRight', "Move Editor Group Right");
|
||||
public static readonly ID = 'workbench.action.moveActiveEditorGroupRight';
|
||||
public static readonly LABEL = nls.localize('moveActiveGroupRight', "Move Editor Group Right");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -885,8 +886,8 @@ export class MoveGroupRightAction extends Action {
|
||||
|
||||
export class MinimizeOtherGroupsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.minimizeOtherEditors';
|
||||
public static LABEL = nls.localize('minimizeOtherEditorGroups', "Minimize Other Editor Groups");
|
||||
public static readonly ID = 'workbench.action.minimizeOtherEditors';
|
||||
public static readonly LABEL = nls.localize('minimizeOtherEditorGroups', "Minimize Other Editor Groups");
|
||||
|
||||
constructor(id: string, label: string, @IEditorGroupService private editorGroupService: IEditorGroupService) {
|
||||
super(id, label);
|
||||
@@ -901,8 +902,8 @@ export class MinimizeOtherGroupsAction extends Action {
|
||||
|
||||
export class EvenGroupWidthsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.evenEditorWidths';
|
||||
public static LABEL = nls.localize('evenEditorGroups', "Even Editor Group Widths");
|
||||
public static readonly ID = 'workbench.action.evenEditorWidths';
|
||||
public static readonly LABEL = nls.localize('evenEditorGroups', "Even Editor Group Widths");
|
||||
|
||||
constructor(id: string, label: string, @IEditorGroupService private editorGroupService: IEditorGroupService) {
|
||||
super(id, label);
|
||||
@@ -917,8 +918,8 @@ export class EvenGroupWidthsAction extends Action {
|
||||
|
||||
export class MaximizeGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.maximizeEditor';
|
||||
public static LABEL = nls.localize('maximizeEditor', "Maximize Editor Group and Hide Sidebar");
|
||||
public static readonly ID = 'workbench.action.maximizeEditor';
|
||||
public static readonly LABEL = nls.localize('maximizeEditor', "Maximize Editor Group and Hide Sidebar");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -942,8 +943,8 @@ export class MaximizeGroupAction extends Action {
|
||||
|
||||
export class KeepEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.keepEditor';
|
||||
public static LABEL = nls.localize('keepEditor', "Keep Editor");
|
||||
public static readonly ID = 'workbench.action.keepEditor';
|
||||
public static readonly LABEL = nls.localize('keepEditor', "Keep Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1003,8 +1004,8 @@ export abstract class BaseNavigateEditorAction extends Action {
|
||||
|
||||
export class OpenNextEditor extends BaseNavigateEditorAction {
|
||||
|
||||
public static ID = 'workbench.action.nextEditor';
|
||||
public static LABEL = nls.localize('openNextEditor', "Open Next Editor");
|
||||
public static readonly ID = 'workbench.action.nextEditor';
|
||||
public static readonly LABEL = nls.localize('openNextEditor', "Open Next Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1022,8 +1023,8 @@ export class OpenNextEditor extends BaseNavigateEditorAction {
|
||||
|
||||
export class OpenPreviousEditor extends BaseNavigateEditorAction {
|
||||
|
||||
public static ID = 'workbench.action.previousEditor';
|
||||
public static LABEL = nls.localize('openPreviousEditor', "Open Previous Editor");
|
||||
public static readonly ID = 'workbench.action.previousEditor';
|
||||
public static readonly LABEL = nls.localize('openPreviousEditor', "Open Previous Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1041,8 +1042,8 @@ export class OpenPreviousEditor extends BaseNavigateEditorAction {
|
||||
|
||||
export class OpenNextEditorInGroup extends BaseNavigateEditorAction {
|
||||
|
||||
public static ID = 'workbench.action.nextEditorInGroup';
|
||||
public static LABEL = nls.localize('nextEditorInGroup', "Open Next Editor in Group");
|
||||
public static readonly ID = 'workbench.action.nextEditorInGroup';
|
||||
public static readonly LABEL = nls.localize('nextEditorInGroup', "Open Next Editor in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1060,8 +1061,8 @@ export class OpenNextEditorInGroup extends BaseNavigateEditorAction {
|
||||
|
||||
export class OpenPreviousEditorInGroup extends BaseNavigateEditorAction {
|
||||
|
||||
public static ID = 'workbench.action.previousEditorInGroup';
|
||||
public static LABEL = nls.localize('openPreviousEditorInGroup', "Open Previous Editor in Group");
|
||||
public static readonly ID = 'workbench.action.previousEditorInGroup';
|
||||
public static readonly LABEL = nls.localize('openPreviousEditorInGroup', "Open Previous Editor in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1077,10 +1078,29 @@ export class OpenPreviousEditorInGroup extends BaseNavigateEditorAction {
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenLastEditorInGroup extends BaseNavigateEditorAction {
|
||||
|
||||
public static readonly ID = 'workbench.action.lastEditorInGroup';
|
||||
public static readonly LABEL = nls.localize('lastEditorInGroup', "Open Last Editor in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IEditorGroupService editorGroupService: IEditorGroupService,
|
||||
@IWorkbenchEditorService editorService: IWorkbenchEditorService
|
||||
) {
|
||||
super(id, label, editorGroupService, editorService);
|
||||
}
|
||||
|
||||
protected navigate(): IEditorIdentifier {
|
||||
return this.editorGroupService.getStacksModel().last();
|
||||
}
|
||||
}
|
||||
|
||||
export class NavigateForwardAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.navigateForward';
|
||||
public static LABEL = nls.localize('navigateNext', "Go Forward");
|
||||
public static readonly ID = 'workbench.action.navigateForward';
|
||||
public static readonly LABEL = nls.localize('navigateNext', "Go Forward");
|
||||
|
||||
constructor(id: string, label: string, @IHistoryService private historyService: IHistoryService) {
|
||||
super(id, label);
|
||||
@@ -1095,8 +1115,8 @@ export class NavigateForwardAction extends Action {
|
||||
|
||||
export class NavigateBackwardsAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.navigateBack';
|
||||
public static LABEL = nls.localize('navigatePrevious', "Go Back");
|
||||
public static readonly ID = 'workbench.action.navigateBack';
|
||||
public static readonly LABEL = nls.localize('navigatePrevious', "Go Back");
|
||||
|
||||
constructor(id: string, label: string, @IHistoryService private historyService: IHistoryService) {
|
||||
super(id, label);
|
||||
@@ -1111,8 +1131,8 @@ export class NavigateBackwardsAction extends Action {
|
||||
|
||||
export class NavigateLastAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.navigateLast';
|
||||
public static LABEL = nls.localize('navigateLast', "Go Last");
|
||||
public static readonly ID = 'workbench.action.navigateLast';
|
||||
public static readonly LABEL = nls.localize('navigateLast', "Go Last");
|
||||
|
||||
constructor(id: string, label: string, @IHistoryService private historyService: IHistoryService) {
|
||||
super(id, label);
|
||||
@@ -1127,8 +1147,8 @@ export class NavigateLastAction extends Action {
|
||||
|
||||
export class ReopenClosedEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.reopenClosedEditor';
|
||||
public static LABEL = nls.localize('reopenClosedEditor', "Reopen Closed Editor");
|
||||
public static readonly ID = 'workbench.action.reopenClosedEditor';
|
||||
public static readonly LABEL = nls.localize('reopenClosedEditor', "Reopen Closed Editor");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1147,8 +1167,8 @@ export class ReopenClosedEditorAction extends Action {
|
||||
|
||||
export class ClearRecentFilesAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.clearRecentFiles';
|
||||
public static LABEL = nls.localize('clearRecentFiles', "Clear Recently Opened");
|
||||
public static readonly ID = 'workbench.action.clearRecentFiles';
|
||||
public static readonly LABEL = nls.localize('clearRecentFiles', "Clear Recently Opened");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1169,8 +1189,8 @@ export const NAVIGATE_IN_GROUP_ONE_PREFIX = 'edt one ';
|
||||
|
||||
export class ShowEditorsInGroupOneAction extends QuickOpenAction {
|
||||
|
||||
public static ID = 'workbench.action.showEditorsInFirstGroup';
|
||||
public static LABEL = nls.localize('showEditorsInFirstGroup', "Show Editors in First Group");
|
||||
public static readonly ID = 'workbench.action.showEditorsInFirstGroup';
|
||||
public static readonly LABEL = nls.localize('showEditorsInFirstGroup', "Show Editors in First Group");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -1187,8 +1207,8 @@ export const NAVIGATE_IN_GROUP_TWO_PREFIX = 'edt two ';
|
||||
|
||||
export class ShowEditorsInGroupTwoAction extends QuickOpenAction {
|
||||
|
||||
public static ID = 'workbench.action.showEditorsInSecondGroup';
|
||||
public static LABEL = nls.localize('showEditorsInSecondGroup', "Show Editors in Second Group");
|
||||
public static readonly ID = 'workbench.action.showEditorsInSecondGroup';
|
||||
public static readonly LABEL = nls.localize('showEditorsInSecondGroup', "Show Editors in Second Group");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -1205,8 +1225,8 @@ export const NAVIGATE_IN_GROUP_THREE_PREFIX = 'edt three ';
|
||||
|
||||
export class ShowEditorsInGroupThreeAction extends QuickOpenAction {
|
||||
|
||||
public static ID = 'workbench.action.showEditorsInThirdGroup';
|
||||
public static LABEL = nls.localize('showEditorsInThirdGroup', "Show Editors in Third Group");
|
||||
public static readonly ID = 'workbench.action.showEditorsInThirdGroup';
|
||||
public static readonly LABEL = nls.localize('showEditorsInThirdGroup', "Show Editors in Third Group");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -1221,8 +1241,8 @@ export class ShowEditorsInGroupThreeAction extends QuickOpenAction {
|
||||
|
||||
export class ShowEditorsInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.showEditorsInGroup';
|
||||
public static LABEL = nls.localize('showEditorsInGroup', "Show Editors in Group");
|
||||
public static readonly ID = 'workbench.action.showEditorsInGroup';
|
||||
public static readonly LABEL = nls.localize('showEditorsInGroup', "Show Editors in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1255,8 +1275,8 @@ export const NAVIGATE_ALL_EDITORS_GROUP_PREFIX = 'edt ';
|
||||
|
||||
export class ShowAllEditorsAction extends QuickOpenAction {
|
||||
|
||||
public static ID = 'workbench.action.showAllEditors';
|
||||
public static LABEL = nls.localize('showAllEditors', "Show All Editors");
|
||||
public static readonly ID = 'workbench.action.showAllEditors';
|
||||
public static readonly LABEL = nls.localize('showAllEditors', "Show All Editors");
|
||||
|
||||
constructor(actionId: string, actionLabel: string, @IQuickOpenService quickOpenService: IQuickOpenService) {
|
||||
super(actionId, actionLabel, NAVIGATE_ALL_EDITORS_GROUP_PREFIX, quickOpenService);
|
||||
@@ -1298,8 +1318,8 @@ export class BaseQuickOpenEditorInGroupAction extends Action {
|
||||
|
||||
export class OpenPreviousRecentlyUsedEditorInGroupAction extends BaseQuickOpenEditorInGroupAction {
|
||||
|
||||
public static ID = 'workbench.action.openPreviousRecentlyUsedEditorInGroup';
|
||||
public static LABEL = nls.localize('openPreviousRecentlyUsedEditorInGroup', "Open Previous Recently Used Editor in Group");
|
||||
public static readonly ID = 'workbench.action.openPreviousRecentlyUsedEditorInGroup';
|
||||
public static readonly LABEL = nls.localize('openPreviousRecentlyUsedEditorInGroup', "Open Previous Recently Used Editor in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1314,8 +1334,8 @@ export class OpenPreviousRecentlyUsedEditorInGroupAction extends BaseQuickOpenEd
|
||||
|
||||
export class OpenNextRecentlyUsedEditorInGroupAction extends BaseQuickOpenEditorInGroupAction {
|
||||
|
||||
public static ID = 'workbench.action.openNextRecentlyUsedEditorInGroup';
|
||||
public static LABEL = nls.localize('openNextRecentlyUsedEditorInGroup', "Open Next Recently Used Editor in Group");
|
||||
public static readonly ID = 'workbench.action.openNextRecentlyUsedEditorInGroup';
|
||||
public static readonly LABEL = nls.localize('openNextRecentlyUsedEditorInGroup', "Open Next Recently Used Editor in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1330,8 +1350,8 @@ export class OpenNextRecentlyUsedEditorInGroupAction extends BaseQuickOpenEditor
|
||||
|
||||
export class OpenPreviousEditorFromHistoryAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.openPreviousEditorFromHistory';
|
||||
public static LABEL = nls.localize('navigateEditorHistoryByInput', "Open Previous Editor from History");
|
||||
public static readonly ID = 'workbench.action.openPreviousEditorFromHistory';
|
||||
public static readonly LABEL = nls.localize('navigateEditorHistoryByInput', "Open Previous Editor from History");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1353,8 +1373,8 @@ export class OpenPreviousEditorFromHistoryAction extends Action {
|
||||
|
||||
export class OpenNextRecentlyUsedEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.openNextRecentlyUsedEditor';
|
||||
public static LABEL = nls.localize('openNextRecentlyUsedEditor', "Open Next Recently Used Editor");
|
||||
public static readonly ID = 'workbench.action.openNextRecentlyUsedEditor';
|
||||
public static readonly LABEL = nls.localize('openNextRecentlyUsedEditor', "Open Next Recently Used Editor");
|
||||
|
||||
constructor(id: string, label: string, @IHistoryService private historyService: IHistoryService) {
|
||||
super(id, label);
|
||||
@@ -1369,8 +1389,8 @@ export class OpenNextRecentlyUsedEditorAction extends Action {
|
||||
|
||||
export class OpenPreviousRecentlyUsedEditorAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.openPreviousRecentlyUsedEditor';
|
||||
public static LABEL = nls.localize('openPreviousRecentlyUsedEditor', "Open Previous Recently Used Editor");
|
||||
public static readonly ID = 'workbench.action.openPreviousRecentlyUsedEditor';
|
||||
public static readonly LABEL = nls.localize('openPreviousRecentlyUsedEditor', "Open Previous Recently Used Editor");
|
||||
|
||||
constructor(id: string, label: string, @IHistoryService private historyService: IHistoryService) {
|
||||
super(id, label);
|
||||
@@ -1385,8 +1405,8 @@ export class OpenPreviousRecentlyUsedEditorAction extends Action {
|
||||
|
||||
export class ClearEditorHistoryAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.clearEditorHistory';
|
||||
public static LABEL = nls.localize('clearEditorHistory', "Clear Editor History");
|
||||
public static readonly ID = 'workbench.action.clearEditorHistory';
|
||||
public static readonly LABEL = nls.localize('clearEditorHistory', "Clear Editor History");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1407,8 +1427,8 @@ export class ClearEditorHistoryAction extends Action {
|
||||
|
||||
export class FocusLastEditorInStackAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.openLastEditorInGroup';
|
||||
public static LABEL = nls.localize('focusLastEditorInStack', "Open Last Editor in Group");
|
||||
public static readonly ID = 'workbench.action.openLastEditorInGroup';
|
||||
public static readonly LABEL = nls.localize('focusLastEditorInStack', "Open Last Editor in Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1436,8 +1456,8 @@ export class FocusLastEditorInStackAction extends Action {
|
||||
|
||||
export class MoveEditorLeftInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.moveEditorLeftInGroup';
|
||||
public static LABEL = nls.localize('moveEditorLeft', "Move Editor Left");
|
||||
public static readonly ID = 'workbench.action.moveEditorLeftInGroup';
|
||||
public static readonly LABEL = nls.localize('moveEditorLeft', "Move Editor Left");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1459,8 +1479,8 @@ export class MoveEditorLeftInGroupAction extends Action {
|
||||
|
||||
export class MoveEditorRightInGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.moveEditorRightInGroup';
|
||||
public static LABEL = nls.localize('moveEditorRight', "Move Editor Right");
|
||||
public static readonly ID = 'workbench.action.moveEditorRightInGroup';
|
||||
public static readonly LABEL = nls.localize('moveEditorRight', "Move Editor Right");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1482,8 +1502,8 @@ export class MoveEditorRightInGroupAction extends Action {
|
||||
|
||||
export class MoveEditorToPreviousGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.moveEditorToPreviousGroup';
|
||||
public static LABEL = nls.localize('moveEditorToPreviousGroup', "Move Editor into Previous Group");
|
||||
public static readonly ID = 'workbench.action.moveEditorToPreviousGroup';
|
||||
public static readonly LABEL = nls.localize('moveEditorToPreviousGroup', "Move Editor into Previous Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -1506,8 +1526,8 @@ export class MoveEditorToPreviousGroupAction extends Action {
|
||||
|
||||
export class MoveEditorToNextGroupAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.moveEditorToNextGroup';
|
||||
public static LABEL = nls.localize('moveEditorToNextGroup', "Move Editor into Next Group");
|
||||
public static readonly ID = 'workbench.action.moveEditorToNextGroup';
|
||||
public static readonly LABEL = nls.localize('moveEditorToNextGroup', "Move Editor into Next Group");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
|
||||
@@ -60,11 +60,7 @@ function registerActiveEditorMoveCommand(): void {
|
||||
args: [
|
||||
{
|
||||
name: nls.localize('editorCommand.activeEditorMove.arg.name', "Active editor move argument"),
|
||||
description: nls.localize('editorCommand.activeEditorMove.arg.description', `Argument Properties:
|
||||
* 'to': String value providing where to move.
|
||||
* 'by': String value providing the unit for move. By tab or by group.
|
||||
* 'value': Number value providing how many positions or an absolute position to move.
|
||||
`),
|
||||
description: nls.localize('editorCommand.activeEditorMove.arg.description', "Argument Properties:\n\t* 'to': String value providing where to move.\n\t* 'by': String value providing the unit for move. By tab or by group.\n\t* 'value': Number value providing how many positions or an absolute position to move."),
|
||||
constraint: isActiveEditorMoveArg
|
||||
}
|
||||
]
|
||||
|
||||
@@ -21,7 +21,6 @@ import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { Position, POSITIONS } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorGroupService, IEditorTabOptions, GroupArrangement, GroupOrientation } from 'vs/workbench/services/group/common/groupService';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
@@ -30,9 +29,9 @@ import { TabsTitleControl } from 'vs/workbench/browser/parts/editor/tabsTitleCon
|
||||
import { TitleControl, ITitleAreaControl, handleWorkspaceExternalDrop } from 'vs/workbench/browser/parts/editor/titleControl';
|
||||
import { NoTabsTitleControl } from 'vs/workbench/browser/parts/editor/noTabsTitleControl';
|
||||
import { IEditorStacksModel, IStacksModelChangeEvent, IEditorGroup, EditorOptions, TextEditorOptions, IEditorIdentifier } from 'vs/workbench/common/editor';
|
||||
import { extractResources } from 'vs/base/browser/dnd';
|
||||
import { extractResources } from 'vs/workbench/browser/editor';
|
||||
import { IWindowService, IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { editorBackground, contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { Themable, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND, EDITOR_GROUP_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, EDITOR_GROUP_BACKGROUND, EDITOR_GROUP_HEADER_TABS_BORDER } from 'vs/workbench/common/theme';
|
||||
@@ -40,6 +39,7 @@ import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IMessageService } from 'vs/platform/message/common/message';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { IDisposable, combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
export enum Rochade {
|
||||
NONE,
|
||||
@@ -98,17 +98,17 @@ export interface IEditorGroupsControl {
|
||||
*/
|
||||
export class EditorGroupsControl extends Themable implements IEditorGroupsControl, IVerticalSashLayoutProvider, IHorizontalSashLayoutProvider {
|
||||
|
||||
private static TITLE_AREA_CONTROL_KEY = '__titleAreaControl';
|
||||
private static PROGRESS_BAR_CONTROL_KEY = '__progressBar';
|
||||
private static INSTANTIATION_SERVICE_KEY = '__instantiationService';
|
||||
private static readonly TITLE_AREA_CONTROL_KEY = '__titleAreaControl';
|
||||
private static readonly PROGRESS_BAR_CONTROL_KEY = '__progressBar';
|
||||
private static readonly INSTANTIATION_SERVICE_KEY = '__instantiationService';
|
||||
|
||||
private static MIN_EDITOR_WIDTH = 170;
|
||||
private static MIN_EDITOR_HEIGHT = 70;
|
||||
private static readonly MIN_EDITOR_WIDTH = 170;
|
||||
private static readonly MIN_EDITOR_HEIGHT = 70;
|
||||
|
||||
private static EDITOR_TITLE_HEIGHT = 35;
|
||||
private static readonly EDITOR_TITLE_HEIGHT = 35;
|
||||
|
||||
private static SNAP_TO_MINIMIZED_THRESHOLD_WIDTH = 50;
|
||||
private static SNAP_TO_MINIMIZED_THRESHOLD_HEIGHT = 20;
|
||||
private static readonly SNAP_TO_MINIMIZED_THRESHOLD_WIDTH = 50;
|
||||
private static readonly SNAP_TO_MINIMIZED_THRESHOLD_HEIGHT = 20;
|
||||
|
||||
private stacks: IEditorStacksModel;
|
||||
|
||||
@@ -136,7 +136,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
private lastActiveEditor: BaseEditor;
|
||||
private lastActivePosition: Position;
|
||||
|
||||
private visibleEditorFocusTrackers: DOM.IFocusTracker[];
|
||||
private visibleEditorFocusTrackerDisposable: IDisposable[];
|
||||
|
||||
private _onGroupFocusChanged: Emitter<void>;
|
||||
|
||||
@@ -148,7 +148,6 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
groupOrientation: GroupOrientation,
|
||||
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
|
||||
@IEditorGroupService private editorGroupService: IEditorGroupService,
|
||||
@ITelemetryService private telemetryService: ITelemetryService,
|
||||
@IContextKeyService private contextKeyService: IContextKeyService,
|
||||
@IExtensionService private extensionService: IExtensionService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@@ -171,7 +170,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
this.silosMinimized = [];
|
||||
|
||||
this.visibleEditors = [];
|
||||
this.visibleEditorFocusTrackers = [];
|
||||
this.visibleEditorFocusTrackerDisposable = [];
|
||||
|
||||
this._onGroupFocusChanged = new Emitter<void>();
|
||||
this.toUnbind.push(this._onGroupFocusChanged);
|
||||
@@ -225,11 +224,14 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
private registerListeners(): void {
|
||||
this.toUnbind.push(this.stacks.onModelChanged(e => this.onStacksChanged(e)));
|
||||
this.toUnbind.push(this.editorGroupService.onTabOptionsChanged(options => this.updateTabOptions(options, true)));
|
||||
this.extensionService.onReady().then(() => this.onExtensionsReady());
|
||||
this.toUnbind.push(this.extensionService.onDidRegisterExtensions(() => this.onDidRegisterExtensions()));
|
||||
}
|
||||
|
||||
private updateTabOptions(tabOptions: IEditorTabOptions, refresh?: boolean): void {
|
||||
const tabCloseButton = this.tabOptions ? this.tabOptions.tabCloseButton : 'right';
|
||||
const tabSizing = this.tabOptions ? this.tabOptions.tabSizing : 'fit';
|
||||
const iconTheme = this.tabOptions ? this.tabOptions.iconTheme : 'vs-seti';
|
||||
|
||||
this.tabOptions = tabOptions;
|
||||
|
||||
if (!refresh) {
|
||||
@@ -266,8 +268,13 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
this.createTitleControl(this.stacks.groupAt(position), this.silos[position], titleContainer, this.getInstantiationService(position));
|
||||
}
|
||||
|
||||
// Refresh title when icons change
|
||||
else if (showingIcons !== this.tabOptions.showIcons || tabCloseButton !== this.tabOptions.tabCloseButton) {
|
||||
// Refresh title when layout options change
|
||||
else if (
|
||||
showingIcons !== this.tabOptions.showIcons ||
|
||||
tabCloseButton !== this.tabOptions.tabCloseButton ||
|
||||
tabSizing !== this.tabOptions.tabSizing ||
|
||||
iconTheme !== this.tabOptions.iconTheme
|
||||
) {
|
||||
titleControl.refresh();
|
||||
}
|
||||
}
|
||||
@@ -277,7 +284,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
});
|
||||
}
|
||||
|
||||
private onExtensionsReady(): void {
|
||||
private onDidRegisterExtensions(): void {
|
||||
|
||||
// Up to date title areas
|
||||
POSITIONS.forEach(position => this.getTitleAreaControl(position).update());
|
||||
@@ -420,15 +427,17 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
private trackFocus(editor: BaseEditor, position: Position): void {
|
||||
|
||||
// In case there is a previous tracker on the position, dispose it first
|
||||
if (this.visibleEditorFocusTrackers[position]) {
|
||||
this.visibleEditorFocusTrackers[position].dispose();
|
||||
if (this.visibleEditorFocusTrackerDisposable[position]) {
|
||||
this.visibleEditorFocusTrackerDisposable[position].dispose();
|
||||
}
|
||||
|
||||
// Track focus on editor container
|
||||
this.visibleEditorFocusTrackers[position] = DOM.trackFocus(editor.getContainer().getHTMLElement());
|
||||
this.visibleEditorFocusTrackers[position].addFocusListener(() => {
|
||||
const focusTracker = DOM.trackFocus(editor.getContainer().getHTMLElement());
|
||||
const listenerDispose = focusTracker.onDidFocus(() => {
|
||||
this.onFocusGained(editor);
|
||||
});
|
||||
|
||||
this.visibleEditorFocusTrackerDisposable[position] = combinedDisposable([focusTracker, listenerDispose]);
|
||||
}
|
||||
|
||||
private onFocusGained(editor: BaseEditor): void {
|
||||
@@ -443,15 +452,6 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
|
||||
// Automatically maximize this position if it is minimized
|
||||
if (this.isSiloMinimized(this.lastActivePosition)) {
|
||||
|
||||
// Log this fact in telemetry
|
||||
if (this.telemetryService) {
|
||||
/* __GDPR__
|
||||
"workbenchEditorMaximized" : {}
|
||||
*/
|
||||
this.telemetryService.publicLog('workbenchEditorMaximized');
|
||||
}
|
||||
|
||||
let remainingSize = this.totalSize;
|
||||
let layout = false;
|
||||
|
||||
@@ -629,9 +629,9 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
private clearPosition(position: Position): void {
|
||||
|
||||
// Unregister Listeners
|
||||
if (this.visibleEditorFocusTrackers[position]) {
|
||||
this.visibleEditorFocusTrackers[position].dispose();
|
||||
this.visibleEditorFocusTrackers[position] = null;
|
||||
if (this.visibleEditorFocusTrackerDisposable[position]) {
|
||||
this.visibleEditorFocusTrackerDisposable[position].dispose();
|
||||
this.visibleEditorFocusTrackerDisposable[position] = null;
|
||||
}
|
||||
|
||||
// Clear from active editors
|
||||
@@ -652,9 +652,9 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
editor.changePosition(to);
|
||||
|
||||
// Change data structures
|
||||
const listeners = this.visibleEditorFocusTrackers[from];
|
||||
this.visibleEditorFocusTrackers[to] = listeners;
|
||||
this.visibleEditorFocusTrackers[from] = null;
|
||||
const listeners = this.visibleEditorFocusTrackerDisposable[from];
|
||||
this.visibleEditorFocusTrackerDisposable[to] = listeners;
|
||||
this.visibleEditorFocusTrackerDisposable[from] = null;
|
||||
|
||||
const minimizedState = this.silosMinimized[from];
|
||||
this.silosMinimized[to] = minimizedState;
|
||||
@@ -738,7 +738,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
|
||||
// Change data structures
|
||||
arrays.move(this.visibleEditors, from, to);
|
||||
arrays.move(this.visibleEditorFocusTrackers, from, to);
|
||||
arrays.move(this.visibleEditorFocusTrackerDisposable, from, to);
|
||||
arrays.move(this.silosSize, from, to);
|
||||
arrays.move(this.silosMinimized, from, to);
|
||||
|
||||
@@ -957,10 +957,10 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
|
||||
// Sash One
|
||||
this.sashOne = new Sash(this.parent.getHTMLElement(), this, { baseSize: 5, orientation: this.layoutVertically ? Orientation.VERTICAL : Orientation.HORIZONTAL });
|
||||
this.toUnbind.push(this.sashOne.addListener('start', () => this.onSashOneDragStart()));
|
||||
this.toUnbind.push(this.sashOne.addListener('change', (e: ISashEvent) => this.onSashOneDrag(e)));
|
||||
this.toUnbind.push(this.sashOne.addListener('end', () => this.onSashOneDragEnd()));
|
||||
this.toUnbind.push(this.sashOne.addListener('reset', () => this.onSashOneReset()));
|
||||
this.toUnbind.push(this.sashOne.onDidStart(() => this.onSashOneDragStart()));
|
||||
this.toUnbind.push(this.sashOne.onDidChange((e: ISashEvent) => this.onSashOneDrag(e)));
|
||||
this.toUnbind.push(this.sashOne.onDidEnd(() => this.onSashOneDragEnd()));
|
||||
this.toUnbind.push(this.sashOne.onDidReset(() => this.onSashOneReset()));
|
||||
this.sashOne.hide();
|
||||
|
||||
// Silo Two
|
||||
@@ -968,10 +968,10 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
|
||||
// Sash Two
|
||||
this.sashTwo = new Sash(this.parent.getHTMLElement(), this, { baseSize: 5, orientation: this.layoutVertically ? Orientation.VERTICAL : Orientation.HORIZONTAL });
|
||||
this.toUnbind.push(this.sashTwo.addListener('start', () => this.onSashTwoDragStart()));
|
||||
this.toUnbind.push(this.sashTwo.addListener('change', (e: ISashEvent) => this.onSashTwoDrag(e)));
|
||||
this.toUnbind.push(this.sashTwo.addListener('end', () => this.onSashTwoDragEnd()));
|
||||
this.toUnbind.push(this.sashTwo.addListener('reset', () => this.onSashTwoReset()));
|
||||
this.toUnbind.push(this.sashTwo.onDidStart(() => this.onSashTwoDragStart()));
|
||||
this.toUnbind.push(this.sashTwo.onDidChange((e: ISashEvent) => this.onSashTwoDrag(e)));
|
||||
this.toUnbind.push(this.sashTwo.onDidEnd(() => this.onSashTwoDragEnd()));
|
||||
this.toUnbind.push(this.sashTwo.onDidReset(() => this.onSashTwoReset()));
|
||||
this.sashTwo.hide();
|
||||
|
||||
// Silo Three
|
||||
@@ -2040,7 +2040,9 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
|
||||
|
||||
// Layout title controls
|
||||
POSITIONS.forEach(position => {
|
||||
this.getTitleAreaControl(position).layout();
|
||||
const siloWidth = this.layoutVertically ? this.silosSize[position] : this.dimension.width;
|
||||
|
||||
this.getTitleAreaControl(position).layout(new Dimension(siloWidth, EditorGroupsControl.EDITOR_TITLE_HEIGHT));
|
||||
});
|
||||
|
||||
// Update minimized state
|
||||
|
||||
@@ -16,7 +16,7 @@ import arrays = require('vs/base/common/arrays');
|
||||
import types = require('vs/base/common/types');
|
||||
import errors = require('vs/base/common/errors');
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
import { Scope as MementoScope } from 'vs/workbench/common/memento';
|
||||
import { Part } from 'vs/workbench/browser/part';
|
||||
@@ -41,16 +41,16 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { EDITOR_GROUP_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { createCSSRule } from 'vs/base/browser/dom';
|
||||
import { createCSSRule, scheduleAtNextAnimationFrame } from 'vs/base/browser/dom';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
import { join } from 'vs/base/common/paths';
|
||||
import { isCommonCodeEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorDescriptor, IEditorRegistry, Extensions as EditorExtensions } from 'vs/workbench/browser/editor';
|
||||
import { ThrottledEmitter } from 'vs/base/common/async';
|
||||
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
import { convertEditorInput } from 'sql/parts/common/customInputConverter';
|
||||
|
||||
|
||||
class ProgressMonitor {
|
||||
|
||||
constructor(private _token: number, private progressPromise: TPromise<void>) { }
|
||||
@@ -84,14 +84,14 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
public _serviceBrand: any;
|
||||
|
||||
private static GROUP_LEFT = nls.localize('groupOneVertical', "Left");
|
||||
private static GROUP_CENTER = nls.localize('groupTwoVertical', "Center");
|
||||
private static GROUP_RIGHT = nls.localize('groupThreeVertical', "Right");
|
||||
private static GROUP_TOP = nls.localize('groupOneHorizontal', "Top");
|
||||
private static GROUP_MIDDLE = nls.localize('groupTwoHorizontal', "Center");
|
||||
private static GROUP_BOTTOM = nls.localize('groupThreeHorizontal', "Bottom");
|
||||
private static readonly GROUP_LEFT = nls.localize('groupOneVertical', "Left");
|
||||
private static readonly GROUP_CENTER = nls.localize('groupTwoVertical', "Center");
|
||||
private static readonly GROUP_RIGHT = nls.localize('groupThreeVertical', "Right");
|
||||
private static readonly GROUP_TOP = nls.localize('groupOneHorizontal', "Top");
|
||||
private static readonly GROUP_MIDDLE = nls.localize('groupTwoHorizontal', "Center");
|
||||
private static readonly GROUP_BOTTOM = nls.localize('groupThreeHorizontal', "Bottom");
|
||||
|
||||
private static EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.uiState';
|
||||
private static readonly EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.uiState';
|
||||
|
||||
private dimension: Dimension;
|
||||
private editorGroupsControl: IEditorGroupsControl;
|
||||
@@ -102,7 +102,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
private doNotFireTabOptionsChanged: boolean;
|
||||
private revealIfOpen: boolean;
|
||||
|
||||
private _onEditorsChanged: Emitter<void>;
|
||||
private _onEditorsChanged: ThrottledEmitter<void>;
|
||||
private _onEditorOpening: Emitter<IEditorOpeningEvent>;
|
||||
private _onEditorGroupMoved: Emitter<void>;
|
||||
private _onEditorOpenFail: Emitter<EditorInput>;
|
||||
@@ -136,7 +136,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
) {
|
||||
super(id, { hasTitle: false }, themeService);
|
||||
|
||||
this._onEditorsChanged = new Emitter<void>();
|
||||
this._onEditorsChanged = new ThrottledEmitter<void>();
|
||||
this._onEditorOpening = new Emitter<IEditorOpeningEvent>();
|
||||
this._onEditorGroupMoved = new Emitter<void>();
|
||||
this._onEditorOpenFail = new Emitter<EditorInput>();
|
||||
@@ -156,7 +156,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
this.textCompareEditorVisible = TextCompareEditorVisible.bindTo(contextKeyService);
|
||||
|
||||
const config = configurationService.getConfiguration<IWorkbenchEditorConfiguration>();
|
||||
const config = configurationService.getValue<IWorkbenchEditorConfiguration>();
|
||||
if (config && config.workbench && config.workbench.editor) {
|
||||
const editorConfig = config.workbench.editor;
|
||||
|
||||
@@ -165,26 +165,21 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
showIcons: editorConfig.showIcons,
|
||||
showTabs: editorConfig.showTabs,
|
||||
tabCloseButton: editorConfig.tabCloseButton,
|
||||
tabSizing: editorConfig.tabSizing,
|
||||
labelFormat: editorConfig.labelFormat,
|
||||
iconTheme: config.workbench.iconTheme
|
||||
};
|
||||
|
||||
this.revealIfOpen = editorConfig.revealIfOpen;
|
||||
|
||||
/* __GDPR__
|
||||
"workbenchEditorConfiguration" : {
|
||||
"${include}": [
|
||||
"${IWorkbenchEditorConfiguration}"
|
||||
]
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('workbenchEditorConfiguration', editorConfig);
|
||||
} else {
|
||||
this.tabOptions = {
|
||||
previewEditors: true,
|
||||
showIcons: false,
|
||||
showTabs: true,
|
||||
tabCloseButton: 'right',
|
||||
tabSizing: 'fit',
|
||||
labelFormat: 'default',
|
||||
iconTheme: 'vs-seti'
|
||||
};
|
||||
|
||||
this.revealIfOpen = false;
|
||||
@@ -218,8 +213,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
}
|
||||
|
||||
private onConfigurationUpdated(event: IConfigurationChangeEvent): void {
|
||||
if (event.affectsConfiguration('workbench.editor')) {
|
||||
const configuration = this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>();
|
||||
if (event.affectsConfiguration('workbench.editor') || event.affectsConfiguration('workbench.iconTheme')) {
|
||||
const configuration = this.configurationService.getValue<IWorkbenchEditorConfiguration>();
|
||||
if (configuration && configuration.workbench && configuration.workbench.editor) {
|
||||
const editorConfig = configuration.workbench.editor;
|
||||
|
||||
@@ -233,13 +228,15 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
});
|
||||
}
|
||||
|
||||
const oldTabOptions = objects.clone(this.tabOptions);
|
||||
const oldTabOptions = objects.deepClone(this.tabOptions);
|
||||
this.tabOptions = {
|
||||
previewEditors: newPreviewEditors,
|
||||
showIcons: editorConfig.showIcons,
|
||||
tabCloseButton: editorConfig.tabCloseButton,
|
||||
tabSizing: editorConfig.tabSizing,
|
||||
showTabs: this.forceHideTabs ? false : editorConfig.showTabs,
|
||||
labelFormat: editorConfig.labelFormat,
|
||||
iconTheme: configuration.workbench.iconTheme
|
||||
};
|
||||
|
||||
if (!this.doNotFireTabOptionsChanged && !objects.equals(oldTabOptions, this.tabOptions)) {
|
||||
@@ -286,7 +283,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
public hideTabs(forceHide: boolean): void {
|
||||
this.forceHideTabs = forceHide;
|
||||
const config = this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>();
|
||||
const config = this.configurationService.getValue<IWorkbenchEditorConfiguration>();
|
||||
this.tabOptions.showTabs = forceHide ? false : config && config.workbench && config.workbench.editor && config.workbench.editor.showTabs;
|
||||
this._onTabOptionsChanged.fire(this.tabOptions);
|
||||
}
|
||||
@@ -340,7 +337,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
!this.editorGroupsControl || // too early
|
||||
this.editorGroupsControl.isDragging() // pending editor DND
|
||||
) {
|
||||
return TPromise.as<BaseEditor>(null);
|
||||
return TPromise.wrap<BaseEditor>(null);
|
||||
}
|
||||
|
||||
// Editor opening event (can be prevented and overridden)
|
||||
@@ -367,16 +364,6 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
return TPromise.wrapError<BaseEditor>(new Error(strings.format('Can not find a registered editor for the input {0}', input)));
|
||||
}
|
||||
|
||||
// Opened to the side
|
||||
if (position !== Position.ONE) {
|
||||
/* __GDPR__
|
||||
"workbenchSideEditorOpened" : {
|
||||
"position" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
|
||||
}
|
||||
*/
|
||||
this.telemetryService.publicLog('workbenchSideEditorOpened', { position: position });
|
||||
}
|
||||
|
||||
// Update stacks: We do this early on before the UI is there because we want our stacks model to have
|
||||
// a consistent view of the editor world and updating it later async after the UI is there will cause
|
||||
// issues (e.g. when a closeEditor call is made that expects the openEditor call to have updated the
|
||||
@@ -392,7 +379,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
// Return early if the editor is to be open inactive and there are other editors in this group to show
|
||||
if (!active) {
|
||||
return TPromise.as<BaseEditor>(null);
|
||||
return TPromise.wrap<BaseEditor>(null);
|
||||
}
|
||||
|
||||
// Progress Monitor & Ref Counting
|
||||
@@ -409,7 +396,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
// Show editor
|
||||
const editor = this.doShowEditor(group, descriptor, input, options, ratio, monitor);
|
||||
if (!editor) {
|
||||
return TPromise.as<BaseEditor>(null); // canceled or other error
|
||||
return TPromise.wrap<BaseEditor>(null); // canceled or other error
|
||||
}
|
||||
|
||||
// Set input to editor
|
||||
@@ -583,14 +570,14 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
// Recover by closing the active editor (if the input is still the active one)
|
||||
if (group.activeEditor === input) {
|
||||
this.doCloseActiveEditor(group);
|
||||
this.doCloseActiveEditor(group, !(options && options.preserveFocus) /* still preserve focus as needed */);
|
||||
}
|
||||
}
|
||||
|
||||
public closeEditor(position: Position, input: EditorInput): TPromise<void> {
|
||||
const group = this.stacks.groupAt(position);
|
||||
if (!group) {
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
// Check for dirty and veto
|
||||
@@ -713,9 +700,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
}
|
||||
|
||||
// Check for dirty and veto
|
||||
const editorsToClose = arrays.flatten(groups.map(group => group.getEditors().map(editor => { return { group, editor }; })));
|
||||
|
||||
return this.handleDirty(editorsToClose).then(veto => {
|
||||
return this.handleDirty(arrays.flatten(groups.map(group => group.getEditors(true /* in MRU order */).map(editor => { return { group, editor }; })))).then(veto => {
|
||||
if (veto) {
|
||||
return;
|
||||
}
|
||||
@@ -727,22 +712,27 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
public closeEditors(position: Position, filter: { except?: EditorInput, direction?: Direction, unmodifiedOnly?: boolean } = Object.create(null)): TPromise<void> {
|
||||
const group = this.stacks.groupAt(position);
|
||||
if (!group) {
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
let editors = group.getEditors();
|
||||
let editorsToClose = group.getEditors(true /* in MRU order */);
|
||||
|
||||
// Filter: unmodified only
|
||||
if (filter.unmodifiedOnly) {
|
||||
editors = editors.filter(e => !e.isDirty());
|
||||
editorsToClose = editorsToClose.filter(e => !e.isDirty());
|
||||
}
|
||||
|
||||
// Filter: direction (left / right)
|
||||
if (!types.isUndefinedOrNull(filter.direction)) {
|
||||
editorsToClose = (filter.direction === Direction.LEFT) ? editorsToClose.slice(0, group.indexOf(filter.except)) : editorsToClose.slice(group.indexOf(filter.except) + 1);
|
||||
}
|
||||
|
||||
// Filter: except
|
||||
else {
|
||||
editorsToClose = editorsToClose.filter(e => !filter.except || !e.matches(filter.except));
|
||||
}
|
||||
|
||||
// Check for dirty and veto
|
||||
let editorsToClose: EditorInput[];
|
||||
if (types.isUndefinedOrNull(filter.direction)) {
|
||||
editorsToClose = editors.filter(e => !filter.except || !e.matches(filter.except));
|
||||
} else {
|
||||
editorsToClose = (filter.direction === Direction.LEFT) ? editors.slice(0, group.indexOf(filter.except)) : editors.slice(group.indexOf(filter.except) + 1);
|
||||
}
|
||||
|
||||
return this.handleDirty(editorsToClose.map(editor => { return { group, editor }; }), true /* ignore if opened in other group */).then(veto => {
|
||||
if (veto) {
|
||||
return;
|
||||
@@ -838,17 +828,43 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
const { editor } = identifier;
|
||||
|
||||
const res = editor.confirmSave();
|
||||
switch (res) {
|
||||
case ConfirmResult.SAVE:
|
||||
return editor.save().then(ok => !ok);
|
||||
// Switch to editor that we want to handle
|
||||
return this.openEditor(identifier.editor, null, this.stacks.positionOfGroup(identifier.group)).then(() => {
|
||||
return this.ensureEditorOpenedBeforePrompt().then(() => {
|
||||
const res = editor.confirmSave();
|
||||
switch (res) {
|
||||
case ConfirmResult.SAVE:
|
||||
return editor.save().then(ok => !ok);
|
||||
|
||||
case ConfirmResult.DONT_SAVE:
|
||||
return editor.revert().then(ok => !ok);
|
||||
case ConfirmResult.DONT_SAVE:
|
||||
return editor.revert().then(ok => !ok);
|
||||
|
||||
case ConfirmResult.CANCEL:
|
||||
return TPromise.as(true); // veto
|
||||
}
|
||||
case ConfirmResult.CANCEL:
|
||||
return true; // veto
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private ensureEditorOpenedBeforePrompt(): TPromise<void> {
|
||||
|
||||
// Force title area update
|
||||
this.editorGroupsControl.updateTitleAreas(true /* refresh active group */);
|
||||
|
||||
// TODO@Ben our dialogs currently use the sync API, which means they block the JS
|
||||
// thread when showing. As such, any UI update will not happen unless we wait a little
|
||||
// bit. We wait for 2 request animation frames before showing the confirm. The first
|
||||
// frame is where the UI is updating and the second is good enough to bring up the dialog.
|
||||
// See also https://github.com/Microsoft/vscode/issues/39536
|
||||
return new TPromise<void>(c => {
|
||||
scheduleAtNextAnimationFrame(() => {
|
||||
// Here the UI is updating
|
||||
scheduleAtNextAnimationFrame(() => {
|
||||
// Here we can show a blocking dialog
|
||||
c(void 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private countEditors(editor: EditorInput): number {
|
||||
@@ -1146,7 +1162,8 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
|
||||
const editorState: IEditorPartUIState = this.memento[EditorPart.EDITOR_PART_UI_STATE_STORAGE_KEY];
|
||||
|
||||
return this.doOpenEditors(editors, activePosition, editorState && editorState.ratio);
|
||||
// Open editors (throttle editor change events)
|
||||
return this._onEditorsChanged.throttle(this.doOpenEditors(editors, activePosition, editorState && editorState.ratio));
|
||||
}
|
||||
|
||||
private doOpenEditors(editors: { input: EditorInput, position: Position, options?: EditorOptions }[], activePosition?: number, ratio?: number[]): TPromise<IEditor[]> {
|
||||
@@ -1294,48 +1311,11 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
}
|
||||
}
|
||||
|
||||
public unpinEditor(group: EditorGroup, input: EditorInput): void;
|
||||
public unpinEditor(position: Position, input: EditorInput): void;
|
||||
public unpinEditor(arg1: any, input: EditorInput): void {
|
||||
if (input.isDirty()) {
|
||||
return; // we do not allow to unpin dirty editors
|
||||
}
|
||||
|
||||
const group = (typeof arg1 === 'number') ? this.stacks.groupAt(arg1) : arg1;
|
||||
if (group) {
|
||||
if (group.isPreview(input)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Unpinning an editor closes the preview editor if we have any
|
||||
let handlePreviewEditor: TPromise<boolean> = TPromise.as(false);
|
||||
if (group.previewEditor) {
|
||||
handlePreviewEditor = this.handleDirty([{ group, editor: group.previewEditor }], true /* ignore if opened in other group */);
|
||||
}
|
||||
|
||||
handlePreviewEditor.done(veto => {
|
||||
if (veto) {
|
||||
return;
|
||||
}
|
||||
|
||||
// The active editor is the preview editor and we are asked to make
|
||||
// another editor the preview editor. So we need to take care of closing
|
||||
// the active editor first
|
||||
if (group.isPreview(group.activeEditor) && !group.activeEditor.matches(input)) {
|
||||
this.doCloseActiveEditor(group);
|
||||
}
|
||||
|
||||
// Update stacks model
|
||||
group.unpin(input);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public invokeWithinEditorContext<T>(fn: (accessor: ServicesAccessor) => T): T {
|
||||
const activeEditor = this.getActiveEditor();
|
||||
if (activeEditor) {
|
||||
const activeEditorControl = activeEditor.getControl();
|
||||
if (isCommonCodeEditor(activeEditorControl)) {
|
||||
if (isCodeEditor(activeEditorControl)) {
|
||||
return activeEditorControl.invokeWithinContext(fn);
|
||||
}
|
||||
|
||||
@@ -1622,4 +1602,4 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
|
||||
private hasGroup(position: Position): boolean {
|
||||
return !!this.stacks.groupAt(position);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import { Position } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { EditorInput, toResource, IEditorGroup, IEditorStacksModel } from 'vs/workbench/common/editor';
|
||||
import { compareItemsByScore, scoreItem, ScorerCache, prepareQuery } from 'vs/base/parts/quickopen/common/quickOpenScorer';
|
||||
|
||||
@@ -91,7 +90,6 @@ export abstract class BaseEditorPicker extends QuickOpenHandler {
|
||||
|
||||
constructor(
|
||||
@IInstantiationService protected instantiationService: IInstantiationService,
|
||||
@IWorkspaceContextService private contextService: IWorkspaceContextService,
|
||||
@IWorkbenchEditorService protected editorService: IWorkbenchEditorService,
|
||||
@IEditorGroupService protected editorGroupService: IEditorGroupService
|
||||
) {
|
||||
|
||||
@@ -23,17 +23,17 @@ import { UntitledEditorInput } from 'vs/workbench/common/editor/untitledEditorIn
|
||||
import { IFileEditorInput, EncodingMode, IEncodingSupport, toResource, SideBySideEditorInput } from 'vs/workbench/common/editor';
|
||||
import { IDisposable, combinedDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IUntitledEditorService } from 'vs/workbench/services/untitled/common/untitledEditorService';
|
||||
import { IEditorAction, ICommonCodeEditor, EndOfLineSequence, IModel } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorAction, EndOfLineSequence, IModel } from 'vs/editor/common/editorCommon';
|
||||
import { IModelLanguageChangedEvent, IModelOptionsChangedEvent } from 'vs/editor/common/model/textModelEvents';
|
||||
import { TrimTrailingWhitespaceAction } from 'vs/editor/contrib/linesOperations/common/linesOperations';
|
||||
import { IndentUsingSpaces, IndentUsingTabs, DetectIndentation, IndentationToSpacesAction, IndentationToTabsAction } from 'vs/editor/contrib/indentation/common/indentation';
|
||||
import { TrimTrailingWhitespaceAction } from 'vs/editor/contrib/linesOperations/linesOperations';
|
||||
import { IndentUsingSpaces, IndentUsingTabs, DetectIndentation, IndentationToSpacesAction, IndentationToTabsAction } from 'vs/editor/contrib/indentation/indentation';
|
||||
import { BaseBinaryResourceEditor } from 'vs/workbench/browser/parts/editor/binaryEditor';
|
||||
import { BinaryResourceDiffEditor } from 'vs/workbench/browser/parts/editor/binaryDiffEditor';
|
||||
import { IEditor as IBaseEditor, IEditorInput } from 'vs/platform/editor/common/editor';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IQuickOpenService, IPickOpenEntry, IFilePickOpenEntry } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { SUPPORTED_ENCODINGS, IFileService, IFilesConfiguration, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files';
|
||||
import { SUPPORTED_ENCODINGS, IFileService, FILES_ASSOCIATIONS_CONFIG } from 'vs/platform/files/common/files';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
@@ -43,7 +43,7 @@ import { TabFocus } from 'vs/editor/common/config/commonEditorConfig';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IExtensionGalleryService } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { getCodeEditor as getEditorWidget, getCodeOrDiffEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { getCodeEditor as getEditorWidget, getCodeOrDiffEditor } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { IConfigurationChangedEvent, IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
@@ -55,12 +55,13 @@ import { widgetShadow, editorWidgetBackground } from 'vs/platform/theme/common/c
|
||||
// TODO@Sandeep layer breaker
|
||||
// tslint:disable-next-line:import-patterns
|
||||
import { IPreferencesService } from 'vs/workbench/parts/preferences/common/preferences';
|
||||
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration'
|
||||
import { ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { deepClone } from 'vs/base/common/objects';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
import { QueryEditorService } from 'sql/parts/query/services/queryEditorService';
|
||||
|
||||
|
||||
function toEditorWithEncodingSupport(input: IEditorInput): IEncodingSupport {
|
||||
if (input instanceof SideBySideEditorInput) {
|
||||
input = input.master;
|
||||
@@ -580,7 +581,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
}
|
||||
}
|
||||
|
||||
private onModeChange(editorWidget: ICommonCodeEditor): void {
|
||||
private onModeChange(editorWidget: ICodeEditor): void {
|
||||
let info: StateDelta = { mode: null };
|
||||
|
||||
// We only support text based editors
|
||||
@@ -596,7 +597,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
this.updateState(info);
|
||||
}
|
||||
|
||||
private onIndentationChange(editorWidget: ICommonCodeEditor): void {
|
||||
private onIndentationChange(editorWidget: ICodeEditor): void {
|
||||
const update: StateDelta = { indentation: null };
|
||||
|
||||
if (editorWidget) {
|
||||
@@ -626,14 +627,14 @@ export class EditorStatus implements IStatusbarItem {
|
||||
|
||||
private _promptedScreenReader: boolean = false;
|
||||
|
||||
private onScreenReaderModeChange(editorWidget: ICommonCodeEditor): void {
|
||||
private onScreenReaderModeChange(editorWidget: ICodeEditor): void {
|
||||
let screenReaderMode = false;
|
||||
|
||||
// We only support text based editors
|
||||
if (editorWidget) {
|
||||
const screenReaderDetected = (browser.getAccessibilitySupport() === AccessibilitySupport.Enabled);
|
||||
if (screenReaderDetected) {
|
||||
const screenReaderConfiguration = this.configurationService.getConfiguration<IEditorOptions>('editor').accessibilitySupport;
|
||||
const screenReaderConfiguration = this.configurationService.getValue<IEditorOptions>('editor').accessibilitySupport;
|
||||
if (screenReaderConfiguration === 'auto') {
|
||||
// show explanation
|
||||
if (!this._promptedScreenReader) {
|
||||
@@ -656,7 +657,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
this.updateState({ screenReaderMode: screenReaderMode });
|
||||
}
|
||||
|
||||
private onSelectionChange(editorWidget: ICommonCodeEditor): void {
|
||||
private onSelectionChange(editorWidget: ICodeEditor): void {
|
||||
const info: IEditorSelectionStatus = {};
|
||||
|
||||
// We only support text based editors
|
||||
@@ -693,7 +694,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
this.updateState({ selectionStatus: this.getSelectionLabel(info) });
|
||||
}
|
||||
|
||||
private onEOLChange(editorWidget: ICommonCodeEditor): void {
|
||||
private onEOLChange(editorWidget: ICodeEditor): void {
|
||||
const info: StateDelta = { EOL: null };
|
||||
|
||||
if (editorWidget && !editorWidget.getConfiguration().readOnly) {
|
||||
@@ -753,7 +754,7 @@ export class EditorStatus implements IStatusbarItem {
|
||||
}
|
||||
}
|
||||
|
||||
function isWritableCodeEditor(codeEditor: ICommonCodeEditor): boolean {
|
||||
function isWritableCodeEditor(codeEditor: ICodeEditor): boolean {
|
||||
if (!codeEditor) {
|
||||
return false;
|
||||
}
|
||||
@@ -786,8 +787,8 @@ export class ShowLanguageExtensionsAction extends Action {
|
||||
|
||||
export class ChangeModeAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.editor.changeLanguageMode';
|
||||
public static LABEL = nls.localize('changeMode', "Change Language Mode");
|
||||
public static readonly ID = 'workbench.action.editor.changeLanguageMode';
|
||||
public static readonly LABEL = nls.localize('changeMode', "Change Language Mode");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -799,7 +800,6 @@ export class ChangeModeAction extends Action {
|
||||
@IQuickOpenService private quickOpenService: IQuickOpenService,
|
||||
@IPreferencesService private preferencesService: IPreferencesService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@ICommandService private commandService: ICommandService,
|
||||
@IUntitledEditorService private untitledEditorService: IUntitledEditorService
|
||||
) {
|
||||
super(actionId, actionLabel);
|
||||
@@ -990,7 +990,7 @@ export class ChangeModeAction extends Action {
|
||||
}
|
||||
|
||||
// Make sure to write into the value of the target and not the merged value from USER and WORKSPACE config
|
||||
let currentAssociations = (target === ConfigurationTarget.WORKSPACE) ? fileAssociationsConfig.workspace : fileAssociationsConfig.user;
|
||||
let currentAssociations = deepClone((target === ConfigurationTarget.WORKSPACE) ? fileAssociationsConfig.workspace : fileAssociationsConfig.user);
|
||||
if (!currentAssociations) {
|
||||
currentAssociations = Object.create(null);
|
||||
}
|
||||
@@ -1010,8 +1010,8 @@ export interface IChangeEOLEntry extends IPickOpenEntry {
|
||||
|
||||
class ChangeIndentationAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.editor.changeIndentation';
|
||||
public static LABEL = nls.localize('changeIndentation', "Change Indentation");
|
||||
public static readonly ID = 'workbench.action.editor.changeIndentation';
|
||||
public static readonly LABEL = nls.localize('changeIndentation', "Change Indentation");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -1060,8 +1060,8 @@ class ChangeIndentationAction extends Action {
|
||||
|
||||
export class ChangeEOLAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.editor.changeEOL';
|
||||
public static LABEL = nls.localize('changeEndOfLine', "Change End of Line Sequence");
|
||||
public static readonly ID = 'workbench.action.editor.changeEOL';
|
||||
public static readonly LABEL = nls.localize('changeEndOfLine', "Change End of Line Sequence");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -1107,8 +1107,8 @@ export class ChangeEOLAction extends Action {
|
||||
|
||||
export class ChangeEncodingAction extends Action {
|
||||
|
||||
public static ID = 'workbench.action.editor.changeEncoding';
|
||||
public static LABEL = nls.localize('changeEncoding', "Change File Encoding");
|
||||
public static readonly ID = 'workbench.action.editor.changeEncoding';
|
||||
public static readonly LABEL = nls.localize('changeEncoding', "Change File Encoding");
|
||||
|
||||
constructor(
|
||||
actionId: string,
|
||||
@@ -1170,8 +1170,7 @@ export class ChangeEncodingAction extends Action {
|
||||
.then((guessedEncoding: string) => {
|
||||
const isReopenWithEncoding = (action === reopenWithEncodingPick);
|
||||
|
||||
const config = this.textResourceConfigurationService.getConfiguration(resource) as IFilesConfiguration;
|
||||
const configuredEncoding = config && config.files && config.files.encoding;
|
||||
const configuredEncoding = this.textResourceConfigurationService.getValue(resource, 'files.encoding');
|
||||
|
||||
let directMatchIndex: number;
|
||||
let aliasMatchIndex: number;
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab {
|
||||
display: flex;
|
||||
width: 120px;
|
||||
min-width: fit-content;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
height: 35px;
|
||||
@@ -47,6 +45,35 @@
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-shrink.has-icon-theme.close-button-right,
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-shrink.has-icon-theme.close-button-off {
|
||||
padding-left: 5px; /* reduce padding when we show icons and are in shrinking mode and tab close button is not left */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-fit {
|
||||
width: 120px;
|
||||
min-width: fit-content;
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-shrink {
|
||||
min-width: 60px;
|
||||
flex-basis: 0; /* all tabs are even */
|
||||
flex-grow: 1; /* all tabs grow even */
|
||||
max-width: fit-content;
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-shrink.close-button-left {
|
||||
min-width: 80px; /* make more room for close button when it shows to the left */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.dragged {
|
||||
will-change: transform; /* forces tab to be drawn on a separate layer (fixes https://github.com/Microsoft/vscode/issues/18733) */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.dragged-over * {
|
||||
pointer-events: none; /* prevents cursor flickering (fixes https://github.com/Microsoft/vscode/issues/38753) */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-left {
|
||||
flex-direction: row-reverse;
|
||||
padding-left: 0;
|
||||
@@ -60,7 +87,8 @@
|
||||
margin-bottom: auto;
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab .monaco-icon-label {
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-fit .monaco-icon-label,
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.sizing-fit .monaco-icon-label > .monaco-icon-label-description-container {
|
||||
overflow: visible; /* fixes https://github.com/Microsoft/vscode/issues/20182 */
|
||||
}
|
||||
|
||||
@@ -76,6 +104,16 @@
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-right.sizing-shrink > .tab-close {
|
||||
flex: 0;
|
||||
overflow: hidden; /* let the close button be pushed out of view when sizing is set to shrink to make more room... */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.dirty.close-button-right.sizing-shrink > .tab-close,
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-right.sizing-shrink:hover > .tab-close {
|
||||
overflow: visible; /* ...but still show the close button on hover and when dirty */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-off > .tab-close {
|
||||
display: none; /* hide the close action bar when we are configured to hide it */
|
||||
}
|
||||
@@ -127,8 +165,7 @@
|
||||
/* No Tab Close Button */
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-off {
|
||||
padding-right: 12px;
|
||||
transition: padding-right ease-in-out 100ms;
|
||||
padding-right: 10px; /* give a little bit more room if close button is off */
|
||||
}
|
||||
|
||||
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-off.dirty {
|
||||
|
||||
@@ -18,7 +18,6 @@ import { EventType as TouchEventType, GestureEvent, Gesture } from 'vs/base/brow
|
||||
export class NoTabsTitleControl extends TitleControl {
|
||||
private titleContainer: HTMLElement;
|
||||
private editorLabel: ResourceLabel;
|
||||
private titleTouchSupport: Gesture;
|
||||
|
||||
public setContext(group: IEditorGroup): void {
|
||||
super.setContext(group);
|
||||
@@ -32,7 +31,7 @@ export class NoTabsTitleControl extends TitleControl {
|
||||
this.titleContainer = parent;
|
||||
|
||||
// Gesture Support
|
||||
this.titleTouchSupport = new Gesture(this.titleContainer);
|
||||
Gesture.addTarget(this.titleContainer);
|
||||
|
||||
// Pin on double click
|
||||
this.toUnbind.push(DOM.addDisposableListener(this.titleContainer, DOM.EventType.DBLCLICK, (e: MouseEvent) => this.onTitleDoubleClick(e)));
|
||||
@@ -91,8 +90,11 @@ export class NoTabsTitleControl extends TitleControl {
|
||||
this.closeEditorAction.run({ group, editor: group.activeEditor }).done(null, errors.onUnexpectedError);
|
||||
}
|
||||
|
||||
// Focus editor group unless click on toolbar
|
||||
else if (this.stacks.groups.length === 1 && !DOM.isAncestor((e.target || e.srcElement) as HTMLElement, this.editorActionsToolbar.getContainer().getHTMLElement())) {
|
||||
// Focus editor group unless:
|
||||
// - click on toolbar: should trigger actions within
|
||||
// - mouse click: do not focus group if there are more than one as it otherwise makes group DND funky
|
||||
// - touch: always focus
|
||||
else if ((this.stacks.groups.length === 1 || !(e instanceof MouseEvent)) && !DOM.isAncestor((e.target || e.srcElement) as HTMLElement, this.editorActionsToolbar.getContainer().getHTMLElement())) {
|
||||
this.editorGroupService.focusGroup(group);
|
||||
}
|
||||
}
|
||||
@@ -159,10 +161,4 @@ export class NoTabsTitleControl extends TitleControl {
|
||||
default: return Verbosity.MEDIUM;
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
super.dispose();
|
||||
|
||||
this.titleTouchSupport.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
117
src/vs/workbench/browser/parts/editor/rangeDecorations.ts
Normal file
117
src/vs/workbench/browser/parts/editor/rangeDecorations.ts
Normal file
@@ -0,0 +1,117 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import Event, { Emitter } from 'vs/base/common/event';
|
||||
import * as editorCommon from 'vs/editor/common/editorCommon';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { CursorChangeReason, ICursorPositionChangedEvent } from 'vs/editor/common/controller/cursorEvents';
|
||||
import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDecorations';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
export interface IRangeHighlightDecoration {
|
||||
resource: URI;
|
||||
range: IRange;
|
||||
isWholeLine?: boolean;
|
||||
}
|
||||
|
||||
export class RangeHighlightDecorations implements IDisposable {
|
||||
|
||||
private rangeHighlightDecorationId: string = null;
|
||||
private editor: ICodeEditor = null;
|
||||
private editorDisposables: IDisposable[] = [];
|
||||
|
||||
private _onHighlightRemoved: Emitter<void> = new Emitter<void>();
|
||||
public readonly onHighlghtRemoved: Event<void> = this._onHighlightRemoved.event;
|
||||
|
||||
constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService) {
|
||||
}
|
||||
|
||||
public removeHighlightRange() {
|
||||
if (this.editor && this.editor.getModel() && this.rangeHighlightDecorationId) {
|
||||
this.editor.deltaDecorations([this.rangeHighlightDecorationId], []);
|
||||
this._onHighlightRemoved.fire();
|
||||
}
|
||||
this.rangeHighlightDecorationId = null;
|
||||
}
|
||||
|
||||
public highlightRange(range: IRangeHighlightDecoration, editor?: ICodeEditor) {
|
||||
editor = editor ? editor : this.getEditor(range);
|
||||
if (editor) {
|
||||
this.doHighlightRange(editor, range);
|
||||
}
|
||||
}
|
||||
|
||||
private doHighlightRange(editor: ICodeEditor, selectionRange: IRangeHighlightDecoration) {
|
||||
this.removeHighlightRange();
|
||||
editor.changeDecorations((changeAccessor: editorCommon.IModelDecorationsChangeAccessor) => {
|
||||
this.rangeHighlightDecorationId = changeAccessor.addDecoration(selectionRange.range, this.createRangeHighlightDecoration(selectionRange.isWholeLine));
|
||||
});
|
||||
this.setEditor(editor);
|
||||
}
|
||||
|
||||
private getEditor(resourceRange: IRangeHighlightDecoration): ICodeEditor {
|
||||
const activeInput = this.editorService.getActiveEditorInput();
|
||||
const resource = activeInput && activeInput.getResource();
|
||||
if (resource) {
|
||||
if (resource.toString() === resourceRange.resource.toString()) {
|
||||
return <ICodeEditor>this.editorService.getActiveEditor().getControl();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private setEditor(editor: ICodeEditor) {
|
||||
if (this.editor !== editor) {
|
||||
this.disposeEditorListeners();
|
||||
this.editor = editor;
|
||||
this.editorDisposables.push(this.editor.onDidChangeCursorPosition((e: ICursorPositionChangedEvent) => {
|
||||
if (
|
||||
e.reason === CursorChangeReason.NotSet
|
||||
|| e.reason === CursorChangeReason.Explicit
|
||||
|| e.reason === CursorChangeReason.Undo
|
||||
|| e.reason === CursorChangeReason.Redo
|
||||
) {
|
||||
this.removeHighlightRange();
|
||||
}
|
||||
}));
|
||||
this.editorDisposables.push(this.editor.onDidChangeModel(() => { this.removeHighlightRange(); }));
|
||||
this.editorDisposables.push(this.editor.onDidDispose(() => {
|
||||
this.removeHighlightRange();
|
||||
this.editor = null;
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
private disposeEditorListeners() {
|
||||
this.editorDisposables.forEach(disposable => disposable.dispose());
|
||||
this.editorDisposables = [];
|
||||
}
|
||||
|
||||
private static readonly _WHOLE_LINE_RANGE_HIGHLIGHT = ModelDecorationOptions.register({
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'rangeHighlight',
|
||||
isWholeLine: true
|
||||
});
|
||||
|
||||
private static readonly _RANGE_HIGHLIGHT = ModelDecorationOptions.register({
|
||||
stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
className: 'rangeHighlight'
|
||||
});
|
||||
|
||||
private createRangeHighlightDecoration(isWholeLine: boolean = true): ModelDecorationOptions {
|
||||
return (isWholeLine ? RangeHighlightDecorations._WHOLE_LINE_RANGE_HIGHLIGHT : RangeHighlightDecorations._RANGE_HIGHLIGHT);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
if (this.editor && this.editor.getModel()) {
|
||||
this.removeHighlightRange();
|
||||
this.disposeEditorListeners();
|
||||
this.editor = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,16 +36,19 @@ import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import { IDisposable, dispose, combinedDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { extractResources } from 'vs/base/browser/dnd';
|
||||
import { extractResources } from 'vs/workbench/browser/editor';
|
||||
import { getOrSet } from 'vs/base/common/map';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector, HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { IThemeService, registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER } from 'vs/workbench/common/theme';
|
||||
import { activeContrastBorder, contrastBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { Dimension } from 'vs/base/browser/builder';
|
||||
import { scheduleAtNextAnimationFrame } from 'vs/base/browser/dom';
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
||||
import { HIGH_CONTRAST } from 'vs/platform/theme/common/themeService';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import * as QueryConstants from 'sql/parts/query/common/constants';
|
||||
@@ -66,11 +69,14 @@ type AugmentedLabel = IEditorInputLabel & { editor: IEditorInput };
|
||||
export class TabsTitleControl extends TitleControl {
|
||||
private titleContainer: HTMLElement;
|
||||
private tabsContainer: HTMLElement;
|
||||
private editorToolbarContainer: HTMLElement;
|
||||
private activeTab: HTMLElement;
|
||||
private editorLabels: ResourceLabel[];
|
||||
private scrollbar: ScrollableElement;
|
||||
private tabDisposeables: IDisposable[];
|
||||
private blockRevealActiveTab: boolean;
|
||||
private dimension: Dimension;
|
||||
private layoutScheduled: IDisposable;
|
||||
|
||||
constructor(
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@@ -162,11 +168,17 @@ export class TabsTitleControl extends TitleControl {
|
||||
|
||||
const group = this.context;
|
||||
if (group) {
|
||||
TaskUtilities.newQuery(undefined, this.connectionService, this.queryEditorService, this.objectExplorerService, this.workbenchEditorService).then(undefined, errors.onUnexpectedError);
|
||||
this.editorService.openEditor({ options: { pinned: true, index: group.count /* always at the end */ } } as IUntitledResourceInput).done(null, errors.onUnexpectedError); // untitled are always pinned
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
this.toUnbind.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.MOUSE_DOWN, (e: MouseEvent) => {
|
||||
if (e.button === 1) {
|
||||
e.preventDefault(); // required to prevent auto-scrolling (https://github.com/Microsoft/vscode/issues/16690)
|
||||
}
|
||||
}));
|
||||
|
||||
// Custom Scrollbar
|
||||
this.scrollbar = new ScrollableElement(this.tabsContainer, {
|
||||
horizontal: ScrollbarVisibility.Auto,
|
||||
@@ -184,10 +196,11 @@ export class TabsTitleControl extends TitleControl {
|
||||
|
||||
// Drag over
|
||||
this.toUnbind.push(DOM.addDisposableListener(this.tabsContainer, DOM.EventType.DRAG_OVER, (e: DragEvent) => {
|
||||
const draggedEditor = TabsTitleControl.getDraggedEditor();
|
||||
|
||||
// update the dropEffect, otherwise it would look like a "move" operation. but only if we are
|
||||
// not dragging a tab actually because there we support both moving as well as copying
|
||||
if (!TabsTitleControl.getDraggedEditor()) {
|
||||
if (!draggedEditor) {
|
||||
e.dataTransfer.dropEffect = 'copy';
|
||||
}
|
||||
|
||||
@@ -195,7 +208,17 @@ export class TabsTitleControl extends TitleControl {
|
||||
|
||||
const target = e.target;
|
||||
if (target instanceof HTMLElement && target.className.indexOf('tabs-container') === 0) {
|
||||
this.updateDropFeedback(this.tabsContainer, true);
|
||||
|
||||
// Find out if the currently dragged editor is the last tab of this group and in that
|
||||
// case we do not want to show any drop feedback because the drop would be a no-op
|
||||
let draggedEditorIsLastTab = false;
|
||||
if (draggedEditor && this.context === draggedEditor.group && this.context.indexOf(draggedEditor.editor) === this.context.count - 1) {
|
||||
draggedEditorIsLastTab = true;
|
||||
}
|
||||
|
||||
if (!draggedEditorIsLastTab) {
|
||||
this.updateDropFeedback(this.tabsContainer, true);
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -228,13 +251,13 @@ export class TabsTitleControl extends TitleControl {
|
||||
}
|
||||
}));
|
||||
|
||||
// Editor Actions Container
|
||||
const editorActionsContainer = document.createElement('div');
|
||||
DOM.addClass(editorActionsContainer, 'editor-actions');
|
||||
this.titleContainer.appendChild(editorActionsContainer);
|
||||
// Editor Toolbar Container
|
||||
this.editorToolbarContainer = document.createElement('div');
|
||||
DOM.addClass(this.editorToolbarContainer, 'editor-actions');
|
||||
this.titleContainer.appendChild(this.editorToolbarContainer);
|
||||
|
||||
// Editor Actions Toolbar
|
||||
this.createEditorActionsToolBar(editorActionsContainer);
|
||||
this.createEditorActionsToolBar(this.editorToolbarContainer);
|
||||
}
|
||||
|
||||
private updateDropFeedback(element: HTMLElement, isDND: boolean, index?: number): void {
|
||||
@@ -296,78 +319,91 @@ export class TabsTitleControl extends TitleControl {
|
||||
|
||||
// Tab label and styles
|
||||
editorsOfGroup.forEach((editor, index) => {
|
||||
const tabContainer = this.tabsContainer.children[index];
|
||||
if (tabContainer instanceof HTMLElement) {
|
||||
const isPinned = group.isPinned(index);
|
||||
const isTabActive = group.isActive(editor);
|
||||
const isDirty = editor.isDirty();
|
||||
const tabContainer = this.tabsContainer.children[index] as HTMLElement;
|
||||
if (!tabContainer) {
|
||||
return; // could be a race condition between updating tabs and creating tabs
|
||||
}
|
||||
|
||||
const label = labels[index];
|
||||
const name = label.name;
|
||||
const description = label.description || '';
|
||||
const title = label.title || '';
|
||||
const isPinned = group.isPinned(index);
|
||||
const isTabActive = group.isActive(editor);
|
||||
const isDirty = editor.isDirty();
|
||||
|
||||
// Container
|
||||
tabContainer.setAttribute('aria-label', `${name}, tab`);
|
||||
tabContainer.title = title;
|
||||
tabContainer.style.borderLeftColor = (index !== 0) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;
|
||||
tabContainer.style.borderRightColor = (index === editorsOfGroup.length - 1) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;
|
||||
tabContainer.style.outlineColor = this.getColor(activeContrastBorder);
|
||||
const label = labels[index];
|
||||
const name = label.name;
|
||||
const description = label.description || '';
|
||||
const title = label.title || '';
|
||||
|
||||
const tabOptions = this.editorGroupService.getTabOptions();
|
||||
['off', 'left'].forEach(option => {
|
||||
const domAction = tabOptions.tabCloseButton === option ? DOM.addClass : DOM.removeClass;
|
||||
domAction(tabContainer, `close-button-${option}`);
|
||||
});
|
||||
// Container
|
||||
tabContainer.setAttribute('aria-label', `${name}, tab`);
|
||||
tabContainer.title = title;
|
||||
tabContainer.style.borderLeftColor = (index !== 0) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;
|
||||
tabContainer.style.borderRightColor = (index === editorsOfGroup.length - 1) ? (this.getColor(TAB_BORDER) || this.getColor(contrastBorder)) : null;
|
||||
tabContainer.style.outlineColor = this.getColor(activeContrastBorder);
|
||||
|
||||
// Label
|
||||
const tabLabel = this.editorLabels[index];
|
||||
// {{SQL CARBON EDIT}} -- add title in options passed
|
||||
tabLabel.setLabel({ name, description, resource: toResource(editor, { supportSideBySide: true }) }, { extraClasses: ['tab-label'], italic: !isPinned, title });
|
||||
const tabOptions = this.editorGroupService.getTabOptions();
|
||||
|
||||
// Active state
|
||||
if (isTabActive) {
|
||||
DOM.addClass(tabContainer, 'active');
|
||||
tabContainer.setAttribute('aria-selected', 'true');
|
||||
tabContainer.style.backgroundColor = this.getColor(TAB_ACTIVE_BACKGROUND);
|
||||
tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND);
|
||||
['off', 'left', 'right'].forEach(option => {
|
||||
const domAction = tabOptions.tabCloseButton === option ? DOM.addClass : DOM.removeClass;
|
||||
domAction(tabContainer, `close-button-${option}`);
|
||||
});
|
||||
|
||||
// Use boxShadow for the active tab border because if we also have a editor group header
|
||||
// color, the two colors would collide and the tab border never shows up.
|
||||
// see https://github.com/Microsoft/vscode/issues/33111
|
||||
const activeTabBorderColor = this.getColor(isGroupActive ? TAB_ACTIVE_BORDER : TAB_UNFOCUSED_ACTIVE_BORDER);
|
||||
if (activeTabBorderColor) {
|
||||
tabContainer.style.boxShadow = `${activeTabBorderColor} 0 -1px inset`;
|
||||
} else {
|
||||
tabContainer.style.boxShadow = null;
|
||||
}
|
||||
['fit', 'shrink'].forEach(option => {
|
||||
const domAction = tabOptions.tabSizing === option ? DOM.addClass : DOM.removeClass;
|
||||
domAction(tabContainer, `sizing-${option}`);
|
||||
});
|
||||
|
||||
this.activeTab = tabContainer;
|
||||
if (tabOptions.showIcons && !!tabOptions.iconTheme) {
|
||||
DOM.addClass(tabContainer, 'has-icon-theme');
|
||||
} else {
|
||||
DOM.removeClass(tabContainer, 'has-icon-theme');
|
||||
}
|
||||
|
||||
// Label
|
||||
const tabLabel = this.editorLabels[index];
|
||||
// {{SQL CARBON EDIT}} -- add title in options passed
|
||||
tabLabel.setLabel({ name, description, resource: toResource(editor, { supportSideBySide: true }) }, { extraClasses: ['tab-label'], italic: !isPinned, title });
|
||||
|
||||
// Active state
|
||||
if (isTabActive) {
|
||||
DOM.addClass(tabContainer, 'active');
|
||||
tabContainer.setAttribute('aria-selected', 'true');
|
||||
tabContainer.style.backgroundColor = this.getColor(TAB_ACTIVE_BACKGROUND);
|
||||
tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND);
|
||||
|
||||
// Use boxShadow for the active tab border because if we also have a editor group header
|
||||
// color, the two colors would collide and the tab border never shows up.
|
||||
// see https://github.com/Microsoft/vscode/issues/33111
|
||||
const activeTabBorderColor = this.getColor(isGroupActive ? TAB_ACTIVE_BORDER : TAB_UNFOCUSED_ACTIVE_BORDER);
|
||||
if (activeTabBorderColor) {
|
||||
tabContainer.style.boxShadow = `${activeTabBorderColor} 0 -1px inset`;
|
||||
} else {
|
||||
DOM.removeClass(tabContainer, 'active');
|
||||
tabContainer.setAttribute('aria-selected', 'false');
|
||||
tabContainer.style.backgroundColor = this.getColor(TAB_INACTIVE_BACKGROUND);
|
||||
tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND);
|
||||
tabContainer.style.boxShadow = null;
|
||||
}
|
||||
|
||||
// Dirty State
|
||||
if (isDirty) {
|
||||
DOM.addClass(tabContainer, 'dirty');
|
||||
} else {
|
||||
DOM.removeClass(tabContainer, 'dirty');
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
||||
this.setEditorTabColor(editor, tabContainer, isTabActive);
|
||||
this.activeTab = tabContainer;
|
||||
} else {
|
||||
DOM.removeClass(tabContainer, 'active');
|
||||
tabContainer.setAttribute('aria-selected', 'false');
|
||||
tabContainer.style.backgroundColor = this.getColor(TAB_INACTIVE_BACKGROUND);
|
||||
tabLabel.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND);
|
||||
tabContainer.style.boxShadow = null;
|
||||
}
|
||||
|
||||
// Dirty State
|
||||
if (isDirty) {
|
||||
DOM.addClass(tabContainer, 'dirty');
|
||||
} else {
|
||||
DOM.removeClass(tabContainer, 'dirty');
|
||||
}
|
||||
// {{SQL CARBON EDIT}} -- Display the editor's tab color
|
||||
this.setEditorTabColor(editor, tabContainer, isTabActive);
|
||||
});
|
||||
|
||||
// Update Editor Actions Toolbar
|
||||
this.updateEditorActionsToolbar();
|
||||
|
||||
// Ensure the active tab is always revealed
|
||||
this.layout();
|
||||
this.layout(this.dimension);
|
||||
}
|
||||
|
||||
private getTabLabels(editors: IEditorInput[]): IEditorInputLabel[] {
|
||||
@@ -536,7 +572,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
DOM.addClass(tabContainer, 'tab');
|
||||
|
||||
// Gesture Support
|
||||
const gestureSupport = new Gesture(tabContainer);
|
||||
Gesture.addTarget(tabContainer);
|
||||
|
||||
// Tab Editor Label
|
||||
const editorLabel = this.instantiationService.createInstance(ResourceLabel, tabContainer, void 0);
|
||||
@@ -553,19 +589,41 @@ export class TabsTitleControl extends TitleControl {
|
||||
// Eventing
|
||||
const disposable = this.hookTabListeners(tabContainer, index);
|
||||
|
||||
this.tabDisposeables.push(combinedDisposable([disposable, bar, editorLabel, gestureSupport]));
|
||||
this.tabDisposeables.push(combinedDisposable([disposable, bar, editorLabel]));
|
||||
|
||||
return tabContainer;
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
if (!this.activeTab) {
|
||||
public layout(dimension: Dimension): void {
|
||||
if (!this.activeTab || !dimension) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.dimension = dimension;
|
||||
|
||||
// The layout of tabs can be an expensive operation because we access DOM properties
|
||||
// that can result in the browser doing a full page layout to validate them. To buffer
|
||||
// this a little bit we try at least to schedule this work on the next animation frame.
|
||||
if (!this.layoutScheduled) {
|
||||
this.layoutScheduled = scheduleAtNextAnimationFrame(() => {
|
||||
this.doLayout(this.dimension);
|
||||
this.layoutScheduled = void 0;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private doLayout(dimension: Dimension): void {
|
||||
const visibleContainerWidth = this.tabsContainer.offsetWidth;
|
||||
const totalContainerWidth = this.tabsContainer.scrollWidth;
|
||||
|
||||
let activeTabPosX: number;
|
||||
let activeTabWidth: number;
|
||||
|
||||
if (!this.blockRevealActiveTab) {
|
||||
activeTabPosX = this.activeTab.offsetLeft;
|
||||
activeTabWidth = this.activeTab.offsetWidth;
|
||||
}
|
||||
|
||||
// Update scrollbar
|
||||
this.scrollbar.setScrollDimensions({
|
||||
width: visibleContainerWidth,
|
||||
@@ -579,9 +637,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
}
|
||||
|
||||
// Reveal the active one
|
||||
const containerScrollPosX = this.tabsContainer.scrollLeft;
|
||||
const activeTabPosX = this.activeTab.offsetLeft;
|
||||
const activeTabWidth = this.activeTab.offsetWidth;
|
||||
const containerScrollPosX = this.scrollbar.getScrollPosition().scrollLeft;
|
||||
const activeTabFits = activeTabWidth <= visibleContainerWidth;
|
||||
|
||||
// Tab is overflowing to the right: Scroll minimally until the element is fully visible to the right
|
||||
@@ -595,7 +651,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
// Tab is overlflowng to the left or does not fit: Scroll it into view to the left
|
||||
else if (containerScrollPosX > activeTabPosX || !activeTabFits) {
|
||||
this.scrollbar.setScrollPosition({
|
||||
scrollLeft: this.activeTab.offsetLeft
|
||||
scrollLeft: activeTabPosX
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -608,7 +664,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
|
||||
if (e instanceof MouseEvent && e.button !== 0) {
|
||||
if (e.button === 1) {
|
||||
return false; // required due to https://github.com/Microsoft/vscode/issues/16690
|
||||
e.preventDefault(); // required to prevent auto-scrolling (https://github.com/Microsoft/vscode/issues/16690)
|
||||
}
|
||||
|
||||
return void 0; // only for left mouse click
|
||||
@@ -638,7 +694,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
|
||||
// Touch Scroll Support
|
||||
disposables.push(DOM.addDisposableListener(tab, TouchEventType.Change, (e: GestureEvent) => {
|
||||
this.tabsContainer.scrollLeft -= e.translationX;
|
||||
this.scrollbar.setScrollPosition({ scrollLeft: this.scrollbar.getScrollPosition().scrollLeft - e.translationX });
|
||||
}));
|
||||
|
||||
// Close on mouse middle click
|
||||
@@ -743,6 +799,10 @@ export class TabsTitleControl extends TitleControl {
|
||||
e.dataTransfer.setData('DownloadURL', [MIME_BINARY, editor.getName(), resourceStr].join(':')); // enables support to drag a tab as file to desktop
|
||||
}
|
||||
}
|
||||
|
||||
// Fixes https://github.com/Microsoft/vscode/issues/18733
|
||||
DOM.addClass(tab, 'dragged');
|
||||
scheduleAtNextAnimationFrame(() => DOM.removeClass(tab, 'dragged'));
|
||||
}));
|
||||
|
||||
// We need to keep track of DRAG_ENTER and DRAG_LEAVE events because a tab is not just a div without children,
|
||||
@@ -766,6 +826,8 @@ export class TabsTitleControl extends TitleControl {
|
||||
}
|
||||
}
|
||||
|
||||
DOM.addClass(tab, 'dragged-over');
|
||||
|
||||
if (!draggedEditorIsTab) {
|
||||
this.updateDropFeedback(tab, true, index);
|
||||
}
|
||||
@@ -775,6 +837,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_LEAVE, (e: DragEvent) => {
|
||||
counter--;
|
||||
if (counter === 0) {
|
||||
DOM.removeClass(tab, 'dragged-over');
|
||||
this.updateDropFeedback(tab, false, index);
|
||||
}
|
||||
}));
|
||||
@@ -782,6 +845,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
// Drag end
|
||||
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_END, (e: DragEvent) => {
|
||||
counter = 0;
|
||||
DOM.removeClass(tab, 'dragged-over');
|
||||
this.updateDropFeedback(tab, false, index);
|
||||
|
||||
this.onEditorDragEnd();
|
||||
@@ -790,6 +854,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
// Drop
|
||||
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DROP, (e: DragEvent) => {
|
||||
counter = 0;
|
||||
DOM.removeClass(tab, 'dragged-over');
|
||||
this.updateDropFeedback(tab, false, index);
|
||||
|
||||
const { group, position } = this.toTabContext(index);
|
||||
@@ -895,6 +960,12 @@ export class TabsTitleControl extends TitleControl {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
super.dispose();
|
||||
|
||||
this.layoutScheduled = dispose(this.layoutScheduled);
|
||||
}
|
||||
}
|
||||
|
||||
class TabActionRunner extends ActionRunner {
|
||||
|
||||
@@ -31,7 +31,6 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
|
||||
import { IWorkbenchEditorService, DelegatingWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { IEditorInput } from 'vs/platform/editor/common/editor';
|
||||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
@@ -41,7 +40,7 @@ import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
*/
|
||||
export class TextDiffEditor extends BaseTextEditor {
|
||||
|
||||
public static ID = TEXT_DIFF_EDITOR_ID;
|
||||
public static readonly ID = TEXT_DIFF_EDITOR_ID;
|
||||
|
||||
private diffNavigator: DiffNavigator;
|
||||
private nextDiffAction: NavigateAction;
|
||||
@@ -55,10 +54,9 @@ export class TextDiffEditor extends BaseTextEditor {
|
||||
@IWorkbenchEditorService private editorService: IWorkbenchEditorService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IEditorGroupService editorGroupService: IEditorGroupService,
|
||||
@IModeService modeService: IModeService,
|
||||
@ITextFileService textFileService: ITextFileService
|
||||
) {
|
||||
super(TextDiffEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService);
|
||||
super(TextDiffEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService);
|
||||
}
|
||||
|
||||
public getTitle(): string {
|
||||
@@ -122,7 +120,7 @@ export class TextDiffEditor extends BaseTextEditor {
|
||||
textOptions.apply(<IDiffEditor>this.getControl(), ScrollType.Smooth);
|
||||
}
|
||||
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
// Dispose previous diff navigator
|
||||
@@ -161,7 +159,7 @@ export class TextDiffEditor extends BaseTextEditor {
|
||||
this.diffNavigator = new DiffNavigator(diffEditor, {
|
||||
alwaysRevealFirst
|
||||
});
|
||||
this.diffNavigator.addListener(DiffNavigator.Events.UPDATED, () => {
|
||||
this.diffNavigator.onDidUpdate(() => {
|
||||
this.nextDiffAction.updateEnablement();
|
||||
this.previousDiffAction.updateEnablement();
|
||||
});
|
||||
@@ -343,9 +341,9 @@ class NavigateAction extends Action {
|
||||
}
|
||||
|
||||
class ToggleEditorModeAction extends Action {
|
||||
private static ID = 'toggle.diff.editorMode';
|
||||
private static INLINE_LABEL = nls.localize('inlineDiffLabel', "Switch to Inline View");
|
||||
private static SIDEBYSIDE_LABEL = nls.localize('sideBySideDiffLabel', "Switch to Side by Side View");
|
||||
private static readonly ID = 'toggle.diff.editorMode';
|
||||
private static readonly INLINE_LABEL = nls.localize('inlineDiffLabel', "Switch to Inline View");
|
||||
private static readonly SIDEBYSIDE_LABEL = nls.localize('sideBySideDiffLabel', "Switch to Side by Side View");
|
||||
|
||||
constructor(private editor: TextDiffEditor) {
|
||||
super(ToggleEditorModeAction.ID);
|
||||
@@ -371,4 +369,4 @@ class ToggleEditorModeAction extends Action {
|
||||
|
||||
return control && !control.renderSideBySide;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,28 +16,22 @@ import DOM = require('vs/base/browser/dom');
|
||||
import { CodeEditor } from 'vs/editor/browser/codeEditor';
|
||||
import { EditorInput, EditorOptions } from 'vs/workbench/common/editor';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { IEditorViewState, IEditor, isCommonCodeEditor, isCommonDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorViewState, IEditor } from 'vs/editor/common/editorCommon';
|
||||
import { Position } from 'vs/platform/editor/common/editor';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { Scope } from 'vs/workbench/common/memento';
|
||||
import { getCodeEditor } from 'vs/editor/common/services/codeEditorService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { getCodeEditor } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { ITextFileService, SaveReason, AutoSaveMode } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
import { isDiffEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
const TEXT_EDITOR_VIEW_STATE_PREFERENCE_KEY = 'textEditorViewState';
|
||||
|
||||
interface ITextEditorViewState {
|
||||
0?: IEditorViewState;
|
||||
1?: IEditorViewState;
|
||||
2?: IEditorViewState;
|
||||
}
|
||||
|
||||
export interface IEditorConfiguration {
|
||||
editor: object;
|
||||
diffEditor: object;
|
||||
@@ -60,13 +54,12 @@ export abstract class BaseTextEditor extends BaseEditor {
|
||||
@IStorageService private storageService: IStorageService,
|
||||
@ITextResourceConfigurationService private _configurationService: ITextResourceConfigurationService,
|
||||
@IThemeService protected themeService: IThemeService,
|
||||
@IModeService private modeService: IModeService,
|
||||
@ITextFileService private _textFileService: ITextFileService,
|
||||
@IEditorGroupService protected editorGroupService: IEditorGroupService
|
||||
) {
|
||||
super(id, telemetryService, themeService);
|
||||
|
||||
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getConfiguration<IEditorConfiguration>(this.getResource()))));
|
||||
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getValue<IEditorConfiguration>(this.getResource()))));
|
||||
}
|
||||
|
||||
protected get instantiationService(): IInstantiationService {
|
||||
@@ -99,7 +92,7 @@ export abstract class BaseTextEditor extends BaseEditor {
|
||||
protected computeConfiguration(configuration: IEditorConfiguration): IEditorOptions {
|
||||
|
||||
// Specific editor options always overwrite user configuration
|
||||
const editorConfiguration: IEditorOptions = types.isObject(configuration.editor) ? objects.clone(configuration.editor) : Object.create(null);
|
||||
const editorConfiguration: IEditorOptions = types.isObject(configuration.editor) ? objects.deepClone(configuration.editor) : Object.create(null);
|
||||
objects.assign(editorConfiguration, this.getConfigurationOverrides());
|
||||
|
||||
// ARIA label
|
||||
@@ -134,7 +127,7 @@ export abstract class BaseTextEditor extends BaseEditor {
|
||||
|
||||
// Editor for Text
|
||||
this._editorContainer = parent;
|
||||
this.editorControl = this.createEditorControl(parent, this.computeConfiguration(this.configurationService.getConfiguration<IEditorConfiguration>(this.getResource())));
|
||||
this.editorControl = this.createEditorControl(parent, this.computeConfiguration(this.configurationService.getValue<IEditorConfiguration>(this.getResource())));
|
||||
|
||||
// Model & Language changes
|
||||
const codeEditor = getCodeEditor(this);
|
||||
@@ -144,9 +137,9 @@ export abstract class BaseTextEditor extends BaseEditor {
|
||||
}
|
||||
|
||||
// Application & Editor focus change to respect auto save settings
|
||||
if (isCommonCodeEditor(this.editorControl)) {
|
||||
if (isCodeEditor(this.editorControl)) {
|
||||
this.toUnbind.push(this.editorControl.onDidBlurEditor(() => this.onEditorFocusLost()));
|
||||
} else if (isCommonDiffEditor(this.editorControl)) {
|
||||
} else if (isDiffEditor(this.editorControl)) {
|
||||
this.toUnbind.push(this.editorControl.getOriginalEditor().onDidBlurEditor(() => this.onEditorFocusLost()));
|
||||
this.toUnbind.push(this.editorControl.getModifiedEditor().onDidBlurEditor(() => this.onEditorFocusLost()));
|
||||
}
|
||||
@@ -287,7 +280,7 @@ export abstract class BaseTextEditor extends BaseEditor {
|
||||
return null;
|
||||
}
|
||||
|
||||
private updateEditorConfiguration(configuration = this.configurationService.getConfiguration<IEditorConfiguration>(this.getResource())): void {
|
||||
private updateEditorConfiguration(configuration = this.configurationService.getValue<IEditorConfiguration>(this.getResource())): void {
|
||||
if (!this.editorControl) {
|
||||
return;
|
||||
}
|
||||
@@ -328,7 +321,7 @@ export abstract class BaseTextEditor extends BaseEditor {
|
||||
|
||||
public dispose(): void {
|
||||
this.lastAppliedEditorOptions = void 0;
|
||||
this.editorControl.destroy();
|
||||
this.editorControl.dispose();
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { once } from 'vs/base/common/event';
|
||||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
@@ -31,7 +30,7 @@ import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
*/
|
||||
export class TextResourceEditor extends BaseTextEditor {
|
||||
|
||||
public static ID = 'workbench.editors.textResourceEditor';
|
||||
public static readonly ID = 'workbench.editors.textResourceEditor';
|
||||
|
||||
constructor(
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@@ -40,10 +39,9 @@ export class TextResourceEditor extends BaseTextEditor {
|
||||
@ITextResourceConfigurationService configurationService: ITextResourceConfigurationService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
@IEditorGroupService editorGroupService: IEditorGroupService,
|
||||
@IModeService modeService: IModeService,
|
||||
@ITextFileService textFileService: ITextFileService
|
||||
) {
|
||||
super(TextResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, modeService, textFileService, editorGroupService);
|
||||
super(TextResourceEditor.ID, telemetryService, instantiationService, storageService, configurationService, themeService, textFileService, editorGroupService);
|
||||
}
|
||||
|
||||
public getTitle(): string {
|
||||
@@ -66,7 +64,7 @@ export class TextResourceEditor extends BaseTextEditor {
|
||||
textOptions.apply(this.getControl(), ScrollType.Smooth);
|
||||
}
|
||||
|
||||
return TPromise.as<void>(null);
|
||||
return TPromise.wrap<void>(null);
|
||||
}
|
||||
|
||||
// Remember view settings if input changes
|
||||
|
||||
@@ -9,16 +9,14 @@ import 'vs/css!./media/titlecontrol';
|
||||
import nls = require('vs/nls');
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Scope, IActionBarRegistry, Extensions, prepareActions } from 'vs/workbench/browser/actions';
|
||||
import { IAction, Action } from 'vs/base/common/actions';
|
||||
import { IAction, Action, IRunEvent } from 'vs/base/common/actions';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import DOM = require('vs/base/browser/dom');
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { isCommonCodeEditor, isCommonDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
import arrays = require('vs/base/common/arrays');
|
||||
import { IEditorStacksModel, IEditorGroup, IEditorIdentifier, EditorInput, IStacksModelChangeEvent, toResource } from 'vs/workbench/common/editor';
|
||||
import { EventType as BaseEventType } from 'vs/base/common/events';
|
||||
import { IActionItem, ActionsOrientation, Separator } from 'vs/base/browser/ui/actionbar/actionbar';
|
||||
import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
|
||||
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -39,12 +37,14 @@ import { IMenuService, MenuId, IMenu, ExecuteCommandAction } from 'vs/platform/a
|
||||
import { ResourceContextKey } from 'vs/workbench/common/resources';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { Themable } from 'vs/workbench/common/theme';
|
||||
import { IDraggedResource } from 'vs/base/browser/dnd';
|
||||
import { IDraggedResource } from 'vs/workbench/browser/editor';
|
||||
import { WORKSPACE_EXTENSION, IWorkspacesService } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { extname } from 'vs/base/common/paths';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IWindowsService, IWindowService } from 'vs/platform/windows/common/windows';
|
||||
import URI from 'vs/base/common/uri';
|
||||
import { isDiffEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { Dimension } from 'vs/base/browser/builder';
|
||||
|
||||
export interface IToolbarActions {
|
||||
primary: IAction[];
|
||||
@@ -61,7 +61,7 @@ export interface ITitleAreaControl {
|
||||
refresh(instant?: boolean): void;
|
||||
update(instant?: boolean): void;
|
||||
updateEditorActionsToolbar(): void;
|
||||
layout(): void;
|
||||
layout(dimension: Dimension): void;
|
||||
dispose(): void;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl
|
||||
this.doRefresh();
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
public layout(dimension: Dimension): void {
|
||||
// Subclasses can opt in to react on layout
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl
|
||||
});
|
||||
|
||||
// Action Run Handling
|
||||
this.toUnbind.push(this.editorActionsToolbar.actionRunner.addListener(BaseEventType.RUN, (e: any) => {
|
||||
this.toUnbind.push(this.editorActionsToolbar.actionRunner.onDidRun((e: IRunEvent) => {
|
||||
|
||||
// Check for Error
|
||||
if (e.error && !errors.isPromiseCanceledError(e.error)) {
|
||||
@@ -330,7 +330,7 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl
|
||||
// take this code as sample of how to work with menus
|
||||
this.disposeOnEditorActions = dispose(this.disposeOnEditorActions);
|
||||
const widget = control.getControl();
|
||||
const codeEditor = isCommonCodeEditor(widget) && widget || isCommonDiffEditor(widget) && widget.getModifiedEditor();
|
||||
const codeEditor = isCodeEditor(widget) && widget || isDiffEditor(widget) && widget.getModifiedEditor();
|
||||
const scopedContextKeyService = codeEditor && codeEditor.invokeWithinContext(accessor => accessor.get(IContextKeyService)) || this.contextKeyService;
|
||||
const titleBarMenu = this.menuService.createMenu(MenuId.EditorTitle, scopedContextKeyService);
|
||||
this.disposeOnEditorActions.push(titleBarMenu, titleBarMenu.onDidChange(_ => this.update()));
|
||||
@@ -423,7 +423,17 @@ export abstract class TitleControl extends Themable implements ITitleAreaControl
|
||||
getActions: () => TPromise.as(this.getContextMenuActions(identifier)),
|
||||
getActionsContext: () => identifier,
|
||||
getKeyBinding: (action) => this.getKeybinding(action),
|
||||
onHide: (cancel) => this.resourceContext.set(currentContext) // restore previous context
|
||||
onHide: (cancel) => {
|
||||
|
||||
// restore previous context
|
||||
this.resourceContext.set(currentContext);
|
||||
|
||||
// restore focus to active editor if any
|
||||
const editor = this.editorService.getActiveEditor();
|
||||
if (editor) {
|
||||
editor.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -560,4 +570,4 @@ export function handleWorkspaceExternalDrop(
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,11 +14,6 @@ export interface HtmlPreviewEditorViewState {
|
||||
scrollYPercentage: number;
|
||||
}
|
||||
|
||||
interface HtmlPreviewEditorViewStates {
|
||||
0?: HtmlPreviewEditorViewState;
|
||||
1?: HtmlPreviewEditorViewState;
|
||||
2?: HtmlPreviewEditorViewState;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is only intended to be subclassed and not instantiated.
|
||||
|
||||
Reference in New Issue
Block a user