Skip to content

objectionary/eo-intellij-plugin

Repository files navigation

EO principles respected here DevOps By Rultor.com We recommend IntelliJ IDEA

Lines of code Hits-of-Code Build codecov License

This is Intellij plugin for EO.

Installing is possible from IntelliJ IDEA and other JetBrains family products, such as PyCharm, CLion, and so on. Just type "EO" in plugins search tab and you will find it.

You may also install it from its page at JetBrains Marketplace.

How to Contribute

Fork repository, make changes, send us a pull request. We will review your changes and apply them to the master branch shortly, provided they don't violate our quality standards. To avoid frustration, before sending us your pull request please run full gradle build:

$ gradle build

For checking code quality we use Qulice

$ gradle qulice

You will need Gradle, Maven and Java 14+ installed.

Structure

Project has two parts: manually written and auto-generated.

In src/main you may find source code. Classes listed there are not auto-generated. They describe EO language and .eo extension.

The second part is auto-generated classes. They should be generated from .g4 file and moved into src/java/org/eolang/jetbrains/parser. The grammar will be downloaded automatically during build gradle task. Needed class will be generated at the same time.

Resources (icons and plugin.xml) are located in src/resources.

We use Rultor for publishing (see .rultor.yml).

How it Works

Plugin is implemented in Java and ANTLR4 grammar.

ANTLR4 adapter is used for generating EOLexer and EOParser classes.

Compiling EO sources using plugin

In order to compile eo sources withing the project it must be maven project. Its pom file should contain eo-maven-plugin configuration as follows:

<build>
    <plugins>
      <plugin>
        <groupId>org.eolang</groupId>
        <artifactId>eo-maven-plugin</artifactId>
        <version>0.27.0</version>
        <configuration>
          <foreign>${project.basedir}/target/eo/foreign.csv</foreign>
          <foreignFormat>csv</foreignFormat>
          <hash>master</hash>
          <failOnWarning>true</failOnWarning>
        </configuration>
      </plugin>
    </plugins>
  </build>

Having this set up compilation can be triggered by Build -> EO compile menu action.