fwcd / fwcd/kotlin-language-server

Report unused imports as diagnostics

Open
#353 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
2k
Forks
252
PR merge metrics
No merged PRs in 30d

Description

IntellIJ IDEA reports unused imports as a diagnostic for the user. While formatters can remove unused imports automatically, it still might be nice to have a diagnostic/warning on it in your editor.

Could not find any additional compiler flags to automatically include it in the current diagnostics. There might be a need for a lightweight analyzer that adds to the current diagnostics (it seems like [IntelliJs codebase does that](https://github.com/JetBrains/intellij-kotlin/blob/e2c105911e1fca5b7fe6b9dc10cf9f75463a3c13/idea/src/org/jetbrains/kotlin/idea/inspections/KotlinUnusedImportInspection.kt), but we can probably take some shortcuts in our implementation)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the linked IntelliJ reference, KotlinUnusedImportInspection.kt, and trace how the language server currently produces diagnostics. Determine how unused imports can be detected and surfaced as editor warnings, then verify that an editor reports them while formatters can still remove them.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.