-
Notifications
You must be signed in to change notification settings - Fork 874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Made HCL AST on records #7097
Made HCL AST on records #7097
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only eyeballed this and I might not agree with everything, but in general this looks fine.
It will be interesting how records fit into APIs, but that case is not here and so I think this is good to go.
@matthiasblaesing could you share your opinions? I've always valued your wisdom. This Java 17 and records a bit new to me, so I'm eager to see other opinions as well. |
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLContainer.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second pass 😀
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLContainer.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLArithmeticOperation.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLElement.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/HCLSemanticAnalyzer.java
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLTreeWalker.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/test/unit/src/org/netbeans/modules/languages/hcl/HCLIndenterTest.java
Outdated
Show resolved
Hide resolved
f016a1b
to
a4d90c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looked through it in NB (which is so much nicer than here on github), looks good overall, left some comments.
a jackpot rule matched at SourceRef L74-75 which is outside the area github lets me comment on. It can be simplified to:
for (Map.Entry<OffsetRange, HCLElement> e : elementAt.entrySet()) {
public List<? extends HCLExpression> elements() { | ||
return Arrays.asList(condition, trueValue, falseValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List.of
would make this immutable and better compatible with List.copyOf
which I saw somewhere else. Another match would be in HCLLanguage
L236.
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLBlock.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLTreeWalker.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLTreeWalker.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/HCLSemanticAnalyzer.java
Outdated
Show resolved
Hide resolved
ide/languages.hcl/test/unit/src/org/netbeans/modules/languages/hcl/HCLIndenterTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
ide/languages.hcl/src/org/netbeans/modules/languages/hcl/ast/HCLContainer.java
Outdated
Show resolved
Hide resolved
cd0c2d2
to
34f49d7
Compare
Use TextBlocks in formatting test, minor enhancements
34f49d7
to
4e52a8d
Compare
this is causing graal tests to fail since they run on EOL JDK 11 graalvm, but I think i found a way to temp fix this without revert. Testing it locally atm. |
Well,
I've been waiting for this. I think this is an improvement comparing to the previous version at least for reading. The implementation is more safe.
Performance vise it might be worse than before, though I have no tests to prove that.
Anyway, tests are passing.
Now I'm waiting for Java 21 and it's record patterns.