Issues trying to create a Custom language support plugin, following the new Gradle building format (following tutorial)

Answered

Hello, 

 

I began to develop a custom language support plugin, as described in the tutorial https://www.jetbrains.org/intellij/sdk/docs/tutorials/custom_language_support_tutorial.html,

following the directives to use Gradle to build it, the new build flow.

However, after step 9~10, things stopped working at all, and right now, trying to make it work, I may have messed things up a lot.

I'm using as a mine development platform:

"IntelliJ IDEA 2020.1 EAP (Community Edition)
Build #IC-201.4865.12, built on February 4, 2020
Runtime version: 11.0.6+8-b702.1 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.3.0-29-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 1981M
Cores: 8
Registry:
Non-Bundled Plugins: PsiViewer, org.jetbrains.idea.grammar"

The custom language support I'm building with the example, for now, my project is currently stored on 

https://github.com/lvcargnini/systemverilog_language_plugin

The goal is once the example is working, move ahead to support SystemVerilog, with all the bezels of IntelliJ, but that is a bit far ahead, for now, I'm trying to get the example building.

By the error it seems the Gradle is not using/looking in the Classes generated code from the BNF.

```import org.lvcargnini.systemverilog_language_plugin.psi.SystemVerilogProperty;
^
symbol: class SystemVerilogProperty
location: package org.lvcargnini.systemverilog_language_plugin.psi```

error: cannot find symbol
List<SystemVerilogProperty> properties = SystemVerilogUtil.findProperties(project, key);
^
symbol: class SystemVerilogProperty
location: class SystemVerilogAnnotator

0
4 comments

There are three problems with your project:

 

1. The issue with missing SystemVerilogProperty class is because your gen directory with generated PSI classes is not in your classpath. Add the following line to the Grale configuration:

sourceSets.main.java.srcDirs = ['src/main/gen', 'src/main/java']

 

2. Some of the SDK classes are not resolved:

import com.intellij.psi.impl.source.tree.java.PsiJavaTokenImpl;

In Gradle file, you have to specify a dependency to the java plugin:

intellij {
version '2019.3.2'
plugins 'java'
}

 

3. SystemVerilogSyntaxHighlighter.java file has an incorrect name - it contains SystemVerilogSyntaxHighLighter class, so it should be SystemVerilogSyntaxHighLighter.java 

 

 

1

Hi Jakub Chrzanowski,

 

Thank you, your remarks solved my issue and allowed me to move forward again. I appreciate your help and time, I fixed the code and the configuration files (I believe) Quick question, this is somewhat new to me, overall. 

So I changed the 'build.gradle' file so on the field:

intellij {
version '2019.3.2'
plugins 'java'
}

there is a way to make it automatically recognize the version of the idea-IC in use? I did try 2020.1, but it didn't worked.

Again Thank you.


0

2019.3.2 is a release version available in the repository.

You can find such versions here: https://www.jetbrains.com/intellij-repository/releases

 

2020.1 is not yet publicly released, but you can try with: LATEST-EAP

1

Please sign in to leave a comment.