Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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

Discussion in 'Experimental Scripting Previews' started by sapsari, Feb 13, 2022.

  1. sapsari

    sapsari

    Joined:
    May 30, 2013
    Posts:
    12
    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.
     
  2. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,771
    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 https://docs.unity3d.com/Manual/roslyn-analyzers.html.
     
    sapsari likes this.
  3. rectalogic

    rectalogic

    Joined:
    Nov 30, 2012
    Posts:
    35
  4. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,771
  5. bdovaz

    bdovaz

    Joined:
    Dec 10, 2011
    Posts:
    1,015
    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.
     
  6. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,771
    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.
     
    goncalo-vasconcelos and bdovaz like this.
  7. MiTschMR

    MiTschMR

    Joined:
    Aug 28, 2018
    Posts:
    358
    If you could bring it up somewhere so it is generally better handled would be very much appreciated.
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,771
    Yep - will do!
     
  9. sapsari

    sapsari

    Joined:
    May 30, 2013
    Posts:
    12
    @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
     
    Maeslezo, eelstork, DrViJ and 2 others like this.
  10. Florian-Nouviale

    Florian-Nouviale

    Joined:
    Mar 14, 2013
    Posts:
    51
    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 :(