Package-level declarations

Types

Link copied to clipboard
data class Action(val name: String, val apply: (EditorSession) -> Unit)

A quick-fix action that can be applied to resolve a diagnostic.

Link copied to clipboard
data class Diagnostic(val from: DocPos, val to: DocPos, val severity: Severity, val message: String, val source: String? = null, val actions: List<Action> = emptyList())

A diagnostic message attached to a range in the document.

Link copied to clipboard
data class LintConfig(val delay: Long = 750, val markerFilter: (diagnostics: List<Diagnostic>) -> List<Diagnostic>? = null, val tooltipFilter: (diagnostics: List<Diagnostic>) -> List<Diagnostic>? = null, val autoPanel: Boolean = false)

Configuration for the linter.

Link copied to clipboard
data class LintGutterConfig(val hoverTime: Long = 300, val markerFilter: (diagnostics: List<Diagnostic>) -> List<Diagnostic>? = null, val tooltipFilter: (diagnostics: List<Diagnostic>) -> List<Diagnostic>? = null)

Configuration for the lint gutter.

Link copied to clipboard

A lint source function that produces diagnostics for the current editor state.

Link copied to clipboard

Severity levels for diagnostics.

Link copied to clipboard

A suspend lint source function for asynchronous linting.

Properties

Link copied to clipboard

Close the lint diagnostics panel.

Link copied to clipboard

Theme color for error-level diagnostics.

Link copied to clipboard

Theme color for hint-level diagnostics.

Link copied to clipboard

Theme color for info-level diagnostics.

Link copied to clipboard

Default lint keymap bindings.

Link copied to clipboard

Theme color for the diagnostic source label in the lint panel.

Link copied to clipboard

Theme color for warning-level diagnostics.

Link copied to clipboard

Select the next diagnostic after the selection, wrapping to the first one. Returns false when there is none, or when wrapping would select the range that is already selected.

Link copied to clipboard

Open the lint diagnostics panel.

Link copied to clipboard

Select the nearest diagnostic ending before the selection, wrapping to the last one. Returns false when there is none, or when wrapping would land where the selection already starts.

Link copied to clipboard

Effect used to update the set of diagnostics.

Functions

Link copied to clipboard

Get the total number of diagnostics in the given state.

Link copied to clipboard

Make a pending lint run happen right away instead of waiting for the delay. Does nothing when no run is pending, as upstream forceLinting does.

Link copied to clipboard
fun forEachDiagnostic(state: EditorState, callback: (Diagnostic) -> Unit)

Iterate over all diagnostics in the given state.

Link copied to clipboard
fun lintDisplay(config: LintConfig = LintConfig()): Extension

The diagnostic-display half of the linter, without any lint source.

Link copied to clipboard
fun linter(source: LintSource, config: LintConfig = LintConfig()): Extension

Create a linter extension.

fun linter(source: SuspendLintSource, config: LintConfig = LintConfig()): Extension

Create a linter extension with a suspend source.

Link copied to clipboard
fun lintGutter(config: LintGutterConfig = LintGutterConfig()): Extension

Extension that adds a lint gutter column showing colored markers for lines that have diagnostics.

Link copied to clipboard
fun setDiagnostics(view: EditorSession, diagnostics: List<Diagnostic>)

Set diagnostics on an editor view.