Skip to content

Commit 1b5b772

Browse files
committed
[fix] fix another unnecessary short cut if an uri is not a file
1 parent 14961f3 commit 1b5b772

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ghcide/src/Development/IDE/Plugin/Completions.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ getCompletionsLSP ide plId
163163
,_context=completionContext} = ExceptT $ do
164164
contentsMaybe <-
165165
liftIO $ runAction "Completion" ide $ getUriContents $ toNormalizedUri uri
166-
fmap Right $ case (contentsMaybe, uriToFilePath' uri) of
167-
(Just cnts, Just path) -> do
168-
let nuri = filePathToUri' $ toNormalizedFilePath' path
166+
fmap Right $ case contentsMaybe of
167+
Just cnts -> do
168+
let nuri = toNormalizedUri uri
169169
(ideOpts, compls, moduleExports, astres) <- liftIO $ runIdeAction "Completion" (shakeExtras ide) $ do
170170
opts <- liftIO $ getIdeOptionsIO $ shakeExtras ide
171171
localCompls <- useWithStaleFast LocalCompletions nuri
@@ -209,7 +209,7 @@ getCompletionsLSP ide plId
209209
let allCompletions = getCompletions plugins ideOpts cci' parsedMod astres bindMap pfix clientCaps config moduleExports uri
210210
pure $ InL (orderedCompletions allCompletions)
211211
_ -> return (InL [])
212-
_ -> return (InL [])
212+
Nothing -> return (InL [])
213213

214214
getCompletionsConfig :: PluginId -> Action CompletionsConfig
215215
getCompletionsConfig pId =

0 commit comments

Comments
 (0)