any update on package com.unity.code-analysis ?

Is there going to be any update on preview package code-analysis, or can we assume it is a dead project? Last update was more than two years ago.

Roslyn binaries version in the package is 2.10.0, latest version provided by Microsoft is 4.0.0

Current version supports C# 7.0, Unity compiler supports C# 8.0 at the moment. So when using default literals or readonly references in a project, getting not supported error; basically cannot use this package with the current versions of Unity.

https://docs.unity3d.com/Packages/com.unity.code-analysis@0.1/manual/index.html
https://docs.unity3d.com/Packages/com.unity.code-analysis@0.1/changelog/CHANGELOG.html

Sorry if this is posted in the wrong forum category.

I’ve been trying to track down the status of this package. It looks like it is a dead project, as it is not maintained by Unity any more and not used by anyone within Unity.

I think the behavior that it provided is mostly built-in to Unit now. See Unity - Manual: Roslyn analyzers and source generators.

1 Like

It’s used by com.unity.immediate-window which needs Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScript.EvaluateAsync
https://docs.unity3d.com/Packages/com.unity.immediate-window@1.1/manual/index.html

I’ve just learned that com.unity.immediate-window is deprecated and no longer supported.

I know it has been requested several times and there has never been a response.

Have you thought about the possibility of marking packages as deprecated? Now it is not clear which packages are still supported and in development (you use private github repos) and which are not.

I’m not really excited about the way packages (in general) are deprecated. I don’t think there is good communication about this happening. For these specific ones, I’m not directly involved, nor do I really have any say in the general case either. So I can’t do much.

2 Likes

If you could bring it up somewhere so it is generally better handled would be very much appreciated.

Yep - will do!

7 Likes

@JoshPeterson Thank you for the reply.

For those who are interested in new C# features, I created two packages.

Roslyn binaries v3.7 (C# 8.0) for Unity 2020.2 or newer
https://github.com/merryyellow/code-analysis-3-7.git

Roslyn binaries v3.11 (C# 9.0) for Unity 2021.2 or newer
https://github.com/merryyellow/code-analysis-3-11.git

You can still use Unity’s package “com.unity.code-analysis”, which uses Roslyn binaries v2.10 and supports C# 7.3

6 Likes

Hi, I’m wondering if the built-in roslyn alanyzer allow source code modification (I only see code generation in the documentation)? I’ve managed to have a CSharpSyntaxRewriter class working with the com.unity.code-analysis package but I did not know it was deprecated :frowning: