"Add to import list" fails to add constructor import to type import when they're named the same. #1768
Labels
component: ghcide
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Steps to reproduce
Minimum working example:
Expected behaviour
Data constructor
Foo
inf = Foo 1
is correctly underlined with red as 'Foo' constructor is not in scope. Clickingctrl+.
opens code actions tab. I would expect to find there action "Add Foo(Foo) to the import list of A." that would append to type import also constructor import.Actual behaviour
Only available code action is "Add Foo to the import list of A.". This action doesn't change the import.
If the constructor name is different from the type name the code action shows properly and works as expected (that is action "Add Foo(MakeFoo) to the import list of A" shows up and works).
The problem also exist if we use
data
instead ofnewtype
.Include debug information
LSP logs:
Logs when I click
ctrl+.
showing code actions tab/menu.And then choose option
Add "Foo" to the import list of A.
Your environment
I am sorry but I can't find haskell-language-server executable to tell its version. It's not in the path; not in $HOME in .vscode-server, .cabal, .stack, .local; not on Windows in %APPDATA%\Code\User\globalStorage.
I can only say that I expect it to be recent as VSCode updated hls around a week or two ago.
Which OS do you use:
Windows Subsystem for Linux with Ubuntu 20.04.
Which lsp-client do you use:
VS Code
Describe your project (alternative: link to the project):
stack project
The text was updated successfully, but these errors were encountered: