@@ -7,9 +7,10 @@ import Ide.Types (IdePlugins)
7
7
8
8
-- fixed plugins
9
9
import Development.IDE (IdeState )
10
- import Development.IDE.Plugin.HLS.GhcIde as GhcIde
11
- import Ide.Plugin.Example as Example
12
- import Ide.Plugin.Example2 as Example2
10
+ import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
11
+ import qualified Ide.Plugin.Example as Example
12
+ import qualified Ide.Plugin.Example2 as Example2
13
+
13
14
14
15
-- haskell-language-server optional plugins
15
16
#if qualifyImportedNames
@@ -29,7 +30,7 @@ import Ide.Plugin.HaddockComments as HaddockComments
29
30
#endif
30
31
31
32
#if eval
32
- import Ide.Plugin.Eval as Eval
33
+ import qualified Ide.Plugin.Eval as Eval
33
34
#endif
34
35
35
36
#if importLens
@@ -45,7 +46,7 @@ import Ide.Plugin.Rename as Rename
45
46
#endif
46
47
47
48
#if retrie
48
- import Ide.Plugin.Retrie as Retrie
49
+ import qualified Ide.Plugin.Retrie as Retrie
49
50
#endif
50
51
51
52
#if tactic
@@ -69,7 +70,7 @@ import Ide.Plugin.Splice as Splice
69
70
#endif
70
71
71
72
#if alternateNumberFormat
72
- import Ide.Plugin.AlternateNumberFormat as AlternateNumberFormat
73
+ import qualified Ide.Plugin.AlternateNumberFormat as AlternateNumberFormat
73
74
#endif
74
75
75
76
-- formatters
@@ -87,22 +88,33 @@ import Ide.Plugin.Ormolu as Ormolu
87
88
#endif
88
89
89
90
#if stylishHaskell
90
- import Ide.Plugin.StylishHaskell as StylishHaskell
91
+ import qualified Ide.Plugin.StylishHaskell as StylishHaskell
91
92
#endif
92
93
93
94
#if brittany
95
+ import Development.IDE.Types.Logger (Recorder , cmap )
94
96
import Ide.Plugin.Brittany as Brittany
95
97
#endif
96
98
99
+ data Log
100
+ = LogExample Example. Log
101
+ | LogExample2 Example2. Log
102
+ | LogAlternateNumberFormat AlternateNumberFormat. Log
103
+ | LogStylishHaskell StylishHaskell. Log
104
+ | LogRetrie Retrie. Log
105
+ | LogEval Eval. Log
106
+ | LogGhcide GhcIde. Log
107
+ deriving Show
108
+
97
109
-- ---------------------------------------------------------------------
98
110
99
111
-- | The plugins configured for use in this instance of the language
100
112
-- server.
101
113
-- These can be freely added or removed to tailor the available
102
114
-- features of the server.
103
115
104
- idePlugins :: Bool -> IdePlugins IdeState
105
- idePlugins includeExamples = pluginDescToIdePlugins allPlugins
116
+ idePlugins :: Recorder Log -> Bool -> IdePlugins IdeState
117
+ idePlugins recorder includeExamples = pluginDescToIdePlugins allPlugins
106
118
where
107
119
allPlugins = if includeExamples
108
120
then basePlugins ++ examplePlugins
@@ -124,13 +136,13 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
124
136
Ormolu. descriptor " ormolu" :
125
137
#endif
126
138
#if stylishHaskell
127
- StylishHaskell. descriptor " stylish-haskell" :
139
+ StylishHaskell. descriptor (cmap LogStylishHaskell recorder) " stylish-haskell" :
128
140
#endif
129
141
#if rename
130
142
Rename. descriptor " rename" :
131
143
#endif
132
144
#if retrie
133
- Retrie. descriptor " retrie" :
145
+ Retrie. descriptor (cmap LogRetrie recorder) " retrie" :
134
146
#endif
135
147
#if brittany
136
148
Brittany. descriptor " brittany" :
@@ -145,7 +157,7 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
145
157
HaddockComments. descriptor " haddockComments" :
146
158
#endif
147
159
#if eval
148
- Eval. descriptor " eval" :
160
+ Eval. descriptor (cmap LogEval recorder) " eval" :
149
161
#endif
150
162
#if importLens
151
163
ExplicitImports. descriptor " importLens" :
@@ -166,12 +178,12 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
166
178
Splice. descriptor " splice" :
167
179
#endif
168
180
#if alternateNumberFormat
169
- AlternateNumberFormat. descriptor " alternateNumberFormat" :
181
+ AlternateNumberFormat. descriptor (cmap LogAlternateNumberFormat recorder) " alternateNumberFormat" :
170
182
#endif
171
183
-- The ghcide descriptors should come last so that the notification handlers
172
184
-- (which restart the Shake build) run after everything else
173
- GhcIde. descriptors
185
+ GhcIde. descriptors (cmap LogGhcide recorder)
174
186
examplePlugins =
175
- [Example. descriptor " eg"
176
- ,Example2. descriptor " eg2"
187
+ [Example. descriptor (cmap LogExample recorder) " eg"
188
+ ,Example2. descriptor (cmap LogExample2 recorder) " eg2"
177
189
]
0 commit comments