You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 4.3-dev6, checking for an undefined shader preprocessor variable with #ifdef causes the remainder of the script to lose its syntax highlighting, starting with the #endif line. In 4.3-dev5, the rest of the script would be highlighted as expected. This seems to only affect syntax highlighting, as the shader I discovered this with in my project still compiles and runs correctly.
4.3-dev5
4.3-dev6
Steps to reproduce
Create a new shader script
Define a shader preprocessing variable using #define VARIABLE_NAME
Place code inside a check for that variable using #ifdef VARIABLE_NAME (shader code here) #endif
Comment out the line that contains #define VARIABLE_NAME
Note that, starting with the #endif line, the remainder of the script loses its syntax highlighting
Highlighting /** */ and /* */ conflicts.
It seems that I need to modify the highlighting code to similar that of GDScript.
We can start by disabling the highlighting for /** */ and temporarily using the same color as /* */.
If there’s no urgency, I’ll submit a pull request later.
Tested versions
System information
Godot v4.3.dev6 - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 Laptop GPU (NVIDIA; 31.0.15.4633) - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 Threads)
Issue description
In 4.3-dev6, checking for an undefined shader preprocessor variable with
#ifdef
causes the remainder of the script to lose its syntax highlighting, starting with the#endif
line. In 4.3-dev5, the rest of the script would be highlighted as expected. This seems to only affect syntax highlighting, as the shader I discovered this with in my project still compiles and runs correctly.4.3-dev5
4.3-dev6
Steps to reproduce
#define VARIABLE_NAME
#ifdef VARIABLE_NAME
(shader code here)#endif
#define VARIABLE_NAME
#endif
line, the remainder of the script loses its syntax highlightingMinimal reproduction project (MRP)
shader-syntax-highlighting.zip
The text was updated successfully, but these errors were encountered: