Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 4889cc5

Browse files
committed
2 parents 7a924c2 + 60e1e99 commit 4889cc5

27 files changed

+626
-384
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ then it means you have the command in PATH.
153153

154154
On Linux you will need install a couple of extra libraries (for Unicode ([ICU](http://site.icu-project.org/)) and [NCURSES](https://www.gnu.org/software/ncurses/)):
155155

156-
**Debian/Ubuntu**:
156+
**Debian/Ubuntu**:
157157

158158
```bash
159159
sudo apt install libicu-dev libtinfo-dev libgmp-dev
@@ -194,22 +194,22 @@ Available commands can be seen with:
194194
stack ./install.hs help
195195
```
196196

197-
Remember, this will take time to download a Stackage-LTS and an appropriate GHC. However, afterwards all commands should work as expected.
197+
Remember, this will take time to download a Stackage-LTS and an appropriate GHC. However, afterwards all commands should work as expected.
198198

199199
##### Install specific GHC Version
200200

201201
Install **Nightly** (and hoogle docs):
202202

203203
```bash
204204
stack ./install.hs hie-8.6.4
205-
stack ./install.hs build-doc-8.6.4
205+
stack ./install.hs build-doc
206206
```
207207

208208
Install **LTS** (and hoogle docs):
209209

210210
```bash
211211
stack ./install.hs hie-8.4.4
212-
stack ./install.hs build-doc-8.4.4
212+
stack ./install.hs build-doc
213213
```
214214

215215
The Haskell IDE Engine can also be built with `cabal new-build` instead of `stack build`.
@@ -218,7 +218,7 @@ However, this approach does currently not work for windows due to a missing feat
218218
To see what GHC versions are available, the command `stack install.hs cabal-ghcs` can be used.
219219
It will list all GHC versions that are on the path and their respective installation directory.
220220
If you think, this list is incomplete, you can try to modify the PATH variable, such that the executables can be found.
221-
Note, that the targets `cabal-build`, `cabal-build-docs` and `cabal-build-all` depend on the found GHC versions.
221+
Note, that the targets `cabal-build`, `cabal-build-doc` and `cabal-build-all` depend on the found GHC versions.
222222
They install Haskell IDE Engine only for the found GHC versions.
223223

224224
An example output is:
@@ -237,7 +237,7 @@ If your desired ghc has been found, you use it to install Haskell IDE Engine.
237237

238238
```bash
239239
stack install.hs cabal-hie-8.4.4
240-
stack install.hs cabal-build-doc-8.4.4
240+
stack install.hs cabal-build-doc
241241
```
242242

243243
To install HIE for all GHC versions that are present on your system, use:
@@ -589,11 +589,11 @@ These builds have a dependency on [homebrew](https://brew.sh)'s `gmp` library. I
589589

590590
### cannot satisfy -package-id \<package\>
591591

592-
#### Is \<package\> base-x?
592+
#### Is \<package\> base-x?
593593
Make sure that you are running the correct version of hie for your version of ghc, or check out hie-wrapper.
594594

595595
#### Is there a hash (#) after \<package\>?
596596
Delete any `.ghc.environment*` files in your project root and try again. (At the time of writing, cabal new-style projects are not supported with ghc-mod)
597597

598598
#### Otherwise
599-
Try running `cabal update`.
599+
Try running `cabal update`.

haskell-ide-engine.cabal

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ library
7070
, gitrev >= 1.1
7171
, haddock-api
7272
, haddock-library
73-
, haskell-lsp >= 0.8
73+
, haskell-lsp == 0.9.*
74+
, haskell-lsp-types == 0.9.*
7475
, haskell-src-exts
7576
, hie-plugin-api
7677
, hlint >= 2.0.11
@@ -274,7 +275,7 @@ test-suite func-test
274275
, data-default
275276
, directory
276277
, filepath
277-
, lsp-test == 0.5.*
278+
, lsp-test >= 0.5.1.1 && < 0.5.2
278279
, haskell-ide-engine
279280
, haskell-lsp-types >= 0.4
280281
, hie-test-utils

hie-plugin-api/Haskell/Ide/Engine/PluginsIdeMonads.hs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
{-# LANGUAGE ScopedTypeVariables #-}
88
{-# LANGUAGE GADTs #-}
99
{-# LANGUAGE RankNTypes #-}
10-
{-# LANGUAGE TypeSynonymInstances #-}
1110
{-# LANGUAGE PatternSynonyms #-}
1211
{-# LANGUAGE OverloadedStrings #-}
1312

@@ -212,16 +211,24 @@ type SymbolProvider = Uri -> IdeDeferM (IdeResult [DocumentSymbol])
212211
data FormattingType = FormatDocument
213212
| FormatRange Range
214213

215-
-- | Formats the given Uri with the given options.
214+
-- | Formats the given Text associated with the given Uri.
215+
-- Should, but might not, honor the provided formatting options (e.g. Floskell does not).
216216
-- A formatting type can be given to either format the whole document or only a Range.
217+
--
218+
-- Text to format, may or may not, originate from the associated Uri.
219+
-- E.g. it is ok, to modify the text and then reformat it through this API.
220+
--
221+
-- The Uri is mainly used to discover formatting configurations in the file's path.
222+
--
217223
-- Fails if the formatter can not parse the source.
218-
-- Failing menas here that a IdeResultFail is returned.
224+
-- Failing means here that a IdeResultFail is returned.
219225
-- This can be used to display errors to the user, unless the error is an Internal one.
220226
-- The record 'IdeError' and 'IdeErrorCode' can be used to determine the type of error.
221-
type FormattingProvider = Uri -- ^ Uri to the file to format. Can be mapped to a file with `pluginGetFile`
227+
type FormattingProvider = T.Text -- ^ Text to format
228+
-> Uri -- ^ Uri of the file being formatted
222229
-> FormattingType -- ^ How much to format
223230
-> FormattingOptions -- ^ Options for the formatter
224-
-> IdeDeferM (IdeResult [TextEdit]) -- ^ Result of the formatting or the unchanged text.
231+
-> IdeM (IdeResult [TextEdit]) -- ^ Result of the formatting or the unchanged text.
225232

226233
data PluginDescriptor =
227234
PluginDescriptor { pluginId :: PluginId
@@ -272,7 +279,7 @@ runPluginCommand p com arg = do
272279
case Map.lookup p m of
273280
Nothing -> return $
274281
IdeResultFail $ IdeError UnknownPlugin ("Plugin " <> p <> " doesn't exist") Null
275-
Just (PluginDescriptor { pluginCommands = xs }) -> case List.find ((com ==) . commandName) xs of
282+
Just PluginDescriptor { pluginCommands = xs } -> case List.find ((com ==) . commandName) xs of
276283
Nothing -> return $ IdeResultFail $
277284
IdeError UnknownCommand ("Command " <> com <> " isn't defined for plugin " <> p <> ". Legal commands are: " <> T.pack(show $ map commandName xs)) Null
278285
Just (PluginCommand _ _ (CmdSync f)) -> case fromJSON arg of

hie-plugin-api/hie-plugin-api.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ library
4141
, free
4242
, ghc
4343
, ghc-mod-core >= 5.9.0.0
44-
, haskell-lsp >= 0.8
44+
, haskell-lsp == 0.9.*
4545
, hslogger
4646
, monad-control
4747
, mtl

0 commit comments

Comments
 (0)