Skip to content

Commit 67914d7

Browse files
authored
Merge branch 'master' into hindent-support
2 parents ae2815c + a89ba41 commit 67914d7

File tree

89 files changed

+3454
-569
lines changed

Some content is hidden

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

89 files changed

+3454
-569
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 19 additions & 10 deletions
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. -->
Lines changed: 6 additions & 6 deletions
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

Lines changed: 39 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ 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",

.github/workflows/pre-commit.yml

Lines changed: 43 additions & 0 deletions
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/action@v3.0.0

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
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"

.gitpod.Dockerfile

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,23 @@ FROM gitpod/workspace-full
22

33
RUN sudo install-packages build-essential curl libffi-dev libffi7 libgmp-dev libgmp10 \
44
libncurses-dev libncurses5 libtinfo5 && \
5-
BOOTSTRAP_HASKELL_NONINTERACTIVE=1 \
6-
BOOTSTRAP_HASKELL_MINIMAL=1 \
7-
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && \
5+
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | BOOTSTRAP_HASKELL_NONINTERACTIVE=1 BOOTSTRAP_HASKELL_MINIMAL=1 sh && \
86
echo 'source $HOME/.ghcup/env' >> $HOME/.bashrc && \
97
echo 'export PATH=$HOME/.cabal/bin:$HOME/.local/bin:$PATH' >> $HOME/.bashrc && \
108
. /home/gitpod/.ghcup/env && \
11-
ghcup install ghc --set && \
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 && \
1216
ghcup install hls --set && \
1317
ghcup install cabal --set && \
1418
ghcup install stack --set && \
1519
cabal update && \
16-
cabal install stylish-haskell hoogle implicit-hie && \
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 && \
1723
pip install pre-commit && \
1824
npm install -g http-server

.gitpod.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ tasks:
1010
$HOME/.local
1111
$HOME/.cabal
1212
$HOME/.stack
13-
$HOME/.ghcup
13+
$HOME/.cache/ghcide
14+
$HOME/.cache/hie-bios
1415
/nix
1516
)
1617
for DIR in "${CACHE_DIRS[@]}"; do
@@ -41,9 +42,7 @@ tasks:
4142
echo '}' >> .vscode/settings.json
4243
fi
4344
44-
pushd docs
45-
pip install -r requirements.txt
46-
popd
45+
pip install -r docs/requirements.txt
4746
init: |
4847
cabal update
4948
cabal configure --enable-executable-dynamic

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
{
2525
"id": "mixed-line-ending",
2626
"args": ["--fix", "lf"],
27-
"exclude": "test/testdata/.*CRLF*.hs$"
27+
"exclude": "test/testdata/.*CRLF.*?\\.hs$"
2828
}
2929
]
3030
}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
/plugins/hls-splice-plugin @konn
3030
/plugins/hls-stylish-haskell-plugin @Ailrun
3131
/plugins/hls-tactics-plugin @isovector
32+
/plugins/hls-stan-plugin @uhbif19
3233

3334
# Benchmarking
3435
/shake-bench @pepeiborra

cabal.project

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ packages:
2828
./plugins/hls-qualify-imported-names-plugin
2929
./plugins/hls-code-range-plugin
3030
./plugins/hls-change-type-signature-plugin
31+
./plugins/hls-stan-plugin
3132
./plugins/hls-gadt-plugin
3233
./plugins/hls-hindent-plugin
3334

@@ -68,4 +69,5 @@ allow-newer:
6869
----------
6970
hiedb:base,
7071

72+
ekg-core,
7173
ekg-wai:time

configuration-ghc-90.nix

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ let
1919
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
2020

2121
ghc-lib = hself.ghc-lib_9_2_2_20220307;
22-
ghc-lib-parser = hself.ghc-lib-parser_9_2_2_20220307;
23-
ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_2_0_3;
22+
ghc-lib-parser = hself.ghc-lib-parser_9_2_3_20220709;
23+
ghc-lib-parser-ex = hself.ghc-lib-parser-ex_9_2_0_4;
2424

2525
Cabal = hself.Cabal_3_6_3_0;
26-
ormolu = hself.ormolu_0_4_0_0;
26+
ormolu = hself.ormolu_0_5_0_0;
2727
fourmolu = hself.fourmolu_0_6_0_0;
28-
2928
# Hlint is still broken
3029
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint-34 { });
3130

configuration-ghc-92.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ let
2929
# Hlint is still broken
3030
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });
3131

32+
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
33+
3234
# Re-generate HLS drv excluding some plugins
3335
haskell-language-server =
3436
hself.callCabal2nixWithOptions "haskell-language-server" ./.

docs/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The LSP protocol is designed to support many useful server configuration options
1818
These are sent to the server by the client, and can be controlled without reference to a specific language.
1919

