Skip to content

@jsvision/code-editor / formatCodeEditorDiagnosticOverlay

Function: formatCodeEditorDiagnosticOverlay()

formatCodeEditorDiagnosticOverlay(overlay, i18n?, maximumWidth?): readonly string[]

Defined in: code-editor/src/i18n/presentation.ts:96

Formats a structured diagnostic overlay at the final locale-bound view boundary.

Older/custom overlays without metadata retain their compatible rows unchanged.

Parameters

overlay

CodeEditorOverlayPresentation

Controller-owned overlay presentation.

i18n?

I18n = ...

Explicit locale service, defaulting to an isolated English service.

maximumWidth?

number = 240

Available popup content cells.

Returns

readonly string[]

Bounded localized rows.

Example

ts
formatCodeEditorDiagnosticOverlay({
  kind: 'diagnostic',
  items: ['[error] Unexpected token'],
  selected: 0,
  diagnostic: { severity: 'error', detail: 'Unexpected token' },
});