fix(export): keep a null export-model name out of the generated documentation - #1544
Merged
Merged
Conversation
…entation The `export <name> for <grammar>` header is optional, so `ExportModel.name` is null for every header-less model - which is every model the repository itself carries. The Xtend original appended that name through StringConcatenation, which appends nothing for null; the migrated `String.formatted` call renders it as the literal text "null" instead, so the resource description manager was documented as "Resource description manager for null resources.". Guard the name with `Strings.emptyIfNull`, the same guard the scope inferrer already applies at its two setDocumentation sites. Align ScopeExpressionCompiler.calledFeature with its export twin as well: the Xtend original used `head`, which yields null on an empty list, whereas the migrated `get(0)` throws. The id list of a feature call type is never empty in practice, so this only aligns the behaviour of an unreachable branch. ExportJvmModelInferrerTest covers the documentation: it parses a header-less export model, installs the derived state and asserts the documentation of the inferred resource description manager. The inferrer resolves an export model's grammar from the `.xtext` file next to it, so the test registers an empty resource under that URI; the documentation under test does not depend on the grammar. Both resources must share a resource set, hence the explicit set up instead of the test utility call, which hands out a fresh resource set per invocation. The test bundle gains the xbase and common.types dependencies the JVM model API needs, and a version bump for its changed sources. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
rubenporras
approved these changes
Sep 21, 2026
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.
Closes the one fidelity gap a blind adversarial review found in the final Xtend→Java batch (#1536), and aligns one twin inconsistency.
What changed
ExportJvmModelInferrer: theexport … for …header is optional, soExportModel.nameis null for every header-less model. The Xtend original appended it throughStringConcatenation, which appends nothing for null; the migrated.formattedcall rendered the text "null" into the generated resource description manager's documentation. The name is now guarded withStrings.emptyIfNull, the same guard the scope inferrer already uses.ScopeExpressionCompiler.calledFeature:get(0)becomes null-on-empty, matching the export twin and the Xtendheadit replaced. Only the exception on an unreachable empty id list changes.ExportJvmModelInferrerTestparses a header-less export model, runs inference and asserts the manager's documentation. It fails before the fix and passes after. The export test bundle gains the two JVM-model dependencies and a version bump for its changed sources.Verification
testBulkApplyingQuickfixSWTBot flake, which reproduces identically without this change.🤖 Generated with Claude Code