Skip to content

x/tools/gopls: add a setting to control removal of unused imports, and a quickfix #54362

Open
@findleyr

Description

@findleyr

We see feedback in survey results that users don't want unused imports to be removed by the organizeImports code action. I myself sometimes get annoyed by this behavior: it can be frustrating to manually type out an import path, save, and have the import disappear.

Surprisingly, I don't think we have an open (or closed) request for this feature, unless my search failed me.

I think we should consider a configuration option removeUnusedImports to control the removal of unused imports, and the default should probably be to not to remove unused imports EDIT: I take that back, the default behavior should not change.

Metadata

Metadata

Assignees

Labels

FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.gopls/imports

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions