@@ -114,11 +114,12 @@ data CabalAddCommandParams =
114
114
115
115
instance Logger. Pretty CabalAddCommandParams where
116
116
pretty CabalAddCommandParams {.. } =
117
- " CabalAdd parameters:\n " Logger. <+>
118
- " | cabal path: " Logger. <+> Logger. pretty cabalPath Logger. <+> " \n " Logger. <+>
119
- " | target: " Logger. <+> Logger. pretty buildTarget Logger. <+> " \n " Logger. <+>
120
- " | dependendency: " Logger. <+> Logger. pretty dependency Logger. <+> " \n " Logger. <+>
121
- " | version: " Logger. <+> Logger. pretty version Logger. <+> " \n "
117
+ " CabalAdd parameters:" <+> vcat
118
+ [ " cabal path:" <+> pretty cabalPath
119
+ , " target:" <+> pretty buildTarget
120
+ , " dependendency:" <+> pretty dependency
121
+ , " version:" <+> pretty version
122
+ ]
122
123
123
124
-- | Gives a code action that calls the command,
124
125
-- if a suggestion for a missing dependency is found.
@@ -204,10 +205,10 @@ getDependencyEdit :: MonadIO m => Logger.Recorder (Logger.WithPriority Log) -> (
204
205
FilePath -> Maybe String -> NonEmpty String -> ExceptT PluginError m WorkspaceEdit
205
206
getDependencyEdit recorder env cabalFilePath buildTarget dependency = do
206
207
let (state, caps, verTxtDocId) = env
207
- (mbCnfOrigContents, mbFields, mbPackDescr) <- liftIO $ runAction " cabal.cabal-add" state $ do
208
- contents <- Development.IDE. useWithStale GetFileContents $ toNormalizedFilePath cabalFilePath
209
- inFields <- Development.IDE. useWithStale ParseCabalFields $ toNormalizedFilePath cabalFilePath
210
- inPackDescr <- Development.IDE. useWithStale ParseCabalFile $ toNormalizedFilePath cabalFilePath
208
+ runActionE " cabal.cabal-add" state $ do
209
+ contents <- useWithStaleE GetFileContents $ toNormalizedFilePath cabalFilePath
210
+ inFields <- useWithStaleE ParseCabalFields $ toNormalizedFilePath cabalFilePath
211
+ inPackDescr <- useWithStaleE ParseCabalFile $ toNormalizedFilePath cabalFilePath
211
212
let mbCnfOrigContents = case snd . fst <$> contents of
212
213
Just (Just txt) -> Just $ encodeUtf8 txt
213
214
_ -> Nothing
0 commit comments