Skip to content
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

Type class constraint inserted as last line in source file #360

Closed
runeksvendsen opened this issue Aug 29, 2020 · 1 comment · Fixed by haskell/ghcide#839
Closed

Type class constraint inserted as last line in source file #360

runeksvendsen opened this issue Aug 29, 2020 · 1 comment · Fixed by haskell/ghcide#839
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@runeksvendsen
Copy link
Contributor

I'm using the haskell.haskell VSCode plugin (v1.1.0) with VSCode 1.48.1.

When I use the Quick Fix Add <constraint> to the context of the type signature for <function> the constraint(s) are inserted in the bottom of the source file. Please see attached screen recording for an illustration of the issue.

hls-insert-constraint-bug

@Ailrun Ailrun added editor: vscode type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Aug 29, 2020
@jhrcek
Copy link
Collaborator

jhrcek commented Sep 22, 2020

Hello, I'm also hitting this issue and couple of other odd behaviors with this context action.
I created a simple reproducer repository https://github.com/jhrcek/hls-add-to-context-broken

Here's a gif illustrating two issues I'm hitting with this feature:

hls-context-issue

Info about my environment:

$ haskell-language-server --probe-tools
haskell-language-server version: 0.4.0.0 (GHC: 8.8.3) (PATH: /home/jhrcek/.local/bin/haskell-language-server) (GIT hash: b43a8cd78d10d77184a895293d766a0fbceb5573)
Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.10.2

Could someone please take a look at this?
EDIT:
looks like the implementation of this feature lives in ghcide repo: https://github.com/haskell/ghcide/blob/4937586a2d356156a37f8611b5fa3ff8ece56093/src/Development/IDE/Plugin/CodeAction.hs#L689-L738

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

Successfully merging a pull request may close this issue.

3 participants