Skip to content

create model: report the devkits and used languages that MPS adds to a new model #232

Open

Description

@sergej-koscejev

Problem

With #230, mops create model and Code Mode SModule.createModel run MPS's ModelsAutoImportsManager.performImports before the first save. So a new model gets the devkits and used languages that MPS gives it. For example, a <language>.structure model gets jetbrains.mps.devkit.aspect.structure, and a <language>.editor model gets jetbrains.mps.devkit.general-purpose plus jetbrains.mps.lang.editor and jetbrains.mps.lang.actions.

mops fills these in for the caller, but the output does not show them. Neither the report nor the --dry-run plan lists them. This goes against VISION principle 3, "Make every implicit choice visible".

Current output (cli/src/main/kotlin/com/specificlanguages/mops/cli/create/CreateModelCommand.kt on the #230 branch):

created model repro.lang.structure [r:…] in module repro.lang [l:…]
  persistence: …
  location: …

What to build

  • The create model report lists the devkits and used languages that the new model got, in the human output and in --json (ModelCreationReport).
  • The --dry-run plan lists the devkits and used languages the model would get (ModelCreationPlan), if MPS can compute this without creating the model. If it cannot, the plan says that imports are added on creation.
  • Code Mode createModel returns a normal SModel, so the caller can read its imports. Name this sibling path in the PR.

Explicitly not doing

  • Changing which devkits and languages a model gets. MPS decides that.
  • LanguageAspect.<ASPECT>.createNew, which is MPS's own API.

Acceptance criteria

  • mops create model <language>.structure --module <language> prints the added devkit and used languages.
  • --json output has them as fields.
  • --dry-run shows them, or says that they are added on creation.
  • Generated reference docs and examples are updated.

Depends on #230.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions