PsiLiteralExpression Symbol Cannot Be Resolved

Answered

Greetings!

I'm following the Simple Language development tutorial, and I'm at the section on adding an annotator. It requires the class PsiLiteralExpression, but, I can't seem to get the symbol to resolve. I am importing com.intellij.psi.*, which in theory should contain the PsiLiteralExpression class, but it seems that it does not, in fact contain it. I'm not sure if I just don't have my Platform SDK set up properly, or what, but, I set that up by following the Setting Up a Development Environment page, so I don't think it should have any problems... The problem exists when I open the completed Simple Language Project from the sdk docs repo, as well, so it is not exclusive to the version of the project that I am working through.

Thanks in advance for your help.

Zach

1
4 comments

If you are using gradle, try to add the following code in build.gradle:

intellij {
plugins 'java'
}

and in the plugin.xml file, change the depends section to be:

<depends>com.intellij.modules.java</depends>

 

It solved the issue in my case.

1
Avatar
Permanently deleted user

Hi,

Thanks for the suggestion. Unfortunately, I am not using Gradle, and I have already included the proper depends section. in plugin.xml, but the problem still persists...

Zach

0

Go to File > Project structure. Which SDK do you have? I believe you need to have the intellij SDK for this to work.

1

Please sign in to leave a comment.