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

Commit 984c04d

Browse files
committed
Merge remote-tracking branch 'origin/master' into hie-bios
2 parents 9621ccf + 3e38e39 commit 984c04d

30 files changed

+348
-89
lines changed

Changelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
# 0.8.0.0
2+
3+
- GHC 8.6.4 support added.
4+
- Resolver bumped, LTS 13.10 for GHC 8.6.3, LTS 13.15 for GHC 8.6.4 (@alanz)
5+
- Clarify install section of README.md (@antonlogvinenko)
6+
- Clarify the spacemacs installation (@chkl)
7+
- Further install.hs improvements
8+
- idempotent builds (@fendor)
9+
- Shake is now the only supported method of building HIE,
10+
remove no longer needed Makefile and build-all.ps1 (@Anrock)
11+
- only generate the hoogle database once (@fendor)
12+
- install hoogle if not found (@fendor)
13+
- Add support for pattern synonyms in ghc-mod plugin (@anton-dessiatov)
14+
- prevent hie crash if hlint crashes (@fendor)
15+
116
# 0.7.0.0
217

318
- Resolver bumped, LTS 13.9 for GHC 8.6.3 (@alanz)

haskell-ide-engine.cabal

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: haskell-ide-engine
2-
version: 0.7.0.0
2+
version: 0.8.0.0
33
synopsis: Provide a common engine to power any Haskell IDE
44
description: Please see README.md
55
homepage: http://github.com/githubuser/haskell-ide-engine#readme
@@ -19,23 +19,20 @@ flag pedantic
1919

2020
library
2121
hs-source-dirs: src
22-
exposed-modules: Haskell.Ide.Engine.Plugin.Base
23-
Haskell.Ide.Engine.Channel
24-
Haskell.Ide.Engine.Scheduler
22+
exposed-modules: Haskell.Ide.Engine.Channel
2523
Haskell.Ide.Engine.LSP.CodeActions
24+
Haskell.Ide.Engine.Plugin.Base
2625
Haskell.Ide.Engine.LSP.Reactor
2726
Haskell.Ide.Engine.Options
2827
Haskell.Ide.Engine.Plugin.ApplyRefact
2928
Haskell.Ide.Engine.Plugin.Brittany
3029
Haskell.Ide.Engine.Plugin.Build
3130
Haskell.Ide.Engine.Plugin.Example2
3231
Haskell.Ide.Engine.Plugin.Floskell
33-
Haskell.Ide.Engine.Plugin.Fuzzy
3432
Haskell.Ide.Engine.Plugin.GhcMod
3533
Haskell.Ide.Engine.Plugin.Bios
3634
Haskell.Ide.Engine.Plugin.HaRe
3735
Haskell.Ide.Engine.Plugin.Haddock
38-
Haskell.Ide.Engine.Plugin.HieExtras
3936
Haskell.Ide.Engine.Plugin.HfaAlign
4037
Haskell.Ide.Engine.Plugin.Hoogle
4138
Haskell.Ide.Engine.Plugin.HsImport
@@ -44,6 +41,9 @@ library
4441
Haskell.Ide.Engine.Plugin.Package.Compat
4542
Haskell.Ide.Engine.Plugin.Pragmas
4643
Haskell.Ide.Engine.Plugin.Generic
44+
Haskell.Ide.Engine.Scheduler
45+
Haskell.Ide.Engine.Support.Fuzzy
46+
Haskell.Ide.Engine.Support.HieExtras
4747
Haskell.Ide.Engine.Transport.JsonStdio
4848
Haskell.Ide.Engine.Transport.LspStdio
4949
Haskell.Ide.Engine.Types
@@ -269,6 +269,7 @@ test-suite func-test
269269
, ReferencesSpec
270270
, RenameSpec
271271
, SymbolsSpec
272+
, TypeDefinitionSpec
272273
, Utils
273274
-- This cannot currently be handled by hie (cabal-helper)
274275
-- build-tool-depends: haskell-ide-engine:hie

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,20 @@ type HoverProvider = Uri -> Position -> IdeM (IdeResult [Hover])
210210

