|
21 | 21 |
|
22 | 22 | module Development.IDE.Plugin.CodeAction
|
23 | 23 | (
|
| 24 | + mkExactprintPluginDescriptor, |
24 | 25 | iePluginDescriptor,
|
25 | 26 | typeSigsPluginDescriptor,
|
26 | 27 | bindingsPluginDescriptor,
|
@@ -158,39 +159,40 @@ iePluginDescriptor recorder plId =
|
158 | 159 | , wrap suggestExportUnusedTopBinding
|
159 | 160 | ]
|
160 | 161 | plId
|
161 |
| - in old {pluginHandlers = pluginHandlers old <> mkPluginHandler STextDocumentCodeAction codeAction |
162 |
| - , pluginRules = getAnnotatedParsedSourceRule recorder |
163 |
| - } |
| 162 | + in mkExactprintPluginDescriptor recorder $ old {pluginHandlers = pluginHandlers old <> mkPluginHandler STextDocumentCodeAction codeAction } |
164 | 163 |
|
165 | 164 | typeSigsPluginDescriptor :: Recorder (WithPriority E.Log) -> PluginId -> PluginDescriptor IdeState
|
166 |
| -typeSigsPluginDescriptor recorder plId = |
167 |
| - (mkGhcideCAsPlugin [ |
| 165 | +typeSigsPluginDescriptor recorder plId = mkExactprintPluginDescriptor recorder $ |
| 166 | + mkGhcideCAsPlugin [ |
168 | 167 | wrap $ suggestSignature True
|
169 | 168 | , wrap suggestFillTypeWildcard
|
170 | 169 | , wrap removeRedundantConstraints
|
171 | 170 | , wrap suggestAddTypeAnnotationToSatisfyContraints
|
172 | 171 | , wrap suggestConstraint
|
173 | 172 | ]
|
174 |
| - plId) { pluginRules = getAnnotatedParsedSourceRule recorder } |
| 173 | + plId |
175 | 174 |
|
176 | 175 | bindingsPluginDescriptor :: Recorder (WithPriority E.Log) -> PluginId -> PluginDescriptor IdeState
|
177 |
| -bindingsPluginDescriptor recorder plId = |
178 |
| - (mkGhcideCAsPlugin [ |
| 176 | +bindingsPluginDescriptor recorder plId = mkExactprintPluginDescriptor recorder $ |
| 177 | + mkGhcideCAsPlugin [ |
179 | 178 | wrap suggestReplaceIdentifier
|
180 | 179 | , wrap suggestImplicitParameter
|
181 | 180 | , wrap suggestNewDefinition
|
182 | 181 | , wrap suggestDeleteUnusedBinding
|
183 | 182 | ]
|
184 |
| - plId) { pluginRules = getAnnotatedParsedSourceRule recorder } |
| 183 | + plId |
185 | 184 |
|
186 | 185 | fillHolePluginDescriptor :: Recorder (WithPriority E.Log) -> PluginId -> PluginDescriptor IdeState
|
187 |
| -fillHolePluginDescriptor recorder plId = (mkGhcideCAPlugin (wrap suggestFillHole) plId) { pluginRules = getAnnotatedParsedSourceRule recorder } |
| 186 | +fillHolePluginDescriptor recorder plId = mkExactprintPluginDescriptor recorder (mkGhcideCAPlugin (wrap suggestFillHole) plId) |
188 | 187 |
|
189 | 188 | extendImportPluginDescriptor :: Recorder (WithPriority E.Log) -> PluginId -> PluginDescriptor IdeState
|
190 |
| -extendImportPluginDescriptor recorder plId = (defaultPluginDescriptor plId) |
191 |
| - { pluginCommands = [extendImportCommand] |
192 |
| - , pluginRules = getAnnotatedParsedSourceRule recorder |
193 |
| - } |
| 189 | +extendImportPluginDescriptor recorder plId = mkExactprintPluginDescriptor recorder $ (defaultPluginDescriptor plId) |
| 190 | + { pluginCommands = [extendImportCommand] } |
| 191 | + |
| 192 | + |
| 193 | +-- | Add the ability for a plugin to call GetAnnotatedParsedSource |
| 194 | +mkExactprintPluginDescriptor :: Recorder (WithPriority E.Log) -> PluginDescriptor a -> PluginDescriptor a |
| 195 | +mkExactprintPluginDescriptor recorder desc = desc { pluginRules = pluginRules desc >> getAnnotatedParsedSourceRule recorder } |
194 | 196 |
|
195 | 197 | -------------------------------------------------------------------------------------------------
|
196 | 198 |
|
|
0 commit comments