Language references not working when the plugin is installed

Answered

Hi,

I'm developing a plugin for Intellij for a custom language which mainly consists of variable declaration and usages of those variables, and it is almost ready to be published. Whenever I run the :runIde: gradle task to test the plugin in the Development instance, the references work great (i.e. I can CRTL click on a variable to see where it was defined, and I can CTRL click on a variable declaration to find the usages of that variable). However, if I build the plugin zip file and install it the actual Intellij program, the references are all broken (i.e. variable usages say they cannot be resolved and variable declarations say "No usages found in All Places"). The lexing and parsing seem to be working fine, and the syntax highlighting looks good, but it could be that there are other problems with the plugin that I cannot see.
Do you know why this would be happening?
If not, how can I debug the plugin after it is already fully installed in Intellij? Like I said, whenever I debug it from the Development instance it all works great, so I don't know how to find the problem...

Thank you

0
3 comments

In your Gradle configuration file, you can specify the alternativeIdePath property and specify the path to the locally installed IDE.

0

Ok, so I've done that. Here is what my gradle intellij method looks like:

intellij {
version = ideaVersion
plugins 'java'
updateSinceUntilBuild = false
alternativeIdePath 'C:\\Users\\myUserName\\AppData\\Local\\JetBrains\\IntelliJ IDEA Community Edition 2019.3.1'

pluginName 'myPluginName'
downloadSources true
updateSinceUntilBuild false
}

However, when I try to debug the plugin, nothing is different. It still opens a new Development instance and the references work just fine. Am I supposed to run it in a specific way to get it to remote debug while it is running in another window? 

After looking at some examples of the alternativeIdePath attribute, it seems that this is mainly meant for testing the plugin in another IDE, such as PyCharm or Android Studio, but I only have one JetBrains IDE installed on my computer, which is Intellij IDEA, so I'm not sure this will help.

Any other ideas? I can send you a sanitized version of my idea.log if you need it, but I was going over it and couldn't find anything about the plugin itself. No errors or warnings, no information about the use of the plugin, it basically just says that the plugin was loaded...

Thanks

0

I would try to implement heavy logging (or just simple console output) of your reference/resolve code and see what actually happened when your plugin starts with "real" Idea.

0

Please sign in to leave a comment.