Skip to content

code/editor/language

import { … } from 'zidane-ui/code/editor'ui/src/code/editor/language.ts

Interfaces#

EditorLanguageInterface#

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

TypeScript
interface EditorLanguage
EditorLanguage properties
NameTypeDescription
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.

namestring

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).

ui/src/code/editor/language.ts:10

EditorRevealInterface#

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

TypeScript
interface EditorReveal extends EditorLocation
EditorReveal properties
NameTypeDescription
columnfrom EditorLocationnumber

1-based column.

linefrom EditorLocationnumber

1-based line.

noncenumber

Bump it to reveal the same location again.

pathfrom EditorLocationstring

Relative to the editor's root.

ui/src/code/editor/language.ts:28