revealInFileExplorer
Highlights a file or folder in the core file explorer, and resolves only once the explorer has finished taking the focus for it.
The core plugin’s revealInFolder is typed void but is asynchronous at runtime, and the explorer re-activates itself on a later frame. A caller that moves the focus somewhere else right after the reveal — back into an editor, say — loses that race unless it awaits this.
A disabled file explorer reveals nothing, and the returned promise resolves at once.
Import:
import { revealInFileExplorer } from 'obsidian-dev-utils/obsidian/file-explorer';Signature:
function revealInFileExplorer(params: RevealInFileExplorerParams): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
params |
RevealInFileExplorerParams | The parameters. |
Returns: Promise<void> — A Promise that resolves once the explorer has finished revealing.
Links to this page: