Skip to content
This repository has been archived by the owner on Jul 23, 2022. It is now read-only.

Latest commit

 

History

History
51 lines (42 loc) · 2.24 KB

omnisharp.md

File metadata and controls

51 lines (42 loc) · 2.24 KB

Getting Started with UdonRabbit.Analyzer in OmniSharp

Install UdonRabbit.Analyzer to Roslyn integration using OmniSharp (VS Code, Atom, Brackets, Vim and others) is the following steps:

  1. Download the latest NuGet package from GitHub Releases
  2. 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.
  3. Create a omnisharp.json into your project root.
  4. Configure RoslynExtensionsOptions.EnableAnalyzerSupport to true
  5. 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
  6. Restart OmniSharp
  7. Happy Coding!

Example of omnisharp.json

{
  "RoslynExtensionsOptions": {
    "EnableAnalyzersSupport": true,
    "LocationPaths": ["./tools/UdonRabbit.Analyzer.0.3.0/analyzers/dotnet/cs"]
  }
}

Troubleshooting

I cannot use both UdonRabbit Analyzer and Roslynator (and/or other analyzers) in Visual Studio Code

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"
    ]
  }
}