Commit Graph

16 Commits

Author SHA1 Message Date
Pepe Iborra
9cd19eb4b7
Preserve more information about targets (#820)
* Preserve more information about targets

* Correctly model the special target

This should prevent infinite looping on cradles that do not provide targets,
such as the hie-bios implicit cradle (no longer used)
2020-09-18 09:36:29 +01:00
Pepe Iborra
4be22dc61d
Use optExtensions in Session loader (#816)
* Use optExtensions in Session loader

* Add boot suffix to target possible extensions
2020-09-17 19:44:16 +01:00
Pepe Iborra
b7c9d6da2d
Send a warning when using the implicit cradle (#799)
* Send a warning when using the implicit cradle

* Implicit cradle

Co-authored-by: Neil Mitchell <ndmitchell@gmail.com>

Co-authored-by: Neil Mitchell <ndmitchell@gmail.com>
2020-09-14 22:43:10 +01:00
Javier Neira
f79e930bc0
Use implicit-hie when no explicit hie.yaml (#782)
* Use implicit-hie when no explicit hie.yaml

* Use implicit-hie-cradle master in all build config files

* Set correct hie-bios version for ghc-8.10.1

* Fix windows ci build
2020-09-13 18:41:43 +01:00
Pepe Iborra
7dacc236ea
Import paths are relative to cradle (#781)
* Import paths are relative to cradle

I noticed ghcide HEAD was broken on the ghcide submodule of the hls repo.

* remove unused

* Fix comment placement

* Special case the implicit cradle

The implicit cradle comes without import paths, so we need to preserve the old
logic that synthetised them from the current module

* Hlint

* Fix timing issue: update known files before restarting the session

Also, DO NOT filter out missing targets

* Use --verbose when running tests

* Log test outputs on 3rd attempt

* Fall back to filtering known files

* hlint

* Upgrade KnownFiles to KnownTargets

* Use KnownTargets to filter modules, not module paths

* Fix test cradle

* Increase pauses in flaky test

* remove no longer needed check

* Disable ansi color codes in CI

* Disable flaky test
2020-09-12 10:01:01 +01:00
Pepe Iborra
59e8bb91a2
Preserve import paths for implicit cradles (#768)
* Preserve import paths for implicit cradles

Implicit cradles do not list targets, see discussion in

https://github.com/haskell/ghcide/issues/765

* Really preserve import paths
2020-09-07 19:53:16 +01:00
Pepe Iborra
ed95e69965
Fix bug in exports map (#772)
It was appending lists of identifiers without pruning duplicates
2020-09-06 15:59:50 +01:00
Pepe Iborra
8f0a4f842c
Refinement holes (#748)
* Refinement holes

* Set more GHC options and use indentation for parsing

* Add an option to customize the typed holes settings

Refinement hole fits are very cool, but currently too slow to enable at deeper
levels. It should eventually be user configurable.

* GHC Compatibility

* Compat. with 8.4
2020-09-06 02:13:17 +05:30
Pepe Iborra
5dd52ec0ff
Handle multiple user actions concurrently (#727)
* tighten some return types

* Extract ShakeQueue from shakeSession

Instead of creating a new TQueue on every restart, we reuse the same TQueue
over and over.

The trickiest bit is to ensure that enqueued actions are always retried when
a Shake session is cancelled. The ActionQueue datatype is intended to manage
this complexity.

* Handle multiple user actions concurrently

* Fixes for .ghci

Unfortunately these are dependent on the ghc version

* redundant parens

* Formatting

* Attempt fix for completion tests

These tests are failing because ghcide is sending diagnostics interleaved with
completions now (which is good) and the tests cannot handle it

* remove debugging printout

* simplify

* Fix a test

* Fix flaky tests
2020-09-05 13:52:17 +01:00
Pepe Iborra
09aa8e5f4b
Suggestions for missing imports from local modules (#739)
* Suggestions for missing imports from local modules

* Avoid unnecessary work on InitialLoad when checkProject is off
2020-09-03 09:32:40 +01:00
Luke Lau
f8889c7112
Dynamically load libm on Linux for each new session (#723)
This fixes the issue on Linux where the binary was statically linked and
Template Haskell (or the eval plugin on haskell-language-server) tried
to evaluate some code. It would previously fail to load ghc-prim because
it couldn't lookup symbols from libm which are usually dynamically
linked in.
2020-09-03 05:34:47 +01:00
Pepe Iborra
7b1de958eb
Include module path in progress message (#746) 2020-09-02 19:31:56 +01:00
Pepe Iborra
b76ef4261c
Ignore -Werror (#738)
* Ignore -Werror

Fixes #735

* Compat with GHC < 8.8
2020-09-02 19:16:57 +01:00
wz1000
b4589aebe6
Typecheck entire project on Initial Load and typecheck reverse dependencies of a file on saving (#688)
* Add new command to GetModuleGraph for a session and propate changes to
modules

Only propagate changes to parent modules when saving

Typecheck files when they are opened, don't TC FOI

Add known files rule

Don't save ifaces for files with defered errors

Co-authored-by: Zubin Duggal <zubin@cmi.ac.in>

* Add configuration for parent typechecking

* hlint ignore

* Use targets to filter located imports (#10)

* Use targets to filter located imports

* Remove import paths from the GHC session

Otherwise GHC will prioritize source files found in the import path

* Update session-loader/Development/IDE/Session.hs

Co-authored-by: Pepe Iborra <pepeiborra@me.com>

* Add session-loader to hie.yaml (#714)

* move known files rule to RuleTypes

* Disable checkParents on open and close document (#12)

* Really disable expensive checkParents

* Add an option to check parents on close

Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
Co-authored-by: Pepe Iborra <pepeiborra@me.com>
Co-authored-by: Luke Lau <luke_lau@icloud.com>
2020-09-02 18:06:04 +01:00
Luke Lau
765967d19b
Add session-loader to hie.yaml (#714) 2020-07-28 13:39:39 +02:00
Luke Lau
412193716d
Move session loading logic into ghcide library (#697)
* Split out the session loading logic into a sublibrary

This way haskell-language-server can also reuse this logic.
Note that this sublibrary is public so it requires cabal-version: 3.0
Part of the work towards #478

* Move Development.IDE.Session into ghcide itself

Sublibraries do not seem to play well. Hide this behind the ghc-lib flag
so that the Haskell specific hie-bios stuff can be disabled

Note that we need to put the template-haskell part of this module into a
separate module because of an access exception when compiling with
Stack, GHC 8.10.1 and Windows.
2020-07-27 09:10:25 +02:00