haskell / haskell/haskell-language-server

Inlay hints usage

Open
#2,938 23 comments 4 reactions 0 assignees View on GitHub
status: in discussion type: enhancement
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
2d 19h
Merged PRs (30d)
11

Description

In order to prevent spam, I open a thread to discuss about the inlay hint usage in Haskell.

Previous info is here: https://github.com/haskell/haskell-language-server/issues/2019#issuecomment-1144502854

lsp-3.17 had supported inlay hint, in which can embed some useful info, it wildly used by displaying function parameter names in other languages. But it is not suitable in Haskell since Haskell have a lot of currying, which looks not valid to display parameter name in Haskell.

Sample of inlay hint:
![image](https://user-images.githubusercontent.com/16057632/171578120-40b30ad6-be5d-4f8b-a1f9-cc5c757733e8.png)

I don't want Haskell missing this straightforward function, so I wrote these to discuss what we can do to use inlay hint best, here are some I'd like:

1. Show type signature for let expressions
```haskell
f = let g {- inlay hint here, should be `:: Bool` -}= True
in g
```

2. Show operator fixity as mentioned in https://github.com/haskell/haskell-language-server/issues/2019#issuecomment-1144499665

All these are initial ideas for discussion, feel free to put forward any suggestions:)

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.