UdonRabbit.Analyzer
Experimental .NET Roslyn Analyzer for VRChat Udon and UdonSharp.
This analyzer accelerates your Udon development with UdonSharp.
Check out the list of analyzers defined in this project.
Not enough types of analyzers in UdonRabbit.Analyzer?
You can check out the list of missing analyzers or create a new issues.
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
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
- Open
Source/UdonRabbit.Analyzer.sln
in your Visual Studio - Start
UdonRabbit.Analyzer.VSIX
as debug profile - After the Visual Studio Experimental Instance starts, open the Unity project that has VRCSDK3 and UdonSharp installed
- Open any source file that inherits from
UdonSharp.UdonSharpBehaviour
Create a new analyzer
- Open
Source/UdonRabbit.Analyzer.sln
in your Visual Studio or other IDE - Build
UdonRabbit.Analyzer.CodeGen
- Run
dotnet ./UdonRabbit.Analyzer.CodeGen.dll -i IDENTIFIER -l "CLASS_NAME" -t "TITLE" -d "DESCRIPTION" -m "MESSAGE_FORMAT" -c CATEGORY -s SEVERITY -w ../
inROOT/bin
- Rebuild ResX in Visual Studio or run
ResGen.exe
- Start Coding!
Testing
Requirements
- .NET 5
- Visual Studio Version 16.8+
- Unity Project that containing VRCSDK3 and UdonSharp
How to test
- 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
)- Default:
null
(Current Directory) - 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
- Default:
UDONRABBIT_ANALYZER_TEST_UDON_SHARP
:UdonSharp.Runtime.dll
Location- Default:
null
(Current Directory)
- Default:
- Run
dotnet test
Analyzer Documents
See https://docs.mochizuki.moe/udon-rabbit/packages/analyzer/ (ja-JP)
ScreenShots
Troubleshooting
I found a bug on VS/VS Code/Rider/Analyzer
If you find a bug, feel free to create a new issue!
Analyzer is not worked on UdonSharpBehaviour
You cannot run multiple UdonRabbit.Analyzer instances in the same Unity workspace.
Therefore, if you are running Analyzer in multiple editors, disable one.
If that doesn't work, we recommend restarting your PC.
License
MIT by @6jz
Third Party Notices
This project contains some code from the following project.
See method comments for details.
Links
Discord Server : https://discord.gg/h42BzsFtD2
Patreon : XXX