Skip to content

Extract variable should include type when always_include_types lint is enabled #4177

@h-unterp

Description

@h-unterp

Is your feature request related to a problem? Please describe.
I prefer to avoid var whenever possible. When I use the extract local variable feature, it only extracts it as var:

text.split(" ")

becomes

var text2 = text.split(" ")

Describe the solution you'd like
Use the types, if provided. So:

List<String> text2 = text.split(" ")

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris enhancementrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions