Files
NeitzelFXDesigner/docs/source-highlighting-fixes.md
T

36 lines
5.6 KiB
Markdown

# Source highlighting and diagnostic fixes
Both hosts underline current diagnostics in the shared Source editor. **Bindings → Problems** offers a list of explicit fixes for the selected diagnostic and an **Apply diagnostic fix** button. No fix is selected automatically. IntelliJ also publishes native XML annotations with the same ranges and exposes the same actions through **Alt+Enter** in its text editor. Existing Problems navigation remains available.
## Supported actions
- An invalid or missing DirectBinding direction offers `view`, `model` and `both` as separate choices. Only the selected attribute value changes; a missing attribute is inserted.
- A duplicate Direct/Computed target identifies the later declaration and offers removal of that declaration.
- Target validation errors on simple root BindingList DirectBinding, ComputedBinding and Repeat declarations offer explicit removal. Warnings, unknown declarations, nested element payloads, declarations with `fx:id` and Tables do not offer removal.
These actions do not infer Model paths, Controller methods, Converter choices or Column/Row repairs. Removal deletes the chosen declaration; surrounding comments, unrelated declarations, whitespace and quote style remain unchanged. Direction errors highlight the value (or opening tag if missing); other located binding errors highlight the declaration opening tag. Aggregate errors retain their document fallback origin.
## Transactions and freshness
A fix carries lexical replacement ranges tied to the published document snapshot. The shared editor checks the captured revision, exact source, diagnostic generation, offered action and writable state before submitting the existing host edit transaction. Each fix is one normal Undo/Redo command in standalone and IntelliJ. Successful fixes request fresh validation. Edits, related-draft changes, build changes and editor closure invalidate prior evidence and actions.
The IntelliJ annotator reads only current published evidence, never application classes. Its intentions additionally check the publication identity, file, document modification stamp and writable state. The shared callback remains authoritative if an asynchronous action becomes obsolete. The annotator does not write PSI or open its own nested undo command.
The shared editor uses the protected highlight APIs of [JavaFX TextAreaSkin](https://openjfx.io/javadoc/26/javafx.controls/javafx/scene/control/skin/TextAreaSkin.html). Underlines live in the existing scrolling content and do not intercept mouse input or alter selection. Text, font, wrapping and size changes refresh their geometry; source text that no longer matches the evidence has no stale underlines. Native integration follows IntelliJ's [annotator and quick-fix model](https://plugins.jetbrains.com/docs/intellij/syntax-highlighting-and-error-highlighting.html), qualified against the pinned SDK rather than all IDE versions.
## Automated acceptance
Unit checks cover exact lexical changes, missing/empty direction values, duplicate removal, restricted removal eligibility, read-only/stale edits, native range/action availability and independent editor ownership. The shared native-host scenario checks rendered underlines with exact glyph alignment, wrapping/scrolling without caret changes, direction and duplicate fixes, exact source and single-step Undo/Redo. The registered IntelliJ companion additionally checks actual daemon annotations, native intention invocation, exact source ranges, stale-action rejection and highlight withdrawal.
Run the bootstrap and registered IDE checks documented in the [README](../README.md). No manual testing is required. Previously skipped manual gates remain skipped. Project-wide scanning, generated metadata, precise Java/Column/Row origins and additional semantic fixes remain future work.
### Qualification — 2026-11-13
The full bootstrap passed with 138 unit/adapter tests (128 Maven, ten IntelliJ), 36 target processes with 512 fixture checks, 48 lifecycle cycles, connected adapters and packaging/documentation checks. Screenshot review exposed underline geometry being captured before wrapped text layout. The skin now lays out the scrolling content before querying glyph geometry; an exact geometry assertion covers this regression. The final shared build, plugin packaging and connected-host checks passed again after that correction.
The registered native test invokes Undo/Redo through the selected IntelliJ text editor, while the shared checks exercise host document history. Its initial synthetic-editor Undo assertion stalled after the native action had succeeded; using the actual selected editor corrected that test boundary. Other attempts encountered the already recorded initial-preview timeout and a Table-save external-change conflict before the new native check. The startup/persistence reliability follow-ups remain open; source and history assertions were not weakened.
The final registered IntelliJ classpath and module-path runs passed native daemon ranges, Alt+Enter corrections, native Undo/Redo, stale-action rejection, highlight withdrawal, the shared regression suite, Problems cleanup, exclusive JavaFX 26 natives and worker shutdown. No manual testing was used. Final registered evidence: `/tmp/fixes-registered-ide4.log`.
Local evidence: `/tmp/fixes-bootstrap.log`, `/tmp/fixes-layout-build.log`, `/tmp/fixes-layout-plugin.log`, `/tmp/fixes-connected-final.log`, `target/connected-workflow/` and `target/ide-workflow/`. Earlier registered attempts are retained in `/tmp/fixes-registered-ide.log`, `/tmp/fixes-registered-ide2.log` and `/tmp/fixes-registered-ide3.log`. Generated evidence is not a repository input.