File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 4
4
{-# LANGUAGE OverloadedStrings #-}
5
5
{-# LANGUAGE TypeFamilies #-}
6
6
7
- module Ide.Plugin.Cabal (descriptor , haskellFilesDescriptor , Log (.. )) where
7
+ module Ide.Plugin.Cabal (descriptor , haskellInteractionDescriptor , Log (.. )) where
8
8
9
9
import Control.Concurrent.Strict
10
10
import Control.DeepSeq
@@ -88,9 +88,10 @@ instance Pretty Log where
88
88
LogCompletions logs -> pretty logs
89
89
LogCabalAdd logs -> pretty logs
90
90
91
-
92
- haskellFilesDescriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
93
- haskellFilesDescriptor recorder plId =
91
+ -- | Some actions with cabal files originate from haskell files.
92
+ -- This descriptor is needed to handle these cases.
93
+ haskellInteractionDescriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
94
+ haskellInteractionDescriptor recorder plId =
94
95
(defaultPluginDescriptor plId " Provides the cabal-add code action in haskell files" )
95
96
{ pluginHandlers =
96
97
mconcat
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import Data.List (sort)
9
9
import Data.Proxy (Proxy (Proxy ))
10
10
import qualified Data.Text as T
11
11
import Ide.Plugin.Cabal (descriptor ,
12
- haskellFilesDescriptor )
12
+ haskellInteractionDescriptor )
13
13
import qualified Ide.Plugin.Cabal
14
14
import Ide.Plugin.Cabal.Completion.Types
15
15
import System.FilePath
@@ -20,7 +20,7 @@ cabalPlugin :: PluginTestDescriptor Ide.Plugin.Cabal.Log
20
20
cabalPlugin = mkPluginTestDescriptor descriptor " cabal"
21
21
22
22
cabalHaskellPlugin :: PluginTestDescriptor Ide.Plugin.Cabal. Log
23
- cabalHaskellPlugin = mkPluginTestDescriptor haskellFilesDescriptor " cabal-haskell"
23
+ cabalHaskellPlugin = mkPluginTestDescriptor haskellInteractionDescriptor " cabal-haskell"
24
24
25
25
simpleCabalPrefixInfoFromPos :: Position -> T. Text -> CabalPrefixInfo
26
26
simpleCabalPrefixInfoFromPos pos prefix =
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ idePlugins recorder = pluginDescToIdePlugins allPlugins
152
152
allPlugins =
153
153
#if hls_cabal
154
154
let pId = " cabal" in Cabal. descriptor (pluginRecorder pId) pId :
155
- let caId = " cabaladd" in Cabal. haskellFilesDescriptor (pluginRecorder caId) caId :
155
+ let caId = " cabaladd" in Cabal. haskellInteractionDescriptor (pluginRecorder caId) caId :
156
156
#endif
157
157
#if hls_pragmas
158
158
Pragmas. suggestPragmaDescriptor " pragmas-suggest" :
You can’t perform that action at this time.
0 commit comments