File tree 4 files changed +22
-3
lines changed
plugins/hls-pragmas-plugin
4 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,13 @@ suggestDisableWarning Diagnostic {_code}
126
126
pure (" Disable \" " <> w <> " \" warnings" , OptGHC w)
127
127
| otherwise = []
128
128
129
- -- Don't suggest disabling type errors as a solution to all type errors
130
129
warningBlacklist :: [T. Text ]
131
- warningBlacklist = [" deferred-type-errors" ]
130
+ warningBlacklist =
131
+ -- Don't suggest disabling type errors as a solution to all type errors.
132
+ [ " deferred-type-errors"
133
+ -- Don't suggest disabling out of scope errors as a solution to all out of scope errors.
134
+ , " deferred-out-of-scope-variables"
135
+ ]
132
136
133
137
-- ---------------------------------------------------------------------
134
138
Original file line number Diff line number Diff line change @@ -109,11 +109,16 @@ codeActionTests' =
109
109
_ -> assertFailure $ " Expected one code action, but got: " <> show cas
110
110
liftIO $ (ca ^. L. title == " Add \" NamedFieldPuns\" " ) @? " NamedFieldPuns code action"
111
111
executeCodeAction ca
112
- , goldenWithPragmas pragmasSuggestPlugin " doesn't suggest disabling type errors" " DeferredTypeErrors" $ \ doc -> do
112
+ , goldenWithPragmas pragmasDisableWarningPlugin " doesn't suggest disabling type errors" " DeferredTypeErrors" $ \ doc -> do
113
113
_ <- waitForDiagnosticsFrom doc
114
114
cas <- map fromAction <$> getAllCodeActions doc
115
115
liftIO $ " Disable \" deferred-type-errors\" warnings" `notElem` map (^. L. title) cas @? " Doesn't contain deferred-type-errors code action"
116
116
liftIO $ length cas == 0 @? " Expected no code actions, but got: " <> show cas
117
+ , goldenWithPragmas pragmasDisableWarningPlugin " doesn't suggest disabling out of scope variables" " DeferredOutOfScopeVariables" $ \ doc -> do
118
+ _ <- waitForDiagnosticsFrom doc
119
+ cas <- map fromAction <$> getAllCodeActions doc
120
+ liftIO $ " Disable \" deferred-out-of-scope-variables\" warnings" `notElem` map (^. L. title) cas @? " Doesn't contain deferred-out-of-scope-variables code action"
121
+ liftIO $ length cas == 0 @? " Expected no code actions, but got: " <> show cas
117
122
]
118
123
119
124
completionTests :: TestTree
Original file line number Diff line number Diff line change
1
+ module DeferredOutOfScopeVariables where
2
+
3
+ f :: ()
4
+ f = let x = Doesn'tExist
5
+ in undefined
Original file line number Diff line number Diff line change
1
+ module DeferredOutOfScopeVariables where
2
+
3
+ f :: ()
4
+ f = let x = Doesn'tExist
5
+ in undefined
You can’t perform that action at this time.
0 commit comments