Skip to content

Organize Imports Doesn't Respect "Groups" #78553

@chriszwickerocteris

Description

@chriszwickerocteris

Versions:

  • VSCode Version: 1.37.0-Insider
  • OS Version:Darwin x64 18.6.0

Description:

  • When using "Organize Imports", import "groups" are ignored. Instead, each group should be treated individually, retaining import grouping.
  • Comments separating groups are removed if the import following the comment is removed (it seems as if comments were assumed to be associated with the following import - that may be how some / many people work, but others use lines with only a comment as a "section title" and would add comments behind the code related to. Maybe this should be a setting?)

Steps to Reproduce:

  1. In a TS source with a few imports, create 2+ groups of imports (separating them by an empty line)
  2. Add a comment on the line above an unused import (add one if there is none)
  3. Run "Organize Imports"

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

*extension-candidateIssue identified as good extension implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions