Install UdonRabbit.Analyzer to Roslyn integration using OmniSharp (VS Code, Atom, Brackets, Vim and others) is the following steps:
- Download the latest NuGet package from GitHub Releases
- Extract NuGet package using 7-Zip and other unzip tools into your Udon/UdonSharp workspace
- If your project is tracked by Git, I recommended that you remove the decompression location from Git tracking.
- Create a
omnisharp.json
into your project root. - Configure
RoslynExtensionsOptions.EnableAnalyzerSupport
totrue
- Configure
RoslynExtensionsOptions.LocationPaths
to decompression location- For example, you extract NuGet package to
./tools/
directory, specify./tools/UdonRabbit.Analyzer.x.y.z/analyzers/dotnet/cs
- For example, you extract NuGet package to
- Restart OmniSharp
- Happy Coding!
{
"RoslynExtensionsOptions": {
"EnableAnalyzersSupport": true,
"LocationPaths": ["./tools/UdonRabbit.Analyzer.0.3.0/analyzers/dotnet/cs"]
}
}
Roslynator modifies the global omnisharp.json
by Visual Studio Code Extension.
As a result, if you created local omnisharp.json
as described above, the Roslynator configurations will not be found and will not work correctly.
Because UdonRabbit Analyzer provides the extension for Visual Studio Code to avoid conflicts, so consider using them.
If you cannot install them, you have to rewrite local omnisharp.json
as follows:
// @ omnisharp.json
{
"RoslynExtensionsOptions": {
"EnableAnalyzersSupport": true,
"LocationPaths": [
// replace %USERPROFILE% to your home directory
"%USERPROFILE%/.vscode/extensions/josefpihrt-vscode.roslynator-3.1.0/roslyn/common",
"%USERPROFILE%/.vscode/extensions/josefpihrt-vscode.roslynator-3.1.0/roslyn/analyzers",
"%USERPROFILE%/.vscode/extensions/josefpihrt-vscode.roslynator-3.1.0/roslyn/refactorings",
"%USERPROFILE%/.vscode/extensions/josefpihrt-vscode.roslynator-3.1.0/roslyn/fixes",
"./tools/UdonRabbit.Analyzer.0.3.0/analyzers/dotnet/cs"
]
}
}