Skip to content

Commit bcbcd28

Browse files
authored
Merge branch 'master' into qualified-completion
2 parents b47f9f9 + a89ba41 commit bcbcd28

File tree

197 files changed

+7754
-2379
lines changed

Some content is hidden

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

197 files changed

+7754
-2379
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,47 @@
11
---
22
name: Bug report
3-
about: Create a report to help us improve
3+
about: I've spotted something specific thats' going wrong
44
title: ''
55
labels: 'status: needs triage, type: bug'
66
assignees: ''
77

88
---
99

1010
<!--
11-
Before opening an issue, please take a look at the [troubleshooting guide](https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html).
11+
Before opening a bug, please take a look at the [troubleshooting guide](https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html).
1212
This explains some common issues and will also help you to find the information that the issue template asks for.
13-
14-
When filing an issue, please fill out as much of the information below as you can.
15-
This helps us to debug your issue, but is not required!
1613
-->
1714

1815
### Your environment
1916

20-
Which OS do you use:
17+
<!--
18+
Everything in this section is optional, but it does help us to debug your issue!
19+
-->
20+
21+
Which OS do you use?
2122
<!-- Windows, MacOS, Ubuntu, ArchLinux, etc... -->
22-
Which LSP client (editor/plugin) do you use:
23+
Which version of GHC do you use and how did you install it?
24+
<!-- 9.0.2 from stack/ghcup, etc. -->
25+
How is your project built (alternative: link to the project)?
26+
27+
Which LSP client (editor/plugin) do you use?
2328
<!-- Neovim+LanguageClient-neovim, emacs+lsp-mode, VS Codium+vscode-haskell, etc... -->
24-
Describe your project (alternative: link to the project):
25-
<!-- stack.yaml, package.yaml, *.cabal files, cabal.project, hie.yaml -->
29+
Which version of HLS do you use and how did you install it?
30+
<!-- 1.7.0.1 from ghcup, etc. -->
31+
Have you configured HLS in any way (especially: a `hie.yaml` file)?
2632

2733
### Steps to reproduce
34+
2835
<!-- Tell us how to reproduce this issue. -->
2936

3037
### Expected behaviour
38+
3139
<!-- Tell us what should happen. -->
3240

3341
### Actual behaviour
42+
3443
<!-- Tell us what happens instead. -->
3544

36-
### Include debug information
45+
### Debug information
3746

3847
<!-- Include any useful debug information, such as relevant log snippets. -->
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
2-
name: Feature request
3-
about: Suggest an idea for this project
2+
name: Enhancement request
3+
about: I have an idea for how to make things better
44
title: ''
55
labels: 'status: needs triage, type: enhancement'
66
assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
10+
## Is your enhancement request related to a problem? Please describe.
1111

1212
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
1313

14-
**Describe the solution you'd like**
14+
## Describe the solution you'd like
1515

1616
<!-- A clear and concise description of what you want to happen. -->
1717

18-
**Describe alternatives you've considered**
18+
## Describe alternatives you've considered
1919

2020
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
2121

22-
**Additional context**
22+
## Additional context
2323

2424
<!-- Add any other context or screenshots about the feature request here. -->

.github/ISSUE_TEMPLATE/support.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Support request
3+
about: Help, something isn't working and I'm stuck!
4+
title: ''
5+
labels: 'status: needs triage, type: support'
6+
assignees: ''
7+
8+
---
9+
10+
<!--
11+
Before asking for support, please take a look at the [troubleshooting guide](https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html).
12+
This explains some common issues and will also help you to find the information that the issue template asks for.
13+
-->
14+
15+
## Your environment
16+
17+
<!--
18+
Everything in this section is optional, but it does help us to debug your issue!
19+
-->
20+
21+
Which OS do you use?
22+
<!-- Windows, MacOS, Ubuntu, ArchLinux, etc... -->
23+
Which version of GHC do you use and how did you install it?
24+
<!-- 9.0.2 from stack/ghcup, etc. -->
25+
How is your project built (alternative: link to the project)?
26+
27+
Which LSP client (editor/plugin) do you use?
28+
<!-- Neovim+LanguageClient-neovim, emacs+lsp-mode, VS Codium+vscode-haskell, etc... -->
29+
Which version of HLS do you use and how did you install it?
30+
<!-- 1.7.0.1 from ghcup, etc. -->
31+
Have you configured HLS in any way (especially: a `hie.yaml` file)?
32+
33+
## What's wrong?
34+
35+
<!-- What's not working? What have you tried? -->
36+
37+
### Debug information
38+
39+
<!-- Include any useful debug information, such as relevant log snippets. -->

.github/workflows/hackage.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ jobs:
3131
"hls-brittany-plugin", "hls-floskell-plugin", "hls-fourmolu-plugin",
3232
"hls-ormolu-plugin", "hls-stylish-haskell-plugin",
3333
"hls-class-plugin", "hls-eval-plugin", "hls-explicit-imports-plugin",
34-
"hls-haddock-comments-plugin", "hls-hlint-plugin",
34+
"hls-haddock-comments-plugin", "hls-hlint-plugin", "hls-stan-plugin",
3535
"hls-module-name-plugin", "hls-pragmas-plugin",
3636
"hls-refine-imports-plugin", "hls-rename-plugin", "hls-retrie-plugin",
3737
"hls-splice-plugin", "hls-tactics-plugin",
3838
"hls-call-hierarchy-plugin", "hls-alternate-number-format-plugin",
39-
"hls-qualify-imported-names-plugin", "hls-selection-range-plugin",
39+
"hls-qualify-imported-names-plugin", "hls-code-range-plugin",
4040
"haskell-language-server"]
4141
ghc: [ "9.0.2"
4242
, "8.10.7"

.github/workflows/hlint.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '**'
77

88
jobs:
9-
build10:
9+
hlint:
1010
name: "Hlint check run"
1111
runs-on: ubuntu-latest
1212
steps:
@@ -15,11 +15,12 @@ jobs:
1515
- name: 'Installing'
1616
uses: rwe/actions-hlint-setup@v1
1717
with:
18-
version: '3.3.4'
18+
version: '3.4'
1919

2020
- name: 'Checking code'
2121
uses: rwe/actions-hlint-run@v1
2222
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"]'
23+
hlint-bin: "hlint --with-group=extra"
24+
fail-on: error
25+
path: .
2526

.github/workflows/pre-commit.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [master]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- uses: ./.github/actions/setup-build
15+
with:
16+
ghc: "9.2.3"
17+
os: ${{ runner.os }}
18+
shorten-hls: false
19+
20+
- name: "Install stylish-haskell"
21+
run: |
22+
cabal install stylish-haskell
23+
echo "${HOME}/.cabal/bin" >> $GITHUB_PATH
24+
25+
- name: "Check stylish-haskell is available"
26+
run: |
27+
echo $(which stylish-haskell)
28+
29+
- name: Compiled deps cache
30+
id: stylish-haskell-compiled-cache
31+
uses: actions/cache@v2
32+
env:
33+
cache-name: stylish-haskell-compiled-cache
34+
with:
35+
path: ${{ env.CABAL_PKGS_DIR }}
36+
key: ${{ inputs.cache-prefix }}${{ env.cache-name }}-${{ inputs.os }}-${{ inputs.ghc }}-${{ env.INDEX_STATE }}-${{ hashFiles('cabal.project.freeze') }}
37+
restore-keys: |
38+
${{ inputs.cache-prefix }}${{ env.cache-name }}-${{ inputs.os }}-${{ inputs.ghc }}-${{ env.INDEX_STATE }}-
39+
${{ inputs.cache-prefix }}${{ env.cache-name }}-${{ inputs.os }}-${{ inputs.ghc }}-
40+
${{ inputs.cache-prefix }}${{ env.cache-name }}-${{ inputs.os }}-
41+
42+
- uses: actions/setup-python@v3
43+
- uses: pre-commit/[email protected]

.github/workflows/test.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ jobs:
223223
name: Test hls-hlint-plugin test suite
224224
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"
225225

226+
- if: matrix.test && matrix.ghc != '9.0.1' && matrix.ghc != '9.0.2' && matrix.ghc != '9.2.2'
227+
name: Test hls-stan-plugin test suite
228+
run: cabal test hls-stan-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-stan-plugin --test-options="$TEST_OPTS"
229+
226230
- if: matrix.test
227231
name: Test hls-module-name-plugin test suite
228232
run: cabal test hls-module-name-plugin --test-options="$TEST_OPTS" || cabal test hls-module-name-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-module-name-plugin --test-options="$TEST_OPTS"
@@ -236,8 +240,8 @@ jobs:
236240
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"
237241

238242
- if: matrix.test
239-
name: Test hls-selection-range-plugin test suite
240-
run: cabal test hls-selection-range-plugin --test-options="$TEST_OPTS" || cabal test hls-selection-range-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-selection-range-plugin --test-options="$TEST_OPTS"
243+
name: Test hls-code-range-plugin test suite
244+
run: cabal test hls-code-range-plugin --test-options="$TEST_OPTS" || cabal test hls-code-range-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-code-range-plugin --test-options="$TEST_OPTS"
241245

242246
- if: matrix.test
243247
name: Test hls-change-type-signature test suite

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ test/testdata/**/hie.yaml
3030
# shake build folder (used in benchmark suite)
3131
.shake/
3232

33-
# pre-commit-hook.nix
34-
.pre-commit-config.yaml
35-
3633
# direnv
3734
/.direnv/
3835
/.envrc

.gitpod.Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM gitpod/workspace-full
2+
3+
RUN sudo install-packages build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 \
4+
libncurses-dev libncurses5 libtinfo5 && \
5+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh && \
6+
echo 'source $HOME/.ghcup/env' >> $HOME/.bashrc && \
7+
echo 'export PATH=$HOME/.cabal/bin:$HOME/.local/bin:$PATH' >> $HOME/.bashrc && \
8+
. /home/gitpod/.ghcup/env && \
9+
# Install all verions of GHC that HLS supports. Putting GHC into Docker image makes workspace start much faster.
10+
ghcup install ghc 8.6.5 && \
11+
ghcup install ghc 8.8.4 && \
12+
ghcup install ghc 8.10.7 && \
13+
ghcup install ghc 9.0.2 && \
14+
ghcup install ghc 9.2.2 && \
15+
ghcup install ghc 9.2.3 --set && \
16+
ghcup install hls --set && \
17+
ghcup install cabal --set && \
18+
ghcup install stack --set && \
19+
cabal update && \
20+
cabal install --disable-executable-dynamic --install-method copy --constraint "stylish-haskell +ghc-lib" \
21+
stylish-haskell implicit-hie hoogle && \
22+
rm -rf $HOME/.cabal/store && \
23+
pip install pre-commit && \
24+
npm install -g http-server

.gitpod.yml

+43-32
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1+
image:
2+
file: .gitpod.Dockerfile
13
# List the start up tasks. Learn more https://www.gitpod.io/docs/config-start-tasks/
24
tasks:
3-
- before: |
4-
# Only the /workspace folder is persistent
5-
export XDG_DATA_HOME=/workspace/.local/share
6-
export XDG_CONFIG_HOME=/workspace/.local/config
7-
export XDG_STATE_HOME=/workspace/.local/state
8-
export XDG_CACHE_HOME=/workspace/.cache
9-
export CABAL_DIR=/workspace/.cabal
10-
export STACK_ROOT=/workspace/.stack
5+
- name: Setup
6+
before: |
7+
# Make sure some folders not in /workspace persist between worksapce restarts.
8+
# You may add additional directories to this list.
9+
declare -a CACHE_DIRS=(
10+
$HOME/.local
11+
$HOME/.cabal
12+
$HOME/.stack
13+
$HOME/.cache/ghcide
14+
$HOME/.cache/hie-bios
15+
/nix
16+
)
17+
for DIR in "${CACHE_DIRS[@]}"; do
18+
mkdir -p $(dirname /workspace/cache$DIR)
19+
mkdir -p $DIR # in case $DIR doesn't already exist
20+
# On a fresh start with no prebuilds, we move existing directory
21+
# to /workspace. 'sudo mv' fails with 'no permission', I don't know why
22+
if [ ! -d /workspace/cache$DIR ]; then
23+
sudo cp -rp $DIR /workspace/cache$DIR
24+
sudo rm -rf $DIR/*
25+
fi
26+
mkdir -p /workspace/cache$DIR # make sure it exists even if cp fails
27+
# Now /workspace/cache$DIR exists.
28+
# Use bind mount to make $DIR backed by /workspace/cache$DIR
29+
sudo mount --bind /workspace/cache$DIR $DIR
30+
done
1131
12-
# install ghcup, ghc and cabal
13-
export GHCUP_INSTALL_BASE_PREFIX=/workspace
14-
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
15-
export BOOTSTRAP_HASKELL_MINIMAL=1
16-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
17-
/workspace/.ghcup/bin/ghcup install ghc --set
18-
/workspace/.ghcup/bin/ghcup install cabal
19-
20-
# Add ghcup binaries to the PATH since VSCode does not see 'source .ghcup/env'
21-
pushd /usr/local/bin
22-
sudo ln -s /workspace/.ghcup/bin/* /usr/local/bin
23-
popd
24-
25-
# Fix the Cabal dir since VSCode does not see CABAL_DIR
26-
cabal update
27-
echo "Symlinking /workspace/.cabal to ~/.cabal"
28-
ln -s /workspace/.cabal ~
32+
# Install pre-commit hook
33+
pre-commit install
2934
3035
# Configure VSCode to use the locally built version of HLS
3136
mkdir -p .vscode
32-
echo '{ "haskell.serverExecutablePath": "/workspace/.cabal/bin/haskell-language-server" }' > .vscode/settings.json
37+
if [ ! -f .vscode/settings.json ]; then
38+
# Only write to .vscode/settings.json if it doesn't exist.
39+
echo '{' > .vscode/settings.json
40+
echo ' "haskell.serverExecutablePath": "/home/gitpod/.cabal/bin/haskell-language-server",' >> .vscode/settings.json
41+
echo ' "haskell.formattingProvider": "stylish-haskell"' >> .vscode/settings.json
42+
echo '}' >> .vscode/settings.json
43+
fi
3344
34-
init: |
45+
pip install -r docs/requirements.txt
46+
init: |
47+
cabal update
3548
cabal configure --enable-executable-dynamic
36-
cabal build --enable-tests
37-
cabal install exe:haskell-language-server
38-
command: |
39-
cabal build --enable-tests
49+
cabal build --enable-tests all
50+
cabal install exe:haskell-language-server
4051
4152
# List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/
4253
ports: []
@@ -62,4 +73,4 @@ vscode:
6273
extensions:
6374
- "haskell.haskell"
6475
- "justusadam.language-haskell"
65-
- "usernamehw.errorlens"
76+
- "EditorConfig.EditorConfig"

0 commit comments

Comments
 (0)