Skip to content

Eval plugin appears to stop working after a function def that has more than one pattern match #3312

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
googleson78 opened this issue Nov 1, 2022 · 9 comments
Labels
component: hls-eval-plugin type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@googleson78
Copy link
Contributor

googleson78 commented Nov 1, 2022

Your environment

Which OS do you use?

NixOS

Which version of GHC do you use and how did you install it?

[nix-shell:/tmp]$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.4

via nix

How is your project built (alternative: link to the project)?

No project

Which LSP client (editor/plugin) do you use?

Neovim+LanguageClient-neovim

Which version of HLS do you use and how did you install it?

[nix-shell:/tmp]$ haskell-language-server --version
2022-11-01T15:02:05.261746Z | Info | No log file specified; using stderr.
haskell-language-server version: 1.8.0.0 (GHC: 9.2.4) (PATH: /nix/store/d717g1x6mr0310lijj6671pws1k5cvn7-haskell-language-server-1.8.0.0/bin/.haskell-language-server-9.2.4-unwrapped)

via nix-shell -p haskell.packages.ghc924.haskell-language-server

Have you configured HLS in any way (especially: a hie.yaml file)?

No

Steps to reproduce

For the following file

-- >>> 5
-- 5
bla :: Bool -> Bool
bla True = True
bla False = False

The Evaluate... code lens pops up. However, for the following file

bla :: Bool -> Bool
bla True = True
bla False = False
-- >>> 5

it doesn't.

The thing that triggers this issue appears to be any multiline (more than one match) function definition.

This issue does not reproduce if we're using an hls built with 9.0.2

@googleson78 googleson78 added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Nov 1, 2022
@googleson78 googleson78 changed the title Eval plugin appears to stop working after a function def that matches Eval plugin appears to stop working after a function def that has more than one pattern match Nov 1, 2022
@googleson78
Copy link
Contributor Author

Here're the logs from the language server and from the client from the following experiment:

  1. Start with the file that has Evaluate.
  2. Wait for Evaluate... to pop up
  3. Move the -- >>> 5 below the function.
  4. Wait some time.
  5. Close the file

LanguageClient.log
LanguageServer.log

@turbotimon
Copy link

turbotimon commented Feb 21, 2023

Maybe it's the same problem with a newline at the end of the file? #3500

@PiDelport
Copy link
Contributor

@jfong2702
Copy link

I am having the same issue what was the resolution?

@googleson78
Copy link
Contributor Author

This continues to be unresolved - any clues? The eval functionality is extremely helpful for teaching - you can leave examples with expected output for students, and they can easily run pseudo-unit tests to verify that their program works for those cases

@trevarj
Copy link

trevarj commented Dec 30, 2023

@googleson78 FYI, this seems resolved on the HLS 2.5.0.0.

@fendor
Copy link
Collaborator

fendor commented Dec 30, 2023

image

I can still reproduce on 2.5.0.0 with GHC 9.4.8.

@trevarj
Copy link

trevarj commented Dec 30, 2023

I was testing using 2.5.0.0 and GHC 9.8.1.

I should note that the behavior is still weird on my editor (nvim + haskell-tools.nvim) where the eval results overwrite my actual code 😄

image

@jhrcek
Copy link
Collaborator

jhrcek commented Mar 3, 2024

This issue has been fixed by #4113
The fix is probably going to be included in the next release of hls (2.8.0.0?)

@jhrcek jhrcek closed this as completed Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-eval-plugin 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

8 participants