Skip to content

Connect existing P4 LSP to opt-in embedded Java diagnostics - #252

Merged
opaopa6969 merged 4 commits into
masterfrom
feat/embedded-language-diagnostics
Oct 9, 2026
Merged

opaopa6969 merged 4 commits into
masterfrom
feat/embedded-language-diagnostics

Conversation

@opaopa6969

@opaopa6969 opaopa6969 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #251. Integrates opaopa6969/unlaxer-parser#369, opaopa6969/unlaxer-parser#465, opaopa6969/unlaxer-parser#469 and opaopa6969/unlaxer-parser#470.

The existing P4 extension previously parsed only the first FormulaInfo section and removed CR characters before publishing diagnostics. An explicit embedded-languages Maven profile and tinyExpressionP4Lsp.embeddedLanguageDiagnostics setting now send each untouched, versioned full document through the production FormulaInfo/P4 region bridge and real javac. Both Java sections in production fixture 69 publish diagnostics at original UTF-16 positions. Later-section edits reanalyze the snapshot; stale updates, save, close and unavailable extraction have explicit behavior.

This branch includes current Tiny master 0d84f0d (Tiny 2.1.0, unlaxer 3.3.0-SNAPSHOT). The feature remains disabled by default, with registration behind a dependency-neutral SPI. Current retained-source long code fences use the public production layout API only after the real parser certifies the block; shorter backticks and hash characters in Java bodies remain opaque. FormulaInfo/Tiny identities record the current grammar revision. The build pins the mapping API source and JDK 21.0.9, disables annotation processing and executes no user code.

Validation: clean default LSP/DAP 40 tests and opt-in profile 41 tests, all with zero skips; TypeScript compilation and 7 npm tests; actual packaged launcher over stdio invokes javac, publishes independent positions 41:9 and 69:9 and clears them on close. Tests also cover second-section changes, Unicode/CRLF position 42:9, stale updates, save, invalid regions, feature opt-in and long-fence diagnostic range 2:49–54.

Scope: this is the existing Java Tiny LSP consumer. The underlying Java/Rust mapping contract has independent production fixtures in parser PR #470; its fixed older grammar pin is separate from this current-consumer adaptation. No Rust Tiny LSP implementation or current-long-fence cross-language comparison is claimed. Existing Tiny completion/edit behavior remains unchanged; unclosed Java completion follows in #254. Foreign dependency diagnostics remain explicitly rejected by this single-document adapter. Reverting this PR or disabling the feature restores the prior integration; broader roadmap parents remain open until all accepted consumers are verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Opt in existing P4 LSP to source-mapped embedded Java diagnostics

1 participant