Skip to content

Commit 2476a5b

Browse files
author
kokobd
committed
Merge remote-tracking branch 'origin/master' into kokobd/improve-haddock-comments
2 parents 8bb7b03 + bd1d0a1 commit 2476a5b

File tree

43 files changed

+328
-446
lines changed

Some content is hidden

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

43 files changed

+328
-446
lines changed

.github/workflows/pre-commit.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,24 @@ on:
66
branches: [master]
77

88
jobs:
9+
file-diff:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
git-diff: ${{ steps.git-diff.outputs.diff }}
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
- name: Find changed files
17+
uses: technote-space/get-diff-action@v6.1.0
18+
id: git-diff
19+
with:
20+
PATTERNS: |
21+
+(src|exe|test|ghcide|plugins|hls-plugin-api|hie-compat|hls-graph|hls-test-utils)/**/*.hs
922
pre-commit:
1023
runs-on: ubuntu-latest
24+
needs: file-diff
1125
steps:
1226
- uses: actions/checkout@v3
13-
1427
- uses: ./.github/actions/setup-build
1528
with:
1629
os: ${{ runner.os }}
@@ -40,3 +53,5 @@ jobs:
4053
4154
- uses: actions/setup-python@v4
4255
- uses: pre-commit/action@v3.0.0
56+
with:
57+
extra_args: --files ${{ needs.file-diff.outputs.git-diff }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"hooks": [
55
{
66
"entry": "stylish-haskell --inplace",
7-
"exclude": "(^Setup.hs$|test/testdata/.*$|test/data/.*$|test/manual/lhs/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$|^ghcide/src/Development/IDE/GHC/Compat.hs$|^ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs$|^ghcide/src/Development/IDE/GHC/Compat/Core.hs$|^ghcide/src/Development/IDE/Spans/Pragmas.hs$|^ghcide/src/Development/IDE/LSP/Outline.hs$|^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$|^ghcide/test/exe/Main.hs$|ghcide/src/Development/IDE/Core/Rules.hs|^hls-test-utils/src/Test/Hls/Util.hs$)",
7+
"exclude": "(^Setup.hs$|test/testdata/.*$|test/data/.*$|test/manual/lhs/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$|^ghcide/src/Development/IDE/GHC/Compat.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/GHC/Compat/ExactPrint.hs$|^ghcide/src/Development/IDE/GHC/Compat/Core.hs$|^ghcide/src/Development/IDE/Spans/Pragmas.hs$|^ghcide/src/Development/IDE/LSP/Outline.hs$|^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$|^ghcide/test/exe/Main.hs$|^ghcide/src/Development/IDE/Core/Rules.hs$|^hls-test-utils/src/Test/Hls/Util.hs$|^ghcide/src/Development/IDE/Core/Compile.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs$|^plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs$)",
88
"files": "\\.l?hs$",
99
"id": "stylish-haskell",
1010
"language": "system",

.stylish-haskell.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ newline: lf
5757

5858
language_extensions:
5959
- BangPatterns
60+
- CPP
6061
- DataKinds
6162
- DeriveFunctor
6263
- DeriveGeneric

configuration-ghc-90.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let
2323
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_5_0_0;
26+
ormolu = hself.ormolu_0_5_0_1;
2727
fourmolu = hself.fourmolu_0_6_0_0;
2828
# Hlint is still broken
2929
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint-34 { });

configuration-ghc-94.nix

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ let
3131

3232
stylish-haskell = appendConfigureFlag hsuper.stylish-haskell "-fghc-lib";
3333

34+
cereal = hsuper.callHackage "cereal" "0.5.8.3" {};
35+
base-compat = hsuper.callHackage "base-compat" "0.12.2" {};
36+
base-compat-batteries = hsuper.callHackage "base-compat-batteries" "0.12.2" {};
37+
hashable = hsuper.callHackage "hashable" "1.4.1.0" {};
38+
primitive = hsuper.callHackage "primitive" "0.7.4.0" {};
39+
ghc-check = hsuper.callHackage "ghc-check" "0.5.0.8" {};
40+
lens = hsuper.callHackage "lens" "5.2" {};
41+
integer-logarithms = hsuper.callHackage "integer-logarithms" "1.0.3.1" {};
42+
hiedb = hsuper.callHackage "hiedb" "0.4.2.0" {};
43+
hie-bios = hsuper.callHackage "hie-bios" "0.11.0" {};
44+
lsp = hsuper.callCabal2nix "lsp" "${inputs.lsp}/lsp" {};
45+
lsp-types = hsuper.callCabal2nix "lsp-types" "${inputs.lsp}/lsp-types" {};
46+
3447
# Re-generate HLS drv excluding some plugins
3548
haskell-language-server =
3649
hself.callCabal2nixWithOptions "haskell-language-server" ./.

docs/configuration.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ 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 performance in large projects.
46-
- Check parents (`haskell.checkParents`, default `CheckOnSaveAndClose`): when to typecheck reverse dependencies of a file; one of `NeverCheck`, `CheckOnClose`, `CheckOnSaveAndClose`, or `AlwaysCheck`.
45+
- Check project (`haskell.checkProject`, default true): whether to typecheck the entire project on initial load. As it is activated by default could drive to bad performance in large projects.
46+
- Check parents (`haskell.checkParents`, default `CheckOnSave`): when to typecheck reverse dependencies of a file; one of `NeverCheck`, `CheckOnSave` (means dependent/parent modules will only be checked when you save), or `AlwaysCheck` (means re-typechecking them on every change).
4747

4848
#### Generic plugin configuration
4949

5050
Plugins have a generic config to control their behaviour. The schema of such config is:
5151

5252
- `haskell.plugin.${pluginName}.globalOn`: usually with default true. Whether the plugin is enabled at runtime or it is not. That is the option you might use if you want to disable completely a plugin.
53-
- Actual plugin names are: `ghcide-code-actions-fill-holes`, `ghcide-completions`, `ghcide-hover-and-symbols`, `ghcide-type-lenses`, `ghcide-code-actions-type-signatures`, `ghcide-code-actions-bindings`, `ghcide-code-actions-imports-exports`, `eval`, `moduleName`, `pragmas`, `refineImports`, `importLens`, `class`, `tactics` (aka wingman), `hlint`, `haddockComments`, `retrie`, `rename`, `splice`.
53+
- Actual plugin names are: `ghcide-code-actions-fill-holes`, `ghcide-completions`, `ghcide-hover-and-symbols`, `ghcide-type-lenses`, `ghcide-code-actions-type-signatures`, `ghcide-code-actions-bindings`, `ghcide-code-actions-imports-exports`, `eval`, `moduleName`, `pragmas`, `refineImports`, `importLens`, `class`, `tactics` (aka wingman), `hlint`, `haddockComments`, `retrie`, `rename`, `splice`, `stan`.
5454
- So to disable the import lens with an explicit list of module definitions you could set `haskell.plugin.importLens.globalOn: false`
5555
- `haskell.plugin.${pluginName}.${lspCapability}On`: usually with default true. Whether a concrete plugin capability is enabled.
5656
- Capabilities are the different ways a lsp server can interact with the editor. The current available capabilities of the server are: `callHierarchy`, `codeActions`, `codeLens`, `diagnostics`, `hover`, `symbols`, `completion`, `rename`.
@@ -271,6 +271,8 @@ Coc is recommend since it is the only complete LSP implementation for Vim and Ne
271271
Follow Coc's [installation instructions](https://github.com/neoclide/coc.nvim).
272272
Then issue `:CocConfig` and add the following to your Coc config file.
273273

274+
##### Minimal Example
275+
274276
```json
275277
{
276278
"languageserver": {
@@ -284,6 +286,32 @@ Then issue `:CocConfig` and add the following to your Coc config file.
284286
}
285287
```
286288

289+
##### Example with Settings
290+
291+
```json
292+
{
293+
"languageserver": {
294+
"haskell": {
295+
"command": "haskell-language-server-wrapper",
296+
"args": ["--lsp"],
297+
"rootPatterns": [ "*.cabal", "stack.yaml", "cabal.project", "package.yaml", "hie.yaml" ],
298+
"filetypes": ["haskell", "lhaskell"],
299+
"settings": {
300+
"haskell": {
301+
"checkParents": "CheckOnSave",
302+
"checkProject": true,
303+
"maxCompletions": 40,
304+
"formattingProvider": "ormolu",
305+
"plugin": {
306+
"stan": { "globalOn": true }
307+
}
308+
}
309+
}
310+
}
311+
}
312+
}
313+
```
314+
287315
#### LanguageClient-neovim
288316

289317
##### vim-plug

0 commit comments

Comments
 (0)