Add source highlighting and revision-checked diagnostic fixes in both hosts
This commit is contained in:
@@ -141,3 +141,7 @@ The [shared Structure editor](reference-safe-structure.md) adds source-preservin
|
||||
## Shared diagnostics and IntelliJ Problems
|
||||
|
||||
The [shared diagnostics slice](shared-diagnostics.md) adds a View-wide Problems panel, source locations, stale-result withdrawal and native IntelliJ Problems publication/navigation. Validation stays shared and target-isolated; both hosts retain ordinary document Undo/Redo and invalid-draft saving. Generated metadata, richer Java/Row origins, source highlighting and quick fixes remain open.
|
||||
|
||||
## Source highlighting and diagnostic quick fixes
|
||||
|
||||
The [shared highlighting/fixes slice](source-highlighting-fixes.md) adds current source underlines, explicit direction corrections and conservative declaration removal. Both hosts apply lexical edits through their authoritative Undo/Redo transaction. IntelliJ adds native XML annotations and Alt+Enter actions, with revision and publication guards. Generated metadata, richer Java/Column/Row origins, further semantic fixes and project-wide diagnostics remain open.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
Both hosts now provide **Bindings → Problems**. The shared list combines immediate FXML/structural checks with target-side Direct, Computed, Converter, Repeat and Table validation. **Validate View** validates the current draft against the selected successful build. Results include severity and a build/draft qualifier. **Go to FXML**, double-click or Enter opens the authoritative source at the affected declaration without editing the document or adding an undo command.
|
||||
|
||||
Target diagnostics match control/property pairs to binding declarations, Repeat panes to Repeat declarations and Table identities to Tables. Duplicate matching bindings expose each declaration. Unknown/aggregate origins fall back to the document root; malformed XML uses the parser's line/column. This does not guess a Java origin or a particular Column/Row field when metadata supplies only a Table-level location. Local structural checks currently expose document-level locations except XML syntax errors. No protocol change or application execution in the hosts is needed.
|
||||
Target diagnostics match control/property pairs to binding declarations, Repeat panes to Repeat declarations and Table identities to Tables. Duplicate matching bindings expose each declaration. Unknown/aggregate origins fall back to the document root; malformed XML uses the parser's line/column. This does not guess a Java origin or a particular Column/Row field when metadata supplies only a Table-level location. Direction and duplicate-target checks now expose precise ranges through the [source highlighting and fixes slice](source-highlighting-fixes.md); other structural checks retain document-level origins except XML syntax errors. No protocol change or application execution in the hosts is needed.
|
||||
|
||||
## Freshness and lifetime
|
||||
|
||||
@@ -12,7 +12,7 @@ Existing request tickets, source revisions and captured related-draft checks rej
|
||||
|
||||
## IntelliJ adapter
|
||||
|
||||
The IntelliJ adapter publishes the same locations and messages through the native `ProblemsCollector` as `FileProblem` entries grouped under **Neitzel FX Designer**. Severity is exposed in the text and icon. The collector feeds the Problems tool window's Project Errors view; this slice does not install a PSI annotator or source squiggles in Current File. Native file/line/column navigation opens the FXML text editor. The shared panel still uses the shared Source mode in either host.
|
||||
The IntelliJ adapter publishes the same locations and messages through the native `ProblemsCollector` as `FileProblem` entries grouped under **Neitzel FX Designer**. Severity is exposed in the text and icon. The collector feeds the Problems tool window's Project Errors view; the subsequent [highlighting slice](source-highlighting-fixes.md) also installs a native XML annotator and explicit quick fixes. Native file/line/column navigation opens the FXML text editor. The shared panel still uses the shared Source mode in either host.
|
||||
|
||||
The adapter checks the current IDE Document text before publishing queued results, removes superseded entries rather than appending duplicates, isolates editor ownership and withdraws entries on close/project disposal. IDE operations use the EDT with read access; target validation remains outside the IDE process. Host navigation now distinguishes source navigation from Component designer navigation, and standalone source navigation honors offsets in existing or newly opened editors.
|
||||
|
||||
@@ -22,7 +22,7 @@ The pinned IntelliJ build is **263.7307.200**. Its bundled `com.intellij.problem
|
||||
|
||||
Unit tests cover FXML origins, nested bindings, duplicate matching declarations, severity preservation, root fallbacks and malformed XML. The IDE adapter regression checks replacement, independent owners, source mismatch rejection and close/late-result cleanup through the real collector. The shared live scenario checks validation, exact source navigation, stale withdrawal, correction with Undo/Redo and invalid-source recovery in both native standalone and registered IntelliJ launch modes. The registered companion additionally checks native Problems publication, source navigation using collector file/line/column, Undo/Redo invalidation and registered-editor close cleanup.
|
||||
|
||||
Run the bootstrap and registered IDE checks in the [README](../README.md). No manual tests are required for this slice. Previously skipped manual checks remain skipped. Generated metadata, precise Java/Row source origins, source highlighting, quick fixes and broader project-wide diagnostics remain subsequent work.
|
||||
Run the bootstrap and registered IDE checks in the [README](../README.md). No manual tests are required for this slice. Previously skipped manual checks remain skipped. Source highlighting and bounded quick fixes are covered by the subsequent slice. Generated metadata, precise Java/Row source origins and broader project-wide diagnostics remain subsequent work.
|
||||
|
||||
### Qualification — 2026-11-13
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
# 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.
|
||||
Reference in New Issue
Block a user