Skip to content

link-and-tag-input-suggest

Completes [[ links and # tags at the caret of any <input> or <textarea>, the way the editor does.

Class Description
LinkAndTagInputSuggest Completes [[ links and # tags inside any <input> or <textarea>. Obsidian’s AbstractInputSuggest treats the whole value as the query and replaces it on selection. This one reads the trigger before the caret and replaces only that, so it works inside free text such as a template or a description setting, and it accepts a <textarea> too. ts new Setting(containerEl).addTextArea((textArea) => \{ new LinkAndTagInputSuggest(\{ app: this.app, inputEl: textArea.inputEl \}); \});
Interface Description
GetVaultTagSuggestionsParams Parameters for getVaultTagSuggestions.
LinkAndTagCompletionTrigger A completion trigger found before the caret.
LinkAndTagInputSuggestConstructorParams Parameters of LinkAndTagInputSuggest.
LinkSuggestion A suggested link.
TagSuggestion A suggested tag.
Function Description
getLinkAndTagCompletionTrigger Finds the [[ link or # tag being typed before the caret. A link trigger is an unclosed [[ on the caret’s line with no | after it, so an alias being typed is left alone. A tag trigger is a # at the start of the text or after whitespace, followed only by tag characters.
getVaultTagSuggestions Gets the tags of every note matching a query, as LinkAndTagInputSuggest and TagListComponent suggest them.
Type Description
LinkAndTagSuggestion A suggestion of LinkAndTagInputSuggest.
Enum Description
LinkAndTagCompletionKind What a completion trigger completes.