Skip to content

Commit ec59508

Browse files
authored
Merge branch 'master' into fix-sql-busy-database-locked
2 parents ab01084 + b354202 commit ec59508

File tree

46 files changed

+205
-156
lines changed

Some content is hidden

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

46 files changed

+205
-156
lines changed

.github/workflows/bench.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,18 @@ jobs:
2424
uses: fkirc/skip-duplicate-actions@v3.4.1
2525
with:
2626
cancel_others: false
27-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**.nix", "**/test/**", "flake.lock", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
27+
paths_ignore: '[ "**/docs/**"
28+
, "**.md"
29+
, "**/LICENSE"
30+
, ".circleci/**"
31+
, "install/**"
32+
, "**.nix"
33+
, "**/test/**"
34+
, "flake.lock"
35+
, "**/README.md"
36+
, "FUNDING.yml"
37+
, "**/stack*.yaml"
38+
]'
2839

2940
bench_init:
3041
if: needs.pre_job.outputs.should_skip != 'true'

.github/workflows/build.yml

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
ghc: ['9.0.1', '8.10.7', '8.10.6', '8.8.4', '8.6.5']
22-
os: [ubuntu-18.04, macOS-latest, windows-latest]
21+
ghc:
22+
[ "9.0.1"
23+
, '8.10.7'
24+
, "8.10.6"
25+
, "8.8.4"
26+
, "8.6.5"
27+
]
28+
os: [ "ubuntu-18.04"
29+
, "macOS-latest"
30+
, "windows-latest"
31+
]
2332
cabal: ['3.6']
2433

2534
steps:
@@ -44,7 +53,7 @@ jobs:
4453
echo -e 'package blaze-textual\n flags: +integer-simple' >> cabal.project.local
4554
fi
4655
47-
- name: Use modified cabal.project for ghc9
56+
- name: (GHC 9.0) Use modified cabal.project for GHC 9.0
4857
if: ${{ matrix.ghc == '9.0.1' }}
4958
run: cp cabal-ghc901.project cabal.project
5059

@@ -56,36 +65,36 @@ jobs:
5665
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
5766
src/**/*.hs exe/*.hs
5867
59-
- name: Set some window specific things
68+
- name: (Windows) Platform specifics
6069
if: matrix.os == 'windows-latest'
6170
env:
6271
GHC_VER: ${{ matrix.ghc }}
6372
run: |
6473
echo "EXE_EXT=.exe" >> $GITHUB_ENV
6574
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
6675
67-
- name: Set some linux specific things
76+
- name: (Linux) Platform specifics
6877
if: matrix.os == 'ubuntu-18.04'
6978
env:
7079
GHC_VER: ${{ matrix.ghc }}
7180
run: |
7281
echo "LINUX_CABAL_ARGS=--enable-executable-static --ghc-options=-split-sections" >> $GITHUB_ENV
7382
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
7483
75-
- name: Set some macOs specific things
84+
- name: (macOS) Platform specifics
7685
if: matrix.os == 'macOS-latest'
7786
env:
7887
GHC_VER: ${{ matrix.ghc }}
7988
run: |
8089
echo "GHC_VERSION=$GHC_VER" >> $GITHUB_ENV
8190
82-
- name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
91+
- name: (Windows, GHC 8.8.4) Workaround segfaults
8392
if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
8493
run: |
8594
echo "package floskell" >> cabal.project
8695
echo " ghc-options: -O0" >> cabal.project
8796
88-
- name: Build server
97+
- name: Build the server
8998
# Try building it twice in case of flakey builds on Windows
9099
run: |
91100
cabal build --disable-tests exe:hls -O2 $LINUX_CABAL_ARGS || \
@@ -109,7 +118,7 @@ jobs:
109118
echo ::set-output name=extension::gz
110119
fi
111120
112-
- name: Upload server to release
121+
- name: (not check) Upload server to release
113122
if: ${{ !contains(github.ref_name, 'check') }}
114123
uses: actions/upload-release-asset@v1.0.2
115124
env:
@@ -126,11 +135,11 @@ jobs:
126135
name: haskell-language-server-${{ runner.OS }}-${{ matrix.ghc }}${{env.EXE_EXT}}.${{ steps.compress_server_binary.outputs.extension }}
127136
path: ${{ steps.compress_server_binary.outputs.path }}
128137

129-
- name: Build wrapper
138+
- name: (GHC 8.10) Build the wrapper
130139
if: matrix.ghc == '8.10.7'
131140
run: cabal build --disable-tests exe:hls-wrapper -O2 $LINUX_CABAL_ARGS
132141

133-
- name: Compress wrapper binary
142+
- name: (GHC 8.10) Compress wrapper binary
134143
if: matrix.ghc == '8.10.7'
135144
id: compress_wrapper_binary
136145
run: |
@@ -149,7 +158,7 @@ jobs:
149158
echo ::set-output name=extension::gz
150159
fi
151160
152-
- name: Upload wrapper to the release
161+
- name: (GHC 8.10, not check) Upload wrapper to the release
153162
if: ${{ matrix.ghc == '8.10.7' && !contains(github.ref_name, 'check') }}
154163
uses: actions/upload-release-asset@v1.0.2
155164
env:
@@ -160,7 +169,7 @@ jobs:
160169
asset_name: haskell-language-server-wrapper-${{ runner.OS }}${{env.EXE_EXT}}.${{ steps.compress_wrapper_binary.outputs.extension }}
161170
asset_content_type: ${{ steps.compress_wrapper_binary.outputs.content_type}}
162171

163-
- name: Upload wrapper to workflow artifacts
172+
- name: (GHC 8.10) Upload wrapper to workflow artifacts
164173
uses: actions/upload-artifact@v2
165174
if: matrix.ghc == '8.10.7'
166175
with:
@@ -183,7 +192,7 @@ jobs:
183192
-o src-dist/haskell-language-server.tar.gz \
184193
HEAD
185194
186-
- name: Upload source tarball to the release
195+
- name: (not check) Upload source tarball to the release
187196
if: ${{ !contains(github.ref_name, 'check') }}
188197
uses: actions/upload-release-asset@v1.0.2
189198
env:
@@ -207,7 +216,10 @@ jobs:
207216
runs-on: ubuntu-18.04
208217
strategy:
209218
matrix:
210-
os: [Linux, macOS, Windows]
219+
os: [ "Linux"
220+
, "macOS"
221+
, "Windows"
222+
]
211223
steps:
212224
- uses: actions/download-artifact@v2
213225

@@ -227,7 +239,7 @@ jobs:
227239
fi
228240
tar -czpf haskell-language-server.tar.gz *
229241
230-
- name: Upload binaries tarball to the release
242+
- name: (not check) Upload binaries tarball to the release
231243
if: ${{ !contains(github.ref_name, 'check') }}
232244
uses: actions/upload-release-asset@v1.0.2
233245
env:
@@ -256,7 +268,7 @@ jobs:
256268
# we clean up tags to match the release file names
257269
sed -i 's/\/.*)/)/g' SHA256SUMS
258270
259-
- name: Upload sha256sums to the release
271+
- name: (not check) Upload sha256sums to the release
260272
if: ${{ !contains(github.ref_name, 'check') }}
261273
uses: actions/upload-release-asset@v1.0.2
262274
env:

.github/workflows/caching.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,16 @@ jobs:
5858
uses: fkirc/skip-duplicate-actions@v3.4.1
5959
with:
6060
cancel_others: false
61-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**"]'
61+
paths_ignore: '["**/docs/**"
62+
, "**.md"
63+
, "**/LICENSE"
64+
, "install/**"
65+
, "**.nix"
66+
, "flake.lock"
67+
, "**/README.md"
68+
, "FUNDING.yml"
69+
, ".circleci/**"
70+
]'
6271

