Skip to content

Commit 76f064c

Browse files
committed
- logs and empty suggestion
1 parent e4e363b commit 76f064c

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ cabalAddCodeAction recorder state plId (CodeActionParams _ _ (TextDocumentIdenti
344344
Just haskellFilePath -> do
345345
mbCabalFile <- liftIO $ CabalAdd.findResponsibleCabalFile haskellFilePath
346346
case mbCabalFile of
347-
Nothing -> pure $ InL [InR noCabalFileAction]
347+
Nothing -> pure $ InL []
348348
Just cabalFilePath -> do
349349
verTxtDocId <- lift $ pluginGetVersionedTextDoc $ TextDocumentIdentifier (filePathToUri cabalFilePath)
350350
mbGPD <- liftIO $ runAction "cabal.cabal-add" state $ useWithStale ParseCabalFile $ toNormalizedFilePath cabalFilePath
@@ -356,8 +356,6 @@ cabalAddCodeAction recorder state plId (CodeActionParams _ _ (TextDocumentIdenti
356356
haskellFilePath cabalFilePath gpd
357357
pure $ InL $ fmap InR actions
358358
where
359-
noCabalFileAction = CodeAction "No .cabal file found" (Just CodeActionKind_QuickFix) (Just []) Nothing
360-
(Just (CodeActionDisabled "No .cabal file found")) Nothing Nothing Nothing
361359
cabalAddRecorder = cmapWithPrio LogCabalAdd recorder
362360

363361

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/CabalAdd.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ import Text.Regex.TDFA
8585

8686
data Log
8787
= LogFoundResponsibleCabalFile FilePath
88-
| LogCalledCabalAddCodeAction
8988
| LogCalledCabalAddCommand CabalAddCommandParams
9089
| LogCreatedEdit WorkspaceEdit
9190
| LogExecutedCommand
@@ -94,7 +93,6 @@ data Log
9493
instance Pretty Log where
9594
pretty = \case
9695
LogFoundResponsibleCabalFile fp -> "Located the responsible cabal file at " <+> pretty fp
97-
LogCalledCabalAddCodeAction -> "The CabalAdd CodeAction is called"
9896
LogCalledCabalAddCommand params -> "Called CabalAdd command with:\n" <+> pretty params
9997
LogCreatedEdit edit -> "Created inplace edit:\n" <+> pretty edit
10098
LogExecutedCommand -> "Executed CabalAdd command"
@@ -143,7 +141,6 @@ addDependencySuggestCodeAction
143141
-> IO [CodeAction]
144142
addDependencySuggestCodeAction recorder plId verTxtDocId suggestions haskellFilePath cabalFilePath gpd = do
145143
buildTargets <- liftIO $ getBuildTargets gpd cabalFilePath haskellFilePath
146-
logWith recorder Info LogCalledCabalAddCodeAction
147144
case buildTargets of
148145
[] -> pure $ mkCodeAction cabalFilePath Nothing <$> suggestions
149146
targets -> pure $ concat [mkCodeAction cabalFilePath (Just $ buildTargetToStringRepr target) <$>

0 commit comments

Comments
 (0)