Lookup
Design
A lookup command is a vscode command that instantiates a Lookup with custom Lookup and a Lookup.
Examples of lookup commands include:
- Note Lookup
- Rename Note
- Insert Note Link
- etc.
The basic design of lookup command is outlined in the following pseudocode (Private)
class FooLookupCommand extends BaseCommand {
gatherInputs {
lc = LookupController.create(...)
lp = new FooLookupProvider()
lc.prepareQuickPick(lp)
}
execute {
...
}
}
Concepts
Lookup Command
Any command that makes use of the lookup
widget.
Lookup Controller
Used to create a lookup command. Has the following interface.
constructor(opts: {
nodeType: DNodeType;
buttons: DendronBtn[];
fuzzThreshold?: number;
})
Different lookup commands with instantiate lookup with different modifiers.
Lookup Modifiers
A lookup modifier modifiers how lookup behaves. More details on that here (Private).
Modifiers are passed into lookup using the buttons
property in the constructor. Buttons can be toggled in the UI and when enabled, can affect lookup.
Button come in the following types
- LookupEffectType
- performs some effect (eg. copy note)
- LookupNoteType
- change the default hiearchy name
- LookupSelectionType
- performs an action on current selection
- LookupSplitType
- changes how a note is opened
- LookupFilterType
- changes
onUpdateItems
behavior in the Lookup
- changes
Lookup Provider
Provides results for lookup and controls the updateItems
and onAccept
methods when a user interacts with lookup. Different base classes will provide different implementations of the provider depending on functionality desired.
Related
Past Tasks
- chore: lookup provider history service abstraction by hikchoi · Pull Request #1693 · dendronhq/dendron
- enhance: allow wiki links to be looked up by nickolay-kondratyev · Pull Request #1473 · dendronhq/dendron
Children
Backlinks