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

DEPRECATED (U#1.0 not supported) .NET Roslyn Analyzer for VRChat Udon and UdonSharp.

License

Notifications You must be signed in to change notification settings

esnya/UdonRabbit.Analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UdonRabbit.Analyzer

!!Attention!!: This project has been taken over by the current Owner from the original author. At the request of the original author, all past history has also been made anonymous. All branches are force-pushed for this operation. Also, there is no active maintenance as before. We are desperately looking for collaborators to keep up with the fast-changing Udon.

Experimental .NET Roslyn Analyzer, Code Fixes, Refactorings for VRChat Udon and UdonSharp. This analyzer accelerates Udon development with UdonSharp by detecting syntaxes/language features that are not supported by Udon and/or UdonSharp in the editor stage. Check out the list of analyzers for supported syntaxes and other information.

Features

  • It reports the part of the behaviour that doesn't work well on VRChat as an error in editor
  • It reports an error in the editor that about the syntax that cannot be compiled by the UdonSharp
  • etc

Getting Started

Requirements

  • Microsoft Visual Studio 2019 or IDE that supports Roslyn Analyzer
  • VRCSDK3 that supports Udon
  • UdonSharp

Development

This is how to develop the UdonRabbit Analyzer (not your UdonSharp project). If you want to load it into the UdonSharp project, refer to the installation for each IDE in the "Getting Started" section. Unless you are developing an Analyzer, I do not recommend doing the following section unless you have enough machine power.

Requirements

  • .NET 5
  • Visual Studio Version 16.8+ or Visual Studio for Mac 8.8+
  • Unity Project that containing VRCSDK3 and UdonSharp

How to develop

  1. Open Source/UdonRabbit.Analyzer.sln in your Visual Studio
  2. Start UdonRabbit.Analyzer.VisualStudio.XXXX as debug profile
  3. After the Visual Studio Experimental Instance starts, open the Unity project that has VRCSDK3 and UdonSharp installed
  4. Open any source file that inherits from UdonSharp.UdonSharpBehaviour

Create a new analyzer

  1. Open Source/UdonRabbit.Analyzer.sln in your Visual Studio or other IDE
  2. Build UdonRabbit.Analyzer.CodeGen
  3. Run dotnet ./UdonRabbit.Analyzer.CodeGen.dll -i IDENTIFIER -l "CLASS_NAME" -t "TITLE" -d "DESCRIPTION" -m "MESSAGE_FORMAT" -c CATEGORY -s SEVERITY -w ../ in ROOT/bin
  4. Rebuild ResX in Visual Studio or run ResGen.exe
  5. Start Coding!

Testing

Requirements

  • .NET 5
  • Visual Studio Version 16.8+
  • Unity Project that containing VRCSDK3 and UdonSharp

How to test

  1. Configure the following environment variables in Source/UdonRabbit.Analyzer.Test/bin/Debug/net5.0/UdonRabbit.runsettings
    • UDONRABBIT_ANALYZER_TEST_PROJECT : Unity 2018.4.20f1 Test Project Location (.csproj)
      • I recommended to reference to Assembly-CSharp.csproj because it has all references to DLLs.
      • If you are not want to reference to Assembly-CSharp.csproj, add the following external references:
        • TextMeshPro
        • UdonSharp.Runtime
    • UDONRABBIT_ANALYZER_TEST_UDON_SHARP : UdonSharp.Runtime.dll Location
  2. Run dotnet test

ScreenShots

Report Unsupported Language Features

Report Unsupported Udon APIs

Report Unsupported Unity Messages

License

MIT by esnya

Third Party Notices

This project contains some code from the following project. See method comments for details.