Skip to content

Properly import data constructors #1210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GuillaumeDesforges opened this issue Jan 14, 2021 · 9 comments
Closed

Properly import data constructors #1210

GuillaumeDesforges opened this issue Jan 14, 2021 · 9 comments
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@GuillaumeDesforges
Copy link

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

$ haskell-language-server-wrapper --probe-tools
haskell-language-server version: 0.6.0.0 (GHC: 8.10.2) (PATH: /nix/store/li7n1p632m5wkkzw7yvw4ahj2mn55c2d-haskell-language-server-0.6.0.0/bin/haskell-language-server-wrapper)
Tool versions found on the $PATH
cabal:          Not found
stack:          2.5.1
ghc:            Not found

Which lsp-client do you use: VS Code

Describe your project (alternative: link to the project):

Contents of hie.yaml:

cradle:
  stack:

Steps to reproduce

  • Have some imports from a module, for example
    import Katip (permitItem)
    
  • Use a data constructor (e.g. ColorIfTerminal) in the code.
  • Trigger code action (e.g. "Add ColorIfTerminal to to the import list of Katip")

Expected behaviour

Imports become

import Katip (permitItem, ColorStrategy(ColorIfTerminal))

Actual behaviour

import Katip (permitItem, ColorIfTerminal)

which creates an error

@Ailrun
Copy link
Member

Ailrun commented Jan 15, 2021

Maybe related with this merged PR?
#766
I'm not sure, though.

@Ailrun Ailrun added status: needs repro type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jan 15, 2021
@jneira
Copy link
Member

jneira commented Jan 15, 2021

@mrBliss please, could you take a quick look to confirm the bug could be related with that pr?

@mrBliss
Copy link
Contributor

mrBliss commented Jan 15, 2021

@mrBliss please, could you take a quick look to confirm the bug could be related with that pr?

Yes, I'll look into it.

@mrBliss
Copy link
Contributor

mrBliss commented Jan 15, 2021

@GuillaumeDesforges You are using haskell-language-server-0.6.0.0, which is relatively old, we're at 0.8.0.0 now. My PR, #766, was not even merged in 0.6.0.0. (It's good practice to first try to reproduce with the last release (or even HEAD) before opening an issue, the bug might have already been fixed.)

I have tried to reproduce this with a recent version, which includes my #766, and I get the following suggestion: Add ColorStrategy(ColorIfTerminal) to the import list of Katip, which is correct.

I actually think #766 didn't change this but an earlier PR did, e.g., haskell/ghcide#916.

@jneira jneira added status: needs info Not actionable, because there's missing information and removed status: needs repro labels Jan 15, 2021
@jneira
Copy link
Member

jneira commented Jan 15, 2021

@mrBliss many thanks for checking it, i should have checked the hls version before even ping you, sorry
I will wait the confirmation of @GuillaumeDesforges before closing it

@GuillaumeDesforges
Copy link
Author

Indeed, I was using HLS from nixpkgs (e9158eca70a from 09/12, not so long ago).

I'm glad things are going so fast!

Sorry for the inconvenience,

Best

@jneira jneira removed the status: needs info Not actionable, because there's missing information label Jan 15, 2021
@jneira
Copy link
Member

jneira commented Jan 15, 2021

@GuillaumeDesforges no problem at all, thanks for your bug reports

@Ailrun
Copy link
Member

Ailrun commented Jan 15, 2021

Sorry for linking your PR, @mrBliss. I should have checked the HLS version of this issue.
Thank you for all your investigation!

@mrBliss
Copy link
Contributor

mrBliss commented Jan 18, 2021

Sorry for linking your PR, @mrBliss. I should have checked the HLS version of this issue.
Thank you for all your investigation!

No problem at all. My PR indeed looked related 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants