haskell / haskell/haskell-language-server

!!MISSING: command!! is intermittently displayed instead of type class function signatures

Open
#3,827 17 comments 1 reaction 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
4d 3h
Merged PRs (30d)
12

Description

### Your environment

Which OS do you use?

Macbook Air M2 15" (Ventura 13.6)
Intel x86_64 (Ubuntu 20.04.6 LTS)

Same issue on both systems.

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

Installed with `ghcup`:

```
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.6.3

$ cabal --version
cabal-install version 3.10.1.0
compiled using version 3.10.1.0 of the Cabal library
```

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

https://github.com/konnik/haskell-json-parser

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

VSCode + haskell.haskell

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

```
$ haskell-language-server-wrapper --version
haskell-language-server version: 2.3.0.0 (GHC: 9.2.8) (PATH: /Users/niklas/.ghcup/hls/2.3.0.0/lib/haskell-language-server-2.3.0.0/bin/haskell-language-server-wrapper)
```

Installed by `ghcup`

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

no

### Steps to reproduce

Really don't know how to reproduce it. It's very intermittent and resolves itself.

### Expected behaviour

The code lens (don't know if this is the correct termiology) in vscode should show the type class signatures on my instance:

```haskell
instance Monad Parser where
return :: a -> Parser a // this is shown by vscode, not part of the source
return = pure
(>>=) :: Parser a -> (a -> Parser b) -> Parser b // this is shown by vscode, not part of the source
pa >>= fab = Parser $ \input -> do
(input', a) <- runParser pa input
runParser (fab a) input'
```

### Actual behaviour

```haskell
instance Monad Parser where
!!MISSING: command!! // this is shown by vscode, not part of the source
return = pure
!!MISSING: command!! // this is shown by vscode, not part of the source
pa >>= fab = Parser $ \input -> do
(input', a) <- runParser pa input
runParser (fab a) input'
```

If i click on the text "!!MISSING: command!!" the error message "command 'missing' not found" is shown in bottom right of vscode

### Debug information

Some things from the logs. Don't know if its relevant:

```
2023-10-03T17:41:54.161080Z | Info | Typechecking reverse dependencies for NormalizedFilePath "/Users/niklas/devel/haskell-json-parser/src/Json.hs": [ NormalizedFilePath "/Users/niklas/devel/haskell-json-parser/test/Test.hs" ]
2023-10-03T17:42:08.500584Z | Warning | Typechecked a file which is not currently open in the editor: /Users/niklas/devel/haskell-json-parser/src/Json.hs
This can indicate a bug which results in excessive memory usage.
This may be a spurious warning if you have recently closed the file.
If you haven't opened this file recently, please file a report on the issue tracker mentioning the HLS version being used, the plugins enabled, and if

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.