Commit Graph

122 Commits

Author SHA1 Message Date
Pepe Iborra
1a34357f08
Invert the dependency between hls-plugin-api and ghcide (#701)
* Invert the dependency between ghcide and hls-plugin-api

This PR includes changes both to ghcide and HLS to implement the reorg described in https://github.com/haskell/ghcide/issues/936#issuecomment-751437853

To summarise:

- `hls-plugin-api` no longer depends on ghcide.
- `ghcide` now depends on `hls-plugin-api` and exposes:
  - The ghcide HLS plugin
  - The `asGhcIdePlugin` adaptor

The goals are:
- to be able to break the `ghcide` HLS plugin down
- to rewrite exe:ghcide on top of the HLS plugin model.

The ghcide side is reviewed in https://github.com/haskell/ghcide/pull/963

If this change is accepted there are two further considerations:
- This would be a good moment to merge the 2 repos, so that there is no history loss.
- `hls-plugin-api` will need to be released to Hackage prior to merging https://github.com/haskell/ghcide/pull/963

* clean up

* Fix the ghcide plugin to include the rules

* clean up PartialHandlers definition

The ghcide partial handlers for completions, code actions and hover are not
really being used, since they get overriden by the `<> ps` append. This is due
to the right-biased semantics of `PartialHandlers`

* Move ghcide LspConfig into Ide.Plugin.Config

* Use HLS plugins in ghcide

For now there is only one, the main ghcide plugin. But this will allow us to
break it down in more fine grained plugins with parallel semantics, both for
execution and error handling

* Fix hlints

* Revert "Temporarily disable the upstream branch for benchmarks"

This reverts commit 7bb3c6efae.

* Disable the Windows 8.6.4 test

* Fix unrelated hlints

Not sure why these are triggering now.

Linting should be restricted to the Diff ...
2020-12-30 23:48:17 +00:00
Pasqualino Titto Assini
edb150ac52 moved eval plugin to hls-eval-plugin (rebased and fixed) 2020-12-29 18:38:27 +01:00
Pepe Iborra
7f84b94cac Fix language extension code action tests
The ghcide merge includes https://github.com/haskell/ghcide/pull/948
which removes the language extension code actions

This makes the associated func-test fail, because the HLS plugin does not pass
the test (only the ghcide code action did). This is because the HLS plugin uses
commands, and the tests do not wait for the command edit to be applied.

The fix is to change the HLS plugin to return a code action with edits and no commands
2020-12-29 13:22:04 +00:00
Junyoung Clare Jang
19c4f46b8b
Fix invalid comment 2020-12-26 02:37:56 -05:00
Junyoung Clare Jang
2d23a3424b
Fix addWhere 2020-12-26 02:24:44 -05:00
Junyoung Clare Jang
b09e61e92c
Fix non-exhaustive patterns 2020-12-26 02:24:44 -05:00
Junyoung Clare Jang
8af73534a5
Fix hls-class-plugin to use ghc-exactprint 2020-12-26 02:23:30 -05:00
Junyoung Clare Jang
e3acd2e66e
Fix action orders 2020-12-26 02:23:30 -05:00
Junyoung Clare Jang
044259521d
Implements basic Class plugin 2020-12-26 02:23:29 -05:00
Pasqualino Titto Assini
75bbc7dd8a Made addPackages idempotent 2020-12-25 10:12:17 +01:00
Pasqualino Titto Assini
887cde9e11 Eval tests as proper subpackage (to add QuickCheck dependency) 2020-12-25 10:12:17 +01:00
Pasqualino Titto Assini
a48a8f775d Extended Eval Plugin (rebased to 0.7.1) 2020-12-25 10:11:58 +01:00
Sandy Maguire
0f07efcbab
Add a known tactic for writing arbitrary instances (#695)
Christmas comes early for QuickCheck users! This PR adds support for generating arbitrary --- including the tricky business of ensuring termination. It can be run by calling Attempt to fill hole on anything of the form arbitrary :: Gen A for some type A.
2020-12-24 02:12:42 -08:00
Alan Zimmerman
1cbe1fd0d8 Introduce generic config for plugins
Make it possible to provide config for a plugin in a regular way, by
using a namespace in the json config space. So we have

```
haskell.plugin.hlint.globalOn
haskell.plugin.importLens.globalOn
```

It is also possible to have finer-grain config, so the individual
parts of a plugin can also be separately enabled/disabled.

Closes #513
2020-12-21 13:13:46 +00:00
Javier Neira
60f811c5af
Merge pull request #672 from berberman/patch-misc
correct tactic plugin package metadata and cabal.hie.yaml/stack.hie.yaml
2020-12-14 19:48:32 +01:00
Javier Neira
d30ec195ed
Merge pull request #666 from berberman/patch-pragmas
Do not suggest explicitly disabled pragmas
2020-12-14 08:50:11 +01:00
Potato Hatsue
bab10e84bd
Remove invalid links in package description of tactics plugin 2020-12-14 14:10:03 +08:00
Jan Hrček
9c337a86d5 User more suitable Map functions in tactics plugin 2020-12-13 06:11:12 +01:00
Jan Hrček
091cf2ccb4 Remove unnecessary pluginId setting 2020-12-13 05:34:48 +01:00
Potato Hatsue
313916ae71
Update comments 2020-12-12 17:19:53 +08:00
Potato Hatsue
0405631b1a
Use xFlags, instead of enumerating possible language extensions 2020-12-12 17:15:53 +08:00
Potato Hatsue
90de2b3d67
Do not suggest explicitly disabled pragmas 2020-12-12 16:58:55 +08:00
grdvnl
2e6a5320d7 Update CompletionKind. 2020-12-10 06:01:31 -08:00
grdvnl
ad978d29c4 Switch to record syntax 2020-12-10 05:40:52 -08:00
grdvnl
128973855f Remove logging. 2020-12-10 05:40:52 -08:00
grdvnl
00883a580b Initial working version of Language Pragma completions. 2020-12-10 05:40:52 -08:00
grdvnl
09cff8ce68 Initial set up to provide pragma completions. 2020-12-10 05:40:52 -08:00
Javier Neira
df8845d9a5
Merge pull request #648 from tittoassini/idem
idempotent command and code cleanup
2020-12-09 07:23:41 +01:00
Potato Hatsue
36591c0aa3 Add extra-source-files 2020-12-06 21:37:09 +08:00
Pepe Iborra
7f6080ed91
Split the Imports and Retrie plugins (#647)
* Split out the explicit imports plugin

* Split out the retrie plugin

* Avoid test-breaking plugin descriptor change

It changes the order in which code actions get listed.
Some of the code action tests are not very smart and break.

* Fix stack descriptors

* Add ghc-api-version.h

* add LICENSE
2020-12-05 19:33:09 +00:00
Pasqualino Titto Assini
0aaf407c25 idempotent command and code cleanup 2020-12-05 00:15:02 +01:00
Javier Neira
3bd2338e38
Merge pull request #616 from konn/modulename-main-like
Module Name Plugin: Treat modules starting with lowercase as Main module
2020-12-02 07:38:38 +01:00
Joe Hermaszewski
d0fb85eb2c
Preserve the last empty comment line after eval plugin (#631)
```haskell
-- >>> foo
--
-- >>> bar
```

After running the plugin on both prompts we end up with this:

```haskell
-- >>> foo
-- foo_output
--
-- >>> bar
-- bar_output
```

instead of

```haskell
-- >>> foo
-- foo_output
-- >>> bar
-- bar_output
```
2020-11-27 20:33:50 +00:00
Javier Neira
2e7c0ce19f
Merge pull request #623 from gwils/build-tool-depends
Add hspec-discover to build-tool-depends in tactics plugin
2020-11-25 07:38:33 +01:00
Javier Neira
b296149470
Merge pull request #599 from zweimach/fix-fourmolu
Fix fourmolu plugin inconsistent formatting
2020-11-25 07:32:21 +01:00
George Wilson
4d5f13e286 Add hspec-discover to build-tool-depends in tactics plugin 2020-11-25 09:22:27 +10:00
Hiromi ISHII
01110c8eeb
Adds notes on implementation of dataConInstOrigArgTys 2020-11-24 01:51:34 +09:00
Hiromi ISHII
53712b3762
Uses fmap instead 2020-11-24 00:16:00 +09:00
Hiromi ISHII
0d707a9be4
module name plugin: Workaround for modules starting with lowercase 2020-11-23 15:47:49 +09:00
Hiromi ISHII
96bd4c9dde
Proper treatment of existentially quantified type variables in DataCons 2020-11-23 15:17:23 +09:00
Hiromi ISHII
4ad648e8bd
Glue code 2020-11-23 15:15:14 +09:00
Hiromi ISHII
8050b14406
Merge branch 'master' into tactic-exclude-coercions 2020-11-23 12:24:35 +09:00
Ananda Umamil
99d6d55a99
Fix fourmolu plugin's use of FormattingOptions 2020-11-19 12:15:22 +07:00
Alan Zimmerman
0764e7ade3 Hlint: bring over idea2Message for formatting
This restores the hlint formatting from haskell-ide-engine

Closes #553
2020-11-14 14:39:32 +00:00
jneira
59695c28fc Remove unused instance using Orphans 2020-11-07 23:24:36 +01:00
jneira
741e667df1 Adapt plugins to ghcide api changes 2020-11-04 22:28:42 +01:00
jneira
d7f64de76d Replace GhcSessionDeps with GhcSession 2020-11-03 13:45:13 +01:00
jneira
24abcc36d3 Replace missing runGhcEnv with evalGhcEnv 2020-11-01 23:52:00 +01:00
jneira
02a0ce8ab6 Adapt retrie plugin to last ghcide 2020-11-01 23:51:58 +01:00
jneira
915896937c Adapt imports plugin to last ghcide 2020-11-01 23:51:57 +01:00