AtomMaterialUI / color-highlighter

JetBrains plugin to preview colors directly from within the code.
MIT License
42 stars 25 forks source link

C# | `Color.FromArgb()` highlights the entire line #38

Closed VapidLinus closed 3 years ago

VapidLinus commented 3 years ago

Describe the bug When defining colours using Color.FromArgb(int,int,int) the entire line gets highlighted in the colour. When using ColorTranslator.FromHtml(string) only the definition gets highlighted in the colour.

Here's a preview of what I mean: https://i.imgur.com/esaRQfF.png https://i.imgur.com/U43G9u2.png

The entire line turning into the colour is unwanted. ColorTranslator.FromHtml(string) is the wanted apperance.

To Reproduce Define two properties. One using ColorTranslator.FromHtml(string) and one using Color.FromArgb(int,int,int). You will notice the two lines appear differently.

Expected Behavior For only the paramaters part inside the parantehesses in Color.FromArgb(int, int, int) to get highligthed in the colour.

Environment

JetBrains Rider 2021.2.1 Build #RD-212.5080.71, built on August 26, 2021 Licensed to [REDACTED] [REDACTED]. Runtime version: 11.0.11+9-b1504.16 amd64 VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o. Windows 10 10.0 .NET Framework 4.0.30319.42000 GC: G1 Young Generation, G1 Old Generation Memory: 3000M Cores: 12 Registry: debugger.new.debug.tool.window.view=true, ide.tree.horizontal.default.autoscrolling=false, ide.tooltip.showAllSeverities=true, ide.mac.bigsur.alerts.enabled=TRUE, show.diff.preview.as.editor.tab.with.single.click=true, ea.enable.developers.list=false, parameter.info.max.visible.rows=10, ide.win.file.chooser.native=true, ide.mac.file.chooser.native=TRUE, search.everywhere.pattern.checking=false, ide.mac.bigsur.window.with.tabs.enabled=false, performance.watcher.sampling.interval.ms=200, ide.borderless.tab.caption.in.title=false, awt.file.dialog.enable.filter=FALSE, debugger.show.values.use.inlays=TRUE, light.edit.file.open.enabled=false, performance.watcher.unresponsive.interval.ms=1000, vcs.enable.add.ignored.directories.to.exclude=false, ide.allow.merge.buttons=TRUE, search.everywhere.settings=true, debugger.valueTooltipAutoShowOnSelection=true, use.winp.for.graceful.process.termination=FALSE, ide.tooltip.initialDelay=0, ide.require.transaction.for.model.changes=false, ide.debug.in.title=true, rdclient.asyncActions=false Non-Bundled Plugins: lermitage.intellij.extratci (1.9.0.201), com.intellij.resharper.HeapAllocationsViewer (2021.2.0), fr.socolin.application-insights-debug-log-viewer (1.2.1), de.santiv.fastscrolling (1.2), com.microsoft.vso.idea (1.161.2), com.intellij.resharper.StructuredLogging (2021.2.0.168), Abc.MoqComplete.Rider (1.4.10), GrepConsole (11.10.211.6086.0), com.jetbrains.sh (212.4746.58), com.mallowigi.colorHighlighter (9.0.0), izhangzhihao.rainbow.brackets (6.21), com.intellij.resharper.azure (3.50.0.1253-2021.2), com.gmike.visual-studio-2019-dark (1.4)

Screenshots https://i.imgur.com/esaRQfF.png https://i.imgur.com/U43G9u2.png

VapidLinus commented 3 years ago

Just want to add that I appreciate the recently added C# support in the first place heart ❤️

mallowigi commented 3 years ago

Yes I know, this is because C# does not tokenize expressions like in Java, instead they tokenize every item, e.g Color, FromArgb, etc. So there is no way to simply colorize the expression after the =

That's also why I added a setting to disable it if it is too much.

VapidLinus commented 3 years ago

@mallowigi

Could you consider an option that disables the highlighting of the entire line but still keep the gutter icon (the colour to the left near the line numbers)?

Rider does some colour highlighting on its own under the FromArgb so I find disabling the option you mentioned perfectly okay. I would love an option that disables the highlighting of the line but keeps the gutter square colour icon.

image

Would that be reasonable? :)

mallowigi commented 3 years ago

It's a bit harder to do but I'll add it to the backlog

-- Elior On 1 Oct 2021, 8:33 +0200, Linus Närkling @.***>, wrote:

@mallowigi Could you consider an option that disables the highlighting of the entire line but still keep the gutter icon (the colour to the left near the line numbers)? Rider does some colour highlighting on its own under the FromArgb so I find disabling the option you mentioned perfectly okay. I would love an option that disables the highlighting of the line but keeps the gutter square colour icon. Would that be reasonable? :) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.