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
565 stars 97 forks source link

Chaos with Syntax and utilities in inactive code areas #243

Open RobertMtx opened 1 year ago

RobertMtx commented 1 year ago

Most of the features seem to break down when trying to write code inside of an inactive code fragment, such as when blocking code off with preprocessor directives:

#define X 1
#ifdef X
  - this area works great
#else
  - this area throws fits
#endif

When typing code inside of an inactive portion, the auto-completions and other utilities fail to function correctly. I'm not sure what causes this to happen, but I would recommend only changing the syntax color of inactive areas. It is very common to use preprocessor directives to convert one shader into multiple shaders, so the inactive portion is usually just as important as the active portion.

Perhaps we could even have an option to completely disable the syntax changes of inactive code, so that all sections appear to be active at once? But if not, we definitely need to be able to write code in them, which is currently not very feasible. For example, even if I have a variable named g declared, if I type "g =", I get "else =".

Since I'm doing a lot of complaining, I wanted to mention how much I love this addon! It is incredibly useful! Thanks!