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

#ifdef directives issue #77

Open
UHFT opened this issue Jan 8, 2021 · 2 comments
Open

#ifdef directives issue #77

UHFT opened this issue Jan 8, 2021 · 2 comments

Comments

@UHFT
Copy link

UHFT commented Jan 8, 2021

Installed product versions

  • Visual Studio: 2019 (16.8.3)

Description

syntax highlight of directives (#ifdef and #ifndef) does not work

Steps to recreate

try below without '#define ENABLE_SHADOW'.

float Visivility = 1.0
#ifdef ENABLE_SHADOW
Visibility = 0.0
#endif

Current behavior

When ENABLE_SHADOW is not defined then #ifdef - #endif block does not comment out in grey

Expected behavior

When ENABLE_SHADOW is not defined then #ifdef - #endif block should be commented out in grey

@UHFT
Copy link
Author

UHFT commented Jan 8, 2021

Screenshot 2021-01-08 at 23 48 58

@danielscherzer
Copy link
Owner

danielscherzer commented Jan 9, 2021

Thansk for your feedback! Currently there is no semantik analysis of the code.
This would probably require a full fledged syntax tree, which I have not implemented. I just do a simple lexing step with Sprache.
I did not want to go to the trouble of implementing a full glsl parser myself, but if you have knowledge of a C# nuget package that does provide a syntax tree (I only know of a Rust implementation (https://docs.rs/glsl/6.0.0/glsl/) and a C/C++ implementation (https://github.com/KhronosGroup/glslang). I can try to include it, but this probably requires a major overhaul of the extension...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants