Skip to content

Commit be9c5f8

Browse files
committed
Call useWithStale instead of useWithStaleFast when calling ParseCabalFields
Add documentation about this choice
1 parent 7563439 commit be9c5f8

File tree

1 file changed

+4
-8
lines changed
  • plugins/hls-cabal-plugin/src/Ide/Plugin

1 file changed

+4
-8
lines changed

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

+4-8
Original file line numberDiff line numberDiff line change
@@ -314,14 +314,10 @@ completion recorder ide _ complParams = do
314314
mVf <- lift $ getVirtualFile $ toNormalizedUri uri
315315
case (,) <$> mVf <*> uriToFilePath' uri of
316316
Just (cnts, path) -> do
317-
mFields <- liftIO $ runIdeAction "cabal-plugin.fields" (shakeExtras ide) $ useWithStaleFast ParseCabalFields $ toNormalizedFilePath path
318-
case mFields of
319-
Nothing ->
320-
pure . InR $ InR Null
321-
Just (fields, _) -> do
322-
let pref = Ghcide.getCompletionPrefix position cnts
323-
let res = produceCompletions pref path fields
324-
liftIO $ fmap InL res
317+
mFields <- liftIO $ runAction "cabal-plugin.fields" ide $ use_ ParseCabalFields $ toNormalizedFilePath path
318+
let pref = Ghcide.getCompletionPrefix position cnts
319+
let res = produceCompletions pref path mFields
320+
liftIO $ fmap InL res
325321
Nothing -> pure . InR $ InR Null
326322
where
327323
completerRecorder = cmapWithPrio LogCompletions recorder

0 commit comments

Comments
 (0)