Skip to content

Conversation

@alexanderpann
Copy link
Collaborator

All intentions can now be customized through the extension point IntentionCustomization (child filter, description, is applicable block, execute method). Note that you can't customize intentions that are not enabled in the current context (node + editor context) e.g. changing is applicable from false to true. The reason is that we first list the existing available intentions which are already filtered according to the applicable block.

@sergej-koscejev
Copy link
Collaborator

Looks acceptable but there's a cyclic dependency between the two models in com.mbeddr.mpsutil.intentions.runtime. It's only models, not modules, so it's not a big deal but still let's keep it one-way unless absolutely necessary.

As an idea for future customizations since I see the 'pass map and modify it' pattern taking hold: to take it a step further, instead of passing a map, an even better API IMO would be to pass in a builder object that would have methods to build the map internally or maybe do something else in the future, but that allows to have multiple methods, e.g. as a convenience or when additional features are needed later.

void customizeIntentions(IntentionCustomizationsBuilder builder) {
  builder.customize(node-ptr/MyIntention/, new IntentionCustomization {
    @Override
    public string getDescription(node<> node, EditorContext editorContext, { ⇒ string } originalImpl) {
      "my customized description";
    }
  });

  // later if we e.g. find that users often only customize descriptions and only use hard-coded constants,
  // we could introduce a simpler way without breaking user code:
  builder.modifyDescription(node-ptr/MyIntention/, "my customized description");
}

@alexanderpann alexanderpann force-pushed the feature/intention_customization branch 3 times, most recently from 34e7439 to f64eded Compare December 10, 2025 06:36
…re/intention_customization

# Conflicts:
#	CHANGELOG.md
@alexanderpann
Copy link
Collaborator Author

Looks acceptable but there's a cyclic dependency between the two models in com.mbeddr.mpsutil.intentions.runtime

The extension point needs to be in the plugin model and is referenced by the runtime. The only way around this would be to move all classes to the plugin.

All other things I fixed.

@alexanderpann alexanderpann merged commit 36f5d7d into maintenance/mps20251 Dec 12, 2025
2 checks passed
@alexanderpann alexanderpann deleted the feature/intention_customization branch December 12, 2025 06:24
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.

3 participants