dhall-haskell/dhall-lsp-server/src/Dhall/LSP
Frederik Ramcke 2cd4ed948f dhall-lsp-server: Improve type-on-hover behaviour over binders (#1062)
* Improve type-on-hover behaviour over binders

Dhall's parser does not generate `Src` annotations for the names in
binders, which means that it's not quite as straight-forward to check
whether the user meant to hover over it and see its type as one would
hope. As a result, the current "naive" implementation sometimes behaves
slightly unintuitively and returns the type of the entire expression,
rather than the type of the bound variable. E.g.
  let x = 2 in "text"
      ~
would result in the type `Text` being displayed, rather than `Natural`
as one would expect. Since the language server also marks the expression
whose type is being displayed, the behaviour isn't quite that bad in
practice (we aren't falsely led to believe that `x` has type `Text`).

This change recovers the `Src` information describing the bound variable
names and handles those cases in a way that should be more in line with
the expectations of the user.

* Fix exprAt not handling multi-lets correctly

* Fix merge left-overs
2019-07-06 23:17:52 +00:00
..
Backend dhall-lsp-server: Improve type-on-hover behaviour over binders (#1062) 2019-07-06 23:17:52 +00:00
Handlers.hs dhall-lsp-server: Improve type-on-hover behaviour over binders (#1062) 2019-07-06 23:17:52 +00:00
Server.hs dhall-lsp-server: Implement caching (#1040) 2019-07-01 17:30:32 +00:00
State.hs dhall-lsp-server: Implement caching (#1040) 2019-07-01 17:30:32 +00:00
Util.hs dhall-lsp-server: Implement caching (#1040) 2019-07-01 17:30:32 +00:00