We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4dbe03b commit 6fdb676Copy full SHA for 6fdb676
plugins/default/src/Ide/Plugin/Pragmas.hs
@@ -59,14 +59,8 @@ codeActionProvider lsp state _plId docId _ (J.CodeActionContext (J.List diags) _
59
-- Get all potential Pragmas for all diagnostics.
60
pragmas = nubOrd $ concatMap (\d -> genPragma dflags (d ^. J.message)) diags
61
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
+ loc = Position somh 0
+ rng = Range loc loc
70
cmds <- mapM (mkCodeAction rng) pragmas
71
return $ Right $ List cmds
72
where
0 commit comments