Open
Description
Your environment
Which OS do you use: Arch
Which LSP client (editor/plugin) do you use: VSCode
Describe your project (alternative: link to the project): HLS
GHC: 8.10.7
Steps to reproduce
write
instance PluginMethod TextDocumentDocumentHighlight where
like this between:
class HasTracing (MessageParams m) => PluginMethod m where
-- | Parse the configuration to check if this plugin is enabled
pluginEnabled :: SMethod m -> MessageParams m -> PluginDescriptor c -> Config -> Bool
-- | How to combine responses from different plugins
combineResponses
:: SMethod m
-> Config -- ^ IDE Configuration
-> ClientCapabilities
-> MessageParams m
-> NonEmpty (ResponseResult m) -> ResponseResult m
default combineResponses :: Semigroup (ResponseResult m)
=> SMethod m -> Config -> ClientCapabilities -> MessageParams m -> NonEmpty (ResponseResult m) -> ResponseResult m
combineResponses _method _config _caps _params = sconcat
instance PluginMethod TextDocumentDocumentHighlight where
instance PluginMethod TextDocumentCodeAction where
pluginEnabled _ msgParams pluginDesc config =
pluginResponsible uri pluginDesc && pluginEnabledConfig plcCodeActionsOn (pluginId pluginDesc) config
where
uri = msgParams ^. J.textDocument . J.uri
...
Triggering "Add placeholder for 'pluginEnabled'" leads to this change:
instance PluginMethod TextDocumentCodeAction where
pluginEnabled _ msgParams pluginDesc config =
pluginResponsible uri pluginDesc && pluginEnabledConfig plcCodeActionsOn (pluginId pluginDesc) config
where
pluginEnabled = _
uri = msgParams ^. J.textDocument . J.uri
Note, the method was added to the wrong instance and produced invalid code.