Skip to content

FileSuggestManager

Properties

app

app: App

Reference to the app


fileSuggestions

fileSuggestions: null | object[]

Selection of files and their paths that can be matched to


global

global: boolean

Whether search should be vault-wide rather than scoped to current file


mode

mode: string

Type of suggestions that should be provided


runnable

runnable: null | Runnable

Executor of the search

Methods

getBlockSuggestions()

getBlockSuggestions(runner, file, text): Promise<SearchResult[]>

Get suggestions for block query

Parameters

runner: Runnable

file: TFile

text: string

Returns

Promise<SearchResult[]>


getDisplaySuggestions()

getDisplaySuggestions(runner, linkpath, subpath, alias): Promise<SearchResult[]>

Get suggestions for display alias query

Parameters

runner: Runnable

linkpath: string

subpath: string

alias: string

Returns

Promise<SearchResult[]>


getFileSuggestions()

getFileSuggestions(runner, text): Promise<SearchResult[]>

Get suggestions for file query

Parameters

runner: Runnable

text: string

Returns

Promise<SearchResult[]>


getGlobalBlockSuggestions()

getGlobalBlockSuggestions(runner, text): Promise<SearchResult[]>

Get suggestions for global block query

Parameters

runner: Runnable

text: string

Returns

Promise<SearchResult[]>


getGlobalHeadingSuggestions()

getGlobalHeadingSuggestions(runner, text): Promise<SearchResult[]>

Get suggestions for global heading query

Parameters

runner: Runnable

text: string

Returns

Promise<SearchResult[]>


getHeadingSuggestions()

getHeadingSuggestions(runner, file, text): Promise<SearchResult[]>

Get suggestions for file heading query

Parameters

runner: Runnable

file: TFile

text: string

Returns

Promise<SearchResult[]>


getSourcePath()

getSourcePath(): null | string

Determine the source path of current context

Returns

null | string


getSuggestionsAsync()

getSuggestionsAsync(runner, text): Promise<SearchResult[]>

Get suggestions for current input text

Parameters

runner: Runnable

text: string

Returns

Promise<SearchResult[]>


matchBlock()

matchBlock(path, file, block, sourcePath, content, text_parts): null | SearchResult

Match search fragments to a block

Parameters

path: string

file: TFile

block: BlockCache

sourcePath: null | string

content: string

text_parts: string[]

Returns

null | SearchResult