<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`WorkspaceLeaf`](WorkspaceLeaf) › [`openFile`](WorkspaceLeaf/openFile) ## WorkspaceLeaf.openFile() method Open a file in this leaf. **Signature:** ```typescript openFile(file: TFile, openState?: OpenViewState): Promise<void>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | <code>file</code> | [`TFile`](TFile) | | | <code>openState</code> | [`OpenViewState`](OpenViewState) | _(Optional)_ | **Returns:** `Promise<void>`