Skip to content

Commit d4f5d43

Browse files
committed
Merge ghcide repository (replacing the submodule) (#702)
2 parents 9ac127e + b33d495 commit d4f5d43

File tree

168 files changed

+28708
-98
lines changed

Some content is hidden

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

168 files changed

+28708
-98
lines changed

Diff for: .github/workflows/bench.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Benchmark
2+
3+
on: [pull_request]
4+
jobs:
5+
bench:
6+
runs-on: ${{ matrix.os }}
7+
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
ghc: ['8.10.2', '8.8.4', '8.6.5']
12+
os: [ubuntu-latest, macOS-latest]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- run: git fetch origin master # check the master branch for benchmarking
17+
- uses: actions/setup-haskell@v1
18+
with:
19+
ghc-version: ${{ matrix.ghc }}
20+
cabal-version: '3.2'
21+
enable-stack: false
22+
23+
- name: Cache Cabal
24+
uses: actions/cache@v2
25+
with:
26+
path: |
27+
~/.cabal/packages
28+
~/.cabal/store
29+
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal-bench
30+
31+
- run: cabal update
32+
33+
- run: cabal configure --enable-benchmarks
34+
35+
- name: Build
36+
shell: bash
37+
# Retry it three times to workaround compiler segfaults in windows
38+
run: cabal build ghcide:benchHist || cabal build ghcide:benchHist || cabal build ghcide:benchHist
39+
40+
- name: Bench
41+
shell: bash
42+
# run the tests without parallelism, otherwise tasty will attempt to run
43+
# all test cases simultaneously which causes way too many hls
44+
# instances to be spun up for the poor github actions runner to handle
45+
run: cabal bench ghcide:benchHist
46+
47+
- name: Display results
48+
shell: bash
49+
run: |
50+
column -s, -t < ghcide/bench-results/results.csv | tee ghcide/bench-results/results.txt
51+
52+
- name: Archive benchmarking artifacts
53+
uses: actions/upload-artifact@v2
54+
with:
55+
name: bench-results-${{ runner.os }}-${{ matrix.ghc }}
56+
path: |
57+
ghcide/bench-results/results.*
58+
ghcide/bench-results/**/*.svg

Diff for: .github/workflows/nix.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Nix
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44
jobs:
55
nix:
66
runs-on: ${{ matrix.os }}
@@ -21,6 +21,5 @@ jobs:
2121
- uses: cachix/cachix-action@v8
2222
with:
2323
name: haskell-language-server
24-
extraPullNames: haskell-ghcide
2524
authToken: '${{ secrets.HLS_CACHIX_AUTH_TOKEN }}'
2625
- run: nix-shell --argstr compiler ${{ matrix.ghc }} --run "cabal update && cabal build"

Diff for: .github/workflows/test.yml

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Testing
22

3-
on: [push, pull_request]
3+
on: [pull_request]
44
jobs:
55
test:
66
runs-on: ${{ matrix.os }}
@@ -9,6 +9,7 @@ jobs:
99
matrix:
1010
ghc: ["8.10.2", "8.10.1", "8.8.4", "8.8.3", "8.8.2", "8.6.5", "8.6.4"]
1111
os: [ubuntu-latest, macOS-latest, windows-latest]
12+
ghc-lib: [false]
1213
exclude:
1314
- os: windows-latest
1415
ghc: "8.10.2" # broken due to https://gitlab.haskell.org/ghc/ghc/-/issues/18550
@@ -21,6 +22,10 @@ jobs:
2122
include:
2223
- os: windows-latest
2324
ghc: "8.10.2.2" # only available for windows and choco
25+
# one ghc-lib build
26+
- os: ubuntu-latest
27+
ghc: '8.10.1'
28+
ghc-lib: true
2429

2530
steps:
2631
- uses: actions/checkout@v2
@@ -32,6 +37,9 @@ jobs:
3237
cabal-version: "3.2"
3338
enable-stack: true
3439

40+
- run: ./fmt.sh
41+
name: "HLint via ./fmt.sh"
42+
3543
- name: Cache Cabal
3644
uses: actions/cache@v2
3745
env:
@@ -61,7 +69,14 @@ jobs:
6169
# Retry it three times to workaround compiler segfaults in windows
6270
run: cabal build || cabal build || cabal build
6371

72+
- name: Test ghcide
73+
if: ${{ !matrix.ghc-lib }}
74+
shell: bash
75+
# run the tests without parallelism to avoid running out of memory
76+
run: cabal test ghcide --test-options="-j1 --rerun-update" || cabal test ghcide --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test ghcide --test-options="-j1 --rerun"
77+
6478
- name: Test func-test suite
79+
if: ${{ !matrix.ghc-lib }}
6580
shell: bash
6681
env:
6782
HLS_TEST_EXE: hls
@@ -72,6 +87,7 @@ jobs:
7287
run: cabal test func-test --test-options="-j1 --rerun-update" || cabal test func-test --test-options="-j1 --rerun --rerun-update" || cabal test func-test --test-options="-j1 --rerun" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test func-test --test-options="-j1 --rerun"
7388

7489
- name: Test wrapper-test suite
90+
if: ${{ !matrix.ghc-lib }}
7591
shell: bash
7692
env:
7793
HLS_TEST_EXE: hls

Diff for: .gitmodules

-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@
88
# Commit git commit -m "Removed submodule <name>"
99
# Delete the now untracked submodule files
1010
# rm -rf path_to_submodule
11-
[submodule "ghcide"]
12-
path = ghcide
13-
# url = https://github.com/alanz/ghcide.git
14-
# url = https://github.com/wz1000/ghcide.git
15-
url = https://github.com/haskell/ghcide.git
16-
# url = https://github.com/fendor/ghcide.git
17-
# url = https://github.com/bubba/ghcide.git

Diff for: cabal.project

+15-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
packages:
22
./
3-
./ghcide/hie-compat
3+
./hie-compat
4+
./shake-bench
45
./ghcide
56
./hls-plugin-api
67
./plugins/tactics
@@ -23,4 +24,16 @@ write-ghc-environment-files: never
2324

2425
index-state: 2020-12-13T11:31:58Z
2526

26-
allow-newer: data-tree-print:base
27+
allow-newer:
28+
active:base,
29+
data-tree-print:base,
30+
diagrams-contrib:base,
31+
diagrams-core:base,
32+
diagrams-lib:base,
33+
diagrams-postscript:base,
34+
diagrams-svg:base,
35+
dual-tree:base,
36+
force-layout:base,
37+
monoid-extras:base,
38+
statestack:base,
39+
svg-builder:base

Diff for: fmt.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
set -eou pipefail
3+
curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s ghcide/src ghcide/exe ghcide/bench shake-bench/src ghcide/test/exe --with-group=extra --hint=ghcide/.hlint.yaml

Diff for: ghcide

-1
This file was deleted.

Diff for: ghcide/.azure/linux-stack.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
jobs:
2+
- job: ghcide_stack_linux
3+
timeoutInMinutes: 60
4+
pool:
5+
vmImage: 'ubuntu-latest'
6+
variables:
7+
STACK_ROOT: $(Pipeline.Workspace)/.stack
8+
steps:
9+
- checkout: self
10+
- task: Cache@2
11+
inputs:
12+
key: stack-root-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
13+
path: $(STACK_ROOT)
14+
cacheHitVar: STACK_ROOT_CACHE_RESTORED
15+
displayName: "Cache stack root"
16+
- task: Cache@2
17+
inputs:
18+
key: stack-work-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack.yaml | $(Build.SourcesDirectory)/ghcide.cabal
19+
path: .stack-work
20+
cacheHitVar: STACK_WORK_CACHE_RESTORED
21+
displayName: "Cache stack work"
22+
- bash: |
23+
./fmt.sh
24+
displayName: "HLint via ./fmt.sh"
25+
- bash: |
26+
sudo add-apt-repository ppa:hvr/ghc
27+
sudo apt-get update
28+
sudo apt-get install -y g++ gcc libc6-dev libffi-dev libgmp-dev make zlib1g-dev cabal-install-3.2
29+
if ! which stack >/dev/null 2>&1; then
30+
curl -sSL https://get.haskellstack.org/ | sh
31+
fi
32+
mkdir -p $STACK_ROOT
33+
displayName: 'Install Stack'
34+
- bash: stack setup
35+
displayName: 'stack setup'
36+
- bash: cabal update # some tests use Cabal cradles
37+
displayName: 'cabal update'
38+
- bash: stack build --test --no-run-tests
39+
displayName: 'stack build --test --no-run-tests'

Diff for: ghcide/.azure/windows-stack.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
jobs:
2+
- job: ghcide_stack_windows
3+
timeoutInMinutes: 120
4+
pool:
5+
vmImage: 'windows-2019'
6+
variables:
7+
STACK_ROOT: "C:\\sr"
8+
steps:
9+
- checkout: self
10+
- task: Cache@2
11+
inputs:
12+
key: stack-root-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack-windows.yaml | $(Build.SourcesDirectory)/ghcide.cabal
13+
path: $(STACK_ROOT)
14+
cacheHitVar: STACK_ROOT_CACHE_RESTORED
15+
displayName: "Cache stack root"
16+
- task: Cache@2
17+
inputs:
18+
key: stack-work-cache | $(Agent.OS) | $(Build.SourcesDirectory)/stack-windows.yaml | $(Build.SourcesDirectory)/ghcide.cabal
19+
path: .stack-work
20+
cacheHitVar: STACK_WORK_CACHE_RESTORED
21+
displayName: "Cache stack work"
22+
- bash: |
23+
./fmt.sh
24+
displayName: "HLint via ./fmt.sh"
25+
- bash: |
26+
curl -sSkL http://www.stackage.org/stack/windows-x86_64 -o /usr/bin/stack.zip
27+
unzip -o /usr/bin/stack.zip -d /usr/bin/
28+
mkdir -p "$STACK_ROOT"
29+
displayName: 'Install Stack'
30+
- bash: stack setup --stack-yaml stack-windows.yaml
31+
displayName: 'stack setup'
32+
- bash: |
33+
# Installing happy and alex standalone to avoid error "strip.exe: unable to rename ../*.exe; reason: File exists"
34+
stack install happy --stack-yaml stack-windows.yaml
35+
stack install alex --stack-yaml stack-windows.yaml
36+
choco install -y cabal --version=$CABAL_VERSION
37+
$(cygpath $ProgramData)/chocolatey/bin/RefreshEnv.cmd
38+
# GHC 8.10.1 fails with ghc segfaults, using -fexternal-interpreter seems to make it working
39+
# There are other transient errors like timeouts downloading from stackage so we retry 3 times
40+
stack build --test --no-run-tests --stack-yaml stack-windows.yaml --ghc-options="-fexternal-interpreter" || stack build --test --no-run-tests --stack-yaml stack-windows.yaml --ghc-options="-fexternal-interpreter" || stack build --test --no-run-tests --stack-yaml stack-windows.yaml --ghc-options="-fexternal-interpreter"
41+
displayName: 'stack build --test'

Diff for: ghcide/.editorconfig

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at https://EditorConfig.org
3+
4+
root = true
5+
6+
[*]
7+
end_of_line = LF
8+
indent_style = space
9+
indent_size = 4
10+
trim_trailing_whitespace = true
11+
insert_final_newline = true

Diff for: ghcide/.ghci

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:set -Wunused-binds -Wunused-imports -Worphans -Wunused-matches -Wincomplete-patterns
2+
3+
:set -XBangPatterns
4+
:set -XDeriveFunctor
5+
:set -XDeriveGeneric
6+
:set -XGeneralizedNewtypeDeriving
7+
:set -XLambdaCase
8+
:set -XNamedFieldPuns
9+
:set -XOverloadedStrings
10+
:set -XRecordWildCards
11+
:set -XScopedTypeVariables
12+
:set -XStandaloneDeriving
13+
:set -XTupleSections
14+
:set -XTypeApplications
15+
:set -XViewPatterns
16+
17+
:set -package=ghc
18+
:set -ignore-package=ghc-lib-parser
19+
:set -DGHC_STABLE
20+
:set -Iinclude
21+
:set -idist/build/autogen
22+
:set -isrc
23+
:set -isession-loader
24+
:set -iexe
25+
26+
:set -isrc-ghc88
27+
:set -idist-newstyle/build/x86_64-osx/ghc-8.8.3/ghcide-0.2.0/build/autogen
28+
29+
:load Main

Diff for: ghcide/.gitignore

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
dist/
2+
.stack-work/
3+
dist-newstyle/
4+
cabal.project.local
5+
*~
6+
*.lock
7+
/.tasty-rerun-log
8+
.vscode
9+
/.hlint-*
10+
bench/example/
11+
bench-results/
12+
bench-temp/
13+
.shake/
14+
ghcide
15+
ghcide-bench
16+
ghcide-preprocessor
17+
*.benchmark-gcStats
18+
tags

0 commit comments

Comments
 (0)