Skip to content

Codelens: Not documented dependency on Prelude (NoImplicitPrelude EXT ON, causing it to output nothing) #1307

Open
@pe200012

Description

@pe200012

Your environment

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

 I  ~/.c/C/U/g/haskell.haskell > ./haskell-language-server-wrapper-0.9.0-linux  --probe-tools                                 2021年02月05日 05時14分36秒
haskell-language-server version: 0.9.0.0 (GHC: 8.10.1) (PATH: /home/pe200012/.config/Code - Insiders/User/globalStorage/haskell.haskell/haskell-language-server-wrapper-0.9.0-linux) (GIT hash: 46d2a3dc7ef49ba57b2706022af1801149ab3f2b)
Tool versions found on the $PATH
cabal:          2.4.1.0
stack:          2.5.1
ghc:            Not found

Which lsp-client do you use: VS Haskell Extension

Describe your project (alternative: link to the project): https://github.com/pe200012/TAPL-Practice

Contents of hie.yaml:

cradle:
  stack:
    - path: "./src"
      component: "TAPL-Practice:lib"

    - path: "./app/Main.hs"
      component: "TAPL-Practice:exe:TAPL-Practice-exe"

    - path: "./app/Paths_TAPL_Practice.hs"
      component: "TAPL-Practice:exe:TAPL-Practice-exe"

    - path: "./test"
      component: "TAPL-Practice:test:TAPL-Practice-test"

Steps to reproduce

-- main.hs
{-# LANGUAGE NoImplicitPrelude #-}
module Main where

-- >>> 1

Expected behaviour

A plain "1" should appear under the evaluation statement when clicking Evaluate...

Actual behaviour

Nothing happens, even without an error message!

What I found

I found that you'd need these types imported from Prelude to make codelens available:

String,
Monad((>>=), (>>), return),
(.),  
Show(..),
IO

It's frustrating that there isn't even a single word talking about the dependency on it. It took about several hours for me to figure out the cause.

I wonder if you could add this information to the tutorial, which would help a lot when others encounter the same issue like me. Thanks in advance!

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