Closed igreenfield closed 1 year ago
Hi @igreenfield can you give me a grammar that causes this problem? any ideas about what you were doing that might've triggered this? Thanks!
@parrt I was editing spark grammar change one rule.
@igreenfield can you tell me what operating system and which version of intellij? can you confirm 1.17 plugin? thanks!
@parrt I was editing spark grammar change one rule.
are you talking about this grammar?
Sounds like you probably have an old version of intellij:
https://github.com/JetBrains/idea-gitignore/issues/419
Thanks...
@parrt yes, my idea version is: so not so old
oh man!!! ok, reopening... and you are using 1.17 plug-in right? at this point I can't reproduce so any exact sequence editing information or whatever would be very helpful otherwise I don't know how to fix. thanks for the report!
What I remember I did: add a new rule and delete the second line from STRING and that happens.
Dang. I can't reproduce.
I just ran into this issue on Rider 2023.1 EAP 6
build. Switching back to the current 2022.3.2
build of Rider does work.
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Read access is allowed from inside read-action or Event Dispatch Thread (EDT) only (see Application.runReadAction()); see https://jb.gg/ij-platform-threading for details
Current thread: Thread[ApplicationImpl pooled thread 25,4,main] 296579654 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 1285261168
at com.intellij.openapi.application.impl.ApplicationImpl.throwThreadAccessException(ApplicationImpl.java:1046)
at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1004)
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)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgsAsList(RunANTLROnGrammarFile.java:178)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.antlr(RunANTLROnGrammarFile.java:131)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.run(RunANTLROnGrammarFile.java:78)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:513)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
at com.intellij.codeWithMe.ClientId$Companion.decorateFunction$lambda$10(ClientId.kt:329)
at com.intellij.codeWithMe.ClientId$Companion.decorateFunction$lambda$10(ClientId.kt:329)
at com.intellij.codeWithMe.ClientId$Companion.decorateFunction$lambda$10(ClientId.kt:329)
at com.intellij.codeWithMe.ClientId$Companion.decorateFunction$lambda$10(ClientId.kt:329)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
grammar Exodia;
// LEXER
// COMMENTS
SINGLE_COMMENT: '//' ~[\r\n]* -> skip ;
BLOCK_COMMENT: '/*' .*? '*/' -> skip ;
// KEYWORDS
LET: 'let' ;
RETURN: 'return' ;
FN: 'fn' ;
IF: 'if' ;
ELSE: 'else' ;
WHILE: 'while' ;
DO: 'do' ;
FOR: 'for' ;
CLASS: 'class' ;
EXTENDS: 'extends' ;
THIS: 'this' ;
SUPER: 'super';
NEW: 'new' ;
WHITESPACE: [ \t\n\r\f]+ -> skip ;
NUMBER: [0-9]+ ;
STRING: '"' ~'"'* '"' ;
TRUE: 'true' ;
FALSE: 'false' ;
ADDITIVE_OPERATOR: [+\-] ;
MULTIPLICATIVE_OPERATOR: [*/] ;
EQUALITY_OPERATOR: [=!]'=' ;
RELATIONAL_OPERATOR: [><]'='? ;
LOGICAL_OR: '||' ;
LOGICAL_AND: '&&' ;
SIMPLE_ASSIGNMENT_OPERATOR: [=] ;
COMPLEX_ASSIGMENT_OPERATOR: [*/+\-]'=' ;
IDENTIFIER: [a-zA-Z] [a-zA-Z1-9]* ;
// PARSER
program: statement* EOF; // THE ? is so you can have an empty file
// STATEMENTS
statement
: expression_statement
| empty_statement
| block_statement
| function_declaration
| return_statement
| variable_statement
| if_statement
| iteration_statement
| class_declaration
;
class_declaration
: CLASS identifier class_extends? statement
;
class_extends
: EXTENDS identifier
;
iteration_statement
: while_statement
| do_while_statement
| for_statement
;
for_statement
: FOR '(' variable_statement equality_expression ';' expression ')' statement
;
do_while_statement
: DO statement WHILE '(' expression ')'
;
while_statement
: WHILE '(' expression ')' statement
;
variable_statement
: LET variable_declaration_list ';'
;
variable_declaration_list
: variable_declaration
| variable_declaration_list ',' variable_declaration
;
variable_declaration
: identifier variable_initializer?
;
variable_initializer
: SIMPLE_ASSIGNMENT_OPERATOR assignment_expression
;
if_statement
: IF '(' expression ')' statement
| IF '(' expression ')' statement ELSE statement
;
empty_statement
: ';'
;
return_statement
: RETURN expression? ';'
;
block_statement
: '{' statement* '}'
;
// FUNCTIONS
function_declaration
: FN identifier '(' formal_parameter_list? ')' block_statement
;
formal_parameter_list
: identifier
| formal_parameter_list ',' identifier
;
// EXPRESSIONS
expression_statement
: expression ';'
;
expression
: assignment_expression
;
assignment_expression
: logical_OR_expression
| left_hand_side_expression assignment_operator assignment_expression
;
assignment_operator
: SIMPLE_ASSIGNMENT_OPERATOR
| COMPLEX_ASSIGMENT_OPERATOR
;
left_hand_side_expression
: member_expression
;
member_expression
: identifier
| this_expression
| member_expression '.' identifier
| member_expression '[' expression ']'
;
this_expression
: THIS
;
identifier
: IDENTIFIER
;
logical_OR_expression
: logical_AND_expression
| left=logical_OR_expression op=LOGICAL_OR right=logical_AND_expression
;
logical_AND_expression
: equality_expression
| left=logical_AND_expression op=LOGICAL_AND right=equality_expression
;
equality_expression
: relational_expression
| left=equality_expression op=EQUALITY_OPERATOR right=relational_expression
;
relational_expression
: additive_expression
| left=relational_expression op=RELATIONAL_OPERATOR right=additive_expression
;
additive_expression
: multiplicative_expression
| left=additive_expression op=ADDITIVE_OPERATOR right=multiplicative_expression
;
multiplicative_expression
: unary_expression
| left=multiplicative_expression op=MULTIPLICATIVE_OPERATOR right=unary_expression
;
unary_expression
: primary_expression
| call_expression
| ADDITIVE_OPERATOR unary_expression
;
call_expression
: callee args=arguments
| super args=arguments
| call_expression args=arguments
;
super
: SUPER
;
callee
: lhse=left_hand_side_expression
;
arguments
: '(' argument_list? ')'
;
argument_list
: assignment_expression
| argument_list ',' assignment_expression
;
new_expression
: NEW exp=member_expression args=arguments
;
primary_expression
: literal
| member_expression
| parenthesized_expression
| new_expression
;
parenthesized_expression
: '(' expression ')'
;
// LITERALS
literal
: numeric_literal #atom
| string_literal #atom
| true_literal #atom
| false_literal #atom
;
true_literal
: TRUE
;
false_literal
: FALSE
;
numeric_literal
: NUMBER
;
string_literal
: STRING
;
Fixed in #605
Same error here and I'm using ANTLR v4 1.20
This error triggered when I clicked "Generate ANTLR Recognizer"
java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction())
Current thread: Thread[ApplicationImpl pooled thread 124,4,main] 937709905 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 765331596
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1004)
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)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgsAsList(RunANTLROnGrammarFile.java:178)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.antlr(RunANTLROnGrammarFile.java:131)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.run(RunANTLROnGrammarFile.java:78)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:513)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
Following exceptions happened soon after this one, most probably they are induced.
2023-04-02T20:34:20.010
java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction())
Current thread: Thread[ApplicationImpl pooled thread 124,4,main] 937709905 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 765331596
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1004)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:127)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:70)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getPackageName(WorkspaceFileIndexDataImpl.kt:279)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getPackageName(WorkspaceFileIndexImpl.kt:228)
at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getPackageName(DirectoryIndexImpl.java:215)
at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getPackageNameByDirectory(ProjectFileIndexImpl.java:250)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgs(RunANTLROnGrammarFile.java:197)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgsAsList(RunANTLROnGrammarFile.java:178)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.antlr(RunANTLROnGrammarFile.java:131)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.run(RunANTLROnGrammarFile.java:78)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:513)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
2023-04-02T20:34:20.010
java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction())
Current thread: Thread[ApplicationImpl pooled thread 124,4,main] 937709905 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 765331596
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1004)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:127)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:70)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:220)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.findFileSetWithCustomData(WorkspaceFileIndexImpl.kt:205)
at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getContentRootForFile(ProjectFileIndexImpl.java:219)
at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getContentRootForFile(ProjectFileIndexImpl.java:213)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getContentRoot(RunANTLROnGrammarFile.java:269)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgs(RunANTLROnGrammarFile.java:209)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.getANTLRArgsAsList(RunANTLROnGrammarFile.java:178)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.antlr(RunANTLROnGrammarFile.java:131)
at org.antlr.intellij.plugin.parsing.RunANTLROnGrammarFile.run(RunANTLROnGrammarFile.java:78)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:429)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressSynchronously$9(CoreProgressManager.java:513)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$new$0(ProgressRunner.java:84)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)
grammar GeradorRelatorio;
//SÍMBOLOS TERMINAIS
NUM: [0-9]+;
STRING: ["][a-zA-Z0-9 \\/:._]+["];
ESPACO: [ \t\n\r]+ -> skip ;
//SÍMBOLOS NÃO TERMINAIS
program
: exp+ EOF
;
exp
: 'getTopEmpresasMaisContratam' '(' NUM ')'
| 'extrairDados' '(' STRING ')'
| 'estagiosPorCurso' '(' STRING ')'
;
I can visualize the Parse tree, by the way
It also seems to create the files correctly
This is my first time using it, is there something that I should do or is this expected?
Thanks for reporting the problem. It looks like a different stack trace, could you open a separate issue? This error is not expected, I'll fix it asap.
Sure! Here it is: #631