-
Notifications
You must be signed in to change notification settings - Fork 19k
x/tools/gopls: add a setting to control removal of unused imports, and a quickfix #54362
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues 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.Feedback 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.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/imports
Milestone
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues 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.Feedback 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.This label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.Issues related to the Go language server, gopls.gopls/imports
We see feedback in survey results that users don't want unused imports to be removed by the
organizeImportscode 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
removeUnusedImportsto control the removal of unused imports,and the default should probably be to not to remove unused importsEDIT: I take that back, the default behavior should not change.