File tree 1 file changed +2
-4
lines changed
plugins/default/src/Ide/Plugin
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import Control.Applicative ((<|>))
15
15
import qualified Data.HashMap.Strict as H
16
16
import qualified Data.Text as T
17
17
import Data.Maybe (listToMaybe , fromMaybe )
18
- import Data.List (findIndex )
19
18
import Development.IDE as D
20
19
import Ide.Types
21
20
import Language.Haskell.LSP.Types
@@ -52,14 +51,13 @@ mkPragmaEdit uri pragmaName rng = res where
52
51
-- | Offer to add a missing Language Pragma to the top of a file.
53
52
-- Pragmas are defined by a curated list of known pragmas, see 'possiblePragmas'.
54
53
codeActionProvider :: CodeActionProvider IdeState
55
- codeActionProvider lsp state _plId docId _ (J. CodeActionContext (J. List diags) _monly) = do
54
+ codeActionProvider _ state _plId docId _ (J. CodeActionContext (J. List diags) _monly) = do
56
55
let mFile = docId ^. J. uri & uriToFilePath <&> toNormalizedFilePath'
57
56
pm <- fmap join $ runAction " addPragma" state $ getParsedModule `traverse` mFile
58
57
let dflags = ms_hspp_opts . pm_mod_summary <$> pm
59
58
-- Get all potential Pragmas for all diagnostics.
60
59
pragmas = nubOrd $ concatMap (\ d -> genPragma dflags (d ^. J. message)) diags
61
- somh = startOfModuleHeader pm
62
- loc = Position somh 0
60
+ loc = Position (startOfModuleHeader pm) 0
63
61
rng = Range loc loc
64
62
cmds <- mapM (mkCodeAction rng) pragmas
65
63
return $ Right $ List cmds
You can’t perform that action at this time.
0 commit comments