Closed nowsprinting closed 2 years ago
I think this is already fixed in https://github.com/van800/com.unity.ide.rider/pull/9, I would need to check.
Thanks! I'll try to verify it with the 3.0.8 branch.
And I fixed the mistake sample repository URL in descriptions.
I tried branch 3.0.8 in my sample project. https://github.com/nowsprinting/RoslynAnalyzerOnUnitySandbox/tree/rider_editor_308
But The problem I wrote above doesn't seem to be solved.
The Unity version of the above project is 2020.2.0f1, but the behavior of Rider Editor did not change even if I raised it to 2021.2.0f1.
Thank you for the complete repro-case, I have fix in https://github.com/van800/com.unity.ide.rider/pull/9. I have tried it with 2020.2.0f1 and 2021.2.0f1.
Thanks! I was able to confirm that the path problems (cases 1 and 2) have been fixed!
However, the problem with analyzer scope (case 3) remains. You can check it with NoAsmdef.cs and NoReferences.cs in my sample code.
From what I see: Unity 2021.2.0f1 is showing 4 warnings for NoAsmdef.cs, 3 Errors and 5 Warnings in SpecifiedReferences.cs. Rider shows all those + 4 Warnings for NoReferences.cs. For each csproj Unity gives a set of analysers to the Rider package. So the behaviour would likely be consistent over Rider/VsCode/VS. I would try asking in our channel with Unity team.
Thanks! I got the expected result with a combination of Rider Editor package v3.0.8 and Unity 2021.2.0f1!
I would like to know for sure that this is due to a fix on the Unity side, and what the support for older versions will be. I'm waiting for an answer from the Unity team.
In Unity 2020.3.4f1, Fixed problem about Roslyn analyzer under packages. Roslyn analyzer under packages is working on Unity Editor.
But, the same result cannot be obtained with Rider. Because Rider Editor package v3.0.7 generates an incorrect .csproj file.
1. Incorrect analyzer path when local package
Does not work analyzer under the local package (e.g. LocalPackages/com.nowsprinting.analyzer-in-localpackage/WithAsmdef/AnalyzerInLocalPackageWithAsmdef.dll)
But, the following .csproj will be generated. Invalid path.
2. Incorrect analyzer path when package from Git URL (and maybe from UPM repository)
Does not work analyzer under the package from Git URL (e.g. https://github.com/nowsprinting/analyzer-in-package)
But, the following .csproj will be generated. Analyzer dll will be placed under the Library/PackageCache.
3. Not supported analyzer scope
On Unity Editor, Analyzers works by asmdef dependencies. This is clearly stated in the manual as follows.
But, generated .csproj filr will contain all analyzers regardless of their scope.
Refs