This repository contains an implementation of the kotlin type system to be used with the kotlin language in MPS. The implementation relies on MPS coderules.
Several samples from kotlin documentation are also in the project (not in the plugin).
First, install both coderules and kotlin plugins, they can be either:
- downloaded from their respective marketplace pages (coderules, kotlin typesystem),
- installed from MPS, as it is currently only released on EAP channel, you first need to add the following repository to MPS:
https://plugins.jetbrains.com/plugins/eap/list
.
Then, you can toggle usage of coderules in MPS settings via Other Settings -> Typechecking (Enable typechecking with coderules
and Watch model changes and collect updates
are the minimal required for a proper edition experience).
The project requires a version of MPS bundling kotlin (>= 2021.3) with the codesrules plugins to be opened.
Manual building of the plugin can be done through gradle scripts with ./gradlew -b setup.gradle && ./gradlew assemble
, several parameters may be configured in gradle.properties
.
Through MPS, one need to set the coderules_home
path variable or have coderules set up in "deps/coderules" (./gradlew -b setup.gradle installCoderules
will download it there).
The structure of the project gives a starting point to implement your types along with this typesystem implementation. You may also refer to this project for examples.