[purs ide] Hover doesn't show types for non-top-level identifiers

Open
#4,595 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
haskell, neovim
Domain
tooling

Research direction

Reproduce the hover behavior in the provided PureScript sample using IntelliJ or neovim, checking s0, s1, s2, s3, and lambda or function parameters. Start by tracing how hover type information is requested for non-top-level identifiers; done means each local identifier reports its String type instead of “No information available.”

Written by the indexing model from the issue text.

Description

type: bug

Description

IDE doesn't show type information for identifiers that aren't defined at the top level.

To Reproduce

Sample program:

module Main where

import Prelude

import Effect (Effect)
import Effect.Console (log)

s0 :: String
s0 = ""

main :: Effect Unit
main =
  let s1 :: String
      s1 = ""
  in do
      let  s2 :: String
           s2 = ""
      log s0
      log s1
      log s2
      log s3
  where
    s3 :: String
    s3 = ""

Expected behavior

An identical Haskell program shows s{0,1,2,3} with type String:

Image Image

But, purescript IDE fails to fetch the type info for s{1,2,3} (status line at the bottom says No information available):

Image Image

Additional context

Originally experienced in IntelliJ, but also reproducible in neovim.

This also applies to function/lambda parameters. Figuring out the types of a lambda's parameters can be really useful.

PureScript version

0.15.16

Dominant language
Haskell
Stars
8.9k
Forks
574
Avg merge
6d 23h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from purescript/purescript

All issues in purescript/purescript

Similar issues

More Haskell issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.