Skip to content

Commit 6fdb676

Browse files
author
Ishmum Jawad Khan
committed
[refactor] unused contents acquisition removed
1 parent 4dbe03b commit 6fdb676

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

plugins/default/src/Ide/Plugin/Pragmas.hs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,8 @@ codeActionProvider lsp state _plId docId _ (J.CodeActionContext (J.List diags) _
5959
-- Get all potential Pragmas for all diagnostics.
6060
pragmas = nubOrd $ concatMap (\d -> genPragma dflags (d ^. J.message)) diags
6161
somh = startOfModuleHeader pm
62-
loc <- if somh > 0
63-
then do
64-
contents <- LSP.getVirtualFileFunc lsp . toNormalizedUri $ docId ^. J.uri
65-
text <- pure $ fmap VFS.virtualFileText contents
66-
line <- pure . fromMaybe 0 $ findIndex (not . T.null) . take somh . T.lines =<< text
67-
return $ Position line 0
68-
else return $ Position 0 0
69-
rng <- pure $ Range loc loc
62+
loc = Position somh 0
63+
rng = Range loc loc
7064
cmds <- mapM (mkCodeAction rng) pragmas
7165
return $ Right $ List cmds
7266
where

0 commit comments

Comments
 (0)