File tree 1 file changed +16
-2
lines changed
plugins/default/src/Ide/Plugin
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
- {-# LANGUAGE ViewPatterns #-}
2
1
{-# LANGUAGE DeriveAnyClass #-}
3
2
{-# LANGUAGE DeriveGeneric #-}
4
3
{-# LANGUAGE DuplicateRecordFields #-}
5
4
{-# LANGUAGE OverloadedStrings #-}
5
+ {-# LANGUAGE ViewPatterns #-}
6
6
7
7
-- | Provides code actions to add missing pragmas (whenever GHC suggests to)
8
8
module Ide.Plugin.Pragmas
@@ -115,10 +115,24 @@ findPragma str = concatMap check possiblePragmas
115
115
116
116
-- | All language pragmas, including the No- variants
117
117
allPragmas :: [T. Text ]
118
- allPragmas = concat
118
+ allPragmas =
119
+ concat
119
120
[ [name, " No" <> name]
120
121
| FlagSpec {flagSpecName = T. pack -> name} <- xFlags
121
122
]
123
+ <>
124
+ -- These pragmas are not part of xFlags as they are not reversable
125
+ -- by prepending "No".
126
+ [ -- Safe Haskell
127
+ " Unsafe"
128
+ , " Trustworthy"
129
+ , " Safe"
130
+
131
+ -- Language Version Extensions
132
+ , " Haskell98"
133
+ , " Haskell2010"
134
+ -- Maybe, GHC 2021 after its release?
135
+ ]
122
136
123
137
-- ---------------------------------------------------------------------
124
138
You can’t perform that action at this time.
0 commit comments