Skip to content

Eval-plugin: Evaluate -- >>> does not work when there is one or more newlines at end of the file #3500

Closed
@turbotimon

Description

@turbotimon

Your environment

Which OS do you use? Tested on Windows, Ubuntu and MacOS

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

ghcup list
[ Info  ] downloading: https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-0.0.7.yaml as file C:\ghcup\cache\ghcup-0.0.7.yaml
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 
[ Warn  ] New ghc version available. If you want to install this latest version, run 'ghcup install ghc 9.4.4'      
[ Warn  ] New cabal version available. If you want to install this latest version, run 'ghcup install cabal 3.8.1.0'
[ Warn  ] New stack version available. If you want to install this latest version, run 'ghcup install stack 2.9.3'
[ Info  ] verifying digest of: gs.exe
   Tool  Version  Tags                      Notes      
X  ghc   7.10.3   base-4.8.2.0
X  ghc   8.0.2    base-4.9.1.0
X  ghc   8.2.2    base-4.10.1.0
X  ghc   8.4.1    base-4.11.0.0
X  ghc   8.4.2    base-4.11.1.0
X  ghc   8.4.3    base-4.11.1.0
X  ghc   8.4.4    base-4.11.1.0
X  ghc   8.6.1    base-4.12.0.0
X  ghc   8.6.2    base-4.12.0.0
X  ghc   8.6.3    base-4.12.0.0
X  ghc   8.6.4    base-4.12.0.0
X  ghc   8.6.5    base-4.12.0.0
X  ghc   8.8.1    base-4.13.0.0
X  ghc   8.8.2    base-4.13.0.0
X  ghc   8.8.3    base-4.13.0.0
X  ghc   8.8.4    base-4.13.0.0
X  ghc   8.10.1   base-4.14.0.0
X  ghc   8.10.2   base-4.14.1.0
X  ghc   8.10.3   base-4.14.1.0
X  ghc   8.10.4   base-4.14.1.0
X  ghc   8.10.5   base-4.14.2.0
X  ghc   8.10.6   base-4.14.3.0
X  ghc   8.10.7   base-4.14.3.0             hls-powered
X  ghc   9.0.1    base-4.15.0.0
X  ghc   9.0.2    base-4.15.1.0             hls-powered
X  ghc   9.2.1    base-4.16.0.0
X  ghc   9.2.2    base-4.16.1.0
X  ghc   9.2.3    base-4.16.2.0
X  ghc   9.2.4    base-4.16.3.0
IS ghc   9.2.5    recommended,base-4.16.4.0 hls-powered
X  ghc   9.2.6    base-4.16.4.0
X  ghc   9.4.1    base-4.17.0.0
X  ghc   9.4.2    base-4.17.0.0
X  ghc   9.4.3    base-4.17.0.0             hls-powered
X  ghc   9.4.4    latest,base-4.17.0.0      hls-powered
X  cabal 2.4.1.0
X  cabal 3.0.0.0
X  cabal 3.2.0.0
X  cabal 3.4.0.0
X  cabal 3.4.1.0
X  cabal 3.6.0.0
IS cabal 3.6.2.0  recommended
X  cabal 3.8.1.0  latest
X  hls   1.1.0
X  hls   1.2.0
X  hls   1.3.0
X  hls   1.4.0
X  hls   1.5.0
X  hls   1.5.1
X  hls   1.6.0.0
X  hls   1.6.1.0
X  hls   1.7.0.0
X  hls   1.8.0.0
IS hls   1.9.0.0  recommended
I  hls   1.9.1.0  latest
X  stack 2.5.1
X  stack 2.7.1
X  stack 2.7.3
X  stack 2.7.5
IS stack 2.9.1    recommended
X  stack 2.9.3    latest
IS ghcup 0.1.19.1 latest,recommended

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

Haskell v2.2.2
https://marketplace.visualstudio.com/items?itemName=haskell.haskell

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

see above

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

no

Steps to reproduce

Eval-plugin: Evaluate -- >>> does not work (in some cases) when there is one or more newlines at end of the file. Also, only if the -- >>> is AFTER the function definition. It works when its before

21-02-2023_17-47-19

myProduct :: Num p => [p] -> p
myProduct [] = 1
myProduct (n:ns) = n * myProduct ns

-- >>> there is no evaluate

{-
myProduct [2,3,4]
= {???}
???
...
-}

Expected behaviour

Evaluate does work with newline at end

Actual behaviour

Evaluate does not work with newline at end

Debug information

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-eval-plugintype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions