Skip to content

Extend wrong thing to the import list automatically #679

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
berberman opened this issue Dec 17, 2020 · 5 comments
Closed

Extend wrong thing to the import list automatically #679

berberman opened this issue Dec 17, 2020 · 5 comments
Labels
component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@berberman
Copy link
Collaborator

I used ghcide master before HLS 0.7.0 released, and I encountered this many times.
Importing things automatically is a cool feature, but here are some unsolved defects: haskell/ghcide#930 (comment)
BTW, before these problems get fixed, I would like to disable this automatic extending, but there seems to be no way :(

Your environment

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

haskell-language-server version: 0.7.0.0 (GHC: 8.10.2) (PATH: /home/berberman/.cabal/store/ghc-8.10.2/haskell-language-server-0.7.0.0-366830c6e84454f47d73ac01246969cb5c550194b34bde3428fbd57c6144f4d0/bin/haskell-language-server)
Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.5.1
ghc:		8.10.2

Which lsp-client do you use:

vscode
Describe your project (alternative: link to the project):
a new draft project

Steps to reproduce

Peek

Expected behaviour

Don't add return to the import list.

Actual behaviour

It was added incorrectly.

@berberman
Copy link
Collaborator Author

In this case, buildable was already in scope, imported by import Distribution.Types.BuildInfo (BuildInfo (..)):

Peek

After I switched the order of import Distribution.Types.BuildInfo (BuildInfo (..)) and import Distribution.PackageDescription (repoLocation):

Peek

🤦🏻‍♂️

@berberman
Copy link
Collaborator Author

I decided to switch back to HLS 0.6.0. Every time I press Enter after typed "BuildInfo", HLS will produce import Distribution.PackageDescription (repoLocationBuildInfo, ) at this line, which breaks typecheck, hvoer, diagnostic, etc. This is quite common, resulting in a bad user experience.

@jneira jneira added component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. status: regression test needed labels Dec 17, 2020
@berberman
Copy link
Collaborator Author

Maybe #670 could provide an option to disable extendImportList temporarily, before we elaborate this feature.

pepeiborra added a commit to pepeiborra/ide that referenced this issue Dec 17, 2020
It seems that this feature needs a bit more work, as reported in haskell#679

I am disabling it locally in HLS rather than in ghcide
@jneira
Copy link
Member

jneira commented Dec 17, 2020

I would be nice to add a regression test and mark it as known broken, here and/or in ghcide.
I would keep open, as the plan is #685 disable the feature temporary, to check it is not reproduced when it is reenabled

@berberman
Copy link
Collaborator Author

Closed by #1266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide status: blocked Not actionable, because blocked by upstream/GHC etc. 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

2 participants