diff --git a/.circleci/config.yml b/.circleci/config.yml index 70b984260b..53aca2c977 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -148,13 +148,21 @@ jobs: - cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} - run: name: Update - command: cabal update + command: cabal new-update - run: name: Configure - command: cabal configure --enable-tests + command: cabal new-configure --enable-tests + - run: + name: Build dependencies + command: cabal new-build -j1 --dependencies-only # need j1, else ghc-lib-parser triggers OOM + no_output_timeout: 30m + - save_cache: + key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} + paths: + - ~/.cabal - run: name: Build - command: cabal build -j1 # need j1, else ghc-lib-parser triggers OOM + command: cabal new-build -j1 # need j1, else ghc-lib-parser triggers OOM no_output_timeout: 30m - save_cache: key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }} diff --git a/exe/Main.hs b/exe/Main.hs index 816c321f2b..439a1be19b 100644 --- a/exe/Main.hs +++ b/exe/Main.hs @@ -58,15 +58,20 @@ import System.Log.Logger as L import System.Time.Extra -- --------------------------------------------------------------------- - +-- ghcide partialhandlers import Development.IDE.Plugin.CodeAction as CodeAction import Development.IDE.Plugin.Completions as Completions +import Development.IDE.LSP.HoverDefinition as HoverDefinition + + -- haskell-language-server plugins import Ide.Plugin.Example as Example import Ide.Plugin.Example2 as Example2 +import Ide.Plugin.GhcIde as GhcIde import Ide.Plugin.Floskell as Floskell import Ide.Plugin.Ormolu as Ormolu import Ide.Plugin.Pragmas as Pragmas + -- --------------------------------------------------------------------- -- | The plugins configured for use in this instance of the language @@ -90,7 +95,8 @@ idePlugins pid includeExamples -- , hsimportDescriptor "hsimport" -- , liquidDescriptor "liquid" -- , packageDescriptor "package" - Pragmas.descriptor "pragmas" + GhcIde.descriptor "ghc" + , Pragmas.descriptor "pragmas" , Floskell.descriptor "floskell" -- , genericDescriptor "generic" -- , ghcmodDescriptor "ghcmod" @@ -145,6 +151,7 @@ main = do -- (ps, commandIds) = idePlugins pid argsExamplePlugin (ps, commandIds) = idePlugins pid True plugins = Completions.plugin <> CodeAction.plugin <> + Plugin mempty HoverDefinition.setHandlersDefinition <> ps options = def { LSP.executeCommandCommands = Just commandIds , LSP.completionTriggerCharacters = Just "." diff --git a/ghcide b/ghcide index 8b328bb7c5..7ecdd21874 160000 --- a/ghcide +++ b/ghcide @@ -1 +1 @@ -Subproject commit 8b328bb7c5f3e09280788b56abd6fb6d0bfb08ce +Subproject commit 7ecdd21874e1b9c638502c47d61facd3be581c65 diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index a3076a8af3..97b7ecd69a 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -34,6 +34,7 @@ library Ide.Plugin.Config Ide.Plugin.Example Ide.Plugin.Example2 + Ide.Plugin.GhcIde Ide.Plugin.Ormolu Ide.Plugin.Pragmas Ide.Plugin.Floskell diff --git a/src/Ide/Plugin/GhcIde.hs b/src/Ide/Plugin/GhcIde.hs new file mode 100644 index 0000000000..16826956d7 --- /dev/null +++ b/src/Ide/Plugin/GhcIde.hs @@ -0,0 +1,35 @@ +{-# LANGUAGE OverloadedStrings #-} +module Ide.Plugin.GhcIde + ( + descriptor + ) where + +import Development.IDE.Types.Logger +import Ide.Types +import Development.IDE.LSP.HoverDefinition +import Development.IDE.Core.Shake + +-- --------------------------------------------------------------------- + +descriptor :: PluginId -> PluginDescriptor +descriptor plId = PluginDescriptor + { pluginId = plId + , pluginRules = mempty + , pluginCommands = [] + , pluginCodeActionProvider = Nothing + , pluginCodeLensProvider = Nothing + , pluginDiagnosticProvider = Nothing + , pluginHoverProvider = Just hover' + , pluginSymbolsProvider = Nothing + , pluginFormattingProvider = Nothing + , pluginCompletionProvider = Nothing + } + +-- --------------------------------------------------------------------- + +hover' :: HoverProvider +hover' ideState params = do + logInfo (ideLogger ideState) "GhcIde.hover entered (ideLogger)" -- AZ + hover ideState params + +-- ---------------------------------------------------------------------