Package-level declarations
Types
A fix for a diagnostic: replacement for its range, shown on the menu as label. A label says what a fix does where the replacement alone would not, such as "Remove “the”" for an empty replacement.
The underline of one diagnostic, on layer. It carries the diagnostic's message and fixes itself, so they move with the span as the text around it is edited. By default it is on the layer a TextDiagnosticsState reads, replaces and clears as its own; one on a layer of its own is left to that layer's owner.
One line's result from TextDiagnosticsChecker.check: the diagnostics to underline, and whether the line was completely checked. A complete result is kept until the line's text changes. An incomplete one, such as when a service the checker relies on could not be reached, is underlined and the line goes to TextDiagnosticsChecker.check again on each refresh until a complete result comes back. Each refresh, after any edit, sends every incomplete line again, so a checker that retries something slow should hold off on its own and answer incomplete meanwhile. A failure that will not pass, such as a line the service refuses, is complete, or the line is sent again for as long as it stays.
Finds issues other than spelling, such as grammar, in lines of text.
Underlines what a TextDiagnosticsChecker finds in textState, line by line. Results are kept by line text, so after an edit only the lines that changed, and those whose result was an incomplete LineCheck, go to TextDiagnosticsChecker.check; TextDiagnosticsChecker.checkText sees the whole text every time. Pass it to com.darkrockstudios.texteditor.spellcheck.SpellCheckingTextEditor, which refreshes it as the text changes and opens a menu of the message and fixes on an underline. The underlines are on the diagnostics decoration layer, which it reads and replaces by line; a state made for the same editor later takes over the underlines an earlier one left.
Properties
The default underline color: blue, apart from spell check's red.
The default underline color of a DiagnosticSeverity.Suggestion: a muted gold.
Functions
A LineDiagnostic whose fixes are replacements, each shown as itself.
Remembers a TextDiagnosticsState for textState, following checker and the colors as they change. Pass a stable checker: a new instance checks the whole text again.