code/editor/LanguageEditor
import { … } from 'zidane-ui/code/editor'ui/src/code/editor/LanguageEditor.tsx
Components#
LanguageEditorComponent#
A CodeEditor wired to a language service; see the module comment.
function LanguageEditor(props: LanguageEditorProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | LanguageEditorProps | See |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root element. |
| doc | CodeDocument | The file's state from |
| language | EditorLanguage | null | The service for this file; |
| onDiagnostics? | (path: string, items: readonly EditorDiagnostic[] | null) => void | The file's findings changed ( |
| onNavigate? | (target: EditorLocation) => void | Open a file at a position (a definition, a reference). |
| path | string | The file's path; the language service and navigation targets know it by this. |
| readOnly? | boolean | Never arm the editor. |
| reveal? | EditorReveal | null | Where to go in this file, once per nonce. |
| sessionKey | string | pierre's retained-session key (the draft and undo stack survive remounts under it). |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| visible | boolean | Whether this editor is on screen; focus and ⌘F follow it. |
Constants#
LANGUAGE_DEBOUNCE_MSConstant#
Edits are sent this long after the last keystroke, like the app's language servers.
const LANGUAGE_DEBOUNCE_MS = 300Interfaces#
LanguageEditorPropsInterface#
Props of LanguageEditor.
interface LanguageEditorPropsProperties
| Name | Type | Description |
|---|---|---|
| className? | string | Extra classes on the root element. |
| doc | CodeDocument | The file's state from |
| language | EditorLanguage | null | The service for this file; |
| onDiagnostics? | (path: string, items: readonly EditorDiagnostic[] | null) => void | The file's findings changed ( |
| onNavigate? | (target: EditorLocation) => void | Open a file at a position (a definition, a reference). |
| path | string | The file's path; the language service and navigation targets know it by this. |
| readOnly? | boolean | Never arm the editor. |
| reveal? | EditorReveal | null | Where to go in this file, once per nonce. |
| sessionKey | string | pierre's retained-session key (the draft and undo stack survive remounts under it). |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
| visible | boolean | Whether this editor is on screen; focus and ⌘F follow it. |