How to toggle UNITY_EDITOR directive for code analysis?
By default, Rider only highlights and analyzes code in #IF UNITY_EDITOR and not the other branch.
How to tell Rider to assume UNITY_EDITOR is false so I can edit the other branch more easily?
Please sign in to leave a comment.
Hello Kodoragon1997 ,
Thank you for the report. I was able to reproduce the same behavior and submitted a new issue in our tracker: RIDER-117279 Code inside active preprocessor branch is not highlighted. Please upvote it and keep an eye on status updates there.
It's a bit different though. My issue is not that one branch is highlighted and the other isn't. My issue it how to switch them.
Assuming “Player project” has UNITY_EDITOR = 0 isn't the proper solution, as people put editor-only code in player project all the time. Actually, that's the whole point of using UNITY_EDITOR directive.
Hello,
Please click the control in the upper right corner of the editor window and select the player project there. It will switch context for code analysis.