Commit Graph

36 Commits

Author SHA1 Message Date
Pepe Iborra
4e7b2fcdbb
More benchmarks (#625)
* Add a benchmark to track startup times

* Benchmark automation

disable benchmarks easily

save GC stats to file

cradle, rts, filter and samples options

path to ghcide

configurable example

--help

more detailed CSV output

hover after edit

pause for GC

configurable timeout

upgrade extra (required to build bench)

Include max residency in BenchRun

Include all details on output

* reduce threadDelay to avoid upsetting lsp-test

* Fix startup time measurement

* Added new edit experiment

* fix doc comment

* hlints

* Upgrade to lsp-test 0.11.0.2

* Flag failed experiments

* Update ghcide.cabal
2020-06-12 20:46:55 +02:00
Pepe Iborra
a538f0644b
ghc initialization error handling (#609)
There are a couple of cases to handle as seen below.
Thanks @jneira for help discovering them all.
There used to be linking errors but I no longer see those after the multi-cradle patch

Non Nix
=========

The table below shows a couple of combinations of cradles and ghcide versions in a
non-Nix environment. All the version mismatches are now handled as follows:

- "Cannot satisfy package" -  `-package-id` flags referencing
  package versions not available (generally base)
- "bad interface" - tried to load an interface file created by a different version of ghc

cradle/ghcide | 8.6 | 8.8 | 8.10
--------------|-----|----|---
Cabal 8.6   | success | cannot satisfy package | cannot satisfy package
Cabal 8.8   | cannot satisfy package | success | cannot satisfy package
Cabal 8.10  | cannot satisfy package | cannot satisfy package | success
Stack 8.6   | success | bad-interface | bad-interfac-
Stack 8.8   | bad-interface | success | bad-interface
Stack 8.10  | bad-interface | bad-interface | success

Nix
=========

Because Nix redefines the libdir to point at the run-time ghc installation,
it's actually much easier to detect a version mismatch:
just compare the compile-time and run-time libdirs
2020-06-10 14:26:35 +02:00
fendor
9129475b87
Update to hie-bios 0.5.0 (#552)
* Update to hie-bios 0.5.0

* Fix test-cases due to changes in the direct cradle

* Update test/exe/Main.hs comment

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-05-23 09:54:25 +02:00
Luke Lau
cd6f62bbed
Use lsp-test-0.11 (#566)
Replace openDoc' with createDoc which sends out
workspace/didChangedWatchedFiles notifications
2020-05-17 16:37:08 +02:00
Luke Lau
5661348b5e
Upgrade to haskell-lsp-0.22 (#547) 2020-05-13 14:59:51 +02:00
Pepe Iborra
15bb044269
Improve ghc version check (#535)
- retrieve runtime version from ghc executable, not from pkg db (ghc-check 0.3.0.0)
- Do not error when unable to retrieve runtime version
2020-05-08 15:48:05 +02:00
Pepe Iborra
9ccd9eec08
Detect ghc mismatch (#462)
* Detect ghc version mismatches

* Add ghc-check to stack extra deps

* ghc-check: explicit libdir and delay version error
2020-03-24 12:40:21 +01:00
Javier Neira
9951f35b08
Use NormalizedFilePath and adapt types of haskell-lsp-0.21 (#479)
* Use custom version of h-l-t

* Use normalized path functions from h-l-t

* Restore empty path corner case

* Create a wrapper over NFP to override IsString

* Use maybe instead fromMaybe

* Use patched version of lsp-types in all yaml files

* Remove unused import

* Rename specific NormalizeFilePath to NormalizeFilePath'

* Remove specific newtype and IsString instance

* Use released haskell-lsp-0.21

* Adapt to type changes of haskell-lsp-0.21

* Add tags field to CompletionItem

* Fix test case about empty file path

* Correct stack.yaml used in azure ci cache

* Build ghcide including tests in windows azure ci

* Qualify haskell-lsp modules to avoid name clashes
2020-03-23 09:07:04 +01:00
Alan Zimmerman
111b6855e2
Use tasty-rerun to allow rerunning failed tests only (#484)
Use by

  stack --stack-yaml=stack84.yaml test --test-arguments "--rerun"
2020-03-16 09:07:50 +01:00
Moritz Kiefer
e59d3e2c77
Upgrade to haskell-lsp-0.20 (#405) 2020-02-05 10:14:13 +01:00
Neil Mitchell
025fa5be68
#381, require shake-0.18.5, which ensures progress cancellation is robust (#400)
* #381, require shake-0.18.5, which ensures progress cancelation is robust

* Fix a GHC 8.8.2 warning

* Don't allow-newer, do pin hie-bios
2020-02-04 11:59:07 +01:00
fendor
1d04b09add
Update to latest hie-bios (#382)
* Update to latest hie-bios

* Remove explicit usage of type parameter Void from Cradle
2020-02-04 11:09:50 +01:00
Neil Mitchell
f3abff8b7c
Better progress messages (#379)
* Require shake-0.18.4 which contains actionBracket

* Change progress reporting to use files rather than Shake nodes

* Remove inadvertantly writing down Shake twice
2020-02-03 13:26:16 +01:00
Neil Mitchell
913aa5f9fa Don't support old haddock-library versions (#375)
* Don't support old haddock-library versions

* Update stack.yaml values

* Remove some more haddock_library CPP

* Make sure the latest haddock-library is on GHC 8.4
2020-01-28 20:20:38 +01:00
Alejandro Serrano
a0aa013e33 Better docs for completions (#288)
* Remove JSON instances for completions, since we are not implementing "resolve"

* Remove completion resolve data from tests

* Better docs

* Fix tests

* Fix for 8.4

* Turn Haddock markup into Markdown

* Add types to completion items

* Make it work on 8.8 and 8.4

* Revert "Remove completion resolve data from tests"

This reverts commit 625d710f11.

* Revert "Remove JSON instances for completions, since we are not implementing "resolve""

This reverts commit 12ff27dce7.

* Fix tests

* Require higher version of regex-pcre-builtin

* Replace Pandoc with direct conversion from Haddock to Markdown

* Show kinds of type constructors too

* A few fixed to Markdown conversion

* Check optNewColonConvention

* Fix build on 8.4 and 8.8

* More fixes for 8.4 and 8.8

* Check only the common part of the completion text

* Make icons consistent with Outline

* Test docs for completions

* Make constructors return the corresponding CompletionItem + tests for that behavior

* Make test work on 8.4
2020-01-09 09:44:32 +01:00
Neil Mitchell
2c96c9b87f Require hie-bios 0.3.2 or above (#286)
* Require hie-bios 0.3.2 or above

* Update stack.yaml files

* Use newer parser-combinators on GHC 8.4

* Bump parser combinators on 8.6

Co-authored-by: Moritz Kiefer <moritz.kiefer@purelyfunctional.org>
2020-01-03 11:14:09 +01:00
Pepe Iborra
0bcdc6a226 Fix for #45 - remove redundant symbols from imports (#290)
* Test for #45

* Remove redundant symbols from imports

Fixes #45

* Update src/Development/IDE/LSP/CodeAction.hs

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Apply suggestions from code review

Co-Authored-By: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>

* Add regex-tdfa extra deps to ghc-lib build

* Fix for GHC 8.4 (error message prints qualified binding)

GHC ticket #14881 changed this to print identifiers unqualified

* dropBindingsFromImportLine: make total

Co-authored-by: Andreas Herrmann <42969706+aherrmann-da@users.noreply.github.com>
2019-12-30 10:40:13 +01:00
Alejandro Serrano
b52ee607f9 [WIP] Completion support (#227)
* Initial implementation of completion support

* Add fuzzy to set of additional dependencies in 8.8

* Fix test

* Work a bit more on completion

* Attempt at getting completions from last good tckd module

* Revert "Attempt at getting completions from last good tckd module"

This reverts commit 04ca13b9d8.

* "useWithStale" everywhere

* Some suggestions by @cocreature

* Adjust positions in the document

* Start working on tests

* Fix compilation problem

* Fix tests

* Better type tests
2019-12-19 15:00:39 +01:00
Moritz Kiefer
8ea5d69e18
Upgrade to haskell-lsp 0.19 (#254)
* Upgrade to haskell-lsp 0.19

* Clarify version handling
2019-12-16 14:57:38 +01:00
Moritz Kiefer
fc30f1476f
Upgrade to hie-bios (#257)
This does not yet take advantage of any new features but we should at
least be able to benefit from bugfixes.
2019-12-16 11:42:44 +01:00
Moritz Kiefer
bc32a2eab3
Upgrade to new haskell-lsp release (#203) 2019-11-18 09:37:10 +01:00
Moritz Kiefer
2755212f48
Switch to new releases of haskell-lsp and lsp-test (#171) 2019-10-18 20:58:26 +02:00
Moritz Kiefer
5febbcbc48
Fix progress reporting (#153)
* Fix progress reporting

* Bump haskell-lsp and lsp-test revisions

* Change client name

* Fix typo

* Bump revisions
2019-10-17 11:11:52 +02:00
Neil Mitchell
f538492343 Use the latest hie-bios, which now works on Windows (#125) 2019-09-25 08:43:47 +02:00
Domen Kožar
82da406520 bump to hie-bios 0.2.0 and bump *lsp packages (#83) 2019-09-18 13:42:34 +02:00
Ollie Charles
9a5ee23c01 Build on GHC 8.8 (#43) 2019-09-16 15:20:48 +02:00
Moritz Kiefer
2c24f2be15 Cleanup GHC API version checks
Previously we had a mix of GHC_STABLE and checks on
__GLASGOW_HASKELL__. This PR changes this to always check on
MIN_GHC_API_VERSION. Depending on whether you use ghc-lib or not (now
controlled by a cabal flag), this macro expands to MIN_VERSION_ghc or
MIN_VERSION_ghc_lib.
2019-09-16 11:34:25 +02:00
Neil Mitchell
9bd78857d8 #2326, GHC 8.4 compatibility (#2796)
* #2326, GHC 8.4 compatibility

* Fix up CI

* Add a Shake lower bound

* Upgrade to a hie-bios which is GHC 8.4 compatible

* Add a GHC 8.4 stack

* Fix HLint again
2019-09-10 14:52:17 +02:00
Moritz Kiefer
75e53e7633 Bump hie-bios (#2586)
This includes my patches to fix the Stack cradle in hie-bios so
hie-core should now work properly on Stack projects.
2019-09-10 14:52:17 +02:00
Moritz Kiefer
79c04cd202 Upgrade haskell-lsp and lsp-test (#2474)
* Upgrade haskell-lsp and lsp-test

There have been some fixes upstream that should hopefully mean that we
no longer need to mark the lsp-tests as flaky on Windows. I am having
trouble reproducing the flakiness locally, so let’s see what happens
on CI.

* Also bump stack.yaml
2019-09-10 14:52:17 +02:00
Moritz Kiefer
fbe192a7a3 Add a Stack based pipeline for testing hie-core (#2348)
This is in preparation for #2326 as well as for splitting hie-core
into a separate repo. Given that, it explicitely avoids using our
dev-env.

We do need to install a few system packages, so for now this uses the
hosted builder so we can do this. Another option would be to just add
those to our builders. I don’t really have a preference either
way. The builds are < 5 minutes so I don’t expect issues from using
the hosted builders.
2019-09-10 14:52:17 +02:00
Andreas Herrmann
ae37b4b21c stack/cabal for hie-core-tests (#2287)
* stack/cabal for hie-core-tests

* ./fmt.sh
2019-09-10 14:52:17 +02:00
Shayne Fletcher
59e871c6e8 Update the hie-bios commit SHA (#1825)
* Update the hie-bios commit SHA

* Also update the SHA in our bazel WORKSPACE

* Update the hash too

* Tutorial for Emacs integration

* Update hie-bios patch
2019-09-10 14:52:17 +02:00
Moritz Kiefer
1be84f1a23 Initial stab at integrating hie-bios (#1685) 2019-06-15 10:29:40 +02:00
Neil Mitchell
6f7b304106 Update to use LSP from github (#1662)
* Update to use LSP from github

* Switch to upstream LSP everywhere
2019-06-14 08:38:29 +00:00
Neil Mitchell
a290aab694 Add a haskell-ide-core demo project (#1251)
* Demo program for haskell-ide-core as a library

* Fix all warnings in the Demo file

* Build the IDE demo

* Give a better error message than undefined

* HLint

* Fix copyright header

* Sort the dependencies

* Improve the comment

* Bazel formatting

* Disable building on Windows until ghc-paths is fixed

* Bazel formatting

* Specify the main function
2019-05-20 16:36:08 +01:00