tgjones / HlslTools

A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files
http://timjones.io/blog/archive/2016/04/25/hlsl-tools-for-visual-studio-v1.0-released
Other
561 stars 97 forks source link

Highlight matching parens feature #175

Closed Reedbeta closed 4 years ago

Reedbeta commented 4 years ago

It would be nice for HLSL Tools to highlight matching parens, brackets, and braces when the cursor is placed on one of the pair, similar to VS and other editors.

tgjones commented 4 years ago

That sounds like a bug, because this should already work in HLSL Tools, in both VS and VSCode. Are you using VS? Does it not match braces at all?

Reedbeta commented 4 years ago

I'm using VS. It matches braces in C++, but I don't see any matching brace highlighting when I put the cursor next to a brace in HLSL at all.

tgjones commented 4 years ago

I notice the default brace highlight colour is a very light grey, but still, I'm definitely getting brace highlighting for parens, brackets, and braces. Which version of VS are you using? Is it still an issue?

Reedbeta commented 4 years ago

You're right! I had to look really close to see it, the colors are so similar that it's almost impossible to tell, but the highlighting is there.

It's interesting that the highlight color is different for HLSL than for C++, though. I haven't made any changes to the colors, just using the default dark theme in VS (2019, now, though I saw this on 2017 first). Does the extension have any influence over those colors? Is it possible to change the default to match those for C++/C#?

tgjones commented 4 years ago

There was a bug in how I was doing brace highlighting, which meant the highlight colour couldn't be customised. I've fixed that now, so the "Brace Matching" colour will be applied to HLSL:

image

Reedbeta commented 4 years ago

Awesome, thanks!