Code wrapped in defines not highlighting correctly with Unity
See original GitHub issueEnvironment 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
- Create unity project
- Create code with defined out code Ex.
#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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Scripting define symbols not working - Unity Forum
when I NEED to build the game i cant build it because of editor code. But when i put Editor code in #if...
Read more >Conditional Compilation - Unity - Manual
First of all, select the platform you want to test your code against by going to File > Build Settings. This displays the...
Read more >Visual Studio code highlight doesn't work with Unity project
If the project is loaded, there is still no code highlighting. This means that when you load the project file, the script file...
Read more >Common Mistakes - OpenGL Wiki - Khronos Group
Thus, glGenTextures will not work correctly before context ... on the user to correctly use them, but it also makes their working code...
Read more >50 Tips and Best Practices for Unity (2016 Edition)
This article describes many strategies for working with Unity to make ... later (for example, animation does not always scale correctly).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@XeonG This should be handed by semantic highlighting. Do you have
csharp.semanticHighlighting.enable
set totrue
in your vscode settings?why don’t you make it true by default?curiousness