Closed sagacity closed 1 year ago
I've tried to look into the issue, it seems that besides of a trivial problem with lexing/parsing rules, something may be wrong with generated lexer/parser classes. I'm on IU-2023.1
using plugin GK-2022.3.2
(jflex-1.9.1
) but tested this with jflex-1.7.0-2
also and I've encountered something weird: if you erase gen
directory and generate lexer + parser, you'll get a lot of diffs:
Most of these diffs are generated boilerplate getters/setters for internals. Are you using some kind of automation to perform generation? I'm questioning because of a known issue with gradle-based support for grammar-kit
https://github.com/JetBrains/gradle-grammar-kit-plugin/issues/3
Some of generated files contained a bit of trivial to fix problems:
WGSLVariableIdentDecl.java
contains duplicates for generated PsiElement setName(String name)
_WgslLexer.java
contains duplicates of zzAtBOL
and zzEOFDone
It seems to me that lexer and parser files may be not in sync to produce fully-correct output, or there are some hand-crafted parsing procedures (or it's just about updated jflex and grammar-kit). I'm writing this to ask if grammar files may be left hanging mid-refactoring, because if so - it's not possible for volunteers to fix any such issue. @dparnell please update the situation with any status, and thanks for the plugin!
Adding a space between the brackets solves the issue.
Produced from this, there is a brace-matching behavior bug. Assuming you have this code:
fn test() {
let a = a[a[a]];
}
Place cursor after first opening {
and press return
- you'll get a matching pair inserted
fn test() {
}
let a = a[a[a]];
}
Hi @rosingrind I'm using the stuff in IntelliJ to generate the files. I'll take a look at what it is doing.
I have just made release 0.0.25 which should fix the issue with nested arrays. It should become available on the marketplace in a couple of days
Thanks for the fix!
First of all, awesome plugin!
I'm noticing some odd behaviour with nested arrays:
Adding a space between the brackets solves the issue.