Commit Graph

27 Commits

Author SHA1 Message Date
Jan Hrcek
9d0fc445a4
Update URLs after move to haskell github org (#950) 2020-12-13 07:56:38 +00:00
Pepe Iborra
65c95801c9
Add support for customizing the hidir location (#944) 2020-12-08 19:18:22 +00:00
Pepe Iborra
89eeb50034
Custom cradle loading (#928)
When using ghcide as a library, it may be desirable to host the hie.yaml file
in a location other than the project root, or even avoid the file system altogether
2020-11-29 13:52:52 +00:00
fendor
b11d0106a3
Make Filetargets absolute before continue using them (#914)
* Add testcase for proving relative filetargets

* Normalise file targets after loading
2020-11-21 10:11:13 +01:00
Pepe Iborra
30a46e8a18
Avoid calling kick explicitly (#904)
* Avoid calling kick explicitly

Leverages that rules are rerun by shakeRunDatabase.
Allows users of ghcide as a library to use their own kick

* Tweak doc comment
2020-11-12 19:18:21 +00:00
Pepe Iborra
f4bfe9c103
Compatibility with fbghc (#892)
* Compatibility with fbghc

Rather than forking ghcide, we use conditional compilation to build with https://github.com/facebook/fbghc hopefully only until certain changes have been upstreamed.

* Reexport DynFlags from Compat.GHC

* Add a link to the fbghc repo
2020-11-07 15:13:40 +00:00
Avi Dessauer
6a6b68dc8a
Clarify and downgrade implicit-hie message (#883) 2020-10-24 09:42:18 +01:00
wz1000
d76fbf9a5c
simplify things unnecessarily running in GhcM (#875)
* simplify things unnecessarily running in GhcM

* untick catchSrcErrors

* set useUnicode
2020-10-23 12:20:53 +05:30
wz1000
71c88dc521
Switch back to bytecode (#873)
* Switch back to bytecode

* return a HomeModInfo even if we can't generate a linkable

* set target to HscNothing

* add rule for GetModIfaceWithoutLinkable

* use IdeGlobal for compiled linkables
2020-10-19 11:48:54 +05:30
wz1000
03bdcaebfd
Use object code for Template Haskell, emit desugarer warnings (#836)
* Use object code for TH

* Set target location for TargetFiles

* Fix tests

* hlint

* fix build on 8.10

* fix ghc-lib

* address review comments

* hlint

* better error handling if module headers don't parse

* Always desugar, don't call interactive API functions

* deprioritize desugar when not TH, fix iface handling

* write hie file on save

* more tweaks

* fix tests

* disable desugarer warnings

* use ModGuts for exports map

* don't desugar

* use bytecode

* make HiFileStable early-cutoff

* restore object code

* re-enable desugar

* review comments

* Don't use ModIface for DocMap

* fix docs for the current module

* mark test as broken on windows
2020-10-04 21:34:43 +05:30
Pepe Iborra
1d1f2db3bd
Enhance benchmarks & bug fixes (#823)
* parse allocations

* WaitForShakeQueue

* Measure user time and shake time in experiments

* clean ups

* Prevent a potential crash of the shake enqueue thread

* Fix a bug that was preventing reenqueud actions from getting flushed

* Avoid running the check-project action per file

What we really want is to check the project once per cradle

* Backwards compat.

* Review feedback

* Fix typo

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

Co-authored-by: Neil Mitchell <ndmitchell@gmail.com>
2020-09-20 11:03:51 +01:00
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