Skip to content

running "Convert to GeneratedRegexAttribute" fixer wants to fix all kinds of other things #79892

@danmoseley

Description

@danmoseley

I built the fixer from ca5bb93 (ie, dotnet/runtime today) and put it into Files\dotnet\packs\Microsoft.NETCore.App.Ref\7.0.1\analyzers\dotnet\cs so that VS 2022 uses it.

I then cloned dotnet/msbuild, opened the solution in VS2022 17.4.3, built everything, then opened Expander.cs here
https://github.com/dotnet/msbuild/blob/main/src/Build/Evaluation/Expander.cs#L3018

I hit Ctrl-. and choose "Convert to GeneratedRegexAttribute" and this is what I get -- it wants to adjust many unrelated things, as below.

I'm not sure what's governing this -- in the repo's editor config, for example I see csharp_style_var_for_built_in_types = false:suggestion but if anything that suggests it ought to prefer String to string? Besides the fact i don't want it to touch any of these things. Is this a VS bug?

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions