ghcide/exe
Pepe Iborra f804b138dc
Support for interface files (#457)
* Rules for loading interface files

* Typechecking with interface files

* Add a note in the README about the optimal project setup

* Improve support for hs-boot files

The branch was failing to load GHC because the module graph was missing
edges between a .hs file and its .hs-boot file. This means the .hs-boot
file was getting added into the HPT after the .hs file which led to
confusing errors about variables being out of scope.

The fix is to maintain a map from hs-boot to hs files and then add an
edge for this case when calling `transitiveDependencies`.

Also tidy up some code in setupEnv which I assume was attempting to fix
this but in an incorrect manner.

Add the -boot suffix when looking for hi-boot files.

For some reason, the `hi` path is not set to the right thing for
`hs-boot` files. I don't know why not perhaps it is ok to use an
existing `.hi` file in place of an `hs-boot` file. More investigation
needed. My experience is that GHC is quite bad a recompilation avoidance
for hs-boot files anyway.

For example: https://gitlab.haskell.org/ghc/ghc/issues/17434

Add the -boot suffix when writing interface files

* Generate .hi and .hie files during type checking

* Refactor GetModIface to not retain TypeChecked module in memory

This improves memory performance on a cold cache.

* Trailing whitespace

* Turn debug log messages into diagnostics

* Implement "hie" files for ghc-8.6.5

This means that the .hi files patch can also be used with 8.6.5

* Add tests for hover/definition on imported symbols

* hlints

* Generate .hie files when missing

* Fix subtle bug in setDefaultHieDir

* Simplify optimal project setup in README

* Move interface loading diagnostics behind --test flag

Reusing the --test flag for this seems harmless, I cannot justify introducing a
new flag

* Avoid expensive interface file generation for files of interest

* avoid redundant arguments (thanks Moritz K)

* qualify a DAML only comment

* Skip module source when generating hie file

thanks Moritz Kiefer for noting that we don't care for the generated .hie files
to embed module sources

* runGhcEnv <-> evalGhcEnv

* Apply suggestions from code review

Thanks Moritz Kiefer

Co-Authored-By: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

* Add suggested Show instance

Co-Authored-By: Matthew Pickering <matthewtpickering@gmail.com>

* Use Control.Exception.Safe

This is to avoid accidentally capturing asynchronous exceptions

* Rename atomicFileUpdate

* Fix a flaky test

We have to be careful with module naming in tests to avoid interference of .hi
files across tests

* Undo formatting of D.IDE.GHC.Util

* follow changes in master

Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-03-24 12:39:53 +01:00
..
Arguments.hs Tests for cradle loading (#460) 2020-03-04 17:31:24 +01:00
Main.hs Support for interface files (#457) 2020-03-24 12:39:53 +01:00
Rules.hs Use NormalizedFilePath and adapt types of haskell-lsp-0.21 (#479) 2020-03-23 09:07:04 +01:00
RuleTypes.hs Fix regression in cradle loading logic (#450) 2020-02-26 09:16:17 +01:00