mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 (#6381)
* Merge from vscode 8e0f348413f4f616c23a88ae30030efa85811973 * disable strict null check
This commit is contained in:
@@ -27,7 +27,7 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { contrastBorder, editorWidgetBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { contrastBorder, editorWidgetBackground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
||||
|
||||
@@ -321,6 +321,11 @@ registerThemingParticipant((theme, collector) => {
|
||||
collector.addRule(`.monaco-editor .accessibilityHelpWidget { background-color: ${widgetBackground}; }`);
|
||||
}
|
||||
|
||||
const widgetForeground = theme.getColor(editorWidgetForeground);
|
||||
if (widgetBackground) {
|
||||
collector.addRule(`.monaco-editor .accessibilityHelpWidget { color: ${widgetForeground}; }`);
|
||||
}
|
||||
|
||||
const widgetShadowColor = theme.getColor(widgetShadow);
|
||||
if (widgetShadowColor) {
|
||||
collector.addRule(`.monaco-editor .accessibilityHelpWidget { box-shadow: 0 2px 8px ${widgetShadowColor}; }`);
|
||||
|
||||
@@ -9,6 +9,10 @@ import { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IUntitledResourceInput } from 'vs/workbench/common/editor';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
|
||||
class InspectKeyMap extends EditorAction {
|
||||
|
||||
@@ -30,3 +34,24 @@ class InspectKeyMap extends EditorAction {
|
||||
}
|
||||
|
||||
registerEditorAction(InspectKeyMap);
|
||||
|
||||
class InspectKeyMapJSON extends Action {
|
||||
public static readonly ID = 'workbench.action.inspectKeyMappingsJSON';
|
||||
public static readonly LABEL = nls.localize('workbench.action.inspectKeyMapJSON', "Inspect Key Mappings (JSON)");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IKeybindingService private readonly _keybindingService: IKeybindingService,
|
||||
@IEditorService private readonly _editorService: IEditorService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
public run(): Promise<any> {
|
||||
return this._editorService.openEditor({ contents: this._keybindingService._dumpDebugInfoJSON(), options: { pinned: true } } as IUntitledResourceInput);
|
||||
}
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(InspectKeyMapJSON, InspectKeyMapJSON.ID, InspectKeyMapJSON.LABEL), 'Developer: Inspect Key Mappings (JSON)', nls.localize('developer', "Developer"));
|
||||
|
||||
@@ -9,7 +9,7 @@ import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { mixin } from 'vs/base/common/objects';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { URI as uri } from 'vs/base/common/uri';
|
||||
@@ -103,7 +103,6 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
private _onInputDidChange = new Emitter<string | undefined>();
|
||||
readonly onInputDidChange: Event<string | undefined> = this._onInputDidChange.event;
|
||||
|
||||
private disposables: IDisposable[] = [];
|
||||
private readonly inputWidget: CodeEditorWidget;
|
||||
private readonly inputModel: ITextModel;
|
||||
private stylingContainer: HTMLDivElement;
|
||||
@@ -134,31 +133,31 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
contributions: [SuggestController, SnippetController2, ContextMenuController, MenuPreventer, SelectionClipboard],
|
||||
isSimpleWidget: true,
|
||||
});
|
||||
this.disposables.push(this.inputWidget);
|
||||
this._register(this.inputWidget);
|
||||
|
||||
let scopeHandle = uri.parse(resourceHandle);
|
||||
this.inputModel = modelService.createModel('', null, scopeHandle, true);
|
||||
this.inputWidget.setModel(this.inputModel);
|
||||
|
||||
this.disposables.push(this.inputWidget.onDidPaste(() => this.setValue(this.getValue()))); // setter cleanses
|
||||
this._register(this.inputWidget.onDidPaste(() => this.setValue(this.getValue()))); // setter cleanses
|
||||
|
||||
this.disposables.push((this.inputWidget.onDidFocusEditorText(() => {
|
||||
this._register((this.inputWidget.onDidFocusEditorText(() => {
|
||||
if (options.focusContextKey) { options.focusContextKey.set(true); }
|
||||
addClass(this.stylingContainer, 'synthetic-focus');
|
||||
})));
|
||||
this.disposables.push((this.inputWidget.onDidBlurEditorText(() => {
|
||||
this._register((this.inputWidget.onDidBlurEditorText(() => {
|
||||
if (options.focusContextKey) { options.focusContextKey.set(false); }
|
||||
removeClass(this.stylingContainer, 'synthetic-focus');
|
||||
})));
|
||||
|
||||
const onKeyDownMonaco = Event.chain(this.inputWidget.onKeyDown);
|
||||
onKeyDownMonaco.filter(e => e.keyCode === KeyCode.Enter).on(e => { e.preventDefault(); this._onEnter.fire(); }, this, this.disposables);
|
||||
onKeyDownMonaco.filter(e => e.keyCode === KeyCode.DownArrow && (isMacintosh ? e.metaKey : e.ctrlKey)).on(() => this._onShouldFocusResults.fire(), this, this.disposables);
|
||||
this._register(onKeyDownMonaco.filter(e => e.keyCode === KeyCode.Enter).on(e => { e.preventDefault(); this._onEnter.fire(); }, this));
|
||||
this._register(onKeyDownMonaco.filter(e => e.keyCode === KeyCode.DownArrow && (isMacintosh ? e.metaKey : e.ctrlKey)).on(() => this._onShouldFocusResults.fire(), this));
|
||||
|
||||
let preexistingContent = this.getValue();
|
||||
const inputWidgetModel = this.inputWidget.getModel();
|
||||
if (inputWidgetModel) {
|
||||
this.disposables.push(inputWidgetModel.onDidChangeContent(() => {
|
||||
this._register(inputWidgetModel.onDidChangeContent(() => {
|
||||
let content = this.getValue();
|
||||
this.placeholderText.style.visibility = content ? 'hidden' : 'visible';
|
||||
if (preexistingContent.trim() === content.trim()) { return; }
|
||||
@@ -175,7 +174,7 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
|
||||
this.setValue(options.value || '');
|
||||
|
||||
this.disposables.push(modes.CompletionProviderRegistry.register({ scheme: scopeHandle.scheme, pattern: '**/' + scopeHandle.path, hasAccessToAllModels: true }, {
|
||||
this._register(modes.CompletionProviderRegistry.register({ scheme: scopeHandle.scheme, pattern: '**/' + scopeHandle.path, hasAccessToAllModels: true }, {
|
||||
triggerCharacters: validatedSuggestProvider.triggerCharacters,
|
||||
provideCompletionItems: (model: ITextModel, position: Position, _context: modes.CompletionContext) => {
|
||||
let query = model.getValue();
|
||||
@@ -249,11 +248,6 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
private selectAll(): void {
|
||||
this.inputWidget.setSelection(new Range(1, 1, 1, this.getValue().length + 1));
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.disposables = dispose(this.disposables);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// Override styles in selections.ts
|
||||
|
||||
@@ -13,7 +13,7 @@ import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/wor
|
||||
|
||||
export class ToggleMinimapAction extends Action {
|
||||
public static readonly ID = 'editor.action.toggleMinimap';
|
||||
public static readonly LABEL = nls.localize('toggleMinimap', "View: Toggle Minimap");
|
||||
public static readonly LABEL = nls.localize('toggleMinimap', "Toggle Minimap");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -30,16 +30,16 @@ export class ToggleMinimapAction extends Action {
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMinimapAction, ToggleMinimapAction.ID, ToggleMinimapAction.LABEL), 'View: Toggle Minimap');
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleMinimapAction, ToggleMinimapAction.ID, ToggleMinimapAction.LABEL), 'View: Toggle Minimap', nls.localize('view', "View"));
|
||||
|
||||
// {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
// MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
// group: '5_editor',
|
||||
// command: {
|
||||
// id: ToggleMinimapAction.ID,
|
||||
// title: nls.localize({ key: 'miToggleMinimap', comment: ['&& denotes a mnemonic'] }, "Toggle &&Minimap"),
|
||||
// toggled: ContextKeyExpr.equals('config.editor.minimap.enabled', true)
|
||||
// },
|
||||
// order: 2
|
||||
// });
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
group: '5_editor',
|
||||
command: {
|
||||
id: ToggleMinimapAction.ID,
|
||||
title: nls.localize({ key: 'miShowMinimap', comment: ['&& denotes a mnemonic'] }, "Show &&Minimap"),
|
||||
toggled: ContextKeyExpr.equals('config.editor.minimap.enabled', true)
|
||||
},
|
||||
order: 2
|
||||
});
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/wor
|
||||
export class ToggleRenderControlCharacterAction extends Action {
|
||||
|
||||
public static readonly ID = 'editor.action.toggleRenderControlCharacter';
|
||||
public static readonly LABEL = nls.localize('toggleRenderControlCharacters', "View: Toggle Control Characters");
|
||||
public static readonly LABEL = nls.localize('toggleRenderControlCharacters', "Toggle Control Characters");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -31,16 +31,16 @@ export class ToggleRenderControlCharacterAction extends Action {
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleRenderControlCharacterAction, ToggleRenderControlCharacterAction.ID, ToggleRenderControlCharacterAction.LABEL), 'View: Toggle Control Characters');
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleRenderControlCharacterAction, ToggleRenderControlCharacterAction.ID, ToggleRenderControlCharacterAction.LABEL), 'View: Toggle Control Characters', nls.localize('view', "View"));
|
||||
|
||||
// {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
// MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
// group: '5_editor',
|
||||
// command: {
|
||||
// id: ToggleRenderControlCharacterAction.ID,
|
||||
// title: nls.localize({ key: 'miToggleRenderControlCharacters', comment: ['&& denotes a mnemonic'] }, "Toggle &&Control Characters"),
|
||||
// toggled: ContextKeyExpr.equals('config.editor.renderControlCharacters', true)
|
||||
// },
|
||||
// order: 4
|
||||
// });
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
group: '5_editor',
|
||||
command: {
|
||||
id: ToggleRenderControlCharacterAction.ID,
|
||||
title: nls.localize({ key: 'miToggleRenderControlCharacters', comment: ['&& denotes a mnemonic'] }, "Render &&Control Characters"),
|
||||
toggled: ContextKeyExpr.equals('config.editor.renderControlCharacters', true)
|
||||
},
|
||||
order: 5
|
||||
});
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,7 @@ import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/wor
|
||||
export class ToggleRenderWhitespaceAction extends Action {
|
||||
|
||||
public static readonly ID = 'editor.action.toggleRenderWhitespace';
|
||||
public static readonly LABEL = nls.localize('toggleRenderWhitespace', "View: Toggle Render Whitespace");
|
||||
public static readonly LABEL = nls.localize('toggleRenderWhitespace', "Toggle Render Whitespace");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
@@ -39,16 +39,16 @@ export class ToggleRenderWhitespaceAction extends Action {
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleRenderWhitespaceAction, ToggleRenderWhitespaceAction.ID, ToggleRenderWhitespaceAction.LABEL), 'View: Toggle Render Whitespace');
|
||||
registry.registerWorkbenchAction(new SyncActionDescriptor(ToggleRenderWhitespaceAction, ToggleRenderWhitespaceAction.ID, ToggleRenderWhitespaceAction.LABEL), 'View: Toggle Render Whitespace', nls.localize('view', "View"));
|
||||
|
||||
// {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
// MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
// group: '5_editor',
|
||||
// command: {
|
||||
// id: ToggleRenderWhitespaceAction.ID,
|
||||
// title: nls.localize({ key: 'miToggleRenderWhitespace', comment: ['&& denotes a mnemonic'] }, "Toggle &&Render Whitespace"),
|
||||
// toggled: ContextKeyExpr.notEquals('config.editor.renderWhitespace', 'none')
|
||||
// },
|
||||
// order: 3
|
||||
// });
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
group: '5_editor',
|
||||
command: {
|
||||
id: ToggleRenderWhitespaceAction.ID,
|
||||
title: nls.localize({ key: 'miToggleRenderWhitespace', comment: ['&& denotes a mnemonic'] }, "&&Render Whitespace"),
|
||||
toggled: ContextKeyExpr.notEquals('config.editor.renderWhitespace', 'none')
|
||||
},
|
||||
order: 4
|
||||
});
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user