External Files and Tools
How do I write an importer?
- Specific Languages Blog — Writing an importer: Introduction
- Specific Languages Blog — Writing an importer: Adding the action to a menu
- Specific Languages Blog — Writing an importer: Invoking from the editor
- Specific Languages Blog — Writing an importer: Error handling considerations
- Specific Languages Blog — Writing an importer: Updating existing nodes
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.
- MPS doesn't have any special support for databases or for example Spring Boot (unlike IntelliJ IDEA) .
- Specific Languages Blog — MPS is not a (relational) database
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