@@ -9,38 +9,38 @@ module Development.IDE.Plugin.Completions
9
9
, NonLocalCompletions (.. )
10
10
) where
11
11
12
- import Control.Monad
13
- import Control.Monad.Extra
14
- import Control.Monad.Trans.Maybe
15
- import Data.Aeson
16
- import Data.List ( find )
17
- import Data.Maybe
18
- import qualified Data.Text as T
19
- import Language.LSP.Types
20
- import qualified Language.LSP.Server as LSP
21
- import qualified Language.LSP.VFS as VFS
22
- import Development.Shake.Classes
23
- import Development.Shake
24
- import GHC.Generics
25
- import Development.IDE.Core.Service
26
- import Development.IDE.Core.PositionMapping
27
- import Development.IDE.Plugin.Completions.Logic
28
- import Development.IDE.Types.Location
29
- import Development.IDE.Core.RuleTypes
30
- import Development.IDE.Core.Shake
31
- import Development.IDE.GHC.Compat
32
- import Development.IDE.GHC.ExactPrint ( Annotated ( annsA ), GetAnnotatedParsedSource ( GetAnnotatedParsedSource ) )
33
- import Development.IDE.Types.HscEnvEq ( hscEnv )
34
- import Development.IDE.Plugin.CodeAction.ExactPrint
35
- import Development.IDE.Plugin.Completions.Types
36
- import Ide.Plugin.Config ( Config ( completionSnippetsOn ) )
37
- import Ide.PluginUtils ( getClientConfig )
38
- import Ide.Types
39
- import TcRnDriver ( tcRnImportDecls )
40
- import Control.Concurrent.Async ( concurrently )
41
- import GHC.Exts ( toList )
42
- import Development.IDE.GHC.Error ( rangeToSrcSpan )
43
- import Development.IDE.GHC.Util ( prettyPrint )
12
+ import Control.Concurrent.Async ( concurrently )
13
+ import Control.Monad
14
+ import Control.Monad.Extra
15
+ import Control.Monad.Trans.Maybe
16
+ import Data.Aeson
17
+ import Data.List ( find )
18
+ import Data.Maybe
19
+ import qualified Data.Text as T
20
+ import Development.IDE.Core.PositionMapping
21
+ import Development.IDE.Core.RuleTypes
22
+ import Development.IDE.Core.Service
23
+ import Development.IDE.Core .Shake
24
+ import Development.IDE. GHC.Compat
25
+ import Development.IDE.GHC.Error ( rangeToSrcSpan )
26
+ import Development.IDE.GHC.ExactPrint ( Annotated ( annsA ),
27
+ GetAnnotatedParsedSource ( GetAnnotatedParsedSource ))
28
+ import Development.IDE.GHC.Util ( prettyPrint )
29
+ import Development.IDE.Plugin.CodeAction.ExactPrint
30
+ import Development.IDE.Plugin.Completions.Logic
31
+ import Development.IDE.Plugin.Completions.Types
32
+ import Development.IDE.Types.HscEnvEq ( hscEnv )
33
+ import Development.IDE.Types.Location
34
+ import Development.Shake
35
+ import Development.Shake.Classes
36
+ import GHC.Exts ( toList )
37
+ import GHC.Generics
38
+ import Ide.Plugin.Config ( Config ( completionSnippetsOn ))
39
+ import Ide.Types
40
+ import qualified Language.LSP.Server as LSP
41
+ import Language.LSP.Types
42
+ import qualified Language.LSP.VFS as VFS
43
+ import TcRnDriver ( tcRnImportDecls )
44
44
45
45
descriptor :: PluginId -> PluginDescriptor IdeState
46
46
descriptor plId = (defaultPluginDescriptor plId)
@@ -86,7 +86,7 @@ dropListFromImportDecl iDecl = let
86
86
f d@ ImportDecl {ideclHiding} = case ideclHiding of
87
87
Just (False , _) -> d {ideclHiding= Nothing }
88
88
-- if hiding or Nothing just return d
89
- _ -> d
89
+ _ -> d
90
90
f x = x
91
91
in f <$> iDecl
92
92
@@ -135,7 +135,7 @@ getCompletionsLSP ide plId
135
135
-> return (InL $ List [] )
136
136
(Just pfix', _) -> do
137
137
let clientCaps = clientCapabilities $ shakeExtras ide
138
- config <- getClientConfig
138
+ config <- getClientConfig $ shakeExtras ide
139
139
let snippets = WithSnippets . completionSnippetsOn $ config
140
140
allCompletions <- liftIO $ getCompletions plId ideOpts cci' parsedMod bindMap pfix' clientCaps snippets
141
141
pure $ InL (List allCompletions)
@@ -200,5 +200,5 @@ liftMaybe :: Monad m => Maybe a -> MaybeT m a
200
200
liftMaybe a = MaybeT $ pure a
201
201
202
202
liftEither :: Monad m => Either e a -> MaybeT m a
203
- liftEither (Left _) = mzero
203
+ liftEither (Left _) = mzero
204
204
liftEither (Right x) = return x
0 commit comments