dhall-haskell/dhall-lsp-server
Frederik Ramcke 8ae7b603fe
dhall-lsp-server: Fix cache to correctly invalidate transitive dependencies (#1069)
* Move "Dot" import graph generation to Dhall.Main

Previously `Dhall.Import` would generate the import graph in "dot"
format while resolving imports. This change simplifies `Dhall.Import` to
only keep track of the adjacency list representing the import graph,
moving the logic for generating "dot" files to Dhall.Main.

This change will allow us to implement proper cache invalidation for
`dhall-lsp-server`.

* Correctly invalidate transitive dependencies

Fixes dhall-lsp-server`s caching behaviour to correctly invalidate
cached imports that (possibly indirectly) depend on the changed file.

Example:

Suppose we have the following three files:
{- In A.dhall -} 2 : ./B.dhall
{- In B.dhall -} ./C.dhall
{- In C.dhall -} Natural

Previously, changing C.dhall to `Text` would not cause `A.dhall` to stop
type-checking, since the old version of `B.dhall` (which evaluated to
`Natural`) would still have been in the cache. This change fixes that
behaviour.

* Make edges of import graph self-documenting

As suggested by @Gabriel439

* Don't cache expressions manually

After computing the diagnostics for a given file we added its normal
form to the cache, but forgot to add its dependencies to the dependency
graph. This bug points out that keeping the import graph consistent
manually is probably not a good idea. With this commit we never mess
with the import cache manually; this means that files are only cached
once they are depended upon by some other file, potentially causing us
to duplicate work (but no more than once).

* Fix left-overs from previous commit
2019-07-08 10:55:15 +00:00
..
app Simplify dhall-lsp-server and reorganise its modules (#992) 2019-06-07 07:47:07 +00:00
src/Dhall/LSP dhall-lsp-server: Fix cache to correctly invalidate transitive dependencies (#1069) 2019-07-08 10:55:15 +00:00
test Simplify dhall-lsp-server and reorganise its modules (#992) 2019-06-07 07:47:07 +00:00
ChangeLog.md LSP. Fix import errors location. Minor clean-up. Add tests for backend/diagnostics. (#868) 2019-03-26 13:20:25 +00:00
LICENSE Add dhall-lsp-server (#843) 2019-03-06 21:41:38 -08:00
README.md LSP. Fix import errors location. Minor clean-up. Add tests for backend/diagnostics. (#868) 2019-03-26 13:20:25 +00:00
Setup.hs Add dhall-lsp-server (#843) 2019-03-06 21:41:38 -08:00
default.nix Add dhall-lsp-server (#843) 2019-03-06 21:41:38 -08:00
dhall-lsp-server.cabal dhall-lsp-server: Implement caching (#1040) 2019-07-01 17:30:32 +00:00
shell.nix Add Nix support for `dhall-lsp-server` project (#849) 2019-03-10 09:43:44 -07:00

README.md

dhall-lsp-server

This is a Language Server Protocol server implementation for the Dhall programming language.

For installation or development instructions, see: