Skip to content

Add open code fix to place statements at the top of the file by default? #5737

Closed
@cartermp

Description

@cartermp

Currently, the add open code fixer will place an open statement at the top of the containing scope you are working in. There is a setting to place the statement at the top of the file. The tradeoff is thus:

At top Not at top
Benefit Can use symbols from that namesspace anywhere else in the file Separates namespaces by scope (e.g., module), which some people may prefer
Drawback Could be seen as polluting the top of the file Cannot access that namespace outside of the scope it was opened in

So I think the root question is, do people generally prefer open statements at the top of a file, or would they prefer tooling to always try to hide them in the scope in which the symbol was used?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions