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

Rainbow variables in C# shouldn't color types #2578

Closed
mtpilarek opened this issue Jan 2, 2023 · 16 comments
Closed

Rainbow variables in C# shouldn't color types #2578

mtpilarek opened this issue Jan 2, 2023 · 16 comments
Labels
bug? In the next release Rider specific Features/bugs about the Rider IDE

Comments

@mtpilarek
Copy link

mtpilarek commented Jan 2, 2023

Your programming language

C#

Expected Behavior

Types, interfaces and enums shouldn't be colored, but have one static color.
For enums and interfaces it should be this one:
image
For classes it should be this one:
image

Coloring types is really confusing and makes file less readible. I suggest at least to make it configurable. In my opinion it's a bug, but maybe some would concider it as a feature.

Current Behavior

Types, interfaces and enums are treated like a variable.
image
image

Code snippet for reproduce (for bugs)

Open any C# file.

Your Environment

JetBrains Rider 2022.3.1

  • Plugin version:
    Rainbow Brackets 2023.1.0
@mtpilarek mtpilarek added the bug? label Jan 2, 2023
@open-collective-bot
Copy link

Hey @mtpilarek 👋,

Thank you for opening an issue/feature request. We will get back to you as soon as we can.

Please consider support us by buying a license here or donating from OpenCollective https://opencollective.com/intellij-rainbow-brackets.

And we have a special plan for paid users, if you are a paid user, your issue or feature request will have a higher priority.

If you are creating a issue, please make sure you already read the latest change log here.

@izhangzhihao
Copy link
Owner

True, since the dummy C sharp light parser from the Rider IDE could not tell me the real stuff behind the PSI tree, what this plugin could find is only something created by IDENTIFIERs, but I will have to try to find some pattern, and handle some cases.

image

@izhangzhihao izhangzhihao added the Rider specific Features/bugs about the Rider IDE label Jan 2, 2023
@jansviland
Copy link

Just want to add to this, I have the same issue. Can not use this feature in C#.

This should be highlighted:
bilde

This is the result. Everything is highlighted.
bilde

@izhangzhihao
Copy link
Owner

Hi @jansviland please provide your code sample, so I could reproduce this issue and fix.

@jansviland
Copy link

Hi @jansviland please provide your code sample, so I could reproduce this issue and fix.

Of course, the example above can be found here:
https://github.com/jansviland/AdventOfCode/blob/main/2022/AdventOfCode.2022.Day7.Tests/Tests.cs

@mtpilarek
Copy link
Author

mtpilarek commented Jan 9, 2023

Better, but not there yet.
image
Still coloring types here.

image
Here some variables not colored (_settings)
Some strange coloring for initializer of first prop (TotalCount)
Coloring constructor (ArchitectsTeamsDto)
Still coloring types in method definition.

@mtpilarek
Copy link
Author

mtpilarek commented Jan 10, 2023

Better, but:
image
Private variables not colored
image
totalCount changed coloring in conditional statement

Also sometimes variables next to each other have same colors:
image
settingsInterfaceType and factoryMethod
image
searchableType and searchableTypeGeneric

I think plugin should try to differ colors for variables close to each other/in the same scope. Don't really know if it's possible, but it would be nice.

@izhangzhihao
Copy link
Owner

Ah, are you using the color generator for rainbow variables or the default color config?

@mtpilarek
Copy link
Author

mtpilarek commented Jan 10, 2023

image
Do u mean this feature? I can't select this, because after saving and entering settings afterwards it is not selected again. After restart it is also deselected.
image
And as you can see I have purchased Rainbow Brackets.

@izhangzhihao
Copy link
Owner

Does this help you?

@mtpilarek
Copy link
Author

mtpilarek commented Jan 10, 2023

image
It didn't help, maybe it's because I have installed build from your previous comments?
It's something with this specifing options, because other paid features work. For example color generator lumosity works.

@izhangzhihao
Copy link
Owner

Thanks! this is another bug, I will fix it later!

@mtpilarek
Copy link
Author

image
Option is now working, but the issue with same coloring persists.

@izhangzhihao
Copy link
Owner

izhangzhihao commented Jan 11, 2023

image

@mtpilarek
Copy link
Author

Much better now.
The only persisting issue I can find is this one:
image
totalCount changed coloring in conditional statement

@mtpilarek
Copy link
Author

mtpilarek commented Jan 12, 2023

Did you manage to fix conditional statement?
image
The easiest way to reproduce it is make simple statement with ? and :

image
I've just also spotted that similar bug appears in constructor arguments. If we use same variable in constructor arguments it changes coloring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? In the next release Rider specific Features/bugs about the Rider IDE
Projects
None yet
Development

No branches or pull requests

3 participants