@@ -100,7 +100,7 @@ haskellInteractionDescriptor recorder plId =
100100 (defaultPluginDescriptor plId " Provides the cabal-add code action in haskell files" )
101101 { pluginHandlers =
102102 mconcat
103- [ mkPluginHandler LSP. SMethod_TextDocumentCodeAction $ cabalAddCodeAction recorder
103+ [ mkPluginHandler LSP. SMethod_TextDocumentCodeAction cabalAddCodeAction
104104 ]
105105 , pluginCommands = [PluginCommand CabalAdd. cabalAddCommand " add a dependency to a cabal file" (CabalAdd. command cabalAddRecorder)]
106106 , pluginRules = pure ()
@@ -332,8 +332,8 @@ gotoDefinition ideState _ msgParam = do
332332 isSectionArgName name (Syntax. Section _ sectionArgName _) = name == CabalFields. onelineSectionArgs sectionArgName
333333 isSectionArgName _ _ = False
334334
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
337337 maxCompls <- fmap maxCompletions . liftIO $ runAction " cabal.cabal-add" state getClientConfigAction
338338 let suggestions = take maxCompls $ concatMap CabalAdd. hiddenPackageSuggestion diags
339339 case suggestions of
@@ -351,12 +351,11 @@ cabalAddCodeAction recorder state plId (CodeActionParams _ _ (TextDocumentIdenti
351351 case mbGPD of
352352 Nothing -> pure $ InL []
353353 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
357358 pure $ InL $ fmap InR actions
358- where
359- cabalAddRecorder = cmapWithPrio LogCabalAdd recorder
360359
361360
362361-- ----------------------------------------------------------------
0 commit comments