mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
Polish language filter button implementation (#147461)
This commit is contained in:
+1
-1
@@ -111,7 +111,7 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
private readonly _onInputDidChange = new Emitter<string | undefined>();
|
||||
readonly onInputDidChange: Event<string | undefined> = this._onInputDidChange.event;
|
||||
|
||||
protected readonly inputWidget: CodeEditorWidget;
|
||||
readonly inputWidget: CodeEditorWidget;
|
||||
private readonly inputModel: ITextModel;
|
||||
protected stylingContainer: HTMLDivElement;
|
||||
private placeholderText: HTMLDivElement;
|
||||
|
||||
@@ -604,9 +604,9 @@ export class SettingsEditor2 extends EditorPane {
|
||||
|
||||
const actionBar = this._register(new ActionBar(this.controlsElement, {
|
||||
animated: false,
|
||||
actionViewItemProvider: (_action) => {
|
||||
if (_action.id === filterAction.id) {
|
||||
return this.instantiationService.createInstance(SettingsSearchFilterDropdownMenuActionViewItem, _action, this.actionRunner, this.searchWidget);
|
||||
actionViewItemProvider: (action) => {
|
||||
if (action.id === filterAction.id) {
|
||||
return this.instantiationService.createInstance(SettingsSearchFilterDropdownMenuActionViewItem, action, this.actionRunner, this.searchWidget);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -6,19 +6,20 @@
|
||||
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import { DropdownMenuActionViewItem } from 'vs/base/browser/ui/dropdown/dropdownActionViewItem';
|
||||
import { IAction, IActionRunner } from 'vs/base/common/actions';
|
||||
import { SuggestController } from 'vs/editor/contrib/suggest/browser/suggestController';
|
||||
import { localize } from 'vs/nls';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { SuggestEnabledInput } from 'vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
|
||||
import { EXTENSION_SETTING_TAG, FEATURE_SETTING_TAG, GENERAL_TAG_SETTING_TAG, ID_SETTING_TAG, LANGUAGE_SETTING_TAG, MODIFIED_SETTING_TAG } from 'vs/workbench/contrib/preferences/common/preferences';
|
||||
|
||||
export class SettingsSearchFilterDropdownMenuActionViewItem extends DropdownMenuActionViewItem {
|
||||
private readonly suggestController: SuggestController | null;
|
||||
|
||||
constructor(
|
||||
action: IAction,
|
||||
actionRunner: IActionRunner | undefined,
|
||||
private readonly searchWidget: SuggestEnabledInput,
|
||||
@IContextMenuService contextMenuService: IContextMenuService,
|
||||
@ICommandService private readonly commandService: ICommandService
|
||||
@IContextMenuService contextMenuService: IContextMenuService
|
||||
) {
|
||||
super(action,
|
||||
{ getActions: () => this.getActions() },
|
||||
@@ -30,6 +31,8 @@ export class SettingsSearchFilterDropdownMenuActionViewItem extends DropdownMenu
|
||||
menuAsChild: true
|
||||
}
|
||||
);
|
||||
|
||||
this.suggestController = SuggestController.get(this.searchWidget.inputWidget);
|
||||
}
|
||||
|
||||
override render(container: HTMLElement): void {
|
||||
@@ -39,8 +42,8 @@ export class SettingsSearchFilterDropdownMenuActionViewItem extends DropdownMenu
|
||||
private doSearchWidgetAction(queryToAppend: string, triggerSuggest: boolean) {
|
||||
this.searchWidget.setValue(this.searchWidget.getValue().trimEnd() + ' ' + queryToAppend);
|
||||
this.searchWidget.focus();
|
||||
if (triggerSuggest) {
|
||||
this.commandService.executeCommand('editor.action.triggerSuggest');
|
||||
if (triggerSuggest && this.suggestController) {
|
||||
this.suggestController.triggerSuggest();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user