6372
caching:
6473
if: needs.pre_job.outputs.should_skip != 'true'
@@ -67,8 +76,16 @@ jobs:
6776
strategy:
6877
fail-fast: false
6978
matrix:
70-
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
71-
os: [ubuntu-latest, macOS-latest, windows-latest]
79+
ghc: [ "9.0.1"
80+
, "8.10.7"
81+
, "8.10.6"
82+
, "8.8.4"
83+
, "8.6.5"
84+
]
85+
os: [ "ubuntu-latest"
86+
, "macOS-latest"
87+
, "windows-latest"
88+
]
7289
cabal: ['3.6']
7390

7491
steps:

.github/workflows/hlint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "HLint check"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
build10:
10+
name: "Run"
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: 'Installing'
16+
uses: rwe/actions-hlint-setup@v1
17+
with:
18+
version: '3.3.4'
19+
20+
- name: 'Checking code'
21+
uses: rwe/actions-hlint-run@v1
22+
with:
23+
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" ]'

.github/workflows/nix.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,20 @@ jobs:
2424
uses: fkirc/skip-duplicate-actions@v3.4.1
2525
with:
2626
cancel_others: false
27-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", ".circleci/**", "install/**", "**/README.md", "FUNDING.yml", "**/stack*.yaml"]'
27+
paths_ignore: '[ "**/docs/**"
28+
, "**.md"
29+
, "**/LICENSE"
30+
, ".circleci/**"
31+
, "install/**"
32+
, "**/README.md"
33+
, "FUNDING.yml"
34+
, "**/stack*.yaml"
35+
]'
2836
- id: skip_check_no_nix
2937
uses: fkirc/skip-duplicate-actions@v3.4.1
3038
with:
3139
cancel_others: false
32-
paths: '["**.nix"]'
40+
paths: '[ "**.nix" ]'
3341

3442
# Enter the development shell and run `cabal build`
3543
develop:

.github/workflows/test.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,29 @@ jobs:
2525
uses: fkirc/skip-duplicate-actions@v3.4.1
2626
with:
2727
cancel_others: false
28-
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**", "**/stack*.yaml"]'
28+
paths_ignore: '[ "**/docs/**"
29+
, "**.md"
30+
, "**/LICENSE"
31+
, "install/**"
32+
, "**.nix"
33+
, "flake.lock"
34+
, "**/README.md"
35+
, "FUNDING.yml"
36+
, ".circleci/**"
37+
, "**/stack*.yaml"
38+
]'
2939
# If we only change ghcide downstream packages we have not test ghcide itself
3040
- id: skip_ghcide_check
3141
uses: fkirc/skip-duplicate-actions@v3.4.1
3242
with:
3343
cancel_others: false
34-
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
44+
paths_ignore: '[ "hls-test-utils/**"
45+
, "plugins/**"
46+
, "src/**"
47+
, "exe/**"
48+
, "test/**"
49+
, "shake-bench/**"
50+
]'
3551

3652
test:
3753
if: needs.pre_job.outputs.should_skip != 'true'
@@ -40,8 +56,15 @@ jobs:
4056
strategy:
4157
fail-fast: true
4258
matrix:
43-
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.8.4", "8.6.5"]
44-
os: [ubuntu-latest, macOS-latest]
59+
ghc: [ "9.0.1"
60+
, "8.10.7"
61+
, "8.10.6"
62+
, "8.8.4"
63+
, "8.6.5"
64+
]
65+
os: [ "ubuntu-latest"
66+
, "macOS-latest"
67+
]
4568
cabal: ['3.6']
4669
include:
4770
# only test supported ghc major versions
@@ -93,7 +116,7 @@ jobs:
93116
94117
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
95118
- if: matrix.ghc == '9.0.1'
96-
name: (GHC 9.0.1) Use modified `cabal.project`
119+
name: (GHC 9.0) Use modified `cabal.project`
97120
run: |
98121
# File has some protections preventing regular `rm`.
99122
# (most probably sticky bit is set on $HOME)
@@ -154,11 +177,7 @@ jobs:
154177
${{ env.cache-name }}-${{ runner.os }}-${{ matrix.ghc }}-
155178
${{ env.cache-name }}-${{ runner.os }}-
156179
157-
- run: cabal update
158-
159-
- name: "HLint via ./fmt.sh"
160-
run: |
161-
./fmt.sh
180+
- run: cabal v2-update
162181

163182
# repeating builds to workaround segfaults in windows and ghc-8.8.4
164183
- name: Build

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
534534
let sessionOpts :: (Maybe FilePath, FilePath)
535535
-> IO (IdeResult HscEnvEq, [FilePath])
536536
sessionOpts (hieYaml, file) = do
537-
v <- fromMaybe HM.empty . Map.lookup hieYaml <$> readVar fileToFlags
537+
v <- Map.findWithDefault HM.empty hieYaml <$> readVar fileToFlags
538538
cfp <- makeAbsolute file
539539
case HM.lookup (toNormalizedFilePath' cfp) v of
540540
Just (opts, old_di) -> do

ghcide/src/Development/IDE/Import/DependencyInformation.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ data ModuleParseError = ModuleParseError
166166
instance NFData ModuleParseError
167167

168168
-- | Error when trying to locate a module.
169-
data LocateError = LocateError [Diagnostic]
169+
newtype LocateError = LocateError [Diagnostic]
170170
deriving (Eq, Show, Generic)
171171

172172
instance NFData LocateError
@@ -316,7 +316,7 @@ transitiveReverseDependencies file DependencyInformation{..} = do
316316
where
317317
go :: Int -> IntSet -> IntSet
318318
go k i =
319-
let outwards = fromMaybe IntSet.empty (IntMap.lookup k depReverseModuleDeps)
319+
let outwards = IntMap.findWithDefault IntSet.empty k depReverseModuleDeps
320320
res = IntSet.union i outwards
321321
new = IntSet.difference i outwards
322322
in IntSet.foldr go res new

ghcide/src/Development/IDE/Types/Logger.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ data Priority
3131
-- | Note that this is logging actions _of the program_, not of the user.
3232
-- You shouldn't call warning/error if the user has caused an error, only
3333
-- if our code has gone wrong and is itself erroneous (e.g. we threw an exception).
34-
data Logger = Logger {logPriority :: Priority -> T.Text -> IO ()}
34+
newtype Logger = Logger {logPriority :: Priority -> T.Text -> IO ()}
3535

3636
instance Semigroup Logger where
3737
l1 <> l2 = Logger $ \p t -> logPriority l1 p t >> logPriority l2 p t

hls-graph/src/Control/Concurrent/STM/Stats.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE CPP #-}
2-
{-# LANGUAGE RecordWildCards #-}
32
{-# LANGUAGE ScopedTypeVariables #-}
43
module Control.Concurrent.STM.Stats
54
( atomicallyNamed

hls-graph/src/Development/IDE/Graph.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE PatternSynonyms #-}
2-
31
module Development.IDE.Graph(
42
shakeOptions,
53
Rules,

hls-graph/src/Development/IDE/Graph/Internal/Action.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{-# LANGUAGE ConstraintKinds #-}
2-
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
32
{-# LANGUAGE ScopedTypeVariables #-}
43
{-# LANGUAGE TypeFamilies #-}
54

hls-graph/src/Development/IDE/Graph/Internal/Database.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
{-# LANGUAGE DeriveFunctor #-}
55
{-# LANGUAGE DerivingStrategies #-}
66
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
7-
{-# LANGUAGE LambdaCase #-}
8-
{-# LANGUAGE NamedFieldPuns #-}
97
{-# LANGUAGE RankNTypes #-}
108
{-# LANGUAGE RecordWildCards #-}
119
{-# LANGUAGE ScopedTypeVariables #-}
12-
{-# LANGUAGE TupleSections #-}
1310
{-# LANGUAGE TypeFamilies #-}
1411

1512
module Development.IDE.Graph.Internal.Database (newDatabase, incDatabase, build, getDirtySet, getKeysAndVisitAge) where

0 commit comments

Comments
 (0)