Closed viluon closed 2 years ago
@ErnestKz and I did some work on this front. He might be in a good position to get it pushed through
https://github.com/ErnestKz/haskell-language-server/commit/c23b213d1a76486cb571b5317dadad72b6eca76e
Recently wrapped up some other stuff, I can pick this up now and try get it pushed through. 👍
Hey, unfortunately did not get around to spending time on it, and I'm not sure I can see myself spending time on it in the near future.
The fork https://github.com/ErnestKz/haskell-language-server/tree/explicit-prescedence is the most up to date I have it, so feel free if anyone would like to pick it up.
Also, here's a pair programming session with Isovector that built up to that point VIDEO
Many thanks for share your work
I just thought of this feature request too. Maybe this is self-evident, but I hope if this gets implemented, it also works for non-operator functions that have explicit infix notations :heart:
I'll pick this.
I'm thinking of adding an extra inlay hint for the operator, is it reasonable?
/cc @michaelpj
More a little off-topic, how about adding inlay hints to show signature for inner expressions?
f = g
where
-- inlay hint here
g = undefined
The lsp
library doesn't support inlay hints yet, I think.
Indeed, I would love to have type signature code lenses for local bindings, I'm not really sure why we don't!
I think just putting the fixity in the hover doc would be good enough for starters.
OK, we can put inlay hints later.
Pardon me if there's a better place to open this issue, or if it has been discussed already. I tried to look for similar suggestions but could not find any.
When dealing with infix operators -heavy expressions, it is sometimes difficult to tell what precedence various operators have. In some cases, different parenthesising can lead to semantically different but equally type-correct expressions.
It would be helpful if HLS could show the fixity of an operator along with its type in the hover. (Not very relevant screenshot follows)