-
Notifications
You must be signed in to change notification settings - Fork 77
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
How to use these with VSCode? #122
Comments
See OmniSharp/omnisharp-roslyn#1711 You can use our diagnostics, but you cannot use our suppressors so far. |
@sailro I had checked out that thread actually (you can see the latest comment is from me). I couldn't find the information there on how to get the Unity analyzers to be run on VSCode. Do I have to build the .dlls from this repository? Can I download them using NuGet? Do I have to install Visual Studio? How did you do it? |
No you don't need to install Visual Studio. We have a nuget here: Check this page: |
@sailro I used this VSCode extension to install the I still am not able to see the Unity analyzers in action, however: The code above should trigger This is what my
Do I need to add a direct link to the package there? If so, how do I figure out where the nuget extension is installing packages to? Thanks! |
Oh wow! I went on a journey but I finally did it! Ok so trying to install packages using any NuGet installer extension is pointless because it seems Unity won't allow anything to mess with its
Another extension threw a rather obscure error everytime I attempted to install the package:
This all points to Unity trying to keep its So then I tried downloading the package manually from the NuGet website, then extracting
And now it works: This was definitely not obvious and way harder than it needed to be. Shame that there's no clear step by step tutorial on how to do this anywhere 😢 Maybe we should add this to the readme? |
@marcospgp there are clear instructions on this page: https://code.visualstudio.com/docs/other/unity#_enabling-unity-warnings The page also recommends you do not put |
Thanks @1hko , though it was I who wrote that section of the guide ahaha |
https://github.com/vad710/UnityEngineAnalyzer#jetbrains-rider-integration specifies an alternative way that also works with Rider. If we follow the guide to place the |
@danvim, did you intend to reference different versions of the analyzers (1.9.0 vs 1.12.0)? |
That was unintentional. I was directly copying code from my project. Thanks for reminding. 😅. Edited. |
Does this mean you need to make a copy and extract the analysers everytime you create a new unity project? |
Yup, that's what that means. |
@marcospgp Thanks for these instructions (and the updates to the vscode docs). They are still helpful 2 years later! |
Not anymore. I forked the project and ensured that omnisharp.json and the nuget dll were automatically generated. |
Crazy genius, you have no idea how much I had to search the internet to find your solution, thank you! |
We updated VSCode documentation after the release of the new Unity extension for VSCode |
So now there are no instructions on how to add third party analyzers to a Unity project so that the warnings will be displayed in VSCode? |
Is there a simple way to enable these in VSCode?
The text was updated successfully, but these errors were encountered: