public sealed class CommandPaletteFuzzy search over everything the editor can do, reached with one chord.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
The palette is CommandPalette.vxml; this file is PaletteRow, the record its loop keys on, and the one-line element for the preview pane's own text.
Cheap to build on the registry, and the feature power users judge tooling by — doc 11's words, and the reason it is in the first version of the shell rather than a later one. Nothing here knows what a command is beyond IPaletteSource: commands, assets, scene objects and settings all arrive the same way.
⚠ The field keeps the focus and the rows never take it. A palette where Down moved the focus into the list is one where the next letter typed goes nowhere — so the arrows move a highlight this class owns, and the rows are not focusable at all. It is the opposite arrangement to Menu, whose items are the focus, and for the opposite reason: a menu has no text field to protect.
⚠ Rows are rebuilt per query and capped. Ten results is what fits and what anybody reads; a palette that realised a thousand rows to show ten would be the tree view's virtualisation problem without the tree view's payoff. ⚠ They are no longer pooled, which wave 6 deleted — a keyed @for is the pool, and palette-row.parked is now reached by nothing in this assembly.
Fields and properties (11)
protected override string TagNamepublic int LimitHow many results are shown.
public bool GroupBySourceWhether the best results are kept together by the source they came from.
public bool RequiresQueryWhether an empty query shows nothing rather than asking the sources.
public SearchBox FieldWhat is typed into it.
public UiElement ListWhere the rows go.
public UiElement EmptyPartWhat it says when nothing matched.
public UiElement PreviewPartThe pane under the rows describing whatever is highlighted.
public IReadOnlyList<IPaletteSource> SourcesWhere it looks, in order.
public IReadOnlyList<PaletteItem> ResultsWhat it is currently showing, best first.
public int HighlightedWhich result is highlighted, or -1.
Methods (8)
protected override void OnCreated()protected override void OnRemoved()public void AddSource(IPaletteSource source)Adds somewhere for it to look.
public void OpenPalette()Opens it in the middle of the top of the document, empty.
public bool Accept()Runs the highlighted result and closes.
public void Move(int delta)Moves the highlight.
public void Refresh()Asks every source what matches what is typed, and shows the best of it.
protected override void OnOpened()Called after it opens.
Used by (8)
- EditorApplicationVixen.Editor.App
- EditorChromeVisualTestsVixen.Editor.Ui.Tests
- EditorCombinatorPairTestsVixen.Editor.App.Tests
- EditorShellVixen.Editor.Ui
- EditorShellTestsVixen.Editor.Ui.Tests
- MilestoneE3TestsVixen.Editor.App.Tests
- PaletteTestsVixen.Editor.Ui.Tests
- SelfHandlerKeyTestsVixen.Editor.Ui.Tests