-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add NuGet Package Import Support #39
Comments
Will support for other Roslyn analyzers such as Roslynator tie into this? I'm happy to create a new ticket for it if not, I guess it depends a bit on how you're planning to do this. Currently with the vscode package from Unity (and the other fork from wackoisgod) Unity looks for Roslyn analyzer assemblies inside the project folder with a specific asset tag, passes them to the VSCode extension, which in turn generates entries like this: <ItemGroup>
<Analyzer Include="/home/user/project/Assets/RoslynAnalyzers/roslynator.analyzers/4.2.0/analyzers/dotnet/cs/Roslynator_Analyzers_Roslynator.Core.dll" />
...
</ItemGroup> I have a bunch of those right now, but they don't appear to be added to the generated If it's not yet implemented: the Unity approach is to ask you to drop your analyzers as DLLs inside the project and tag them, but installing through NuGet is much better since you can effectively version properly and don't need to push dependencies to your repository. This package may be able to generate the entries just for the C# project files and ignore Unity altogether. The downside to ignoring Unity is that you won't get the analyzer messages inside the Unity editor, but the upside is that analyzer errors won't block play mode (and you can't turn Roslyn analyzers off in Unity 2022 any more, whilst you could in 2021) and the analyzers won't slow down editor iteration times if all you want is to see them with OmniSharp, your IDE, and/or use them in CI. EDIT: I just realized I can try creating a |
The analyzer works. The problems just aren't showing up :c I posted a picture in #48 |
I'm not sure that's the problem, though (I'm the one that reported it, by the way 😄), since it didn't happen on Linux and is Windows-specific (I'm on Linux). I'll try to dig in a bit more to see what the problem is 🙂 . |
I should really invest some time into creating a new VM for specific Linux edge cases xD |
Btw, if you have time, please let me know if the new dev tool extension works, I'm currently locked behind a path issue 😢 I want to know if it solves the analyzer problems ✌️ |
It's working for me in ordinary .NET projects and in Unity projects (using the wackoisgod fork that generates SDK-style projects). With this package I'm currently hitting #54, but it still works, probably because the projects are already properly generated (not getting any analyzer messages to show up in VSCode, though, but I'll dig into that later). EDIT: But, as mentioned, I am on Linux, so I might not be suffering from the same bug 😄. |
It will generate the projects as intended, but your issue stops dotnet from running restore/build 😅 Hopefully I can patch it soon |
I fixed my problem with the analyzers not working: it was some shenanigans with indeed not having run FWIW, a heads-up from someone who looked into getting NuGet packages into Unity using standard .NET tooling and built a mostly-working-home-baked-that-probably-doesn't-work-in-all-situations approach for the company he works for before you start on this 😄 : it's unfortunately not just a matter of
If you look at the codebase of e.g. NuGetForUnity, they also have various workarounds for these things. We started out using that and ended up rolling our own in-house thing because it still fails to install e.g. (Off-topic about item 5: starting with Unity 2022 you can't disable Roslyn analyzers inside the Unity Editor any more, and Roslyn analyzer options specified through |
Thanks for the great advice; I'll see what I can do in my free time. 😄 |
To answer my own question from before about Roslyn analyzers: I got this working with how this package works right now by making a custom This pulls in the necessary analyzers I want, which works for OmniSharp and |
Describe what feature you'd like. Pseudo-code, mockups, or screenshots of similar solutions are encouraged!
It should be a simple process of adding names and versions.
What type of pull request would this be?
New Feature
Any links to similar examples or other references we should review?
No.
The text was updated successfully, but these errors were encountered: