dotnet / format

Home for the dotnet-format command

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Namespace of generated code not detected

garcipat opened this issue · comments

Issue

We have a source code generator generating code in a defined namespace

namespace Path.To.My.Generated.Code;

public static class MyGeneratedClass
{
..
}

and we are consumig that generator in a different assembly

using Path.To.My.Generated.Code;

var field = MyGeneratedClass.Field;

when I now run dotnet format, the using Path.To.My.Generated.Code gets removed becasue our style removes unused using.
Therefore code doesnt compile anymore becasue the using is then missig.

System information:

  • Our Code generator uses the CSharp 4.6 package
  • And we have dotnet SDK 7.0.401 installed in our client

Are analyzers not run? Or do I have to register my analyzer in an additional place?

If any other infos are required tell me.