Closed confused-Techie closed 9 months ago
I've noticed what feels like a bug in Java Syntax Highlighting.
Which to be clear is way better in Java, although still seems to be missing something.
In the following snippet:
import java.util.Scanner; public class balloon { public static void main(String[] args) { int initialDiameter; Scanner scnr = new Scanner(System.in); System.out.print("Input Initial Diameter: "); initialDiameter = scnr.nextInt(); int diameter = initialDiameter; double v1 = Math.PI * initialDiameter * initialDiameter * initialDiameter / 6; diameter = diameter++; } }
In this snippet the diameter = diameter++; only applies highlighting on the = with the rest being just basic text.
diameter = diameter++;
=
Additionally, the assignment of initialDiameter is blank, along with usage of initialDiameter later on, although thats less of an issue.
initialDiameter
To be clear, non of this is a regression, in fact in the Legacy Tree-Sitter the situation is the same, except two things:
++
So mostly things are better here, but still not perfect.
Would love if you could take a look!
1.113.0
🪟 Windows
2H22
x86_64/AMD64
anthing.java
No response
Addressed in this commit. Should now scope variables whenever they're reassigned or incremented. Also added -- and ++ as operators.
--
Amazingly speedy @savetheclocktower, absolutely unbelievable, thanks!
Thanks in advance for your bug report!
What happened?
I've noticed what feels like a bug in Java Syntax Highlighting.
Which to be clear is way better in Java, although still seems to be missing something.
In the following snippet:
In this snippet the
diameter = diameter++;
only applies highlighting on the=
with the rest being just basic text.Additionally, the assignment of
initialDiameter
is blank, along with usage ofinitialDiameter
later on, although thats less of an issue.To be clear, non of this is a regression, in fact in the Legacy Tree-Sitter the situation is the same, except two things:
++
is highlighted, which is the only regression present.So mostly things are better here, but still not perfect.
Would love if you could take a look!
Pulsar version
1.113.0
Which OS does this happen on?
🪟 Windows
OS details
2H22
Which CPU architecture are you running this on?
x86_64/AMD64
What steps are needed to reproduce this?
anthing.java
Additional Information:
No response