提交 c9fb992a 编写于 作者: A Alex Dima

Fixes #2410: Add Alt+F1 help widget, Ctrl+Shift+R for toggling on experimental...

Fixes #2410: Add Alt+F1 help widget, Ctrl+Shift+R for toggling on experimental screen reader support, ariaLabel option for the editor
上级 7fc4b8bf
......@@ -21,6 +21,7 @@ import {CommonKeybindings} from 'vs/base/common/keyCodes';
import Event, {Emitter} from 'vs/base/common/event';
import {TextAreaHandler} from 'vs/editor/common/controller/textAreaHandler';
import {ITextAreaWrapper, IClipboardEvent, IKeyboardEventWrapper, ISimpleModel, TextAreaStrategy} from 'vs/editor/common/controller/textAreaState';
import {GlobalScreenReaderNVDA} from 'vs/editor/common/config/commonEditorConfig';
class ClipboardEventWrapper implements IClipboardEvent {
......@@ -261,6 +262,9 @@ export class KeyboardHandler extends ViewEventHandler implements Lifecycle.IDisp
DomUtils.StyleMutator.setTop(this.textArea.actual, 0);
DomUtils.removeClass(this.viewHelper.viewDomNode, 'ime-input');
}));
this._toDispose.push(GlobalScreenReaderNVDA.onChange((value) => {
this.textAreaHandler.setStrategy(this._getStrategy());
}));
this.context.addEventHandler(this);
......@@ -274,7 +278,10 @@ export class KeyboardHandler extends ViewEventHandler implements Lifecycle.IDisp
}
private _getStrategy(): TextAreaStrategy {
if (this.context.configuration.editor._screenReaderNVDA) {
if (GlobalScreenReaderNVDA.getValue()) {
return TextAreaStrategy.NVDA;
}
if (this.context.configuration.editor.experimentalScreenReader) {
return TextAreaStrategy.NVDA;
}
return TextAreaStrategy.IENarrator;
......@@ -288,7 +295,7 @@ export class KeyboardHandler extends ViewEventHandler implements Lifecycle.IDisp
// Give textarea same font size & line height as editor, for the IME case (when the textarea is visible)
DomUtils.StyleMutator.setFontSize(this.textArea.actual, this.context.configuration.editor.fontSize);
DomUtils.StyleMutator.setLineHeight(this.textArea.actual, this.context.configuration.editor.lineHeight);
if (e._screenReaderNVDA) {
if (e.experimentalScreenReader) {
this.textAreaHandler.setStrategy(this._getStrategy());
}
return false;
......
......@@ -6,6 +6,7 @@ define([
'vs/editor/browser/widget/codeEditorWidget',
'vs/editor/browser/widget/diffEditorWidget',
'vs/editor/contrib/accessibility/browser/accessibility',
'vs/editor/contrib/clipboard/browser/clipboard',
'vs/editor/contrib/codelens/browser/codelens',
'vs/editor/contrib/color/browser/color',
......
......@@ -4,8 +4,6 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import nls = require('vs/nls');
import Lifecycle = require('vs/base/common/lifecycle');
import DomUtils = require('vs/base/browser/dom');
import EventEmitter = require('vs/base/common/eventEmitter');
......@@ -174,7 +172,7 @@ export class View extends ViewEventHandler implements EditorBrowser.IView, Lifec
this.textArea.setAttribute('autocorrect', 'off');
this.textArea.setAttribute('autocapitalize', 'off');
this.textArea.setAttribute('spellcheck', 'false');
this.textArea.setAttribute('aria-label', nls.localize('editorViewAccessibleLabel', "Editor content"));
this.textArea.setAttribute('aria-label', this.context.configuration.editor.ariaLabel);
this.textArea.setAttribute('role', 'textbox');
this.textArea.setAttribute('aria-multiline', 'true');
DomUtils.StyleMutator.setTop(this.textArea, 0);
......@@ -431,6 +429,9 @@ export class View extends ViewEventHandler implements EditorBrowser.IView, Lifec
if (e.stylingInfo) {
Configuration.applyEditorStyling(this.domNode, this.context.configuration.editor.stylingInfo);
}
if (e.ariaLabel) {
this.textArea.setAttribute('aria-label', this.context.configuration.editor.ariaLabel);
}
return false;
}
public onScrollChanged(e:EditorCommon.IScrollEvent): boolean {
......
......@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vs/nls';
import * as EditorCommon from 'vs/editor/common/editorCommon';
import {TPromise} from 'vs/base/common/winjs.base';
import * as Objects from 'vs/base/common/objects';
......@@ -29,6 +30,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {EditorState} from 'vs/editor/common/core/editorState';
import {IKeybindingScopeLocation, IKeybindingService, IKeybindingContextKey} from 'vs/platform/keybinding/common/keybindingService';
import {CommonEditorConfiguration, IIndentationGuesser} from 'vs/editor/common/config/commonEditorConfig';
import {DefaultConfig} from 'vs/editor/common/config/defaultConfig';
var EDITOR_ID = 0;
......@@ -105,6 +107,11 @@ export abstract class CommonCodeEditor extends EventEmitter.EventEmitter impleme
delete options.model;
}
if (typeof options.ariaLabel === 'undefined') {
options.ariaLabel = DefaultConfig.editor.ariaLabel;
}
options.ariaLabel += this._ariaLabelAppendMessage();
this._configuration = this._createConfiguration(options, (tabSize:number) => {
if (this.model) {
return this.model.guessIndentation(tabSize);
......@@ -171,7 +178,18 @@ export abstract class CommonCodeEditor extends EventEmitter.EventEmitter impleme
return new EditorState(this, flags);
}
private _ariaLabelAppendMessage(): string {
let keybindings = this._keybindingService.lookupKeybindings(EditorCommon.SHOW_ACCESSIBILITY_HELP_ACTION_ID);
if (keybindings.length > 0) {
return nls.localize('showAccessibilityHelp', "Press {0} for more info.", this._keybindingService.getLabelFor(keybindings[0]));
}
return '';
}
public updateOptions(newOptions:EditorCommon.IEditorOptions): void {
if (typeof newOptions.ariaLabel !== 'undefined') {
newOptions.ariaLabel += this._ariaLabelAppendMessage();
}
this._configuration.updateOptions(newOptions);
if (this._configuration.editor.tabFocusMode) {
this._editorTabMovesFocusKey.set(true);
......
......@@ -16,6 +16,28 @@ import {HandlerDispatcher} from 'vs/editor/common/controller/handlerDispatcher';
import {EditorLayoutProvider} from 'vs/editor/common/viewLayout/editorLayoutProvider';
import {Disposable} from 'vs/base/common/lifecycle';
/**
* Experimental screen reader support toggle
*/
export class GlobalScreenReaderNVDA {
private static _value = false;
private static _onChange = new Emitter<boolean>();
public static onChange: Event<boolean> = GlobalScreenReaderNVDA._onChange.event;
public static getValue(): boolean {
return this._value;
}
public static setValue(value:boolean): void {
if (this._value === value) {
return;
}
this._value = value;
this._onChange.fire(this._value);
}
}
export class ConfigurationWithDefaults {
private _editor:EditorCommon.IEditorOptions;
......@@ -150,7 +172,8 @@ class InternalEditorOptionsHelper {
scrollbar: scrollbar,
overviewRulerLanes: toInteger(opts.overviewRulerLanes, 0, 3),
cursorBlinking: opts.cursorBlinking,
_screenReaderNVDA: toBoolean(opts._screenReaderNVDA),
experimentalScreenReader: toBoolean(opts.experimentalScreenReader),
ariaLabel: String(opts.ariaLabel),
cursorStyle: opts.cursorStyle,
fontLigatures: toBoolean(opts.fontLigatures),
hideCursorInOverviewRuler: toBoolean(opts.hideCursorInOverviewRuler),
......@@ -228,7 +251,8 @@ class InternalEditorOptionsHelper {
public static createConfigurationChangedEvent(prevOpts:EditorCommon.IInternalEditorOptions, newOpts:EditorCommon.IInternalEditorOptions): EditorCommon.IConfigurationChangedEvent {
return {
_screenReaderNVDA: (prevOpts._screenReaderNVDA !== newOpts._screenReaderNVDA),
experimentalScreenReader: (prevOpts.experimentalScreenReader !== newOpts.experimentalScreenReader),
ariaLabel: (prevOpts.ariaLabel !== newOpts.ariaLabel),
lineNumbers: (prevOpts.lineNumbers !== newOpts.lineNumbers),
selectOnLineNumbers: (prevOpts.selectOnLineNumbers !== newOpts.selectOnLineNumbers),
......
......@@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import EditorCommon = require('vs/editor/common/editorCommon');
import * as nls from 'vs/nls';
import * as EditorCommon from 'vs/editor/common/editorCommon';
export interface IConfiguration {
editor:EditorCommon.IEditorOptions;
......@@ -16,7 +17,8 @@ class ConfigClass implements IConfiguration {
constructor() {
this.editor = {
_screenReaderNVDA: false,
experimentalScreenReader: false,
ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"),
lineNumbers: true,
selectOnLineNumbers: true,
lineNumbersMinChars: 5,
......
......@@ -272,7 +272,8 @@ export function wrappingIndentFromString(wrappingIndent:string): WrappingIndent
* Configuration options for the editor. Common between configuring the editor and the options the editor has computed
*/
export interface ICommonEditorOptions {
_screenReaderNVDA?: boolean;
experimentalScreenReader?: boolean;
ariaLabel?: string;
/**
* Control the rendering of line numbers.
* If it is a function, it will be invoked when rendering a line number and the return value will be rendered.
......@@ -584,7 +585,8 @@ export interface IEditorWrappingInfo {
* Internal configuration options (transformed or computed) for the editor.
*/
export interface IInternalEditorOptions {
_screenReaderNVDA: boolean;
experimentalScreenReader: boolean;
ariaLabel: string;
// ---- Options that are transparent - get no massaging
lineNumbers:any;
......@@ -669,7 +671,8 @@ export interface IInternalEditorOptions {
* An event describing that the configuration of the editor has changed.
*/
export interface IConfigurationChangedEvent {
_screenReaderNVDA: boolean;
experimentalScreenReader: boolean;
ariaLabel: boolean;
// ---- Options that are transparent - get no massaging
lineNumbers: boolean;
......@@ -2410,12 +2413,13 @@ export interface IDiffLineInformation {
equivalentLineNumber: number;
}
export var KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS = 'editorTextFocus';
export var KEYBINDING_CONTEXT_EDITOR_FOCUS = 'editorFocus';
export var KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS = 'editorTabMovesFocus';
export var KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS = 'editorHasMultipleSelections';
export var KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION = 'editorHasSelection';
export var KEYBINDING_CONTEXT_EDITOR_LANGUAGE_ID = 'editorLangId';
export const KEYBINDING_CONTEXT_EDITOR_TEXT_FOCUS = 'editorTextFocus';
export const KEYBINDING_CONTEXT_EDITOR_FOCUS = 'editorFocus';
export const KEYBINDING_CONTEXT_EDITOR_TAB_MOVES_FOCUS = 'editorTabMovesFocus';
export const KEYBINDING_CONTEXT_EDITOR_HAS_MULTIPLE_SELECTIONS = 'editorHasMultipleSelections';
export const KEYBINDING_CONTEXT_EDITOR_HAS_NON_EMPTY_SELECTION = 'editorHasSelection';
export const KEYBINDING_CONTEXT_EDITOR_LANGUAGE_ID = 'editorLangId';
export const SHOW_ACCESSIBILITY_HELP_ACTION_ID = 'editor.action.showAccessibilityHelp';
export interface IDispatcherEvent {
getSource(): string;
......
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-editor .accessibilityHelpWidget {
padding: 10px;
font-family: "Segoe UI", "SFUIText-Light", "HelveticaNeue-Light", sans-serif, "Droid Sans Fallback";
vertical-align: middle;
}
.monaco-editor .accessibilityHelpWidget {
background-color: #EFEFF2;
box-shadow: 0 2px 8px #A8A8A8;
}
.monaco-editor.vs-dark .accessibilityHelpWidget {
background-color: #2D2D30;
box-shadow: 0 2px 8px #000;
}
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import 'vs/css!./accessibility';
import * as nls from 'vs/nls';
import {EditorBrowserRegistry} from 'vs/editor/browser/editorBrowserExtensions';
import {ServicesAccessor} from 'vs/platform/instantiation/common/instantiation';
import {TPromise} from 'vs/base/common/winjs.base';
import {CommonEditorRegistry, ContextKey, EditorActionDescriptor} from 'vs/editor/common/editorCommonExtensions';
import {EditorAction, Behaviour} from 'vs/editor/common/editorAction';
import EditorCommon = require('vs/editor/common/editorCommon');
import {INullService} from 'vs/platform/instantiation/common/instantiation';
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
import EditorBrowser = require('vs/editor/browser/editorBrowser');
import {Disposable} from 'vs/base/common/lifecycle';
import {Widget} from 'vs/base/browser/ui/widget';
import {clearNode, StyleMutator} from 'vs/base/browser/dom';
import {IKeybindingService, IKeybindingContextKey} from 'vs/platform/keybinding/common/keybindingService';
import {ToggleTabFocusModeAction} from 'vs/editor/contrib/toggleTabFocusMode/common/toggleTabFocusMode';
import * as Strings from 'vs/base/common/strings';
import {renderHtml} from 'vs/base/browser/htmlContentRenderer';
import {GlobalScreenReaderNVDA} from 'vs/editor/common/config/commonEditorConfig';
import {KeybindingsRegistry} from 'vs/platform/keybinding/common/keybindingsRegistry';
const NLS_SHOW_ACCESSIBILITY_HELP_ACTION_LABEL = nls.localize('ShowAccessibilityHelpAction',"Show Accessibility Help");
const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = 'accessibilityHelpWidgetVisible';
const TOGGLE_EXPERIMENTAL_SCREEN_READER_SUPPORT_COMMAND_ID = 'toggleExperimentalScreenReaderSupport';
class AccessibilityHelpController extends Disposable implements EditorCommon.IEditorContribution {
static ID = 'editor.contrib.accessibilityHelpController';
static get(editor:EditorCommon.ICommonCodeEditor): AccessibilityHelpController {
return <AccessibilityHelpController>editor.getContribution(AccessibilityHelpController.ID);
}
private _editor: EditorBrowser.ICodeEditor;
private _widget: AccessibilityHelpWidget;
constructor(editor:EditorBrowser.ICodeEditor, @IKeybindingService keybindingService: IKeybindingService, @INullService ns) {
super();
this._editor = editor;
this._widget = this._register(new AccessibilityHelpWidget(this._editor, keybindingService));
}
public getId(): string {
return AccessibilityHelpController.ID;
}
public show(): void {
this._widget.show();
}
public hide(): void {
this._widget.hide();
}
}
class AccessibilityHelpWidget extends Widget implements EditorBrowser.IOverlayWidget {
private static ID = 'editor.contrib.accessibilityHelpWidget';
private static WIDTH = 500;
private static HEIGHT = 300;
private _editor: EditorBrowser.ICodeEditor;
private _keybindingService: IKeybindingService;
private _domNode: HTMLElement;
private _isVisible: boolean;
private _isVisibleKey: IKeybindingContextKey<boolean>;
constructor(editor:EditorBrowser.ICodeEditor, keybindingService: IKeybindingService) {
super();
this._editor = editor;
this._keybindingService = keybindingService;
this._isVisibleKey = keybindingService.createKey(CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE, false);
this._domNode = document.createElement('div');
this._domNode.className = 'accessibilityHelpWidget';
StyleMutator.setWidth(this._domNode, AccessibilityHelpWidget.WIDTH);
StyleMutator.setHeight(this._domNode, AccessibilityHelpWidget.HEIGHT);
this._domNode.style.display = 'none';
this._domNode.setAttribute('role', 'tooltip');
this._domNode.setAttribute('aria-hidden', 'true');
this._isVisible = false;
this._register(this._editor.addListener2(EditorCommon.EventType.EditorLayout, () => {
if (this._isVisible) {
this._layout();
}
}));
this.onblur(this._domNode, () => {
this.hide();
});
this._editor.addOverlayWidget(this);
}
public dispose(): void {
this._editor.removeOverlayWidget(this);
super.dispose();
}
public getId(): string {
return AccessibilityHelpWidget.ID;
}
public getDomNode(): HTMLElement {
return this._domNode;
}
public getPosition(): EditorBrowser.IOverlayWidgetPosition {
return {
preference: null
};
}
public show(): void {
if (this._isVisible) {
return;
}
this._isVisible = true;
this._isVisibleKey.set(true);
this._layout();
this._domNode.style.display = 'block';
this._domNode.setAttribute('aria-hidden', 'false');
this._domNode.tabIndex = 0;
this._buildContent();
this._domNode.focus();
}
private _descriptionForCommand(commandId:string, msg:string, noKbMsg:string): string {
let keybindings = this._keybindingService.lookupKeybindings(commandId);
if (keybindings.length > 0) {
return Strings.format(msg, this._keybindingService.getLabelFor(keybindings[0]));
}
return Strings.format(noKbMsg, commandId);
}
private _buildContent() {
let opts = this._editor.getConfiguration();
let text = nls.localize('introMsg', "Thank you for trying out VS Code's experimental accessibility options.");
text += '\n\n' + nls.localize('status', "Status:");
const NLS_TAB_FOCUS_MODE_ON = nls.localize('tabFocusModeOnMsg', "Pressing Tab in this editor will move focus to the next focusable element. Toggle this behaviour by pressing {0}.");
const NLS_TAB_FOCUS_MODE_ON_NO_KB = nls.localize('tabFocusModeOnMsgNoKb', "Pressing Tab in this editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding.");
const NLS_TAB_FOCUS_MODE_OFF = nls.localize('tabFocusModeOffMsg', "Pressing Tab in this editor will insert the tab character. Toggle this behaviour by pressing {0}.");
const NLS_TAB_FOCUS_MODE_OFF_NO_KB = nls.localize('tabFocusModeOffMsgNoKb', "Pressing Tab in this editor will move focus to the next focusable element. The command {0} is currently not triggerable by a keybinding.");
if (opts.tabFocusMode) {
text += '\n\n -' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, NLS_TAB_FOCUS_MODE_ON, NLS_TAB_FOCUS_MODE_ON_NO_KB);
} else {
text += '\n\n -' + this._descriptionForCommand(ToggleTabFocusModeAction.ID, NLS_TAB_FOCUS_MODE_OFF, NLS_TAB_FOCUS_MODE_OFF_NO_KB);
}
const NLS_EXPERIMENTAL_SCREENREADER_OPTS_ON = nls.localize('experimentalScreenReaderOptsOn', "Experimental screen reader support is turned on due to editor.experimentalScreenReader settings key.");
const NLS_EXPERIMENTAL_SCREENREADER_SESSION_ON = nls.localize('experimentalScreenReaderSessionOff', "Experimental screen reader support is turned on for this session. Toggle this behaviour by pressing {0}.");
const NLS_EXPERIMENTAL_SCREENREADER_SESSION_ON_NO_KB = nls.localize('experimentalScreenReaderSessionOffNoKb', "Experimental screen reader support is turned on for this session. The command {0} is currently not triggerable by a keybinding.");
const NLS_EXPERIMENTAL_SCREENREADER_SESSION_OFF = nls.localize('experimentalScreenReaderSessionOff', "Experimental screen reader support is turned off. Turn it on for this session by pressing {0} or turn it on for all sessions by configuring the editor.experimentalScreenReader setting to true.");
const NLS_EXPERIMENTAL_SCREENREADER_SESSION_OFF_NO_KB = nls.localize('experimentalScreenReaderSessionOffNoKb', "Experimental screen reader support is turned off. The command {0} is currently not triggerable by a keybinding. Turn it on for all sessions by configuring the editor.experimentalScreenReader setting to true.");
if (opts.experimentalScreenReader) {
text += '\n\n - ' + NLS_EXPERIMENTAL_SCREENREADER_OPTS_ON;
} else {
if (GlobalScreenReaderNVDA.getValue()) {
text += '\n\n -' + this._descriptionForCommand(TOGGLE_EXPERIMENTAL_SCREEN_READER_SUPPORT_COMMAND_ID, NLS_EXPERIMENTAL_SCREENREADER_SESSION_ON, NLS_EXPERIMENTAL_SCREENREADER_SESSION_ON_NO_KB);
} else {
text += '\n\n -' + this._descriptionForCommand(TOGGLE_EXPERIMENTAL_SCREEN_READER_SUPPORT_COMMAND_ID, NLS_EXPERIMENTAL_SCREENREADER_SESSION_OFF, NLS_EXPERIMENTAL_SCREENREADER_SESSION_OFF_NO_KB);
}
}
text += '\n\n' + nls.localize('outroMsg', "You can dismiss this tooltip and return to the editor by pressing Escape.");
this._domNode.appendChild(renderHtml({
formattedText: text
}));
}
public hide(): void {
if (!this._isVisible) {
return;
}
this._isVisible = false;
this._isVisibleKey.reset();
this._domNode.style.display = 'none';
this._domNode.setAttribute('aria-hidden', 'true');
this._domNode.tabIndex = -1;
clearNode(this._domNode);
this._editor.focus();
}
private _layout(): void {
let editorLayout = this._editor.getLayoutInfo();
let top = Math.round((editorLayout.height - AccessibilityHelpWidget.HEIGHT) / 2);
StyleMutator.setTop(this._domNode, top);
let left = Math.round((editorLayout.width - AccessibilityHelpWidget.WIDTH) / 2);
StyleMutator.setLeft(this._domNode, left);
}
}
class ShowAccessibilityHelpAction extends EditorAction {
constructor(descriptor:EditorCommon.IEditorActionDescriptorData, editor:EditorCommon.ICommonCodeEditor, @INullService ns) {
super(descriptor, editor, Behaviour.WidgetFocus);
}
public run(): TPromise<boolean> {
let controller = AccessibilityHelpController.get(this.editor);
controller.show();
return TPromise.as(true);
}
}
EditorBrowserRegistry.registerEditorContribution(AccessibilityHelpController);
CommonEditorRegistry.registerEditorAction(new EditorActionDescriptor(ShowAccessibilityHelpAction, EditorCommon.SHOW_ACCESSIBILITY_HELP_ACTION_ID, NLS_SHOW_ACCESSIBILITY_HELP_ACTION_LABEL, {
context: ContextKey.EditorFocus,
primary: KeyMod.Alt | KeyCode.F1
}));
CommonEditorRegistry.registerEditorCommand('closeAccessibilityHelp', CommonEditorRegistry.commandWeight(100), { primary: KeyCode.Escape }, false, CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE, (ctx, editor, args) => {
AccessibilityHelpController.get(editor).hide();
});
KeybindingsRegistry.registerCommandDesc({
id: TOGGLE_EXPERIMENTAL_SCREEN_READER_SUPPORT_COMMAND_ID,
handler: (accessor: ServicesAccessor, args: any) => {
let currentValue = GlobalScreenReaderNVDA.getValue();
GlobalScreenReaderNVDA.setValue(!currentValue);
},
weight: KeybindingsRegistry.WEIGHT.workbenchContrib(),
context: null,
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_R
});
......@@ -12,9 +12,9 @@ import EditorCommon = require('vs/editor/common/editorCommon');
import {INullService} from 'vs/platform/instantiation/common/instantiation';
import {KeyMod, KeyCode} from 'vs/base/common/keyCodes';
class ToggleTabFocusModeAction extends EditorAction {
export class ToggleTabFocusModeAction extends EditorAction {
static ID = 'editor.action.toggleTabFocusMode';
public static ID = 'editor.action.toggleTabFocusMode';
constructor(descriptor:EditorCommon.IEditorActionDescriptorData, editor:EditorCommon.ICommonCodeEditor, @INullService ns) {
super(descriptor, editor, Behaviour.TextFocus);
......
......@@ -122,7 +122,7 @@ export class KeybindingResolver {
if (KeybindingResolver.contextIsEntirelyIncluded(true, conflict.context, item.context)) {
// `item` completely overwrites `conflict`
if (this._shouldWarnOnConflict && isDefault) {
console.warn('Conflict detected, command `' + conflict.commandId + '` cannot be triggered by ' + Keybinding.toUserSettingsLabel(keypress));
console.warn('Conflict detected, command `' + conflict.commandId + '` cannot be triggered by ' + Keybinding.toUserSettingsLabel(keypress) + ' due to ' + item.command);
}
this._lookupMapUnreachable[conflict.commandId] = this._lookupMapUnreachable[conflict.commandId] || [];
this._lookupMapUnreachable[conflict.commandId].push(conflict.keybinding);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册