Add Behavior Annex language server services - #10
Open
lwrage wants to merge 6 commits into
Open
Conversation
Pin the language server to the Phase 8 OSATE commit, register BA IDE services with language-server scoping, and delegate embedded reference completion through the retained annex node model. Package the BA feature, remove the obsolete ANTLR 4.4 extraction/classpath requirement, and retain compatibility with the OSATE 2.20 diagnostic API.
For language-server, osate-cli, vscode-extension
The previous pin, cf327fe, was a local OSATE commit that never reached osate/osate2, so CI could not check the submodule out at all. That work has since been merged upstream through PRs #3144 through #3150, which also carry the follow-on BA cross-reference, outline, and legacy-annex-removal changes. Move the pin to aafcbaae, the last commit on osate/osate2 master that builds. Master's tip, 0aa9711 "version updates", bumps org.osate.ge.ba to 3.0.0 but leaves org.osate.ge.ba.tests hosted on "[2.2.2,3.0.0)", so Tycho cannot resolve the fragment and the OSATE reactor fails before the language server is reached. That is an upstream defect to fix in osate2, not here. The parent version stays 2.20.0-SNAPSHOT, so aadl-language-server/pom.xml needs no change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Removing the ANTLR 4.4 extraction from the language server repository left the CLI workspace server still demanding antlr-runtime-4.4.jar in its plug-in directory. buildServerClassLoader threw before the embedded server started, so every EndToEndIT case failed with "server died before emitting port" and the only trace went to the workspace log the test does not read. The Behavior Annex parser is generated by Xtext now and uses the ANTLR 3 runtime that ships as an OSGi bundle, so no standalone ANTLR jar is required. Require a non-empty plug-in directory instead, which still catches an empty or misresolved aadl.plugins.dir, and keep the standalone ANTLR 4 runtime excluded to stay in step with dist/pom.xml and the extension's .vscodeignore. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The packaged-runtime check still required two org.antlr.runtime bundles plus antlr-runtime-4.4.jar, so it failed the build after the ANTLR 4.4 extraction was removed even though every test passed. The Xtext-generated Behavior Annex parser links against the ANTLR 3 runtime, and that bundle is the only ANTLR the server needs. Require exactly one org.antlr.runtime bundle at 3.x, which still catches the case the old check existed for: two versions of those classes on one classloader. Now that only one such bundle is expected, drop org.antlr.runtime from the duplicate-bundle exemption so it is covered by that check again. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The pin sat at aafcbaae, one commit behind master, because master's tip 0aa9711 "version updates" bumped org.osate.ge.ba to 3.0.0 while org.osate.ge.ba.tests still declared Fragment-Host org.osate.ge.ba;bundle-version="[2.2.2,3.0.0)". Tycho could not resolve the fragment, so the OSATE reactor failed before the language server was reached. Upstream 37a7f77 "Fix dependency version" widens that range to [3.0.0,4.0.0) and adds the Eclipse project metadata the fragment was missing. Move the pin to master's tip, 0561df2e; the intervening commit only edits releng/osate.releng/OSATE2.launch, which no build reads. The parent version stays 2.20.0-SNAPSHOT, so aadl-language-server/pom.xml needs no change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires the Behavior Annex into the language server now that OSATE serves the annex through Xtext, and follows the consequences of that switch through the extension, the CLI, and the build.
Behavior Annex services
BehaviorAnnexLsSetupmixes the BA runtime and generic IDE modules and is registered both as anISetupservice and inAadl2LsResourceServiceProviderRegistry, so the language-server injectors win theaadlregistration rather than OSATE's Eclipse-oriented ones.BehaviorAnnexLsRuntimeModulekeeps the normal BA runtime services but swaps Eclipse project scoping for the multi-rootAadl2LsGlobalScopeProvider.EmbeddedBehaviorAnnexContentAssistServicehandles completion inside an embedded annex subclause. It locates the annex leaf at the request offset, confirms the enclosingDefaultAnnexSubclauseparsed to aBehaviorAnnex, and either answers reference positions directly fromBehaviorAnnexReferenceProposalServiceor replays the annex text into a synthetic BA resource and delegates. Any position that is not embedded BA text, and any failure, falls through to the normal AADL path.OSATE pin
The branch previously pinned a local OSATE commit that never reached
osate/osate2, so CI could not check the submodule out. That work is now upstream through PRs #3144–#3150, and the pin followsosate/osate2master at0561df2e.It briefly sat one commit behind, at
aafcbaae, because master's tip0aa9711("version updates") bumpedorg.osate.ge.bato 3.0.0 whileorg.osate.ge.ba.testsstill declaredFragment-Host: org.osate.ge.ba;bundle-version="[2.2.2,3.0.0)". Tycho could not resolve the fragment, so the OSATE reactor failed before the language server was reached. Upstream37a7f77("Fix dependency version") widens that range to[3.0.0,4.0.0)and adds the Eclipse project metadata the fragment was missing, so the pin now moves to the tip. The one commit after that fix,0561df2e, only editsreleng/osate.releng/OSATE2.launch, which no build reads.Consequences of the Xtext switch
The legacy BA parser needed ANTLR 4.4, extracted from the
org.osate.babundle into the p2 repository by an antrun step. The Xtext-generated parser links against the ANTLR 3 runtime that already ships as an OSGi bundle, so the extraction and everything downstream of it goes away:org.osate.aadl.ls.repository/pom.xml, and the extension'sserverClasspathrequirement and newer-runtime filter;buildServerClassLoader, which otherwise threw before the embedded server started and failed all fiveEndToEndITcases withserver died before emitting port, logging the cause only to a workspace log the test never reads. It now requires a non-empty plug-in directory, which still catches a misresolvedaadl.plugins.dir;scripts/build-test-release, which expected twoorg.antlr.runtimebundles plusantlr-runtime-4.4.jar. It now requires exactly one at 3.x, which still catches two versions of those classes on one classloader, andorg.antlr.runtimeloses its duplicate-bundle exemption.org.osate.ba.featurejoinscategory.xmlso the annex is packaged, andInstantiateCommandadapts to OSATE 2.20 returning a typed diagnostic kind.Build parallelism
Only the OSATE build is large enough to earn
-T6. The language server, extension, and CLI reactors are small, and serial builds keep their output readable and their module ordering as declared.Validation
./scripts/build-test-releasepasses from a clean state on the0561df2epin — all 145 OSATE modules includingorg.osate.ge.ba.tests— and./scripts/assert-test-countsconfirms no suite silently vanished:🤖 Generated with Claude Code