JetBrains / MPS-extensions

MPS-extensions aims to ease language development within MPS.
https://jetbrains.github.io/MPS-extensions/
Apache License 2.0
82 stars 50 forks source link

Implement editor components with parameters #780

Closed alexanderpann closed 6 months ago

alexanderpann commented 7 months ago

The parameter information is saved in the user object of the node instead of the root editor cell. The reason is that on first editor creation, this information can't be accessed.

For updated screenshots: see last answer

Example

Declaration

image image

Usage

image
kbirken commented 7 months ago

Looks useful to be able to pass context information when calling the editor component. Just one proposal on syntax: It would look more consistent if the parameters were shown in the style of "overrides:" and "applicable concept:". I.e., just another section with the parameters:

  applicable concept:
    Interface
  parameters:
    node<> suppliedNode
    string name

BTW: Why is the first parameter in your example shown with type first, and the second parameter with the type after the colon?

alexanderpann commented 7 months ago

I've implemented the feedback by @kbirken and Dennis Albrecht and also fixed the issue with the different parameter syntaxes. I like the way it looks now: