Skip to content

Commit 9b5356b

Browse files
committed
Merge branch 'master' into hls-class-plugin-9.4
2 parents 566e0d0 + e36208b commit 9b5356b

File tree

61 files changed

+317
-3615
lines changed

Some content is hidden

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

61 files changed

+317
-3615
lines changed

.github/workflows/caching.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ jobs:
8585
, "9.0.2"
8686
, "8.10.7"
8787
, "8.8.4"
88-
, "8.6.5"
8988
]
9089
os: [ "ubuntu-latest"
9190
, "macOS-latest"

.github/workflows/flags.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
, "9.0.2"
4949
, "8.10.7"
5050
, "8.8.4"
51-
, "8.6.5"
5251
]
5352
os: [ "ubuntu-latest"
5453
]

.github/workflows/hackage.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ jobs:
4141
ghc: [ "9.0.2"
4242
, "8.10.7"
4343
, "8.8.4"
44-
, "8.6.5"
4544
]
4645
exclude:
4746
- ghc: "9.0.2"

.github/workflows/hlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
version: '3.4'
1919

2020
- name: 'Checking code'
21-
uses: rwe/actions-hlint-run@v1
21+
uses: rwe/actions-hlint-run@v2
2222
with:
2323
hlint-bin: "hlint --with-group=extra"
2424
fail-on: error

