@@ -202,15 +202,15 @@ hiddenPackageSuggestion maxCompletions diag = take maxCompletions $ getMatch (ms
202
202
203
203
command :: Logger. Recorder (Logger. WithPriority Log ) -> CommandFunction IdeState CabalAddCommandParams
204
204
command recorder state _ params@ (CabalAddCommandParams {cabalPath = path, verTxtDocId = verTxtDocId, buildTarget = target, dependency = dep, version = mbVer}) = do
205
- Logger. logWith recorder Logger. Info $ LogCalledCabalAddCommand params
205
+ Logger. logWith recorder Logger. Debug $ LogCalledCabalAddCommand params
206
206
let specifiedDep = case mbVer of
207
207
Nothing -> dep
208
208
Just ver -> dep <> " ^>=" <> ver
209
209
caps <- lift pluginGetClientCapabilities
210
210
let env = (state, caps, verTxtDocId)
211
211
edit <- getDependencyEdit recorder env path target (fromList [T. unpack specifiedDep])
212
212
void $ lift $ pluginSendRequest SMethod_WorkspaceApplyEdit (ApplyWorkspaceEditParams Nothing edit) (\ _ -> pure () )
213
- Logger. logWith recorder Logger. Info LogExecutedCommand
213
+ Logger. logWith recorder Logger. Debug LogExecutedCommand
214
214
pure $ InR Null
215
215
216
216
-- | Constructs prerequisites for the @executeConfig@
@@ -259,7 +259,7 @@ getDependencyEdit recorder env cabalFilePath buildTarget dependency = do
259
259
Nothing -> throwE $ PluginInternalError $ T. pack $ " Cannot extend build-depends in " ++ cabalFilePath
260
260
Just newContents -> do
261
261
let edit = diffText caps (verTxtDocId, T. decodeUtf8 cnfOrigContents) (T. decodeUtf8 newContents) SkipDeletions
262
- Logger. logWith recorder Logger. Info $ LogCreatedEdit edit
262
+ Logger. logWith recorder Logger. Debug $ LogCreatedEdit edit
263
263
pure edit
264
264
265
265
-- | Given a path to a haskell file, returns the closest cabal file.
@@ -283,6 +283,9 @@ findResponsibleCabalFile haskellFilePath = do
283
283
-- | Gives cabal file's contents or throws error.
284
284
-- Inspired by @readCabalFile@ in cabal-add,
285
285
-- Distribution.Client.Main
286
+ --
287
+ -- This is a fallback option!
288
+ -- Use only if the `GetFileContents` fails.
286
289
readCabalFile :: MonadIO m => FilePath -> ExceptT PluginError m ByteString
287
290
readCabalFile fileName = do
288
291
cabalFileExists <- liftIO $ doesFileExist fileName
0 commit comments