Skip to content

Commit c2a7952

Browse files
authored
Promote more warnings to errors in ghcide (#4054)
* Promote more warnings to errors in ghcide * Small simplifications
1 parent 0047d13 commit c2a7952

File tree

5 files changed

+10
-16
lines changed

5 files changed

+10
-16
lines changed

ghcide/ghcide.cabal

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ flag pedantic
4242

4343
common warnings
4444
ghc-options:
45-
-Wall -Wincomplete-uni-patterns -Wunused-packages
45+
-Wall
46+
-Wincomplete-uni-patterns
47+
-Wunused-packages
48+
-Wno-name-shadowing
4649
-Wno-unticked-promoted-constructors
4750
-fno-ignore-asserts
4851

@@ -216,12 +219,7 @@ library
216219
-- finished purging the warnings, so some are set to not be errors
217220
-- for now
218221
ghc-options:
219-
-Werror -Wwarn=unused-packages -Wwarn=unrecognised-pragmas
220-
-Wwarn=dodgy-imports -Wwarn=missing-signatures
221-
-Wwarn=duplicate-exports -Wwarn=dodgy-exports
222-
-Wwarn=incomplete-patterns -Wwarn=overlapping-patterns
223-
-Wwarn=incomplete-record-updates
224-
-Wwarn=ambiguous-fields
222+
-Werror -Wwarn=unused-packages
225223

226224
if flag(ekg)
227225
build-depends:
@@ -238,7 +236,6 @@ executable ghcide-test-preprocessor
238236
import: warnings
239237
default-language: GHC2021
240238
hs-source-dirs: test/preprocessor
241-
ghc-options: -Wno-name-shadowing
242239
main-is: Main.hs
243240
build-depends: base >=4 && <5
244241

@@ -253,7 +250,7 @@ executable ghcide
253250
import: warnings
254251
default-language: GHC2021
255252
hs-source-dirs: exe
256-
ghc-options: -threaded -rtsopts "-with-rtsopts=-I0 -A128M -T" -Wno-name-shadowing
253+
ghc-options: -threaded -rtsopts "-with-rtsopts=-I0 -A128M -T"
257254

258255

259256
-- allow user RTS overrides
@@ -352,7 +349,7 @@ test-suite ghcide-tests
352349
build-depends: ghc-typelits-knownnat
353350

354351
hs-source-dirs: test/cabal test/exe test/src
355-
ghc-options: -threaded -O0 -Wno-name-shadowing
352+
ghc-options: -threaded -O0
356353

357354
main-is: Main.hs
358355
other-modules:

ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ mainRule recorder RulesConfig{..} = do
12701270
reportImportCyclesRule recorder
12711271
typeCheckRule recorder
12721272
getDocMapRule recorder
1273-
loadGhcSession recorder def{fullModuleGraph}
1273+
loadGhcSession recorder GhcSessionDepsConfig{fullModuleGraph}
12741274
getModIfaceFromDiskRule recorder
12751275
getModIfaceFromDiskAndIndexRule recorder
12761276
getModIfaceRule recorder

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{-# LANGUAGE CPP #-}
22
{-# LANGUAGE PatternSynonyms #-}
3-
{-# HLINT ignore "Unused LANGUAGE pragma" #-}
43

54
-- | Parser compatibility module.
65
module Development.IDE.GHC.Compat.Parser (

ghcide/src/Development/IDE/LSP/Outline.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,10 @@ documentSymbolForDecl (L (locA -> (RealSrcSpan l _)) (ForD _ x)) = Just
190190
{ _name = case x of
191191
ForeignImport{} -> name
192192
ForeignExport{} -> name
193-
XForeignDecl{} -> "?"
194193
, _kind = SymbolKind_Object
195194
, _detail = case x of
196195
ForeignImport{} -> Just "import"
197196
ForeignExport{} -> Just "export"
198-
XForeignDecl{} -> Nothing
199197
}
200198
where name = printOutputable $ unLoc $ fd_name x
201199

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,10 @@ defRowToSymbolInfo _ = Nothing
439439

440440
pointCommand :: HieASTs t -> Position -> (HieAST t -> a) -> [a]
441441
pointCommand hf pos k =
442-
catMaybes $ M.elems $ flip M.mapWithKey (getAsts hf) $ \fs ast ->
442+
M.elems $ flip M.mapMaybeWithKey (getAsts hf) $ \fs ast ->
443443
-- Since GHC 9.2:
444444
-- getAsts :: Map HiePath (HieAst a)
445-
-- type HiePath = LexialFastString
445+
-- type HiePath = LexicalFastString
446446
--
447447
-- but before:
448448
-- getAsts :: Map HiePath (HieAst a)

0 commit comments

Comments
 (0)