Intentions are a signature feature of the entire family of JetBrains IDEs, including MPS. An intention is defined in the eponymous language aspect. In order for an intention to be visible, the user has to import the language into their model.
If you want to add an intention to an existing language (for example, adding a great new refactoring to base language, to be invoked via an intention), you could define a new language extending the original language and add the intention there. However, the visibility rule mentioned above means that your users will have to import your language into their model to see the intention. This presents an extra step for the users that they will often forget and become confused.
You can help your users in two ways: by using devkits or by changing the intention as an action.
Using devkits
Define a devkit including your languages and tell your users to import the devkit. This way your users will only need to import the devkit once when they create the model (and since they have to do it anyway they won’t forget). Second, if you later update the devkit with additional languages the users will get extra features automatically.
Intentions as actions
If you don’t or can’t use the devkit approach, you can convert your intention into an action. Contrary to intentions,
actions are defined in a plugin solution and are visible as long as the users have the plugin installed. Creating a
plugin solution is described in the JetBrains MPS Help. In that
solution you define an action and add it to a
special action group called ActionsAsIntentions
(MPS
link,
search for its usages globally to see some examples). Actions added to this group will appear in the intention menu if
they are applicable to the current context.