antlr / intellij-plugin-v4

An IntelliJ plugin for ANTLR v4
https://plugins.jetbrains.com/plugin/7358-antlr-v4
BSD 3-Clause "New" or "Revised" License
461 stars 103 forks source link

plugin does not trigger code generator on save #697

Open tbabczynski opened 5 months ago

tbabczynski commented 5 months ago

I have IntelliJ 2023.3.6 and the plugin version is 1.23.1. In these versions of tools, the parser, lexer and the whole menagerie are not generated on save of grammar file. I do have the option checked. I don't remember the exact version of the plugin/IntelliJ when it worked but I'm sure that last year it worked like charm. Now I have to generate the code manually each time. OK, Ctrl Shift G is my friend but ^S is more natural ;).

tbabczynski commented 4 months ago

I've seen that after saving the grammar file, the following exception is thrown: java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction()) Current thread: Thread[Alarm Pool,4,main] 2036941950 (EventQueue.isDispatchThread()=false) SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 402563983 at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202) at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1002) at com.intellij.openapi.roots.impl.DirectoryIndexImpl.checkAvailability(DirectoryIndexImpl.java:250) at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getPackageName(DirectoryIndexImpl.java:213) at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getPackageNameByDirectory(ProjectFileIndexImpl.java:250) at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgs(RunANTLROnGrammarFile.java:197) ...