Skip to content

Commit c9d37fc

Browse files
authored
Merge branch 'master' into wip/file-versions2
2 parents 25aed41 + 8466bc1 commit c9d37fc

File tree

30 files changed

+242
-183
lines changed

30 files changed

+242
-183
lines changed

.circleci/config.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,11 @@ jobs:
105105
- STACK_FILE: "stack-9.0.2.yaml"
106106
<<: *defaults
107107

108-
ghc-9.2.1:
108+
ghc-9.2.2:
109109
environment:
110-
- STACK_FILE: "stack-9.2.1.yaml"
110+
# https://github.com/digital-asset/ghc-lib/issues/352
111+
- CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
112+
- STACK_FILE: "stack-9.2.yaml"
111113
<<: *defaults
112114

113115
ghc-default:
@@ -126,5 +128,5 @@ workflows:
126128
- ghc-8.10.7
127129
- ghc-9.0.1
128130
- ghc-9.0.2
129-
- ghc-9.2.1
131+
- ghc-9.2.2
130132
- ghc-default

.github/workflows/caching.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
strategy:
8181
fail-fast: false
8282
matrix:
83-
ghc: [ "9.2.1"
83+
ghc: [ "9.2.2"
8484
, "9.0.2"
8585
, "9.0.1"
8686
, "8.10.7"
@@ -116,6 +116,9 @@ jobs:
116116
run: |
117117
# repeating builds to workaround segfaults in windows and ghc-8.8.4
118118
cabal $cabalBuild || cabal $cabalBuild || cabal $cabalBuild
119+
env:
120+
# needed for GHC 9.2.2 https://github.com/digital-asset/ghc-lib/issues/352
121+
CPATH:"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi":$CPATH
119122

120123
# We build ghcide with benchs and test enabled to include its dependencies in the cache
121124
# (including shake-bench)

.github/workflows/flags.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
fail-fast: true
4646
matrix:
47-
ghc: [ "9.2.1"
47+
ghc: [ "9.2.2"
4848
, "9.0.2"
4949
, "8.10.7"
5050
, "8.8.4"
@@ -72,7 +72,7 @@ jobs:
7272
run: cabal v2-build ghcide --flags="ghc-patched-unboxed-bytecode test-exe executable bench-exe"
7373

7474
# we have to clean up warnings for 9.0 and 9.2 before enable -WAll
75-
- if: matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1'
75+
- if: matrix.ghc != '9.0.2' && matrix.ghc != '9.2.2'
7676
name: Build with pedantic (-WError)
7777
run: cabal v2-build --flags="pedantic"
7878

.github/workflows/test.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
strategy:
5858
fail-fast: true
5959
matrix:
60-
ghc: [ "9.2.1"
60+
ghc: [ "9.2.2"
6161
, "9.0.2"
6262
, "9.0.1"
6363
, "8.10.7"
@@ -71,7 +71,7 @@ jobs:
7171
include:
7272
# only test supported ghc major versions
7373
- os: ubuntu-latest
74-
ghc: '9.2.1'
74+
ghc: '9.2.2'
7575
test: true
7676
- os: ubuntu-latest
7777
ghc: '9.0.2'
@@ -86,7 +86,7 @@ jobs:
8686
ghc: '8.6.5'
8787
test: true
8888
- os: windows-latest
89-
ghc: '9.2.1'
89+
ghc: '9.2.2'
9090
test: true
9191
- os: windows-latest
9292
ghc: '9.0.2'
@@ -115,6 +115,9 @@ jobs:
115115

116116
# repeating builds to workaround segfaults in windows and ghc-8.8.4
117117
- name: Build
118+
# needed for GHC 9.2.2 https://github.com/digital-asset/ghc-lib/issues/352
119+
env:
120+
CPATH: "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
118121
run: cabal build || cabal build || cabal build
119122

120123
- name: Set test options
@@ -125,7 +128,7 @@ jobs:
125128
echo "TEST_OPTS=-j1 --rerun-update --rerun-filter failures,exceptions" >> $GITHUB_ENV
126129
127130
- name: Cache test log bewteen attempts of the same run
128-
uses: actions/cache@v2
131+
uses: actions/cache@v3
129132
env:
130133
cache-name: cache-test-log
131134
with:
@@ -159,7 +162,7 @@ jobs:
159162
HLS_WRAPPER_TEST_EXE: hls-wrapper
160163
run: cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" || cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper" || cabal test wrapper-test --test-options="$TEST_OPTS --rerun-log-file .tasty-rerun-log-wrapper"
161164

162-
- if: matrix.test && matrix.ghc != '9.2.1'
165+
- if: matrix.test && matrix.ghc != '9.2.2'
163166
name: Test hls-brittany-plugin
164167
run: cabal test hls-brittany-plugin --test-options="$TEST_OPTS" || cabal test hls-brittany-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-brittany-plugin --test-options="$TEST_OPTS"
165168

@@ -175,19 +178,19 @@ jobs:
175178
name: Test hls-pragmas-plugin
176179
run: cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-pragmas-plugin --test-options="$TEST_OPTS"
177180

178-
- if: matrix.test && matrix.ghc != '9.2.1'
181+
- if: matrix.test && matrix.ghc != '9.2.2'
179182
name: Test hls-eval-plugin
180183
run: cabal test hls-eval-plugin --test-options="$TEST_OPTS" || cabal test hls-eval-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-eval-plugin --test-options="$TEST_OPTS"
181184

182-
- if: matrix.test && matrix.ghc != '9.2.1'
185+
- if: matrix.test && matrix.ghc != '9.2.2'
183186
name: Test hls-haddock-comments-plugin
184187
run: cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-haddock-comments-plugin --test-options="$TEST_OPTS"
185188

186-
- if: matrix.test && matrix.ghc != '9.2.1'
189+
- if: matrix.test && matrix.ghc != '9.2.2'
187190
name: Test hls-splice-plugin
188191
run: cabal test hls-splice-plugin --test-options="$TEST_OPTS" || cabal test hls-splice-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-splice-plugin --test-options="$TEST_OPTS"
189192

190-
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.1'
193+
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.2'
191194
name: Test hls-stylish-haskell-plugin
192195
run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS"
193196

@@ -199,7 +202,7 @@ jobs:
199202
name: Test hls-fourmolu-plugin
200203
run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS"
201204

202-
- if: matrix.test && matrix.ghc != '9.2.1'
205+
- if: matrix.test && matrix.ghc != '9.2.2'
203206
name: Test hls-tactics-plugin test suite
204207
run: cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || cabal test hls-tactics-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-tactics-plugin --test-options="$TEST_OPTS"
205208

@@ -219,7 +222,7 @@ jobs:
219222
name: Test hls-rename-plugin test suite
220223
run: cabal test hls-rename-plugin --test-options="$TEST_OPTS" || cabal test hls-rename-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-rename-plugin --test-options="$TEST_OPTS"
221224

222-
- if: matrix.test && matrix.ghc != '9.2.1'
225+
- if: matrix.test && matrix.ghc != '9.2.2'
223226
name: Test hls-hlint-plugin test suite
224227
run: cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || cabal test hls-hlint-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-hlint-plugin --test-options="$TEST_OPTS"
225228

.gitlab-ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ variables:
1919
CABAL_PROJECT: cabal.project
2020
- GHC_VERSION: 9.0.2
2121
CABAL_PROJECT: cabal-ghc90.project
22-
- GHC_VERSION: 9.2.1
22+
- GHC_VERSION: 9.2.2
2323
CABAL_PROJECT: cabal-ghc921.project
2424

2525
workflow:
@@ -419,8 +419,10 @@ build-x86_64-darwin:
419419
ADD_CABAL_ARGS: ""
420420
before_script:
421421
- /bin/bash ./.gitlab/brew.sh autoconf automake coreutils make tree
422+
# CPATH https://github.com/digital-asset/ghc-lib/issues/352
422423
script: |
423424
export PATH="$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
425+
export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
424426
/bin/bash ./.gitlab/ci.sh
425427
after_script:
426428
- rm -Rf /private/tmp/.brew_tmp
@@ -469,6 +471,7 @@ build-aarch64-darwin:
469471
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
470472
- arch -arm64 /bin/bash ./.gitlab/brew.sh llvm autoconf automake coreutils make tree
471473
# C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
474+
# CPATH https://github.com/digital-asset/ghc-lib/issues/352
472475
script: |
473476
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
474477
export CC=$CI_PROJECT_DIR/.brew/opt/llvm/bin/clang
@@ -477,6 +480,7 @@ build-aarch64-darwin:
477480
export AR=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ar
478481
export RANLIB=$CI_PROJECT_DIR/.brew/opt/llvm/bin/llvm-ranlib
479482
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
483+
export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
480484
arch -arm64 /bin/bash ./.gitlab/ci.sh
481485
after_script:
482486
- rm -Rf /private/tmp/.brew_tmp
@@ -505,9 +509,11 @@ test-aarch64-darwin:
505509
- export HOMEBREW_CHANGE_ARCH_TO_ARM=1
506510
- arch -arm64 /bin/bash ./.gitlab/brew.sh make tree
507511
# C_INCLUDE_PATH: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
512+
# CPATH https://github.com/digital-asset/ghc-lib/issues/352
508513
script: |
509514
export PATH="$CI_PROJECT_DIR/.brew/opt/llvm/bin:$CI_PROJECT_DIR/.brew/bin:$CI_PROJECT_DIR/.brew/sbin:$PATH"
510515
export C_INCLUDE_PATH="`xcrun --show-sdk-path`/usr/include/ffi"
516+
export CPATH="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi:$CPATH"
511517
arch -arm64 /bin/bash ./.gitlab/test.sh
512518
after_script:
513519
- rm -Rf /private/tmp/.brew_tmp

bindist/ghcs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
8.10.7,cabal.project
22
9.0.2,cabal-ghc90.project
3-
9.2.1,cabal-ghc921.project
3+
9.2.1,cabal-ghc92.project

cabal-ghc921.project renamed to cabal-ghc92.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ packages:
2929
./plugins/hls-selection-range-plugin
3030
./plugins/hls-change-type-signature-plugin
3131

32-
with-compiler: ghc-9.2.1
32+
with-compiler: ghc-9.2.2
3333

3434
tests: true
3535

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ type PsError = ErrMsg
164164
mkPrintUnqualifiedDefault :: HscEnv -> GlobalRdrEnv -> PrintUnqualified
165165
mkPrintUnqualifiedDefault env =
166166
#if MIN_VERSION_ghc(9,2,0)
167-
-- GHC 9.2.1 version
167+
-- GHC 9.2 version
168168
-- mkPrintUnqualified :: UnitEnv -> GlobalRdrEnv -> PrintUnqualified
169169
mkPrintUnqualified (hsc_unit_env env)
170170
#else

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@
55
module Development.IDE.Spans.Pragmas
66
( NextPragmaInfo(..)
77
, LineSplitTextEdits(..)
8-
, getNextPragmaInfo ) where
8+
, getNextPragmaInfo
9+
, insertNewPragma ) where
910

1011
import Data.Bits (Bits (setBit))
1112
import Data.Function ((&))
1213
import qualified Data.List as List
1314
import qualified Data.Maybe as Maybe
14-
import Data.Text (Text)
15+
import Data.Text (Text, pack)
1516
import qualified Data.Text as Text
1617
import Development.IDE (srcSpanToRange)
1718
import Development.IDE.GHC.Compat
1819
import Development.IDE.GHC.Compat.Util
20+
import GHC.LanguageExtensions.Type (Extension)
1921
import qualified Language.LSP.Types as LSP
2022

2123
getNextPragmaInfo :: DynFlags -> Maybe Text -> NextPragmaInfo
@@ -29,6 +31,13 @@ getNextPragmaInfo dynFlags sourceText =
2931
| otherwise
3032
-> NextPragmaInfo 0 Nothing
3133

34+
insertNewPragma :: NextPragmaInfo -> Extension -> LSP.TextEdit
35+
insertNewPragma (NextPragmaInfo _ (Just (LineSplitTextEdits ins _))) newPragma = ins { LSP._newText = "{-# LANGUAGE " <> pack (show newPragma) <> " #-}\n" } :: LSP.TextEdit
36+
insertNewPragma (NextPragmaInfo nextPragmaLine _) newPragma = LSP.TextEdit pragmaInsertRange $ "{-# LANGUAGE " <> pack (show newPragma) <> " #-}\n"
37+
where
38+
pragmaInsertPosition = LSP.Position (fromIntegral nextPragmaLine) 0
39+
pragmaInsertRange = LSP.Range pragmaInsertPosition pragmaInsertPosition
40+
3241
-- Pre-declaration comments parser -----------------------------------------------------
3342

3443
-- | Each mode represents the "strongest" thing we've seen so far.

haskell-language-server.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ copyright: The Haskell IDE Team
1414
license: Apache-2.0
1515
license-file: LICENSE
1616
build-type: Simple
17-
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.1 || == 9.0.2 || == 9.2.1
17+
tested-with: GHC == 8.6.5 || == 8.8.4 || == 8.10.6 || == 8.10.7 || == 9.0.2 || == 9.2.2
1818
extra-source-files:
1919
README.md
2020
ChangeLog.md
@@ -290,7 +290,7 @@ common splice
290290

291291
common alternateNumberFormat
292292
if flag(alternateNumberFormat)
293-
build-depends: hls-alternate-number-format-plugin ^>=1.0.0.0
293+
build-depends: hls-alternate-number-format-plugin ^>=1.1.0.0
294294
cpp-options: -DalternateNumberFormat
295295

296296
common qualifyImportedNames

0 commit comments

Comments
 (0)