# code/editor/language (zidane-ui/code/editor)

Import: `import { … } from 'zidane-ui/code/editor'`. Source: [ui/src/code/editor/language.ts](https://github.com/Tahul/zidane/blob/main/ui/src/code/editor/language.ts).

## Interfaces

### `EditorLanguage`

Interface.

The language service an `EditorColumn` talks to; see the module comment.

```ts
interface EditorLanguage
```

**Properties**

- `definition` (`(path: string, line: number, column: number) => Promise<readonly EditorDefinition[]>`): Where the symbol at a 1-based (line, column) is defined, with the symbol's extent when known; empty when unknown.
- `diagnostics` (`(path: string, listener: (items: readonly EditorDiagnostic[] | null) => void) => () => void`): Hears a file's findings (`null` while a check runs); returns the unsubscribe.
- `handles` (`(path: string) => boolean`): Whether it serves this path (by extension, usually).
- `hover` (`(path: string, line: number, column: number) => Promise<string | null>`): Markdown for the symbol at a 1-based (line, column), or `null`.
- `name` (`string`): Who checks, for the chip's tooltip (`TypeScript`).
- `references` (`(path: string, line: number, column: number) => Promise<readonly EditorLocation[]>`): Every use of the symbol at a 1-based (line, column); empty when unknown.
- `update` (`(path: string, text: string) => void`): An open file's text: on open, then after each burst of edits (debounced by the editor).

Source: [ui/src/code/editor/language.ts:10](https://github.com/Tahul/zidane/blob/main/ui/src/code/editor/language.ts#L10)

### `EditorReveal`

Interface.

A navigation into a file, from a definition or a reference.

```ts
interface EditorReveal extends EditorLocation
```

**Properties**

- `column` (`number`, from `EditorLocation`): 1-based column.
- `line` (`number`, from `EditorLocation`): 1-based line.
- `nonce` (`number`): Bump it to reveal the same location again.
- `path` (`string`, from `EditorLocation`): Relative to the editor's root.

Source: [ui/src/code/editor/language.ts:28](https://github.com/Tahul/zidane/blob/main/ui/src/code/editor/language.ts#L28)