.github/workflows/test.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ jobs:
6464
, "9.0.2"
6565
, "8.10.7"
6666
, "8.8.4"
67-
, "8.6.5"
6867
]
6968
os: [ "ubuntu-latest"
7069
, "macOS-latest"
@@ -86,9 +85,6 @@ jobs:
8685
- os: ubuntu-latest
8786
ghc: '8.8.4'
8887
test: true
89-
- os: ubuntu-latest
90-
ghc: '8.6.5'
91-
test: true
9288
- os: windows-latest
9389
ghc: '9.4.2'
9490
test: true
@@ -101,9 +97,6 @@ jobs:
10197
- os: windows-latest
10298
ghc: '8.10.7'
10399
test: true
104-
- os: windows-latest
105-
ghc: '8.6.5'
106-
test: true
107100
# only build rest of supported ghc versions for windows
108101
- os: windows-latest
109102
ghc: '8.8.4'

.gitpod.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ RUN sudo install-packages build-essential curl libffi-dev libffi7 libgmp-dev lib
77
echo 'export PATH=$HOME/.cabal/bin:$HOME/.local/bin:$PATH' >> $HOME/.bashrc && \
88
. /home/gitpod/.ghcup/env && \
99
# 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 && \
1110
ghcup install ghc 8.8.4 && \
1211
ghcup install ghc 8.10.7 && \
1312
ghcup install ghc 9.0.2 && \

.hlint.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- ignore: {name: "Use camelCase"}
2424
- ignore: {name: "Use uncurry"}
2525
- ignore: {name: "Avoid lambda using `infix`"}
26+
- ignore: {name: "Replace case with fromMaybe"}
2627

2728
# Gives at least one suggestion we don't like.
2829
- ignore: {name: "Use <=<"}
@@ -65,11 +66,11 @@
6566
- Wingman.Types
6667
- AutoTupleSpec
6768
- name: unsafeInterleaveIO
68-
within:
69+
within:
6970
- Development.IDE.LSP.LanguageServer
7071
- {name: unsafeDupablePerformIO, within: []}
7172
- name: unsafeCoerce
72-
within:
73+
within:
7374
- Ide.Plugin.Eval.Code
7475
- Development.IDE.Core.Compile
7576
- Development.IDE.Types.Shake
@@ -85,12 +86,12 @@
8586
- Compat.HieBin
8687

8788
# Partial functions
88-
89+
8990
# We need to check fucntions which
9091
# are typically exported multiple ways under both names,
9192
# see https://github.com/ndmitchell/hlint/issues/1389
9293
- name: [Prelude.head, Data.List.head]
93-
within:
94+
within:
9495
- Main
9596
- Experiments
9697
- Development.Benchmark.Rules
@@ -116,7 +117,7 @@
116117
- Wingman.Tactics
117118

118119
- name: [Prelude.tail, Data.List.tail]
119-
within:
120+
within:
120121
- Main
121122
- Development.Benchmark.Rules
122123
- Development.IDE.Plugin.CodeAction
@@ -125,7 +126,7 @@
125126
- UnificationSpec
126127

127128
- name: [Prelude.last, Data.List.last]
128-
within:
129+
within:
129130
- Main
130131
- Development.IDE.Plugin.CodeAction
131132
- Development.IDE.Plugin.CodeAction.ExactPrint
@@ -136,7 +137,7 @@
136137
- Ide.Plugin.Eval.CodeLens
137138

138139
- name: [Prelude.init, Data.List.init]
139-
within:
140+
within:
140141
- Main
141142
- Development.IDE.Spans.Common
142143
- Ide.PluginUtils
@@ -151,7 +152,7 @@
151152
within: []
152153

153154
- name: ["Prelude.!!", "Data.List.!!"]
154-
within:
155+
within:
155156
- Main
156157
- Experiments
157158
- FunctionalCodeAction
@@ -171,11 +172,11 @@
171172
within: []
172173

173174
- name: Data.Foldable.foldr1
174-
within:
175+
within:
175176
- Wingman.Tactics
176177

177-
- name: Data.Maybe.fromJust
178-
within:
178+
- name: Data.Maybe.fromJust
179+
within:
179180
- Experiments
180181
- Main
181182
- MultipleImports
@@ -193,7 +194,7 @@
193194
- Ide.Plugin.Class
194195

195196
- name: "Data.Map.!"
196-
within:
197+
within:
197198
- Wingman.LanguageServer
198199

199200
- name: "Data.IntMap.!"
@@ -210,7 +211,7 @@
210211
# Debug.Trace, because that module also
211212
# includes the eventlog tracing functions,
212213
# which are legitimate to use.
213-
- name:
214+
- name:
214215
- Debug.Trace.trace
215216
- Debug.Trace.traceId
216217
- Debug.Trace.traceShow
@@ -220,7 +221,7 @@
220221
- Debug.Trace.traceM
221222
- Debug.Trace.traceShowM
222223
- Debug.Trace.putTraceMsg
223-
within:
224+
within:
224225
- Development.IDE.Core.Compile
225226
- Development.IDE.Graph.Internal.Database
226227
- Development.IDE.GHC.Util

bench/Main.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
{-# LANGUAGE DerivingStrategies #-}
4545
{-# LANGUAGE TypeFamilies #-}
4646
{-# OPTIONS -Wno-orphans #-}
47-
{-# LANGUAGE PackageImports #-}
4847

4948
import Control.Lens (preview, (^.))
5049
import Control.Monad.Extra

bindist/ghcs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
8.6.5,cabal.project
21
8.8.4,cabal.project
32
8.10.7,cabal.project
43
9.0.2,cabal.project

configuration-ghc-94.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ let
4141
integer-logarithms = hsuper.callHackage "integer-logarithms" "1.0.3.1" {};
4242
hiedb = hsuper.callHackage "hiedb" "0.4.2.0" {};
4343
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" {};
44+
lsp = hsuper.callCabal2nix "lsp" inputs.lsp {};
45+
lsp-types = hsuper.callCabal2nix "lsp-types" inputs.lsp-types {};
4646

4747
# Re-generate HLS drv excluding some plugins
4848
haskell-language-server =

docs/contributing/contributing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ To create binaries:
6464
* `nix build .#haskell-language-server-884` - GHC 8.8.4
6565
* `nix build .#haskell-language-server-901` - GHC 9.0.1
6666

67-
GHC 8.6.5 is not supported here because `nixpkgs-unstable` no longer maintains the corresponding packages set.
68-
6967
## Testing
7068

7169
The tests make use of the [Tasty](https://github.com/feuerbach/tasty) test framework.
@@ -196,7 +194,7 @@ See the [tutorial](./plugin-tutorial.md) on writing a plugin in HLS.
196194

197195
When ghcide is built with the `ekg` flag, HLS opens a metrics server on port 8999 exposing GC and ghcide metrics. The ghcide metrics currently exposed are:
198196

199-
- `ghcide.values_count`- count of build results in the store
197+
- `ghcide.values_count` - count of build results in the store
200198
- `ghcide.database_count` - count of build keys in the store (these two would be the same in the absence of GC)
201199
- `ghcide.build_count` - build count. A key is GC'ed if it is dirty and older than 100 builds
202200
- `ghcide.dirty_keys_count` - non transitive count of dirty build keys

docs/contributing/plugin-tutorial.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ And here is the gist of the algorithm:
3434

3535
## Setup
3636

37-
To get started, let’s fetch the HLS repo and build it. You need at least GHC 8.6 for this:
37+
To get started, let’s fetch the HLS repo and build it. You need at least GHC 8.8 for this:
3838

3939
```
4040
git clone --recursive http://github.com/haskell/haskell-language-server hls
@@ -44,7 +44,7 @@ cabal build
4444
```
4545

4646
If you run into any issues trying to build the binaries, the #haskell-language-server IRC chat room in
47-
Freenode is always a good place to ask for help.
47+
[Libera Chat](https://libera.chat/) is always a good place to ask for help.
4848

4949
Once cabal is done take a note of the location of the `haskell-language-server` binary and point your LSP client to it. In VSCode this is done by editing the "Haskell Server Executable Path" setting. This way you can simply test your changes by reloading your editor after rebuilding the binary.
5050

@@ -83,20 +83,20 @@ The HLS codebase includes several plugins under the namespace `Ide.Plugin.*`, th
8383

8484
I would recommend looking at the existing plugins for inspiration and reference.
8585

86-
Plugins are "linked" in the `Main` module, so we will need to add our plugin there once we have defined it:
86+
Plugins are "linked" in the `HlsPlugins` module, so we will need to add our plugin there once we have defined it:
8787

8888
```haskell
8989
idePlugins = pluginDescToIdePlugins allPlugins
9090
where
9191
allPlugins =
92-
[ GhcIde.descriptor "ghcide"
93-
, Pragmas.descriptor "pragmas"
92+
[ GhcIde.descriptor "ghcide"
93+
, Pragmas.descriptor "pragmas"
9494
, Floskell.descriptor "floskell"
9595
, Fourmolu.descriptor "fourmolu"
96-
, Ormolu.descriptor "ormolu"
96+
, Ormolu.descriptor "ormolu"
9797
, StylishHaskell.descriptor "stylish-haskell"
9898
, Retrie.descriptor "retrie"
99-
, Brittany.descriptor "brittany"
99+
, Brittany.descriptor "brittany"
100100
, Eval.descriptor "eval"
101101
]
102102
```
@@ -271,7 +271,7 @@ runImportCommand _lspFuncs _state (ImportCommandParams edit) = do
271271

272272
The code lens provider implements all the steps of the algorithm described earlier:
273273

274-
> 1. Request the type checking artefacts from the ghcide subsystem
274+
> 1. Request the type checking artefacts from the ghcide subsystem
275275
> 2. Extract the actual import lists from the type checked AST,
276276
> 3. Ask GHC to produce the minimal import lists for this AST,
277277
> 4. For every import statement without a explicit import list, find out what's the minimal import list, and produce a code lens to display it together with a diff to graft the import list in.
@@ -381,7 +381,7 @@ generateLens pId uri minImports (L src imp)
381381

382382
## Wrapping up
383383

384-
There's only one haskell code change left to do at this point: "link" the plugin in the `Main` HLS module.
384+
There's only one haskell code change left to do at this point: "link" the plugin in the `HlsPlugins` HLS module.
385385
However integrating the plugin in haskell-language-server itself will need some changes in config files. The best way is looking for the id (f.e. `hls-tactics-plugin`) of an existing plugin:
386386
- `./cabal*.project` and `./stack*.yaml`: add the plugin package in the `packages` field
387387
- `./haskell-language-server.cabal`: add a conditional block with the plugin package dependency
@@ -392,5 +392,4 @@ However integrating the plugin in haskell-language-server itself will need some
392392
The full code as used in this tutorial, including imports, can be found in [this Gist](https://gist.github.com/pepeiborra/49b872b2e9ad112f61a3220cdb7db967) as well as in this [branch](https://github.com/pepeiborra/ide/blob/imports-lens/src/Ide/Plugin/ImportLens.hs)
393393

394394
I hope this has given you a taste of how easy and joyful it is to write plugins for HLS.
395-
If you are looking for ideas for contributing, here are some cool ones found in the HLS issue tracker:
396-
- https://github.com/haskell/haskell-language-server/issues?q=is%3Aopen+is%3Aissue+label%3A%22type%3A+possible+new+plugin%22
395+
If you are looking for ideas for contributing, here are some cool ones found in the HLS [issue tracker](https://github.com/haskell/haskell-language-server/issues?q=is%3Aopen+is%3Aissue+label%3A%22type%3A+possible+new+plugin%22).

docs/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Homebrew users can install `haskell-language-server` using the following command
157157
brew install haskell-language-server
158158
```
159159

160-
This formula contains HLS binaries compiled with GHC versions available via Homebrew; at the moment those are: 8.6.5, 8.8.4, 8.10.7.
160+
This formula contains HLS binaries compiled with GHC versions available via Homebrew; at the moment those are: 8.8.4, 8.10.7.
161161

162162
You need to provide your own GHC/Cabal/Stack as required by your project, possibly via Homebrew.
163163

docs/support/ghc-version-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Support status (see the support policy below for more details):
3232
| 8.8.4 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support, will be deprecated after LTS and HLS full support for ghc-9.2 |
3333
| 8.8.3 | [1.5.1](https://github.com/haskell/haskell-language-server/releases/1.5.1) | deprecated |
3434
| 8.8.2 | [1.2.0](https://github.com/haskell/haskell-language-server/releases/tag/1.2.0) | deprecated |
35-
| 8.6.5 | [latest](https://github.com/haskell/haskell-language-server/releases/latest) | full support, will be deprecated after LTS and HLS full suppot for ghc-9.2 |
35+
| 8.6.5 | [1.8.0.0](https://github.com/haskell/haskell-language-server/releases/tag/1.8.0.0) | deprecated |
3636
| 8.6.4 | [1.4.0](https://github.com/haskell/haskell-language-server/releases/tag/1.4.0) | deprecated |
3737

3838
GHC versions not in the list have never been supported by HLS.

exe/Wrapper.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
module Main where
1313

1414
import Control.Monad.Extra
15-
import Data.Char (isSpace)
1615
import Data.Default
1716
import Data.Either.Extra (eitherToMaybe)
1817
import Data.Foldable
1918
import Data.List
19+
import Data.List.Extra (trimEnd)
2020
import Data.Void
2121
import qualified Development.IDE.Session as Session
2222
import qualified HIE.Bios.Environment as HieBios
@@ -232,7 +232,7 @@ findProjectCradle' log = do
232232
trim :: String -> String
233233
trim s = case lines s of
234234
[] -> s
235-
ls -> dropWhileEnd isSpace $ last ls
235+
ls -> trimEnd $ last ls
236236

237237
data WrapperSetupError
238238
= FailedToObtainGhcVersion (ActionName Void) CradleError

0 commit comments

Comments
 (0)