2020
For example, there are protocol methods for highlighting matching identifiers throughout a document.
21-
This is a capability which any server can implement, so the client can decide generically whether to ask the server to do it or not.
21+
This is a capability that any server can implement, so the client can decide generically whether to ask the server to do it or not.
2222
So your editor can provide a setting to turn this on or off globally, for any language server you might use.
2323

2424
Settings like this are typically provided by the generic LSP client support for your editor, for example in Emacs by [lsp-mode](https://github.com/emacs-lsp/lsp-mode).
@@ -42,7 +42,7 @@ Here is a list of the additional settings currently supported by `haskell-langua
4242

4343
- Formatting provider (`haskell.formattingProvider`, default `ormolu`): what formatter to use; one of `floskell`, `ormolu`, `fourmolu`, `stylish-haskell`, or `brittany` (if compiled with the brittany plugin).
4444
- Max completions (`haskell.maxCompletions`, default 40): maximum number of completions sent to the LSP client.
45-
- Check project (`haskell.checkProject`, default true): whether to typecheck the entire project on load. As it is activated by default could drive to bad perfomance in large projects.
45+
- Check project (`haskell.checkProject`, default true): whether to typecheck the entire project on load. As it is activated by default could drive to bad performance in large projects.
4646
- Check parents (`haskell.checkParents`, default `CheckOnSaveAndClose`): when to typecheck reverse dependencies of a file; one of `NeverCheck`, `CheckOnClose`, `CheckOnSaveAndClose`, or `AlwaysCheck`.
4747

4848
#### Generic plugin configuration
@@ -72,7 +72,7 @@ Plugins have a generic config to control their behaviour. The schema of such con
7272
- `haskell.plugin.ghcide-completions.config.snippetsOn`, default true: Inserts snippets when using code completions.
7373
- `haskell.plugin.ghcide-completions.config.autoExtendOn`, default true: Extends the import list automatically when completing a out-of-scope identifier.
7474
- `ghcide-type-lenses`:
75-
- `haskell.plugin.ghcide-type-lenses.config.mode`, default `always`: Control how type lenses are shown. One of `always`, `exported`, `diganostics`.
75+
- `haskell.plugin.ghcide-type-lenses.config.mode`, default `always`: Control how type lenses are shown. One of `always`, `exported`, `diagnostics`.
7676
- `hlint`:
7777
- `haskell.plugin.hlint.config.flags`, default empty: List of flags used by hlint.
7878
This reference of configuration can be outdated at any time but we can query the `haskell-server-executable` about what configuration is effectively used:

docs/features.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ Provided by: `hls-hlint-plugin`
3838

3939
Provides hlint hints as diagnostics.
4040

41+
### Stan hints
42+
43+
Provided by: `hls-stan-plugin`
44+
45+
Provides Stan hints as diagnostics.
46+
4147
## Hovers
4248

4349
Provided by: `ghcide`

docs/installation.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,10 @@ You can check if HLS is available for your platform via `ghcup` here: <https://h
1919
You can also install HLS from source without checking out the code manually:
2020

2121
```bash
22-
# `ghcup compile` uses cabal under the hood to build, so you may
23-
# want to run `cabal update` beforehand
24-
cabal update
2522
ghcup compile hls -v $HLS_VERSION --ghc $GHC_VERSION
2623
```
2724

28-
Make sure to check `ghcup compile hls --help` for more complete help.
29-
30-
Examples:
31-
32-
Install HLS 1.7.0.0 for GHC 8.10.7, or for multiple GHC versions:
33-
```bash
34-
ghcup compile hls -v 1.7.0.0 --ghc 8.10.7
35-
ghcup compile hls -v 1.7.0.0 --ghc 8.10.7 --ghc 9.2.3
36-
```
37-
38-
Install HLS from master, or a specific commit:
39-
```
40-
ghcup compile hls -g master --ghc 9.2.3
41-
ghcup compile hls -g 510bd51e46fea8fb51ddfaa60bba505f0663497d --ghc 9.2.3
42-
```
25+
More information here: <https://www.haskell.org/ghcup/guide/#hls>
4326

4427
## Installation from source
4528

docs/supported-versions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Sometimes a plugin will be supported in the pre-built binaries but not in a HLS
5858
| `hls-fourmolu-plugin` | |
5959
| `hls-haddock-comments-plugin` | 9.2 |
6060
| `hls-hlint-plugin` | |
61+
| `hls-stan-plugin` | 8.6, 9.0, 9.2 |
6162
| `hls-module-name-plugin` | |
6263
| `hls-ormolu-plugin` | |
6364
| `hls-pragmas-plugin` | |

0 commit comments

Comments
 (0)