Skip to content

code/editor/DiagnosticAnnotation

import { … } from 'zidane-ui/code/editor'ui/src/code/editor/DiagnosticAnnotation.tsx

Components#

DiagnosticAnnotationComponent#

Lists the findings on one line under that line, each with its glyph, message, source and code.

TypeScript
function DiagnosticAnnotation<D extends EditorDiagnostic>(
  props: DiagnosticAnnotationProps<D>,
): Element
Type parameters
NameTypeDescription
Dextends EditorDiagnostic
Parameters
NameTypeDescription
propsDiagnosticAnnotationProps<D>

items: the line's findings; onAddToChat: shows a per-finding "Add to chat" button.

Element
DiagnosticAnnotation props
NameTypeDescription
className?string

Extra classes on the root element.

itemsreadonly D[]

The findings on this line, in display order.

onAddToChat?(d: D) => void

Called with a finding when its "Add to chat" button is pressed. The button is hidden without it.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/code/editor/DiagnosticAnnotation.tsx:30

Interfaces#

DiagnosticAnnotationPropsInterface#

Props for DiagnosticAnnotation.

TypeScript
interface DiagnosticAnnotationProps<D extends EditorDiagnostic>
DiagnosticAnnotationProps type parameters
NameTypeDescription
Dextends EditorDiagnostic
DiagnosticAnnotationProps properties
NameTypeDescription
className?string

Extra classes on the root element.

itemsreadonly D[]

The findings on this line, in display order.

onAddToChat?(d: D) => void

Called with a finding when its "Add to chat" button is pressed. The button is hidden without it.

style?CSSProperties

Inline styles on the root element, merged after the component's own.

ui/src/code/editor/DiagnosticAnnotation.tsx:14