-
Notifications
You must be signed in to change notification settings - Fork 677
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
Code wrapped in defines not highlighting correctly with Unity #2461
Comments
Unfortunately, there's not much we can do about this at the moment. Today, VS Code colorization is handled with regular expressions rather than a proper parse tree that properly represents code surrounded by conditional compilation symbols. So, it's very easy to trick the colorization. In this case, the content between the end of the method declaration header and opening curly brace of the method body are not considered colorable by the regular expression engine. |
Is it now possible to solve this with the new Semantic Token API? |
Good thing that the code editor from micrsoft when used by the language made by microsoft is unable to do simple syntax highlighting. What an age of technology we live in |
ffs when is this getting fix in vscode? still broken |
@XeonG This should be handed by semantic highlighting. Do you have |
why don't you make it true by default?curiousness |
Environment data
VS Code version: 1.26
C# Extension version: 1.15.2
Unity version: 2017.3.1f1 .Net3.5
OS: Windows 10
Steps to reproduce
#if UNITY_ANDROID
Expected behavior
Code that is not being compiled due to defines should be grayed out
Actual behavior
Code looks normal or has incorrect highlighting. In the screenshot below the highlighting at the top is reversed because the
RECORD_RAND_FLOAT_CALLS
is not defined. Hovering works as expected with the defined out code not giving any results. You can also see towards the bottom that another#if #else
has different behavior with the same define.I've also looked at the Assembly-CSharp.csproj file and confirmed that it does contain a UNITY_ANDROID define but highlighting does not occur.
The text was updated successfully, but these errors were encountered: