Skip to content

Commit c73b3e9

Browse files
committed
force complete pattern in ghcide lib
1 parent 86f0664 commit c73b3e9

File tree

5 files changed

+23
-1
lines changed

5 files changed

+23
-1
lines changed

ghcide/ghcide.cabal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ flag pedantic
3535

3636
common warnings
3737
ghc-options:
38+
-Werror=incomplete-patterns
3839
-Wall
3940
-Wincomplete-uni-patterns
4041
-Wunused-packages
@@ -43,6 +44,7 @@ common warnings
4344
-fno-ignore-asserts
4445

4546
library
47+
import: warnings
4648
default-language: GHC2021
4749
build-depends:
4850
, aeson

ghcide/src/Development/IDE/GHC/CoreFile.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ tcIfaceId = fmap getIfaceId . tcIfaceDecl False <=< unmangle_decl_name
202202
name' <- newIfaceName (mkVarOcc $ getOccString name)
203203
pure $ ifid{ ifName = name' }
204204
| otherwise = pure ifid
205+
unmangle_decl_name _ifid = error $ "tcIfaceId: got non IfaceId: "
205206
-- invariant: 'IfaceId' is always a 'IfaceId' constructor
206207
getIfaceId (AnId identifier) = identifier
207208
getIfaceId _ = error "tcIfaceId: got non Id"

ghcide/src/Development/IDE/GHC/Orphans.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ instance NFData Unlinked where
6060
rnf (DotA f) = rnf f
6161
rnf (DotDLL f) = rnf f
6262
rnf (BCOs a b) = seqCompiledByteCode a `seq` liftRnf rwhnf b
63+
rnf _ = error "rnf: not implemented for Unlinked"
6364
instance Show PackageFlag where show = unpack . printOutputable
6465
instance Show InteractiveImport where show = unpack . printOutputable
6566
instance Show PackageName where show = unpack . printOutputable

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import Numeric.Natural
4141
data Log
4242
= LogShake Shake.Log
4343
| LogFileStore FileStore.Log
44-
| LogOpenTextDocument !Uri
4544
| LogOpenedTextDocument !Uri
4645
| LogModifiedTextDocument !Uri
4746
| LogSavedTextDocument !Uri

srcipt.bash

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# recommended to build test binary separately and then run it in a loop (to avoid running cabal test in a loop)
2+
# cabal build hls-eval-plugin-tests
3+
# find dist-newstyle -name hls-eval-plugin-tests -type f
4+
# # ./dist-newstyle/build/x86_64-linux/ghc-9.4.8/haskell-language-server-2.7.0.0/t/hls-eval-plugin-tests/build/hls-eval-plugin-tests/hls-eval-plugin-tests
5+
# # Run tests in a loop
6+
for i in {1..500}; do
7+
echo "Iteration $i" &&
8+
# LSP_TEST_LOG_MESSAGES=0 LSP_TEST_LOG_STDERR=0 TASTY_PATTERN="Testing PluginError order" $(find dist-newstyle -name ghcide-tests -type f | head -n 1) \
9+
LSP_TEST_LOG_MESSAGES=0 LSP_TEST_LOG_STDERR=0 TASTY_PATTERN="notification handlers run in priority order" $(find dist-newstyle -name ghcide-tests -type f | head -n 1) \
10+
|| {
11+
# line_count=$(wc -l < test.txt)
12+
# if (( line_count > 100 )); then
13+
# echo "Warning: More than 100 lines in test.txt at iteration $i"
14+
# break
15+
# fi
16+
echo "Warning: error at iteration $i"
17+
break
18+
}; done
19+

0 commit comments

Comments
 (0)