<!-- Do not edit this file. It is automatically generated by API Documenter. --> [`WorkspaceLeaf`](WorkspaceLeaf) › [`openFile`](WorkspaceLeaf/openFile) ## WorkspaceLeaf.openFile() method By default, `openFile` will also make the leaf active. Pass in `{ active: false }` to override. **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>`