Skip to content

Commit 9a2aaf1

Browse files
authored
Merge branch 'master' into batch-load
2 parents 112bc95 + 6d0a6f2 commit 9a2aaf1

File tree

6 files changed

+24
-5
lines changed

6 files changed

+24
-5
lines changed

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ packages:
88
./hls-test-utils
99

1010

11-
index-state: 2024-10-21T00:00:00Z
11+
index-state: 2024-11-02T00:00:00Z
1212

1313
tests: True
1414
test-show-details: direct

ghcide/src/Development/IDE/GHC/Compat/Core.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ initObjLinker env =
674674
loadDLL :: HscEnv -> String -> IO (Maybe String)
675675
loadDLL env str = do
676676
res <- GHCi.loadDLL (GHCi.hscInterp env) str
677-
#if MIN_VERSION_ghc(9,11,0)
677+
#if MIN_VERSION_ghc(9,11,0) || (MIN_VERSION_ghc(9, 8, 3) && !MIN_VERSION_ghc(9, 9, 0))
678678
pure $
679679
case res of
680680
Left err_msg -> Just err_msg

plugins/hls-pragmas-plugin/src/Ide/Plugin/Pragmas.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,13 @@ suggestDisableWarning Diagnostic {_code}
126126
pure ("Disable \"" <> w <> "\" warnings", OptGHC w)
127127
| otherwise = []
128128

129-
-- Don't suggest disabling type errors as a solution to all type errors
130129
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+
]
132136

133137
-- ---------------------------------------------------------------------
134138

plugins/hls-pragmas-plugin/test/Main.hs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,16 @@ codeActionTests' =
109109
_ -> assertFailure $ "Expected one code action, but got: " <> show cas
110110
liftIO $ (ca ^. L.title == "Add \"NamedFieldPuns\"") @? "NamedFieldPuns code action"
111111
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
113113
_ <- waitForDiagnosticsFrom doc
114114
cas <- map fromAction <$> getAllCodeActions doc
115115
liftIO $ "Disable \"deferred-type-errors\" warnings" `notElem` map (^. L.title) cas @? "Doesn't contain deferred-type-errors code action"
116116
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
117122
]
118123

119124
completionTests :: TestTree
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module DeferredOutOfScopeVariables where
2+
3+
f :: ()
4+
f = let x = Doesn'tExist
5+
in undefined
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module DeferredOutOfScopeVariables where
2+
3+
f :: ()
4+
f = let x = Doesn'tExist
5+
in undefined

0 commit comments

Comments
 (0)