Skip to content

Evaluate (-- >>>) not working after pattern matching #4141

Closed
@turbotimon

Description

@turbotimon

Your environment

Which OS do you use: Linux (NixOS)
VSCode: 1.84.2
Haskell Extension: v2.4.3 and v2.5.2

Steps to reproduce

-- >>> evaluate sumdown 3

sumdown :: Int -> Int
-- sumdown n = if n==0 then 0 else n + sumdown (n-1)
sumdown 0 = 0
sumdown n = n + sumdown (n-1)

-- >>> evaluate sumdown 3

x = undefined

-- >>> evaluate sumdown 3

image

Expected behaviour

Evaluate.. is visible in line 9 like it is in 2 and 13

Actual behaviour

Evaluate isn't shown in line 9. This seems to be always the case right after a pattern matching expression

For example, it works in line 2 and 13 and it also works if you replace the pattern matching with the if/else one-liner:

image

Include debug information

Execute in the root of your project the command haskell-language-server-wrapper --debug . and paste the logs here (you can find the executable location here):

Debug output:
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 2.4.0.0 x86_64 ghc-9.4.8
Current directory: /home/erti/fp
Operating system: linux
Arguments: ["--debug","."]
Cradle directory: /home/erti/fp
Cradle type: Stack

Tool versions found on the $PATH
cabal:          Not found
stack:          2.13.1
ghc:            9.4.8


Consulting the cradle to get project GHC version...
2024-03-13T16:57:49.777009Z | Debug | executing command: stack setup --silent
2024-03-13T16:57:57.463471Z | Debug | executing command: stack exec ghc -- --numeric-version
Project GHC version: 9.4.8
haskell-language-server exe candidates: ["haskell-language-server-9.4.8","haskell-language-server"]
Launching haskell-language-server exe at:/run/current-system/sw/bin/haskell-language-server-9.4.8
2024-03-13T16:58:05.373453Z | Debug | executing command: stack setup --silent
2024-03-13T16:58:13.166375Z | Debug | executing command: stack exec ghc -- -v0 -package-env=- -ignore-dot-ghci -e Control.Monad.join (Control.Monad.fmap System.IO.putStr System.Environment.getExecutablePath)
2024-03-13T16:58:21.300263Z | Debug | executing command: stack setup --silent
2024-03-13T16:58:28.935202Z | Debug | executing command: stack exec ghc -- --print-libdir
2024-03-13T16:58:41.297299Z | Info | haskell-language-server version: 2.4.0.0 (GHC: 9.4.8) (PATH: /nix/store/9y4mslfqg3c68v4hxqnh38z1zj1pl1a3-haskell-language-server-2.4.0.0/bin/.haskell-language-server-9.4.8-unwrapped)
2024-03-13T16:58:41.299972Z | Info | Directory: /home/erti/fp
2024-03-13T16:58:41.300949Z | Info | Logging heap statistics every 60.00s
 ghcide setup tester in /home/erti/fp.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /home/erti/fp
Found 37 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
  ()

Step 3/4: Initializing the IDE
2024-03-13T16:58:41.357956Z | Debug | Initializing exports map from hiedb
2024-03-13T16:58:41.359422Z | Debug | Shake session initialized

Step 4/4: Type checking the files
2024-03-13T16:58:41.394051Z | Debug | Done initializing exports map from hiedb. Size: 141
2024-03-13T16:58:41.399869Z | Info | Cradle path: test/Chapter_03_Spec.hs
2024-03-13T16:58:41.400306Z | Warning | No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for test/Chapter_03_Spec.hs.
Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2024-03-13T16:58:41.410675Z | Debug | Cradle: Cradle {cradleRootDir = "/home/erti/fp", cradleOptsProg = CradleAction: Stack}
2024-03-13T16:58:41.411128Z | Info | invoking build tool to determine build flags (this may take some time depending on the cache)
2024-03-13T16:58:41.412605Z | Debug | executing command: stack repl --no-nix-pure --with-ghc /home/erti/.cache/hie-bios/wrapper-b54f81dea4c0e6d1626911c526bc4e36 

Paste the contents of extension specific log, you can check instructions about how to find it here

Extension log:
2024-03-13T17:01:56.688443Z | Info | Typechecking reverse dependencies for NormalizedFilePath "/home/erti/fp/src/Chapter_06 copy.hs": [  ]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions