junichi11 / netbeans-color-codes-preview

Show colors in an editor's sidebar
https://netbeans-vm.apache.org/pluginportal/catalogue/?id=24
Apache License 2.0
32 stars 8 forks source link

Wrong showing of colors, which shouldn't be there. #11

Closed Chris2011 closed 7 years ago

Chris2011 commented 7 years ago

After I update to the newest version of your plugin, I got false positives for colors:

should-not-be-there

and

should-not-be-there-too

so as you can see, the text contains white and green so it will show that, which is false. The second example is a scss variable, where another color is inside, which is linked to this ticket: #7

Regards

Chris

junichi11 commented 7 years ago

I know that things. So, I added the option for named colors. (It is disabled by default.) Probably, it can be improved a bit for specific languages. If you can get unexpected results at the moment, just uncheck the option.

Thanks for your understanding.

Chris2011 commented 7 years ago

Maybe you can check whether it is a selector or a key or a value with regex. In HTML there happens to. There should be visible inside style="color: red". So I think with a regex it will work.

Chris2011 commented 7 years ago
<a href="" id="jsCopyBtn" class="link">{{ 'smth.shared.copy' | translate }}</a>

You only check for strings/words in each line right? It will show red because of shaRED.

junichi11 commented 7 years ago

I already wrote: "Probably, it can be improved a bit for specific languages."

Chris2011 commented 7 years ago

Why for specific languages? It only needs to be the value, that has to be a color name, no selector, no other string, no property. Only the value. And if there is a variable like $bla-green, than it is a variable and shouldn't be used.

junichi11 commented 7 years ago

Why cannot you wait at all?

Chris2011 commented 7 years ago

Your initial answer, doesn't mean that you are working on it. Please be more specific at the next time. You only wrote: If you have side effects, just uncheck it. It doesn't mean, that you are working on it.

junichi11 commented 7 years ago

I wrote "at the moment". I'm not going to work on it soon. So I didn't write details. Anyway, you should wait a bit.

junichi11 commented 7 years ago

I've improved it a bit. Please try to test it (0.6.0.1-dev): https://github.com/junichi11/netbeans-color-codes-preview/releases/tag/v0.6.0

Chris2011 commented 7 years ago

Looks ok for me. Thx for the work :)

junichi11 commented 7 years ago

No problem :) Thanks for your verification.