Skip to content

Commit 8ea8366

Browse files
authored
Merge branch 'master' into master
2 parents 8ec8374 + 7f6080e commit 8ea8366

36 files changed

+1031
-571
lines changed

.circleci/config.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -171,33 +171,6 @@ jobs:
171171
key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
172172
paths:
173173
- ~/.cabal
174-
nix:
175-
working_directory: ~/build
176-
environment:
177-
- NIXPKGS_ALLOW_BROKEN: 1
178-
docker:
179-
- image: nixorg/nix:circleci
180-
steps:
181-
- checkout
182-
- run:
183-
name: Sync submodules
184-
command: git submodule sync --recursive
185-
- run:
186-
name: Update submodules
187-
command: git submodule update --recursive --init
188-
- restore-cache:
189-
keys:
190-
- cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
191-
- run:
192-
name: Build
193-
command: nix-shell -j4 --run "cabal new-update && (cabal new-build -j1 --enable-tests || cabal new-build -j1 --enable-tests) "
194-
no_output_timeout: 30m
195-
- save_cache:
196-
key: cabal-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}
197-
paths:
198-
- ~/.cabal
199-
200-
201174

202175
workflows:
203176
version: 2
@@ -212,4 +185,3 @@ workflows:
212185
- ghc-8.10.2
213186
# - ghc-nightly
214187
- cabal
215-
- nix

.github/workflows/nix.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Nix
2+
3+
on: [push, pull_request]
4+
jobs:
5+
nix:
6+
runs-on: ${{ matrix.os }}
7+
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
ghc: ['default', 'ghc8102', 'ghc884', 'ghc865']
12+
os: [ubuntu-latest, macOS-latest]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: true
18+
- uses: cachix/install-nix-action@v12
19+
with:
20+
nix_path: nixpkgs=channel:nixos-20.03
21+
- uses: cachix/cachix-action@v8
22+
with:
23+
name: haskell-language-server
24+
extraPullNames: haskell-ghcide
25+
authToken: '${{ secrets.HLS_CACHIX_AUTH_TOKEN }}'
26+
- run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build"

README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,16 +691,28 @@ $ cp install/hie.yaml.cbl install/hie.yaml
691691

692692
#### Using Stack
693693

