Skip to content

Commit d48a1df

Browse files
committed
Merge branch 'master' into ghc-9.2
2 parents d07f8f8 + 7518a3a commit d48a1df

File tree

75 files changed

+714
-364
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+714
-364
lines changed

.github/workflows/bench.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ jobs:
106106
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
107107
${{ env.cache-name }}-${{ runner.os }}-
108108
109+
# To ensure we get the lastest hackage index and not relying on haskell action logic
109110
- run: cabal update
110111

111112
# max-backjumps is increased as a temporary solution

.github/workflows/caching.yml

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ on:
4545
- cron: "25 2/8 * * *"
4646

4747
env:
48-
cabalBuild: "v2-build all --enable-tests --enable-benchmarks --keep-going"
48+
cabalBuild: "v2-build all --keep-going"
4949

5050
jobs:
5151

@@ -176,21 +176,62 @@ jobs:
176176
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
177177
${{ env.cache-name }}-${{ runner.os }}-
178178
179+
# To ensure we get the lastest hackage index and not relying on haskell action logic
179180
- if: steps.compiled-deps.outputs.cache-hit != 'true'
181+
run: cabal update
182+
183+
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7'
184+
name: Download sources for bench
185+
# Downloaded separately, to match the tested work/PR workflow guarantees
180186
run: |
181-
cabal update
187+
cabal $cabalBuild --only-download --enable-benchmarks
182188
183189
- if: steps.compiled-deps.outputs.cache-hit != 'true'
184-
name: Download all sources
190+
name: Download the rest of the sources
191+
# Downloaded separately, to match the tested work/PR workflow guarantees
185192
run: |
186-
cabal $cabalBuild --only-download
193+
cabal $cabalBuild --only-download --enable-tests
187194
188195
# repeating builds to workaround segfaults in windows and ghc-8.8.4
189196
# This build agenda in not to have successful code,
197+
<<<<<<< HEAD
198+
# but to cache what can be cached, so step is fault tolerant & would always succseed.
199+
# 2021-12-11: NOTE: Building all targets, since
200+
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
201+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
202+
name: Build all targets; try 3 times
203+
run: |
204+
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
205+
||||||| b3542020
190206
# but to cache what can be cached, so step is fault tolerant & would always succseed.
191207
# 2021-12-11: NOTE: Building all targets, since
192208
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies`
193209
- if: steps.compiled-deps.outputs.cache-hit != 'true'
194210
name: Build all targets; try 3 times
211+
continue-on-error: true
195212
run: |
196213
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
214+
215+
# Despite the `continue-on-error: true` directive - CI does not ignore the return code of the last step
216+
- name: Workaround to CI platform
217+
run: |
218+
true
219+
=======
220+
# but to cache what can be cached, so step is fault tolerant & would always succeed.
221+
# 2021-12-11: NOTE: Need to building all targets (build the project also), since
222+
# current Cabal does not allow `all --enable-tests --enable-benchmarks --only-dependencies` combination
223+
224+
- if: steps.compiled-deps.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ghc == '8.10.7'
225+
name: (For Bench workflow) Build benchmark targets
226+
continue-on-error: true
227+
# Downloaded separately, to match the tested work/PR workflow guarantees
228+
run: |
229+
cabal $cabalBuild --enable-benchmarks || cabal $cabalBuild --enable-benchmarks || cabal $cabalBuild --enable-benchmarks
230+
231+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
232+
name: Build targets; try 3 times
233+
continue-on-error: true
234+
# Done separately, matching the tested work/PR workflow guarantees
235+
run: |
236+
cabal $cabalBuild --enable-test || cabal $cabalBuild --enable-test || cabal $cabalBuild --enable-test
237+
>>>>>>> master

.github/workflows/hlint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
build10:
10-
name: "Run"
10+
name: "Hlint check run"
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
@@ -21,4 +21,5 @@ jobs:
2121
uses: rwe/actions-hlint-run@v1
2222
with:
2323
hlint-bin: "hlint --with-group=extra --hint=ghcide/.hlint.yaml"
24-
path: '[ "ghcide/src", "ghcide/exe", "ghcide/bench/lib", "ghcide/bench/exe", "ghcide/bench/hist", "shake-bench/src", "ghcide/test/exe" ]'
24+
path: '[ "ghcide/src", "ghcide/exe", "ghcide/bench/lib", "ghcide/bench/exe", "ghcide/bench/hist", "shake-bench/src", "ghcide/test/exe"]'
25+

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ jobs:
177177
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
178178
${{ env.cache-name }}-${{ runner.os }}-
179179
180-
- run: cabal v2-update
180+
# To ensure we get the lastest hackage index and not relying on haskell action logic
181+
- if: steps.compiled-deps.outputs.cache-hit != 'true'
182+
run: cabal update
181183

182184
# repeating builds to workaround segfaults in windows and ghc-8.8.4
183185
- name: Build

cabal-ghc901.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ package *
3737

3838
write-ghc-environment-files: never
3939

40-
index-state: 2021-11-29T12:30:10Z
40+
index-state: 2021-12-29T12:30:08Z
4141

4242
constraints:
4343
-- These plugins don't work on GHC9 yet

cabal-ghc921.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ package *
5353

5454
write-ghc-environment-files: never
5555

56-
index-state: 2021-12-23T00:00:00Z
56+
index-state: 2021-12-29T12:30:08Z
5757

5858
constraints:
5959
-- These plugins doesn't work on GHC92 yet

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ package *
4040

4141
write-ghc-environment-files: never
4242

43-
index-state: 2021-11-29T12:30:10Z
43+
index-state: 2021-12-29T12:30:08Z
4444

4545
constraints:
4646
hyphenation +embed

ghcide/bench/example/HLS

Lines changed: 0 additions & 1 deletion
This file was deleted.

ghcide/bench/lib/Experiments.hs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ experiments =
195195
let edit :: TextDocumentContentChangeEvent =TextDocumentContentChangeEvent
196196
{ _range = Just Range {_start = bottom, _end = bottom}
197197
, _rangeLength = Nothing, _text = t}
198-
bottom = Position maxBoundUinteger 0
198+
bottom = Position maxBound 0
199199
t = T.unlines
200200
[""
201201
,"holef :: [Int] -> [Int]"
@@ -214,7 +214,7 @@ experiments =
214214
flip allM docs $ \DocumentPositions{..} -> do
215215
bottom <- pred . length . T.lines <$> documentContents doc
216216
diags <- getCurrentDiagnostics doc
217-
case requireDiagnostic diags (DsError, (bottom, 8), "Found hole", Nothing) of
217+
case requireDiagnostic diags (DsError, (fromIntegral bottom, 8), "Found hole", Nothing) of
218218
Nothing -> pure True
219219
Just _err -> pure False
220220
)
@@ -405,7 +405,7 @@ runBenchmarksFun dir allBenchmarks = do
405405
++ ["--verbose" | verbose ?config]
406406
++ ["--ot-memory-profiling" | Just _ <- [otMemoryProfiling ?config]]
407407
lspTestCaps =
408-
fullCaps {_window = Just $ WindowClientCapabilities $ Just True}
408+
fullCaps {_window = Just $ WindowClientCapabilities (Just True) Nothing Nothing }
409409
conf =
410410
defaultConfig
411411
{ logStdErr = verbose ?config,
@@ -586,7 +586,7 @@ setupDocumentContents config =
586586
doc <- openDoc m "haskell"
587587

588588
-- Setup the special positions used by the experiments
589-
lastLine <- length . T.lines <$> documentContents doc
589+
lastLine <- fromIntegral . length . T.lines <$> documentContents doc
590590
changeDoc doc [TextDocumentContentChangeEvent
591591
{ _range = Just (Range (Position lastLine 0) (Position lastLine 0))
592592
, _rangeLength = Nothing
@@ -639,9 +639,9 @@ searchSymbol doc@TextDocumentIdentifier{_uri} fileContents pos = do
639639
return res
640640
where
641641
loop pos
642-
| _line pos >= lll =
642+
| (fromIntegral $ _line pos) >= lll =
643643
return Nothing
644-
| _character pos >= lengthOfLine (_line pos) =
644+
| (fromIntegral $ _character pos) >= lengthOfLine (fromIntegral $ _line pos) =
645645
loop (nextLine pos)
646646
| otherwise = do
647647
checks <- checkDefinitions pos &&^ checkCompletions pos
@@ -664,7 +664,3 @@ searchSymbol doc@TextDocumentIdentifier{_uri} fileContents pos = do
664664
checkCompletions pos =
665665
not . null <$> getCompletions doc pos
666666

667-
-- | We don't have a uinteger type yet. So hardcode the maxBound of uinteger, 2 ^ 31 - 1
668-
-- as a constant.
669-
maxBoundUinteger :: Int
670-
maxBoundUinteger = 2147483647

ghcide/ghcide.cabal

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ library
6565
lens,
6666
list-t,
6767
hiedb == 0.4.1.*,
68-
lsp-types >= 1.3.0.1 && < 1.4,
69-
lsp == 1.2.*,
68+
lsp-types ^>= 1.4.0.0,
69+
lsp ^>= 1.4.0.0 ,
7070
monoid-subclasses,
7171
mtl,
7272
network-uri,
7373
optparse-applicative,
7474
parallel,
7575
prettyprinter-ansi-terminal,
7676
prettyprinter,
77+
random,
7778
regex-tdfa >= 1.3.1.0,
7879
retrie,
7980
rope-utf16-splay,
@@ -392,11 +393,13 @@ test-suite ghcide-tests
392393
process,
393394
QuickCheck,
394395
quickcheck-instances,
396+
random,
395397
rope-utf16-splay,
396398
regex-tdfa ^>= 1.3.1,
397399
safe,
398400
safe-exceptions,
399401
shake,
402+
sqlite-simple,
400403
stm,
401404
stm-containers,
402405
hls-graph,
@@ -421,6 +424,7 @@ test-suite ghcide-tests
421424
Experiments
422425
Experiments.Types
423426
Progress
427+
HieDbRetry
424428
default-extensions:
425429
BangPatterns
426430
DeriveFunctor

0 commit comments

Comments
 (0)