Skip to content

RemoveUnusedBinding offers to remove unused parameters but doesn't remove them #11741

@baronfel

Description

@baronfel

Is your feature request related to a problem? Please describe.

I think this reported issue/feature gap in FSAC is reproducible in the VS tooling as well.

For the code:

let inc i =
    2

with --warnon:1182 enabled, there will be a diagnostic issued for the parameter i, but the current codefix will not handle this scenario.

Describe the solution you'd like

I think a small change to the TryRangeOfBindingWithHeadPatternWithPos member could be made very similarly to what I've done in this PR, and the range that is derived from this member could be tagged as coming from a pattern or a binding.

Then, later in the codefix that result would be inspected to walk the text in slightly different ways for patterns and bindings, so that both kinds of triggering entities for this diagnostic could be handled.

Describe alternatives you've considered

Not doing this work, so that only nested bindings are removable.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions