Skip to content
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

Colorization of If-else levels is broken #174

Open
Alexsey opened this issue Sep 12, 2018 · 7 comments
Open

Colorization of If-else levels is broken #174

Alexsey opened this issue Sep 12, 2018 · 7 comments

Comments

@Alexsey
Copy link
Contributor

Alexsey commented Sep 12, 2018

Your programming language

JavaScript

Expected Behavior

if, consequent if else and final else should be considered as having the same level

Talking in terms of colors on the screenshot, the parenthesizes of (a), (b) and (c) should have the same color and parenthesizes of f(), g(), h() and q() should have the same color

Current Behavior

Every if else is considered as nested to the preceding if or if else. Final else is considered as the same level as preceding if else

Talking in terms of colors on the screenshot, the parenthesizes of (a), (b) and (c) have different colors and parenthesizes of f(), g(), h() have different colors

For some strange reason, parenthesizes of f() has the same color as (b) and g() has the same color as (c)

Code snippet for reproduce (for bugs)

let [a, b, c] = [true, true, true]
let [f, g, h, q] = [() => {}, () => {}, () => {}, () => {}]

if (a) {
  f()
} else if (b) {
  g()
} else if (c) {
  h()
} else {
  q()
}

Your Environment

  • Plugin version: 5.9.1
  • IDE & Operating System version, comment your env as below(go to "About IntelliJ IDEA" -> click the "copy" icon):
WebStorm 2018.3 EAP
Build #WS-183.2153.10, built on September 5, 2018
WebStorm EAP User
Expiration date: October 5, 2018
JRE: 1.8.0_152-release-1293-b10 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

rb-if-else

@izhangzhihao
Copy link
Owner

Same behavior with java:

if (true) {
     System.out.println();
} else if (true) {
     System.out.println();
} else if (true) {
     System.out.println();
} else {
     System.out.println();
}

image

@GenhaoLi
Copy link

still a problem now

@ris58h
Copy link

ris58h commented Oct 12, 2022

I have the same issue with try-catch blocks.
I have Cycle count on all brackets option turned on.
Screenshot 2022-10-12 at 12 58 02

@izhangzhihao
Copy link
Owner

This might finally be fixed.

image

@Alexsey
Copy link
Contributor Author

Alexsey commented Dec 29, 2022

As for the latest version 2023.1.0, it doesn't look fixed:

With Cycle count on all brackets: enabled Screenshot 2022-12-29 at 19 10 10 Screenshot 2022-12-29 at 19 10 42
With Cycle count on all brackets: disabled Screenshot 2022-12-29 at 19 31 41 Screenshot 2022-12-29 at 19 30 41

@izhangzhihao
Copy link
Owner

Yep, because the fix is not verified and added to the current release, for now, I still need some time to verify to not break other features.

@Alexsey
Copy link
Contributor Author

Alexsey commented Dec 13, 2023

@izhangzhihao for the sake of consistency, this issue may also have the "from paid user" badge. I'm with you from the start =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants