Skip to content

Commit 02c5f5d

Browse files
authored
Merge branch 'master' into gitlab-ci-freebsd
2 parents 44522eb + 1a74937 commit 02c5f5d

Some content is hidden

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

55 files changed

+1301
-3
lines changed

.github/workflows/cache-deps.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Caching of dependencies
2+
3+
# 2021-11-30: NOTE: This workflow currently a trimmed copy of a main `test.yml` workflow. Workflows need further deduplication: https://docs.github.com/en/actions/learn-github-actions/reusing-workflows#overview
4+
5+
defaults:
6+
run:
7+
shell: bash
8+
9+
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
10+
concurrency:
11+
group: ${{ github.head_ref }}-${{ github.workflow }}
12+
cancel-in-progress: true
13+
14+
on:
15+
push:
16+
branches:
17+
- master
18+
schedule:
19+
# Try to save snapshot every day at 03:45 UTC (~21:45 in California)
20+
- cron: "45 3 * * *"
21+
pull_request:
22+
branches:
23+
- '**'
24+
25+
jobs:
26+
pre_job:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
30+
should_skip_ghcide: ${{ steps.skip_ghcide_check.outputs.should_skip }}
31+
steps:
32+
- id: skip_check
33+
uses: fkirc/skip-duplicate-actions@v3.4.1
34+
with:
35+
cancel_others: false
36+
paths_ignore: '["**/docs/**", "**.md", "**/LICENSE", "install/**", "**.nix", "flake.lock", "**/README.md", "FUNDING.yml", ".circleci/**"]'
37+
# If we only change ghcide downstream packages we have not test ghcide itself
38+
- id: skip_ghcide_check
39+
uses: fkirc/skip-duplicate-actions@v3.4.1
40+
with:
41+
cancel_others: false
42+
paths_ignore: '["hls-test-utils/**", "plugins/**", "src/**", "exe/**", "test/**", "shake-bench/**"]'
43+
44+
deps:
45+
if: needs.pre_job.outputs.should_skip != 'true'
46+
needs: pre_job
47+
runs-on: ${{ matrix.os }}
48+
strategy:
49+
matrix:
50+
ghc: ["9.0.1", '8.10.7', '8.10.6', "8.10.5", "8.8.4", "8.8.3", "8.6.5"]
51+
os: [ubuntu-latest, macOS-latest, windows-latest]
52+
exclude:
53+
- os: windows-latest
54+
ghc: '8.8.3'
55+
56+
steps:
57+
- uses: actions/checkout@v2
58+
with:
59+
submodules: true
60+
- uses: haskell/actions/setup@v1
61+
with:
62+
ghc-version: ${{ matrix.ghc }}
63+
cabal-version: "3.4"
64+
65+
- if: matrix.os == 'windows-latest'
66+
name: Set some window specific things
67+
run: |
68+
echo "CABAL_STORE_DIR=$SYSTEMDRIVE\\SR" >> $GITHUB_ENV
69+
echo "CABAL_PKGS_DIR=~\\AppData\\cabal\\packages" >> $GITHUB_ENV
70+
71+
- if: matrix.os != 'windows-latest'
72+
name: Set some linux/macOS specific things
73+
run: |
74+
echo "CABAL_STORE_DIR=~/.cabal/store" >> $GITHUB_ENV
75+
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
76+
77+
- if: matrix.os == 'macOS-latest' && matrix.ghc == '8.10.5'
78+
name: Workaround for GHC 8.10.5 on macOS
79+
run: |
80+
echo "# uninstalling CommandLineTools (see https://github.com/haskell/haskell-language-server/issues/1913#issuecomment-861667786)"
81+
sudo rm -rf /Library/Developer/CommandLineTools
82+
83+
# Needs to be before Cache Cabal so the cache can detect changes to the modified cabal.project file
84+
- if: matrix.ghc == '9.0.1'
85+
name: Use modified cabal.project for ghc9
86+
run: cp cabal-ghc901.project cabal.project
87+
88+
- if: matrix.ghc == '8.8.4' && matrix.os == 'windows-latest'
89+
name: Modify cabal.project to workaround segfaults for ghc-8.8.4 and windows
90+
run: |
91+
echo "package floskell" >> cabal.project
92+
echo " ghc-options: -O0" >> cabal.project
93+
94+
- name: Cache Cabal
95+
uses: actions/cache@v2
96+
env:
97+
cache-name: cache-cabal
98+
with:
99+
path: |
100+
${{ env.CABAL_PKGS_DIR }}
101+
${{ env.CABAL_STORE_DIR }}
102+
key: v2-${{ runner.os }}-${{ matrix.ghc }}-build-${{ hashFiles('cabal.project') }}
103+
restore-keys: |
104+
v2-${{ runner.os }}-${{ matrix.ghc }}-bench-${{ hashFiles('cabal.project') }}
105+
v2-${{ runner.os }}-${{ matrix.ghc }}-build-
106+
v2-${{ runner.os }}-${{ matrix.ghc }}
107+
108+
- run: cabal update
109+
110+
# Need this to work around filepath length limits in Windows
111+
- name: Shorten binary names
112+
run: |
113+
sed -i.bak -e 's/haskell-language-server/hls/g' \
114+
-e 's/haskell_language_server/hls/g' \
115+
haskell-language-server.cabal cabal.project
116+
sed -i.bak -e 's/Paths_haskell_language_server/Paths_hls/g' \
117+
src/**/*.hs exe/*.hs
118+
119+
# repeating builds to workaround segfaults in windows and ghc-8.8.4
120+
- name: Build
121+
run: cabal build --only-dependencies || cabal build --only-dependencies || cabal build --only-dependencies

.github/workflows/hackage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
"hls-module-name-plugin", "hls-pragmas-plugin",
2626
"hls-refine-imports-plugin", "hls-retrie-plugin",
2727
"hls-splice-plugin", "hls-tactics-plugin",
28-
"hls-call-hierarchy-plugin",
28+
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
29+
"hls-qualify-imported-names-plugin",
2930
"haskell-language-server"]
3031
# Uncomment 9.0.1 when ghcide is buildable
3132
ghc: [ "9.0.1",

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,13 @@ jobs:
237237
name: Test hls-hlint-plugin test suite
238238
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"
239239

240+
- if: matrix.test
241+
name: Test hls-alternate-number-format-plugin test suite
242+
run: cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" || cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-alternate-number-format-plugin --test-options="$TEST_OPTS"
243+
240244
- if: matrix.test
241245
name: Test hls-qualify-imported-names-plugin test suite
242-
run: cabal test hls-qualify-imported-names-plugin --test-options="-j1 --rerun-update" || cabal test hls-qualify-imported-names-plugin --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-qualify-imported-names-plugin --test-options="-j1 --rerun"
246+
run: cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" || cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-qualify-imported-names-plugin --test-options="$TEST_OPTS"
243247

244248
test_post_job:
245249
if: always()

cabal-ghc901.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ packages:
2525
./plugins/hls-module-name-plugin
2626
./plugins/hls-ormolu-plugin
2727
./plugins/hls-call-hierarchy-plugin
28+
./plugins/hls-alternate-number-format-plugin
2829

2930
with-compiler: ghc-9.0.1
3031

cabal-ghc921.project

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ packages:
2424
./plugins/hls-module-name-plugin
2525
./plugins/hls-ormolu-plugin
2626
./plugins/hls-call-hierarchy-plugin
27+
./plugins/hls-alternate-number-format-plugin
2728

2829
with-compiler: ghc-9.2.1
2930

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ packages:
2424
./plugins/hls-module-name-plugin
2525
./plugins/hls-ormolu-plugin
2626
./plugins/hls-call-hierarchy-plugin
27+
./plugins/hls-alternate-number-format-plugin
2728
./plugins/hls-qualify-imported-names-plugin
2829

29-
3030
-- Standard location for temporary packages needed for particular environments
3131
-- For example it is used in the project gitlab mirror to help in the MAcOS M1 build script
3232
-- See https://github.com/haskell/haskell-language-server/blob/master/.gitlab-ci.yml

docs/features.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ You can watch demos for some of these features [below](#demos).
1717
- [Module name suggestions](#module-names) for insertion or correction
1818
- [Call hierarchy support](#call-hierarchy)
1919
- [Qualify names from an import declaration](#qualify-imported-names) in your code
20+
- [Suggest alternate numeric formats](#alternate-number-formatting)
2021

2122
## Demos
2223

@@ -51,3 +52,7 @@ You can watch demos for some of these features [below](#demos).
5152
### Qualify imported names
5253

5354
![Qualify Imported Names Demo](../plugins/hls-qualify-imported-names-plugin/qualify-imported-names-demo.gif)
55+
56+
### Alternate Number Formatting
57+
58+
![Alternate Number Format Demo](../plugins/hls-alternate-number-format-plugin/HLSAll.gif)

exe/Plugins.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ import Ide.Plugin.Pragmas as Pragmas
6868
import Ide.Plugin.Splice as Splice
6969
#endif
7070

71+
#if alternateNumberFormat
72+
import Ide.Plugin.AlternateNumberFormat as AlternateNumberFormat
73+
#endif
74+
7175
-- formatters
7276

7377
#if floskell
@@ -160,6 +164,9 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
160164
#endif
161165
#if splice
162166
Splice.descriptor "splice" :
167+
#endif
168+
#if alternateNumberFormat
169+
AlternateNumberFormat.descriptor "alternateNumberFormat" :
163170
#endif
164171
-- The ghcide descriptors should come last so that the notification handlers
165172
-- (which restart the Shake build) run after everything else

haskell-language-server.cabal

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ flag splice
156156
default: True
157157
manual: True
158158

159+
flag alternateNumberFormat
160+
description: Enable Alternate Number Format plugin
161+
default: True
162+
manual: True
163+
159164
flag qualifyImportedNames
160165
description: Enable qualifyImportedNames plugin
161166
default: True
@@ -258,6 +263,11 @@ common splice
258263
build-depends: hls-splice-plugin ^>=1.0.0.1
259264
cpp-options: -Dsplice
260265

266+
common alternateNumberFormat
267+
if flag(alternateNumberFormat)
268+
build-depends: hls-alternate-number-format-plugin ^>=1.0.0.0
269+
cpp-options: -DalternateNumberFormat
270+
261271
common qualifyImportedNames
262272
if flag(qualifyImportedNames)
263273
build-depends: hls-qualify-imported-names-plugin ^>=1.0.0.0
@@ -307,6 +317,7 @@ executable haskell-language-server
307317
, moduleName
308318
, pragmas
309319
, splice
320+
, alternateNumberFormat
310321
, qualifyImportedNames
311322
, floskell
312323
, fourmolu
Loading

0 commit comments

Comments
 (0)