@@ -100,7 +100,7 @@ haskellInteractionDescriptor recorder plId =
100
100
(defaultPluginDescriptor plId " Provides the cabal-add code action in haskell files" )
101
101
{ pluginHandlers =
102
102
mconcat
103
- [ mkPluginHandler LSP. SMethod_TextDocumentCodeAction $ cabalAddCodeAction recorder
103
+ [ mkPluginHandler LSP. SMethod_TextDocumentCodeAction cabalAddCodeAction
104
104
]
105
105
, pluginCommands = [PluginCommand CabalAdd. cabalAddCommand " add a dependency to a cabal file" (CabalAdd. command cabalAddRecorder)]
106
106
, pluginRules = pure ()
@@ -332,8 +332,8 @@ gotoDefinition ideState _ msgParam = do
332
332
isSectionArgName name (Syntax. Section _ sectionArgName _) = name == CabalFields. onelineSectionArgs sectionArgName
333
333
isSectionArgName _ _ = False
334
334
335
- cabalAddCodeAction :: Recorder ( WithPriority Log ) -> PluginMethodHandler IdeState 'LSP.Method_TextDocumentCodeAction
336
- cabalAddCodeAction recorder state plId (CodeActionParams _ _ (TextDocumentIdentifier uri) _ CodeActionContext {_diagnostics= diags}) = do
335
+ cabalAddCodeAction :: PluginMethodHandler IdeState 'LSP.Method_TextDocumentCodeAction
336
+ cabalAddCodeAction state plId (CodeActionParams _ _ (TextDocumentIdentifier uri) _ CodeActionContext {_diagnostics= diags}) = do
337
337
maxCompls <- fmap maxCompletions . liftIO $ runAction " cabal.cabal-add" state getClientConfigAction
338
338
let suggestions = take maxCompls $ concatMap CabalAdd. hiddenPackageSuggestion diags
339
339
case suggestions of
@@ -351,12 +351,11 @@ cabalAddCodeAction recorder state plId (CodeActionParams _ _ (TextDocumentIdenti
351
351
case mbGPD of
352
352
Nothing -> pure $ InL []
353
353
Just (gpd, _) -> do
354
- actions <- liftIO $ CabalAdd. addDependencySuggestCodeAction cabalAddRecorder plId
355
- verTxtDocId suggestions
356
- haskellFilePath cabalFilePath gpd
354
+ actions <- liftIO $ CabalAdd. addDependencySuggestCodeAction plId verTxtDocId
355
+ suggestions
356
+ haskellFilePath cabalFilePath
357
+ gpd
357
358
pure $ InL $ fmap InR actions
358
- where
359
- cabalAddRecorder = cmapWithPrio LogCabalAdd recorder
360
359
361
360
362
361
-- ----------------------------------------------------------------
0 commit comments