211211
type SymbolProvider = Uri -> IdeDeferM (IdeResult [DocumentSymbol])
212212

213+
-- | Format the document either as a whole or only a given Range of it.
213214
data FormattingType = FormatDocument
214215
| FormatRange Range
215-
type FormattingProvider = Uri -> FormattingType -> FormattingOptions -> IdeDeferM (IdeResult [TextEdit])
216+
217+
-- | Formats the given Uri with the given options.
218+
-- A formatting type can be given to either format the whole document or only a Range.
219+
-- Fails if the formatter can not parse the source.
220+
-- Failing menas here that a IdeResultFail is returned.
221+
-- This can be used to display errors to the user, unless the error is an Internal one.
222+
-- The record 'IdeError' and 'IdeErrorCode' can be used to determine the type of error.
223+
type FormattingProvider = Uri -- ^ Uri to the file to format. Can be mapped to a file with `pluginGetFile`
224+
-> FormattingType -- ^ How much to format
225+
-> FormattingOptions -- ^ Options for the formatter
226+
-> IdeDeferM (IdeResult [TextEdit]) -- ^ Result of the formatting or the unchanged text.
216227

217228
data PluginDescriptor =
218229
PluginDescriptor { pluginId :: PluginId

src/Haskell/Ide/Engine/Plugin/Bios.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import GHC.Generics
2525
import Haskell.Ide.Engine.MonadFunctions
2626
import Haskell.Ide.Engine.MonadTypes
2727
import Haskell.Ide.Engine.PluginUtils
28-
import qualified Haskell.Ide.Engine.Plugin.HieExtras as Hie
28+
--import qualified Haskell.Ide.Engine.Plugin.HieExtras as Hie
2929
import Haskell.Ide.Engine.ArtifactMap
3030
import qualified Language.Haskell.LSP.Types as LSP
3131

src/Haskell/Ide/Engine/Plugin/Brittany.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ brittanyDescriptor plId = PluginDescriptor
3636
, pluginFormattingProvider = Just provider
3737
}
3838

39+
-- | Formatter provider of Brittany.
40+
-- Formats the given source in either a given Range or the whole Document.
41+
-- If the provider fails an error is returned that can be displayed to the user.
3942
provider :: FormattingProvider
4043
provider uri formatType opts = pluginGetFile "brittanyCmd: " uri $ \file -> do
4144
confFile <- liftIO $ getConfFile file
@@ -65,6 +68,8 @@ normalize (Range (Position sl _) (Position el _)) =
6568
-- Extend to the line below to replace newline character, as above
6669
Range (Position sl 0) (Position (el + 1) 0)
6770

71+
-- | Recursively search in every directory of the given filepath for brittany.yaml
72+
-- If no such file has been found, return Nothing.
6873
getConfFile :: FilePath -> IO (Maybe FilePath)
6974
getConfFile = findLocalConfigPath . takeDirectory
7075

@@ -100,4 +105,3 @@ showErr (ErrorUnusedComment s) = s
100105
showErr (LayoutWarning s) = s
101106
showErr (ErrorUnknownNode s _) = s
102107
showErr ErrorOutputCheck = "Brittany error - invalid output"
103-

src/Haskell/Ide/Engine/Plugin/Floskell.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ floskellDescriptor plId = PluginDescriptor
2727
, pluginFormattingProvider = Just provider
2828
}
2929

30+
-- | Format provider of Floskell.
31+
-- Formats the given source in either a given Range or the whole Document.
32+
-- If the provider fails an error is returned that can be displayed to the user.
3033
provider :: FormattingProvider
3134
provider uri typ _opts =
3235
pluginGetFile "Floskell: " uri $ \file -> do
@@ -43,8 +46,10 @@ provider uri typ _opts =
4346
Left err -> return $ IdeResultFail (IdeError PluginError (T.pack err) Null)
4447
Right new -> return $ IdeResultOk [TextEdit range (T.decodeUtf8 (BS.toStrict new))]
4548

