Commit Graph

306 Commits

Author SHA1 Message Date
Neil Mitchell
233733664d Reduce the extra dependencies (#178) 2019-10-28 09:52:53 +01:00
Jacek Generowicz
440fc1f049 Add goto def / hover tests for classes (#177)
+ internal class in instance declaration
+ internal class in type signature
+ external class in type signature

Hover seems not to work for classes at all.

Goto def works for internal classes, but not external ones.

This leaves the table looking like this:

| | find definition | hover |
|-------------|-----------|---------|
| field in record definition | ✔️  | ✔️ |
| field in record construction |   |  |
| field name as accessor | ✔️ | ✔️ |
| top level name | ✔️ | ✔️ |
| record data constructor |  |  |
| plain data constructor | ✔️ | ✔️  |
| type constructor | ✔️ |  |
| external type constructor |  |  |
| external value |  | ✔️ |
| plain parameter | ✔️ | ✔️ |
| pattern match name | ✔️ | ✔️ |
| top level operator | ✔️ | ✔️ |
| parameter operator | ✔️  | ✔️  |
| name in backticks | ✔️ | ✔️ |
| class in instance declaration | ✔️ |  |
| class in signature | ✔️ |  |
| external class in signature |  |  |
2019-10-23 09:27:48 +02:00
Jacek Generowicz
5645a8030c Move test sample code out to external file (#175)
* Move sample code out into into separate source file

* Add test/data/GotoHover.hs to cabal extra-source-files

* hlint: explicit module export list

* hlint: implement and use readFileUtf8

* hlint: remove -Wmissing-signatures
2019-10-22 16:41:13 +02:00
Jacek Generowicz
38c29030d1 Add gotoDef/hover tests for values from other package (#168)
* Add gotoDef/hover tests for values from other package

* Make Expect constructor names more explicit

* Clean up assertions

* Replace funky function composition operator

* Add signature to checkHoverRange

* Clean up assertion
2019-10-21 10:23:03 -04:00
Andreas Herrmann
9520171921 Allow preprocessors to emit warnings (#176)
* Allow to emit warnings in preprocessor

* preprocessor result type IdePreprocessedSource
2019-10-21 12:24:33 +02:00
Moritz Kiefer
58b997d1aa
Prepare for new releases (#173)
* Prepare for new releases

* More accurate changelog
2019-10-20 17:57:34 -04:00
Neil Mitchell
23142e3cec #170, make sure the right warnings are set when deferring errors to warnings (#172) 2019-10-19 21:22:16 -04: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
Jacek Generowicz
3d34065ad4 Add eglot instruction to Emacs section of README (#169) 2019-10-16 16:56:02 +02:00
Jacek Generowicz
23ff24978f Add goto/hover tests for type constructors from other package (#167) 2019-10-15 12:20:35 +02:00
Neil Mitchell
97e5731629 More things are in the latest stack snapshot (#166) 2019-10-13 15:22:01 +02:00
Neil Mitchell
419a7181e0 Copy the content of #159 to the setup guide (#164)
Original content from @sshine
2019-10-13 15:21:41 +02:00
Jacek Generowicz
e583f13d8d Issue visual warning for humans if --lsp option used (#161)
Experience shows that people sometimes mistakenly start `ghcide` on
the command line with the `--lsp` option (which is intended to be used
only in server/client communication scenarios) and then wonder why
nothing is working..

So let's issue a warning message whenever `--lsp` is used.
2019-10-08 19:43:32 +02:00
Moritz Kiefer
2a67821e60
Avoid file path normalization in moduleImportPath (#152)
This fixes some issues where we used an uppercase drive letter in the
import path even though the LSP client uses lowercase drive letters
2019-10-04 09:37:47 +02:00
Jacek Generowicz
726af7fb3f Signal code actions in initialize response (#150) 2019-10-04 08:57:23 +02:00
Moritz Kiefer
fdf5afa79d
Bump GHC 8.8 stacksnapshot (#149)
Still not at a point where all our deps are back in stackage but we’re
getting closer.
2019-10-03 11:07:44 +02:00
Moritz Kiefer
ed6cf474d3
Use a separate finder cache for each typecheck call (#148)
* Use a separate finder cache for each typecheck call

On a large DAML project, we occasionally saw error about missing
modules during typechecking during concurrent compilations. This was
caused by the fact that we modified the IORef in the HscEnv which is
shared between concurrent compilations.
2019-10-02 13:58:53 +02:00
Jacek Generowicz
986bc04014 Stop waiting in tests which don't need to (#145)
A while ago, `testSession` was modified to include a 0.5s wait, for
the sake of tests which were looking for a specific and complete set
of diagnostics, in order to ensure that all the incoming diagnostics
had been received before the comparison was made. This made sense at a
time when the vast majority of tests fit this pattern. Today we have
plenty of tests which have no need for this. Hence:

+ `testSession` has been renamed to `testSessionWait`

+ a new `testSession` has been added, which does not wait at all

+ all tests which use `expectDiagnostics` have been modified to use
  `testSessionWait`, all other tests use the new delayless
  `testSession`.

Locally this knocks almost 25% off the runtime of the full test
suite.
2019-10-01 14:52:07 +02:00
Jacek Generowicz
3284878b7b Add tests for initialize response (#147)
These tests document and monitor the evolution of the capabilities
announced by the server in the initialize response.

Currently the server advertises almost no capabilities. Out of 23
top-level categories, the only 3 which are announced are

+ text document sync
+ hover
+ goto definition

At the very least code actions are known to be provided, but are not
announced in the initialize response.
2019-10-01 13:03:06 +02:00
Jacek Generowicz
5257eb7d9d Refactor goto-definition and hover tests (#146)
+ Reduce manual duplication of information shared between hover and
  goto-def tests

+ Make sure that all the information in the test specifications that
  relates to fiddly line and column numbers, fits together on one
  screen, and is generally easier to match and understand by eye.
2019-10-01 09:24:33 +02:00
Neil Mitchell
e7d3d129ae #129, add a very basic setup guide (#142) 2019-09-30 08:54:57 +02:00
Neil Mitchell
a126bf3530 Add tests for GHC 8.8 (#143) 2019-09-30 08:53:57 +02:00
Neil Mitchell
4493a4a5b8 Ignore the stack.yaml.lock files (#141) 2019-09-30 08:53:14 +02:00
Jacek Generowicz
2779dbb2e1 Add tests for find-definition and hover (#139)
* Add find definition tests

* Add tests for hovers
2019-09-29 12:03:16 +02:00
Neil Mitchell
9d45eee21c #137, make the status message clearer about what worked and what didn't (#138) 2019-09-27 15:18:24 +02:00
Neil Mitchell
83978c3984 Get rid of mtl dependency (#133)
* Get rid of mtl dependency

* Put back mtl dependency
2019-09-25 16:43:05 +02:00
Moritz Kiefer
833c18c876
Point to the VSCode marketplace in the readme (#134)
* Point to the VSCode marketplace in the readme

* Move instructions for building the VSCode extension to Hacking section
2019-09-25 15:25:32 +02:00
Neil Mitchell
60ed687de9 Support multiple hie.yaml files (#127)
* Hack around https://github.com/mpickering/hie-bios/pull/56 - hie-bios expects files to really exist on disk

* Fix getLocatedImportsRule to pass the file to the session

* Add support for multiple simultaneous hie.yaml files.
Also rewrites the user experience on setup to be less verbose.
Also adds masking for GHC session construction.

* HLint

* Code review comments

* Switch to the Strict map
2019-09-25 13:01:41 +02:00
Moritz Kiefer
37f19935e2
Update extension metadata (#132)
That’s the publisher we use for uploading the DAML extension and it
makes little sense to have two publishers.
2019-09-25 10:23:27 +02:00
Moritz Kiefer
baa59d4bea
Use a stack cradle in hie.yaml (#121) 2019-09-25 10:21:11 +02:00
Neil Mitchell
f538492343 Use the latest hie-bios, which now works on Windows (#125) 2019-09-25 08:43:47 +02:00
Neil Mitchell
f929681493 #9, mention the CLA in the readme (#128) 2019-09-25 08:16:33 +02:00
Neil Mitchell
f050719d4f Add an upper bound to hie-bios (#122) 2019-09-24 20:41:52 +02:00
Jacek Generowicz
2879735a97 Fix deferred messages (#120)
* Test deferred error report message

The text of the deferred {type errors, typed holes, out of scope
variables} should call them 'error', instead it reports 'warning'.

* Change warning to error in deferred messages
2019-09-24 20:41:38 +02:00
Neil Mitchell
f9d4e0ffb9 No warnings (#119)
* Remove warnings

* Turn on warnings when testing with Azure
2019-09-24 09:54:17 +02:00
Neil Mitchell
32a049cc4c Add Paths_ghcide, fixes a warning (#117) 2019-09-24 00:09:20 +02:00
Neil Mitchell
0fa86f2ba3 Fix hie.yaml so it works (#118) 2019-09-24 00:08:43 +02:00
Moritz Kiefer
a581aa907f
Add changelog boilerplate (#111)
fixes #110
2019-09-23 14:54:06 +02:00
Moritz Kiefer
dcd7cb499e
Use a consistent include dir for cwd (#114)
This only matters for the DAML codebase (so I’ll add a test on that
side) where we use relative paths:

Previously, we would produce the include dir "." for moduleImportPath
"./A.daml"
and "" for moduleImportPath "./A/B.daml". This resulted in us ending
up with ./A.daml and A.daml in the Shake graph which resulted in
issues like https://github.com/digital-asset/daml/issues/2929.

We should move this logic completely over to the DAML repo at some
point but I’ll leave that for a separate PR.
2019-09-23 14:38:31 +02:00
Moritz Kiefer
79301b472e
Remove writeIfacesAndHie (#112)
This function is never used in ghcide so it makes more sense to have
it be part of the `daml` source code since we depend on this for
building the `.dar` archives.
2019-09-23 12:55:33 +02:00
Jacek Generowicz
c24ef1c288 Add --version CLI option (#106)
* Add --version CLI option

* Extract ghcide version from cabal

* Extract precise GHC version from cabal preprocessor macro
2019-09-23 08:50:28 +02:00
Moritz Kiefer
cec3159ace
Bump version in preparation for new release (#108) 2019-09-21 12:50:50 +02:00
Neil Mitchell
50e35f0e98 Use the hie-bios function that doesn't perform a downsweep. Fixes #99 (#102) 2019-09-20 17:33:37 +02:00
maralorn
06bde2bf3a Add type signature inserting to feature list (#95) 2019-09-20 07:21:43 +02:00
Matthew Pickering
8fb63de063 Update link (#97) 2019-09-20 07:21:24 +02:00
Dmitry Dzhus
7adc3bc131 Fix a typo (#93) 2019-09-19 19:43:15 +02:00
Neil Mitchell
1a0b852ec0 Add a lower bound on hie-bios (#92) 2019-09-19 19:43:03 +02:00
Jacek Generowicz
bf9ee2a62b Add code actions for missing type signatures (#81)
* Add code actions for missing top-level type signatures

* Turn signature tester into operator
2019-09-19 19:40:52 +02:00
maralorn
54633c9229 Improve and extend feature list (#84)
* Improve and extend feature list

* Fix typo in feature table
2019-09-19 19:39:27 +02:00