694-
Note: Stack project must also be built once until [this issue](https://github.com/commercialhaskell/stack/issues/5213) is fixed.
695-
696694
```shell
697695
$ cp hie.yaml.stack hie.yaml
698696
$ cp install/hie.yaml.stack install/hie.yaml
697+
$ cp ghcide/hie.yaml.stack ghcide/hie.yaml
699698
$ stack build --test --no-run-tests
700699
$ cd install
701700
$ stack build
702701
```
703702

703+
#### Using Nix
704+
705+
The instructions below show how to set up a Cachix binary cache and open a nix shell for local development.
706+
707+
```shell
708+
$ cachix use haskell-language-server
709+
$ nix-shell
710+
$ cabal update
711+
$ cabal build
712+
```
713+
714+
If you are looking for a Nix expression to create haskell-language-server binaries, see https://github.com/haskell/haskell-language-server/issues/122
715+
704716
#### Introduction tutorial
705717
Pepeiborra [wrote an tutorial](https://github.com/pepeiborra/hls-tutorial) on writing a plugin in HLS.
706718

cabal.project

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ packages:
55
./hls-plugin-api
66
./plugins/tactics
77
./plugins/hls-hlint-plugin
8+
./plugins/hls-explicit-imports-plugin
9+
./plugins/hls-retrie-plugin
810

911
source-repository-package
1012
type: git
@@ -23,11 +25,6 @@ package ghcide
2325

2426
write-ghc-environment-files: never
2527

26-
index-state: 2020-11-12T03:53:09Z
28+
index-state: 2020-12-03T03:58:05Z
2729

2830
allow-newer: data-tree-print:base
29-
30-
-- To ensure the build get the version with the fix for #498
31-
-- Remove when the constraint is included upstream
32-
constraints: implicit-hie >= 0.1.2.3
33-
constraints: implicit-hie-cradle >= 0.3.0.0

exe/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Ide.Plugin.Example2 as Example2
1818
import Ide.Plugin.Floskell as Floskell
1919
import Ide.Plugin.Fourmolu as Fourmolu
2020
import Ide.Plugin.GhcIde as GhcIde
21-
import Ide.Plugin.ImportLens as ImportLens
21+
import Ide.Plugin.ExplicitImports as ExplicitImports
2222
import Ide.Plugin.Ormolu as Ormolu
2323
import Ide.Plugin.Retrie as Retrie
2424
import Ide.Plugin.StylishHaskell as StylishHaskell
@@ -60,7 +60,7 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
6060
, Brittany.descriptor "brittany"
6161
#endif
6262
, Eval.descriptor "eval"
63-
, ImportLens.descriptor "importLens"
63+
, ExplicitImports.descriptor "importLens"
6464
, ModuleName.descriptor "moduleName"
6565
, Hlint.descriptor "hlint"
6666
]

haskell-language-server.cabal

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,9 @@ executable haskell-language-server
9898
Ide.Plugin.Example2
9999
Ide.Plugin.Floskell
100100
Ide.Plugin.Fourmolu
101-
Ide.Plugin.ImportLens
102101
Ide.Plugin.ModuleName
103102
Ide.Plugin.Ormolu
104103
Ide.Plugin.Pragmas
105-
Ide.Plugin.Retrie
106104
Ide.Plugin.StylishHaskell
107105

108106
ghc-options:
@@ -133,10 +131,11 @@ executable haskell-language-server
133131
, hls-hlint-plugin
134132
, hls-plugin-api
135133
, hls-tactics-plugin
134+
, hls-explicit-imports-plugin
135+
, hls-retrie-plugin
136136
, lens
137137
, ormolu ^>=0.1.2
138138
, regex-tdfa
139-
, retrie >=0.1.1.0
140139
, hslogger
141140
, optparse-applicative
142141
, haskell-lsp ^>=0.22
@@ -145,7 +144,6 @@ executable haskell-language-server
145144
, mtl
146145
, ormolu ^>=0.1.2
147146
, regex-tdfa
148-
, retrie >=0.1.1.0
149147
, safe-exceptions
150148
, shake >=0.17.5
151149
, stylish-haskell ^>=0.12

hls-plugin-api/src/Ide/Plugin.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,8 @@ makeExecuteCommands ecs lf ide = wrapUnhandledExceptions $ do
238238
-- Send off the workspace request if it has one
239239
forM_ mEdit $ \edit -> do
240240
let eParams = J.ApplyWorkspaceEditParams edit
241-
-- TODO: Use lspfuncs to send an applyedit message. Or change
242-
-- the API to allow a list of messages to be returned.
243-
return (Right J.Null, Just(J.WorkspaceApplyEdit, eParams))
241+
reqId <- LSP.getNextReqId lf
242+
LSP.sendFunc lf $ ReqApplyWorkspaceEdit $ RequestMessage "2.0" reqId WorkspaceApplyEdit eParams
244243

245244
case mCmd of
246245
-- If we have a command, continue to execute it

nix/default.nix

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{ sources ? import ./sources.nix }:
2+
let
3+
overlay = _self: pkgs:
4+
let sharedOverrides = {
5+
overrides = _self: super: {
6+
mkDerivation = args: super.mkDerivation (args //
7+
{
8+
# skip running tests for Hackage packages
9+
doCheck = args.pname != "ghcide" && args.pname != "haskell-language-server";
10+
# relax upper bounds
11+
jailbreak = args.pname != "jailbreak-cabal";
12+
});
13+
};
14+
};
15+
gitignoreSource = (import sources.gitignore { inherit (pkgs) lib; }).gitignoreSource;
16+
extended = haskellPackages:
17+
haskellPackages.extend (pkgs.haskell.lib.packageSourceOverrides {
18+
haskell-language-server = gitignoreSource ../.;
19+
ghcide = gitignoreSource ../ghcide;
20+
hie-compat = gitignoreSource ../ghcide/hie-compat;
21+
hls-plugin-api = gitignoreSource ../hls-plugin-api;
22+
hls-tactics-plugin = gitignoreSource ../plugins/tactics;
23+
hls-hlint-plugin = gitignoreSource ../plugins/hls-hlint-plugin;
24+
hls-explicit-imports-plugin = gitignoreSource ../plugins/hls-explicit-imports-plugin;
25+
hls-retrie-plugin = gitignoreSource ../plugins/hls-retrie-plugin;
26+
});
27+
in
28+
{
29+
inherit gitignoreSource;
30+
ourHaskell = pkgs.haskell // {
31+
packages = pkgs.haskell.packages // {
32+
# relax upper bounds on ghc 8.10.x versions (and skip running tests)
33+
ghc8101 = extended (pkgs.haskell.packages.ghc8101.override sharedOverrides);
34+
ghc8102 = extended (pkgs.haskell.packages.ghc8102.override sharedOverrides);
35+
};
36+
};
37+
};
38+
39+
in import sources.nixpkgs
40+
{ overlays = [ overlay ] ; config = {allowBroken = true;}; }

nix/sources.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
11
{
2+
"gitignore": {
3+
"branch": "master",
4+
"description": "Nix function for filtering local git sources",
5+
"homepage": "",
6+
"owner": "hercules-ci",
7+
"repo": "gitignore",
8+
"rev": "c4662e662462e7bf3c2a968483478a665d00e717",
9+
"sha256": "1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx",
10+
"type": "tarball",
11+
"url": "https://github.com/hercules-ci/gitignore/archive/c4662e662462e7bf3c2a968483478a665d00e717.tar.gz",
12+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13+
},
214
"niv": {
315
"branch": "master",
416
"description": "Easy dependency management for Nix projects",
@@ -12,15 +24,15 @@
1224
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
1325
},
1426
"nixpkgs": {
15-
"branch": "nixpkgs-unstable",
27+
"branch": "haskell-updates",
1628
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
1729
"homepage": "https://github.com/NixOS/nixpkgs",
1830
"owner": "NixOS",
19-
"repo": "nixpkgs-channels",
20-
"rev": "a332da8588aeea4feb9359d23f58d95520899e3c",
21-
"sha256": "18hlja5syv3xpi14c07h9lrn1cchq2azmj06fyalq52vl064nx75",
31+
"repo": "nixpkgs",
32+
"rev": "cbf707b2af4cd66bdcdd84b2bddfb627194b39c0",
33+
"sha256": "1bj55jkgdzx7lv6dvy26l354c7vsxaa1jipm99axgqqax905m8sa",
2234
"type": "tarball",
23-
"url": "https://github.com/NixOS/nixpkgs-channels/archive/a332da8588aeea4feb9359d23f58d95520899e3c.tar.gz",
35+
"url": "https://github.com/NixOS/nixpkgs/archive/cbf707b2af4cd66bdcdd84b2bddfb627194b39c0.tar.gz",
2436
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
2537
}
2638
}

0 commit comments

Comments
 (0)