Skip to content

External Files and Tools

How do I write an importer?

Where do I put my JARs?

Specific Languages Blog — Where do I put my JARs?

Files

I want to load an external file into MPS / I want to migrate existing data into MPS.1

Write a solution that imports the files and converts them to your model or use custom persistence. Here is a tutorial series to get started Make sure to search the other posts for followup posts of this tutorial.

Tools

I want to run an LSP server for MPS grammars.

There is no support for this in IntellJ products (see this ticket) and also no implementation in MPS.

I want to use databases in MPS.

I want to create a standalone utility (not a complete IDE) for language generation with MPS.2

Not possible at the moment but you can interact with MPS models from Java when you setup the necessary dependencies:

import jetbrains.mps.smodel.ModelAccess;
import jetbrains.mps.tool.environment.EnvironmentConfig;
import jetbrains.mps.project.Project;
import jetbrains.mps.tool.environment.MpsEnvironment;
import org.jetbrains.mps.openapi.model.SModel;
import org.jetbrains.mps.openapi.module.SModule;

import java.io.File;

public class Test {
    static String projectDir = "your MPS project path";

    public static void main(String[] args) {
        EnvironmentConfig config = EnvironmentConfig.emptyConfig();
        MpsEnvironment ourEnv = new MpsEnvironment(config);
        ourEnv.init();
        Project myProject = ourEnv.openProject(new File(projectDir));
        myProject.getModelAccess().runReadAction(() -> {
            for(SModule module:myProject.getProjectModules()) {
                for(SModel model:module.getModels()) {
                System.out.println(model.getName());
                }
            }
        });
    }
}

I want to share MPS snippets.

You can use Skadi Cloud Gists.

I want to run MPS in the browser.

You can try Skadi Cloud.

How do I correctly run git clean?

Specific Languages Blog — mpsclean


Last update: March 17, 2022

Comments

Back to top