haskell / haskell/haskell-language-server
Code action not showing on multi-line imports with unused record field
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 13
Description
### Steps to reproduce
Given `ModuleB`:
```haskell
module ModuleB where
newtype B = B {b1 :: String}
x = 1
```
and `ModuleA` which has an unused record field import within a multi-line import statement:
```haskell
module ModuleA where
import ModuleB
( B (b1),
x,
)
x' = x
```
### Expected behaviour
I expect the code action for removing the unused record field: `Remove B, B(b1) from import` to be shown on selecting the single line with the unused import.
### Actual behaviour
Instead, the code action does not show:

However, it shows when collecting the complete range of the import statement.

Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with the ModuleA and ModuleB snippets, selecting the single line containing the unused record field and then the complete import range. The change is done when the “Remove B, B(b1) from import” code action appears for the single-line selection as well.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100