Skip to content

Add Behavior Annex language server services - #10

Open
lwrage wants to merge 6 commits into
mainfrom
2445_add_ba_editor_services
Open

Add Behavior Annex language server services#10
lwrage wants to merge 6 commits into
mainfrom
2445_add_ba_editor_services

Conversation

@lwrage

@lwrage lwrage commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

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

BehaviorAnnexLsSetup mixes the BA runtime and generic IDE modules and is registered both as an ISetup service and in Aadl2LsResourceServiceProviderRegistry, so the language-server injectors win the aadl registration rather than OSATE's Eclipse-oriented ones. BehaviorAnnexLsRuntimeModule keeps the normal BA runtime services but swaps Eclipse project scoping for the multi-root Aadl2LsGlobalScopeProvider.

EmbeddedBehaviorAnnexContentAssistService handles completion inside an embedded annex subclause. It locates the annex leaf at the request offset, confirms the enclosing DefaultAnnexSubclause parsed to a BehaviorAnnex, and either answers reference positions directly from BehaviorAnnexReferenceProposalService or 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 follows osate/osate2 master at 0561df2e.

It briefly sat one commit behind, at aafcbaae, 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, so the pin now moves to the tip. The one commit after that fix, 0561df2e, only edits releng/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.ba bundle 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:

  • the antrun extraction in org.osate.aadl.ls.repository/pom.xml, and the extension's serverClasspath requirement and newer-runtime filter;
  • the same requirement in the CLI workspace server's buildServerClassLoader, which otherwise threw before the embedded server started and failed all five EndToEndIT cases with server 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 misresolved aadl.plugins.dir;
  • the packaged-runtime check in scripts/build-test-release, which expected two org.antlr.runtime bundles plus antlr-runtime-4.4.jar. It now requires exactly one at 3.x, which still catches two versions of those classes on one classloader, and org.antlr.runtime loses its duplicate-bundle exemption.

org.osate.ba.feature joins category.xml so the annex is packaged, and InstantiateCommand adapts 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-release passes from a clean state on the 0561df2e pin — all 145 OSATE modules including org.osate.ge.ba.tests — and ./scripts/assert-test-counts confirms no suite silently vanished:

ok       language server AllTests     34 executed
ok       workspace server EndToEndIT  5 executed
ok       assembled CLI CliEndToEndIT  15 executed
ok       CLI ArgParserTest            26 executed
ok       CLI VersionTest              4 executed

🤖 Generated with Claude Code

sei-lwrage and others added 6 commits September 2, 2026 14:55
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>
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.

2 participants