Skip to content

Merge maintenance/mps20261 into master - #1937

Closed
github-actions[bot] wants to merge 50 commits into
masterfrom
merge/master
Closed

github-actions[bot] wants to merge 50 commits into
masterfrom
merge/master

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Merge changes from maintenance/mps20261 to master.

kbirken and others added 17 commits August 28, 2026 16:26
Details:
- Add test to reproduce the problem
- Add fix for iets3.os issue and prepare fixing iets3.core issue
- Refactor code by introducing ArgumentValueList
- Update CHANGELOG.md
- Fix findings from review
…ribute_vals_1921

Variability: Do not overwrite feature attribute assignments if not necessary
…/mps20251

# Conflicts:
#	code/languages/org.iets3.opensource/solutions/org.iets3.opensource.build/models/org/iets3/opensource/build/build.mps
Merge maintenance/mps20241 into maintenance/mps20251
…/mps20261

Conflict resolution with Claude Opus, as the merge dialog of MPS 2026.1 wasn't usable
(see https://youtrack.jetbrains.com/issue/MPS-40085/Merge-conflict-resolution-Apply-silently-fails-with-IllegalModelAccessError-when-result-needs-reordering).
# Conflicts:
#	code/languages/org.iets3.opensource/languages/org.iets3.variability.configuration.base/models/org.iets3.variability.configuration.base.plugin.mps
#	code/languages/org.iets3.opensource/solutions/org.iets3.opensource.build/models/org/iets3/opensource/build/build.mps
#	code/languages/org.iets3.opensource/tests/test.org.iets3.variability.configuration.base/test.org.iets3.variability.configuration.base.msd
Comparing member values used Object.equals, which throws when a member
is present but mapped to null. Use the null-safe :ne: operator instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
hashCode hashed memberData and recordDeclaration, while equals compared
only memberData, so two record values with equal members but different
record declarations were equal with differing hash codes. Compare the
record declaration in equals as well.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
References to literals of a qualified enum were rendered as "Enum:literal" in
the editor but keyed on the bare literal name everywhere else. That mismatch is
the bug: when such a reference broke, the auto-resolve quick fix matched the
persisted bare name and silently rebound it to a same-named literal in a
different enum, changing the text the editor shows.

Make the two namespaces agree, and let MPS's own machinery do the rest:

- EnumLiteral implements ISmartReferent and overrides getPresentation(reference)
  with the new presentableName() -- qualified when the enum is, bare otherwise.
  This feeds NodePresentationUtil#presentation and, through the default cascade,
  getVisibleMatchingText.
- A constraints property getter computes IResolveInfo#resolveInfo from the same
  method. That is the resolution namespace: it keys
  ListScope#forResolvableElements, it is what getMatchingText falls through to,
  and ResolveInfoUpdater rewrites every reference's persisted resolve= string
  from it on save. Computed, never stored -- as baseLanguage's Classifier does
  for nested class names. EnumLiteral was already an IResolveInfo via
  IValidNamedConcept; only the getter was missing.
- The EnumLiteralRef editor uses a ref-presentation cell, so the cell and the
  completion row read that one method instead of two functions that happened to
  agree. The cell gets an explicit id so editor tests need not name a
  generated one.

That makes the special-casing unnecessary, so it goes:

- QualifierRef, the auxiliary two-step concept for reaching a qualified enum's
  literals, with its editor and constraints. It had no instances, no typesystem
  rule, and was always an error node when persisted.
- Both hand-written EnumLiteralRef substitute menus. MPS regenerates the
  equivalent from the implicit smart reference attribute, and it now reads its
  matching text from ISmartReferent.
- The qualified filter in the EnumLiteralRef scope. What keeps a qualified
  enum's literals out of the general completion list is PatternUtil requiring
  the first typed character to match, so they surface only once the enum name
  is typed.

renderReadable() now agrees with the editor for qualified enums.

Five EditorTestCases in test.kernelf.editor.enums cover bare-name binding,
the cross-enum case that motivated this, the negative case, the qualified
name, and retyping to a sibling literal.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
getUniquelyNamedElements() collected ValExpression/LocalVarDeclExpr from
thisNode.body.descendants, which also walks into BaseCommentAttribute
children. Commented out declarations therefore reached
check_ContainerOfUniqueNames and were reported as duplicate names.

Skip elements that have a BaseCommentAttribute ancestor. BlockExpression's
implementation needs no change, since it reads the expressions role directly
and commented out children do not live there.

Adds a NodesTestCase commentedOutUniqueNames covering a commented out val
duplicating a live val and a commented out local var duplicating an argument.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
compareTo threw a NullPointerException for a record value without a
record declaration -- what the interpreter builds for inline records --
because effectiveMembers() returns null for a null node. Such a record
now compares by member name instead.

Member values that were null were skipped entirely, which made the
ordering intransitive: {y:1} vs {y:null} and {y:null} vs {y:2} both
compared equal while {y:1} vs {y:2} did not, so a TreeSet of the three
held two elements. A member without a value now sorts before one that
has a value.

Adds test cases for both, plus a regression test for the equals()
NullPointerException fixed in 7ec5d2e.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
EnumLiteral now computes IResolveInfo#resolveInfo as "Enum:literal" for
qualified enums, and MPS's ResolveInfoUpdater refreshes the persisted resolve=
attribute of every reference from it on save. This is that one-time rewrite,
produced by Force Save All so it lands in one place rather than trickling into
unrelated commits.

Only references into the four qualified enums are affected -- 34 attributes
across two test models, no other change in either file. resolve= is a hint for
re-resolving a broken reference, not the binding itself, which is by node id,
so nothing changes semantically. What it buys is that a reference to
Starbucks:large can no longer be auto-resolved onto a different enum's "large".

Models elsewhere that reference a qualified enum's literals will take the same
rewrite the next time they are saved.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Merge maintenance/mps20251 into maintenance/mps20261
kbirken
kbirken previously approved these changes Sep 1, 2026

@kbirken kbirken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cascading merge, no conflicts.

renovate Bot and others added 7 commits September 1, 2026 10:51
…ch-mpsversion

Update dependency com.jetbrains:mps to v2025.1.3 (maintenance/mps20251)
…ch-third-party-minor

Update dependency com.mbeddr:platform to v2024.1.26573.0352a59 (maintenance/mps20241)
…dle-9.x

Update Gradle to v9.7.1 (maintenance/mps20241)
…rd-party-minor

Update third-party-minor to 1.31.+ (maintenance/mps20241)
arimer and others added 18 commits September 3, 2026 08:48
Fix NullPointerExceptions and contract violations in RecordValue
IFunctionLike: ignore commented out code in unique name check
The IDotTarget refactoring (#1846) moved `EnumIsTarget.literal` up to the new
AbstractEnumSingleInTarget and `EnumIsInTarget.selectors` up to the new
AbstractEnumInTarget, leaving the old links behind as deprecated `literal_old`
and `selectors_old`. Until a model runs migration 006/007 it therefore renders
as empty and no longer generates, which forces every downstream project to
migrate at once - awkward while feature branches are in flight.

Defer the access behind two behavior methods and let the legacy concepts
override them:

- AbstractEnumSingleInTarget.effectiveLiteral() returns `literal`; EnumIsTarget
  overrides it to fall back to `literal_old`.
- AbstractEnumInTarget.effectiveSelectors() returns `selectors`; EnumIsInTarget
  overrides it to fall back to `selectors_old`.

Everything that used to read the links directly now goes through them: the
behavior aspect (renderReadable, reduce), the three reference macros of the
genjava generator, and the `is()`/`isIn()` interpreter evaluators. This matters
most for `isIn`: it has no template of its own, it is desugared into an `is`
chain by the preprocessEnumIsIn mapping script, and that script's `reduce()`
returned null for an unmigrated node - so the node did not generate at all.

EnumIsTarget and EnumIsInTarget also get their own editors, which add a
reference/child cell for the deprecated element, in red and behind a rendering
condition that hides it as soon as the deprecated link is empty. Unmigrated
models are then legible again:

    ocean.is(<no literal> not migrated: blue)
    c.isIn( not migrated: GREEN, BLUE)

These two editors duplicate the cells of the abstract editors and are meant to
be deleted together with the deprecated links once everyone has migrated.

Also fix renderReadable() of EnumIsInTarget/EnumIsNotInTarget, which rendered
`isIn([, , ])`: the separator was joined onto each selector's presentation
rather than onto the sequence, and resolved to the varargs
String.join(CharSequence, CharSequence...) with no elements.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…patibility

fix: keep enum 'is' and 'isIn' working on unmigrated models
Merge maintenance/mps20251 into maintenance/mps20261
…numLiteralRef-usability

# Conflicts:
#	CHANGELOG.md
Make EnumLiteral an ISmartReferent, drop QualifierRef
…/mps20261

# Conflicts:
#	code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/behavior.mps
#	code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/constraints.mps
#	code/languages/org.iets3.opensource/languages/org.iets3.core.expr.toplevel/models/org/iets3/core/expr/toplevel/editor.mps
Merge maintenance/mps20251 into maintenance/mps20261
@arimer

arimer commented Sep 7, 2026

Copy link
Copy Markdown
Member

Master needs to be updated via #1919 with a green build before we can finalize this PR.

@arimer

arimer commented Oct 6, 2026

Copy link
Copy Markdown
Member

This PR is outated: todo: delete branch and create a new merge/PR

@dbinkele dbinkele closed this Nov 4, 2026
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.

5 participants