zls icon indicating copy to clipboard operation
zls copied to clipboard

Organize Imports doesn't remove duplicate or unused imports

Open Jarred-Sumner opened this issue 9 months ago • 0 comments

Zig Version

0.14.0

ZLS Version

0.14.0-dev

Client / Code Editor / Extensions

Visual Studio Code

Steps to Reproduce and Observed Behavior

  1. Source code:
const Foo = @import("./foo.zig");
  1. Run "Organize imports"
  2. Source code:
const Foo = @import("./foo.zig");

Expected Behavior

When you use "Organize imports" in the TypeScript LSP, it removes unused imports, which sets the expectation for other LSPs that implement "Organize imports" to remove unused imports.

  1. Source code:
const Foo = @import("./foo.zig");
  1. Run "Organize imports"
  2. Source code:

Relevant log output


Jarred-Sumner avatar Apr 04 '25 22:04 Jarred-Sumner