Skip to content

Split dotnet_style_prefer_collection_expression to independently configure + autofix when_types_loosely_match and when_types_exactly_match #57359

Backlog

Description

@SamuelT-Beslogic

Is your feature request related to a problem?

I want when_types_exactly_match to appear as warnings and I want to run autofixes on them.
I want when_types_loosely_match to appear as suggestion (current default) and I won't run autofixes on them.

Describe the solution you'd like

dotnet_style_prefer_collection_expression = when_types_exactly_match --> dotnet_style_prefer_collection_expression_when_types_exactly_match = true
dotnet_style_prefer_collection_expression = when_types_loosely_match --> dotnet_style_prefer_collection_expression_when_types_loosely_match = true

Or more concisely: dotnet_style_prefer_collection_expression_exact_types / dotnet_style_prefer_collection_expression_loose_types

Alternatives you've considered

Leaving default dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion and having custom configuration + scripts for analyzer & fixes that redo dotnet_style_prefer_collection_expression = when_types_exactly_match:warning

Additional context

No response

Activity

  1. added
    untriaged
    on Nov 25, 2026
  2. locked and limited conversation to collaborators on Nov 25, 2026
  3. unlocked this conversation on Nov 25, 2026
  4. added
    needs team triage
    and removed
    untriaged
    on Nov 25, 2026
  5. github-actions commented on Nov 25, 2026

    @github-actions
    Contributor

    🎯 Agentic Issue Triage

    Triage Assessment:

    • 🏷️ Labels: Area-Roslyn Feature Request needs team triage Requires a full team discussion
    • 💻 Assignment: none | @dotnet/dotnet-cli
    • 🟨 Confidence: medium - Roslyn IDE style option is the strongest fit, but no CODEOWNERS section matches it.

    ➡️ Summary: Requests splitting the dotnet_style_prefer_collection_expression editorconfig option so exact and loose type matches get independent severities and autofixes. Follow up with the Roslyn IDE team, since the option is implemented there.

    Generated by 🏷️ Issue Triage for #57359 · copilot · auto (Claude Sonnet 5.5) · ~17 AIC · ⌖ ~2 AIC · ⊞ 15.5K · ◷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions