Skip to content

Commit af19389

Browse files
committed
Address reviwe comments
1 parent 82d43dc commit af19389

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

haskell-language-server.cabal

+4
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ test-suite hls-class-plugin-tests
340340
import: defaults, pedantic, test-defaults, warnings
341341
if !flag(class)
342342
buildable: False
343+
if impl(ghc >= 9.8)
344+
ghc-options: -Wwarn=x-partial
343345
type: exitcode-stdio-1.0
344346
hs-source-dirs: plugins/hls-class-plugin/test
345347
main-is: Main.hs
@@ -1183,6 +1185,8 @@ test-suite hls-change-type-signature-plugin-tests
11831185
import: defaults, pedantic, test-defaults, warnings
11841186
if !flag(changeTypeSignature)
11851187
buildable: False
1188+
if impl(ghc >= 9.8)
1189+
ghc-options: -Wwarn=x-partial
11861190
type: exitcode-stdio-1.0
11871191
hs-source-dirs: plugins/hls-change-type-signature-plugin/test
11881192
main-is: Main.hs

plugins/hls-change-type-signature-plugin/test/Main.hs

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
#if __GLASGOW_HASKELL__ >= 908
3-
{-# OPTIONS_GHC -Wwarn=x-partial #-}
4-
#endif
5-
61
module Main where
72

83
import Control.Monad (void)

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

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
{-# LANGUAGE CPP #-}
21
{-# LANGUAGE LambdaCase #-}
32
{-# LANGUAGE OverloadedLists #-}
43
{-# LANGUAGE OverloadedStrings #-}
5-
#if __GLASGOW_HASKELL__ >= 908
6-
{-# OPTIONS_GHC -Wwarn=x-partial #-}
7-
#endif
84

95
module Main
106
( main

plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1085,12 +1085,14 @@ suggestImportDisambiguation df (Just txt) ps fileContents diag@Diagnostic {..}
10851085
_ -> False
10861086
]
10871087
++ [HideOthers restImports | not (null restImports)]
1088-
] ++ [ ( renderUniquify mode T.empty symbol True
1089-
, disambiguateSymbol ps fileContents diag symbol mode
1090-
) | local
1091-
, (m,ms) <- take 1 targetsWithRestImports
1092-
, let mode = HideOthers (m:ms)
1093-
]
1088+
] ++ case targetsWithRestImports of
1089+
(m,ms):_ | local ->
1090+
let mode = HideOthers (m:ms)
1091+
in [( renderUniquify mode T.empty symbol True
1092+
, disambiguateSymbol ps fileContents diag symbol mode
1093+
)]
1094+
_ -> []
1095+
10941096
renderUniquify HideOthers {} modName symbol local =
10951097
"Use " <> (if local then "local definition" else modName) <> " for " <> symbol <> ", hiding other imports"
10961098
renderUniquify (ToQualified _ qual) _ symbol _ =

0 commit comments

Comments
 (0)