mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 01:00:29 -04:00
Merge from vscode 2b0b9136329c181a9e381463a1f7dc3a2d105a34 (#4880)
This commit is contained in:
@@ -23,6 +23,7 @@ import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { editorWidgetBackground, widgetShadow } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { ScrollType } from 'vs/editor/common/editorCommon';
|
||||
import { SearchWidget, SearchOptions } from 'vs/workbench/contrib/preferences/browser/preferencesWidgets';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
|
||||
export interface KeybindingsSearchOptions extends SearchOptions {
|
||||
recordEnter?: boolean;
|
||||
@@ -257,7 +258,7 @@ export class DefineKeybindingWidget extends Widget {
|
||||
this._chordPart = chordPart;
|
||||
dom.clearNode(this._outputNode);
|
||||
dom.clearNode(this._showExistingKeybindingsNode);
|
||||
new KeybindingLabel(this._outputNode, OS).set(this._firstPart);
|
||||
new KeybindingLabel(this._outputNode, OS).set(withNullAsUndefined(this._firstPart));
|
||||
if (this._chordPart) {
|
||||
this._outputNode.appendChild(document.createTextNode(nls.localize('defineKeybinding.chordsTo', "chord to")));
|
||||
new KeybindingLabel(this._outputNode, OS).set(this._chordPart);
|
||||
|
||||
@@ -330,6 +330,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
this._register(this.searchWidget.onDidChange(searchValue => {
|
||||
clearInputAction.enabled = !!searchValue;
|
||||
this.delayedFiltering.trigger(() => this.filterKeybindings());
|
||||
this.updateSearchOptions();
|
||||
}));
|
||||
this._register(this.searchWidget.onEscape(() => this.recordKeysAction.checked = false));
|
||||
|
||||
@@ -344,6 +345,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
if (e.checked !== undefined) {
|
||||
this.renderKeybindingsEntries(false);
|
||||
}
|
||||
this.updateSearchOptions();
|
||||
}));
|
||||
|
||||
const recordKeysActionKeybinding = this.keybindingsService.lookupKeybinding(KEYBINDINGS_EDITOR_COMMAND_RECORD_SEARCH_KEYS);
|
||||
@@ -364,6 +366,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
this.searchWidget.stopRecordingKeys();
|
||||
this.searchWidget.focus();
|
||||
}
|
||||
this.updateSearchOptions();
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -383,6 +386,17 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
this.actionBar.push([this.recordKeysAction, this.sortByPrecedenceAction, clearInputAction], { label: false, icon: true });
|
||||
}
|
||||
|
||||
private updateSearchOptions(): void {
|
||||
const keybindingsEditorInput = this.input as KeybindingsEditorInput;
|
||||
if (keybindingsEditorInput) {
|
||||
keybindingsEditorInput.searchOptions = {
|
||||
searchValue: this.searchWidget.getValue(),
|
||||
recordKeybindings: !!this.recordKeysAction.checked,
|
||||
sortByPrecedence: !!this.sortByPrecedenceAction.checked
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private createRecordingBadge(container: HTMLElement): HTMLElement {
|
||||
const recordingBadge = DOM.append(container, DOM.$('.recording-badge.disabled'));
|
||||
recordingBadge.textContent = localize('recording', "Recording Keys");
|
||||
@@ -482,6 +496,13 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
}, {});
|
||||
await this.keybindingsEditorModel.resolve(editorActionsLabels);
|
||||
this.renderKeybindingsEntries(false, preserveFocus);
|
||||
if (input.searchOptions) {
|
||||
this.recordKeysAction.checked = input.searchOptions.recordKeybindings;
|
||||
this.sortByPrecedenceAction.checked = input.searchOptions.sortByPrecedence;
|
||||
this.searchWidget.setValue(input.searchOptions.searchValue);
|
||||
} else {
|
||||
this.updateSearchOptions();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -876,7 +897,7 @@ class ActionsColumn extends Column {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.actionBar = dispose(this.actionBar);
|
||||
dispose(this.actionBar);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ export class PreferencesEditor extends BaseEditor {
|
||||
this.sideBySidePreferencesWidget.layout(new DOM.Dimension(dimension.width, dimension.height - headerHeight));
|
||||
}
|
||||
|
||||
getControl(): IEditorControl | null {
|
||||
getControl(): IEditorControl | undefined {
|
||||
return this.sideBySidePreferencesWidget.getControl();
|
||||
}
|
||||
|
||||
@@ -890,8 +890,8 @@ class SideBySidePreferencesWidget extends Widget {
|
||||
}
|
||||
}
|
||||
|
||||
getControl(): IEditorControl | null {
|
||||
return this.editablePreferencesEditor ? this.editablePreferencesEditor.getControl() : null;
|
||||
getControl(): IEditorControl | undefined {
|
||||
return this.editablePreferencesEditor ? this.editablePreferencesEditor.getControl() : undefined;
|
||||
}
|
||||
|
||||
clearInput(): void {
|
||||
|
||||
@@ -53,7 +53,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
|
||||
private handleSettingsEditorOverride(): void {
|
||||
|
||||
// dispose any old listener we had
|
||||
this.editorOpeningListener = dispose(this.editorOpeningListener);
|
||||
dispose(this.editorOpeningListener);
|
||||
|
||||
// install editor opening listener unless user has disabled this
|
||||
if (!!this.configurationService.getValue(USE_SPLIT_JSON_SETTING)) {
|
||||
@@ -144,7 +144,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.editorOpeningListener = dispose(this.editorOpeningListener);
|
||||
this.settingsListener = dispose(this.settingsListener);
|
||||
dispose(this.editorOpeningListener);
|
||||
dispose(this.settingsListener);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user