46-
47-
49+
-- | Find Floskell Config, user and system wide or provides a default style.
50+
-- Every directory of the filepath will be searched to find a user configuration.
51+
-- Also looks into places such as XDG_CONFIG_DIRECTORY<https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>.
52+
-- This function may not throw an exception and returns a default config.
4853
findConfigOrDefault :: FilePath -> IO AppConfig
4954
findConfigOrDefault file = do
5055
mbConf <- findAppConfigIn file

src/Haskell/Ide/Engine/Plugin/Generic.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import qualified GhcMod.SrcUtils as GM
2323
import Haskell.Ide.Engine.MonadFunctions
2424
import Haskell.Ide.Engine.MonadTypes
2525
import Haskell.Ide.Engine.PluginUtils
26-
import qualified Haskell.Ide.Engine.Plugin.HieExtras as Hie
26+
import qualified Haskell.Ide.Engine.Support.HieExtras as Hie
2727
import Haskell.Ide.Engine.ArtifactMap
2828
import qualified Language.Haskell.LSP.Types as LSP
2929
import qualified Language.Haskell.LSP.Types.Lens as LSP

src/Haskell/Ide/Engine/Plugin/GhcMod.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import qualified GhcMod.Utils as GM
3535
import Haskell.Ide.Engine.MonadFunctions
3636
import Haskell.Ide.Engine.MonadTypes
3737
import Haskell.Ide.Engine.PluginUtils
38-
import qualified Haskell.Ide.Engine.Plugin.HieExtras as Hie
38+
import qualified Haskell.Ide.Engine.Support.HieExtras as Hie
3939
import Haskell.Ide.Engine.ArtifactMap
4040
import qualified Language.Haskell.LSP.Types as LSP
4141
import qualified Language.Haskell.LSP.Types.Lens as LSP

src/Haskell/Ide/Engine/Plugin/HaRe.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Haskell.Ide.Engine.ArtifactMap
2828
import Haskell.Ide.Engine.MonadFunctions
2929
import Haskell.Ide.Engine.MonadTypes
3030
import Haskell.Ide.Engine.PluginUtils
31-
import qualified Haskell.Ide.Engine.Plugin.HieExtras as Hie
31+
import qualified Haskell.Ide.Engine.Support.HieExtras as Hie
3232
import Language.Haskell.GHC.ExactPrint.Print
3333
import qualified Language.Haskell.LSP.Core as Core
3434
import qualified Language.Haskell.LSP.Types as J

src/Haskell/Ide/Engine/Plugin/Haddock.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ import Data.IORef
1717
import Data.Function
1818
import Data.Maybe
1919
import Data.List
20-
import System.Directory
21-
import System.FilePath
2220
import GHC
23-
import GhcMonad
24-
import qualified GhcMod.Monad as GM
2521
import qualified GhcMod.LightGhc as GM
26-
import Haskell.Ide.Engine.MonadTypes
22+
import qualified GhcMod.Monad as GM
23+
import GhcMonad
2724
import Haskell.Ide.Engine.MonadFunctions
28-
import Haskell.Ide.Engine.Plugin.HieExtras
25+
import Haskell.Ide.Engine.MonadTypes
2926
import qualified Haskell.Ide.Engine.Plugin.Hoogle as Hoogle
3027
import Haskell.Ide.Engine.PluginUtils
31-
import qualified Language.Haskell.LSP.Types as J
28+
import Haskell.Ide.Engine.Support.HieExtras
3229
import HscTypes
30+
import qualified Language.Haskell.LSP.Types as J
3331
import Name
3432
import Packages
33+
import System.Directory
34+
import System.FilePath
3535

3636

3737
import Documentation.Haddock

src/Haskell/Ide/Engine/Plugin/Fuzzy.hs renamed to src/Haskell/Ide/Engine/Support/Fuzzy.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- | Forked from: Text.Fuzzy (MIT)
55
-- Original Author: Joomy Korkut, http://github.com/joom/fuzzy
66
-- Uses 'TextualMonoid' to be able to run on different types of strings.
7-
module Haskell.Ide.Engine.Plugin.Fuzzy where
7+
module Haskell.Ide.Engine.Support.Fuzzy where
88

99
import Prelude hiding (filter, null)
1010

0 commit comments

Comments
 (0)