Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Implement the HIE Bios #1126

Merged
merged 346 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
346 commits
Select commit Hold shift + click to select a range
b054fe9
Remove SrcUtils import
mpickering Apr 18, 2019
3ff19ba
Use System.Directory makeAbsolute rather than ghc-mod home spun version
mpickering Apr 18, 2019
f163539
Remove unused record field
mpickering Apr 18, 2019
fac0e95
Remove another LightGhc abstraction
mpickering Apr 18, 2019
4231b0b
Add missing compat file woops
mpickering Apr 18, 2019
8fe05bb
Implement ExceptionMonad in HIE rather than ghc-mod
mpickering Apr 18, 2019
3e907c8
Replace GM.Options with CradleOpts
mpickering Apr 18, 2019
ab595a0
Remove ghc-mod dependencies
mpickering Apr 19, 2019
94eaa52
Remove CPP from artifact map
mpickering Apr 19, 2019
0f0c250
Merge remote-tracking branch 'origin/master' into hie-bios
mpickering Apr 22, 2019
671d5ef
Merge remote-tracking branch 'bubba/window-progress' into hie-bios
mpickering Apr 22, 2019
19a106d
Add status update for init cradle
mpickering Apr 22, 2019
e001a1b
Better progress reporting
mpickering Apr 22, 2019
8cd96b1
Progress when initialising a cradle as well
mpickering Apr 23, 2019
5180d25
Make haskell-lsp negotiate window/progress capability
mpickering Apr 23, 2019
973d4a2
Rework MonadIde class
lukel97 Apr 22, 2019
ed9fefa
reworking withprogress
mpickering Apr 24, 2019
4ec8a13
Add shebangs to hie-bios wrappers
expipiplus1 Apr 22, 2019
3b41a98
Fix the liquid haskell reporting
mpickering Apr 24, 2019
9e7af09
Update haskell-lsp
mpickering May 29, 2019
0f507e6
Merge remote-tracking branch 'origin/master' into hie-bios
mpickering May 29, 2019
e132d54
fix dhall config
mpickering May 29, 2019
5373788
Remove inexplicable setting of -fdefer-type-errors
mpickering Jun 15, 2019
b9ebbec
Fix plugins
mpickering Jun 17, 2019
ca06bd6
Fix module leaks
mpickering Jun 17, 2019
4f886df
Revert "Fix module leaks"
mpickering Jun 30, 2019
daf0be5
Fix build
mpickering Jun 30, 2019
8e44c14
fix compilation with hie-plugin-api and remove hare submodules
wz1000 Jul 15, 2019
30fb1e7
remove ghc-mod deps
wz1000 Jul 15, 2019
5ab587c
Merge branch 'master' of https://github.com/haskell/haskell-ide-engin…
wz1000 Jul 15, 2019
40342a0
Get it to compile
wz1000 Jul 15, 2019
cd882b6
Re-enable HaRe
wz1000 Jul 15, 2019
ca53013
Fix HaRe, remove module hash
wz1000 Jul 16, 2019
6f905aa
Restore HaRe tests, get tests to compile
wz1000 Jul 16, 2019
a305239
use upstream for hie-bios
wz1000 Jul 16, 2019
580b188
fix HaRe submodule
wz1000 Jul 16, 2019
2c8b51b
Fix some tests and completions/session saving
wz1000 Jul 20, 2019
0438ac0
Merge branch 'simpler-completion' into hie-bios-wz1000
wz1000 Jul 20, 2019
9c7365f
make ghcSession an IORef again
wz1000 Jul 20, 2019
c5f7d28
fix some more tests and embarrassing implmentation of withMappedFile
wz1000 Jul 20, 2019
775eca2
"ghcmod" -> "bios"
wz1000 Jul 20, 2019
d25984c
fix more tests
wz1000 Jul 22, 2019
2bd16d8
fix more tests redux
wz1000 Jul 22, 2019
f5a0308
Fix HaRe unit tests
wz1000 Jul 22, 2019
94c3bcf
Set defer type errors and report the resulting warnings as errors
wz1000 Jul 23, 2019
092c7a2
Fix most code action tests
wz1000 Jul 23, 2019
805961d
Fix another code action test
wz1000 Jul 23, 2019
0d3af55
Merge pull request #4 from wz1000/hie-bios-wz1000
mpickering Jul 23, 2019
2feab0a
Merge branch 'simpler-completion' into hie-bios-wz1000
wz1000 Jul 23, 2019
c619b66
Merge branch 'simpler-completion' into hie-bios-wz1000
wz1000 Jul 23, 2019
3d96c12
make it build
wz1000 Jul 23, 2019
a78b6a3
make it build
wz1000 Jul 23, 2019
1b1bf14
Merge branch 'master' of https://github.com/haskell/haskell-ide-engin…
wz1000 Jul 23, 2019
1cbae78
Merge branch 'master' of https://github.com/haskell/haskell-ide-engin…
wz1000 Jul 23, 2019
0bfd54f
Merge pull request #5 from wz1000/hie-bios-wz1000
mpickering Jul 25, 2019
fb61925
Fix cabal.project warning
mpickering Jul 25, 2019
373a474
Update src/Haskell/Ide/Engine/Channel.hs
mpickering Jul 25, 2019
a112dbb
Merge remote-tracking branch 'mpickering/hie-bios'
fendor Sep 5, 2019
6d8bd90
Merge remote-tracking branch 'upstream/master'
fendor Sep 5, 2019
65d700b
Fix hieWrapper
fendor Sep 9, 2019
7eb37df
Update hie-bios
fendor Sep 9, 2019
2e36879
Update HIE to use current master of hie-bios
fendor Sep 9, 2019
c243b50
Avoid persisting Virtual Files after closing
fendor Sep 11, 2019
98d8668
Undo changes to logging utility functions
fendor Sep 12, 2019
e83022e
Remove unused imports and language extensions
fendor Sep 12, 2019
6d9df0f
Add vomit as a synonym for bios-verbose
fendor Sep 12, 2019
0738eb4
Silence or fix all warnings
fendor Sep 13, 2019
4031ac6
Generate hie.yaml to speed up unit-tests
fendor Sep 13, 2019
03473c9
Fix stack.yaml files to include required dependencies
fendor Sep 15, 2019
5a5648d
Remove submodule hie-bios
fendor Sep 22, 2019
5e09ef9
Fix compat for ghc 8.4.4
fendor Sep 24, 2019
9039bcf
Merge hie bios (#3)
fendor Sep 25, 2019
e631b58
Fix builds for stack
fendor Sep 25, 2019
c401bb2
Fix stack for ghc 8.2.2
fendor Sep 25, 2019
4ff9a38
Unbreak build for ghc 8.2.2
fendor Sep 28, 2019
df764c3
Remove unused subfolders
fendor Sep 28, 2019
50f4fe9
Fix tests by editing various cabal files
fendor Sep 25, 2019
1cc08c4
Catch any ghc exception when initialising
fendor Sep 28, 2019
6df6c64
Use cradle to detect used ghc version
fendor Sep 29, 2019
46a986a
Remove hoogle generate from CI because it crashes for ghc 8.2.2
fendor Sep 29, 2019
52601c9
Implement workaround for https://github.com/mpickering/haskell-ide-en…
fendor Sep 30, 2019
80270ff
Add missing filepath deps
fendor Sep 30, 2019
f91070d
Show error on client if initialisation of project failed
fendor Sep 30, 2019
f41edf2
Remove test case that can not succeed in this project
fendor Sep 30, 2019
d7403d2
Fix package plugin spec test
fendor Oct 1, 2019
54becfd
Add hie-bios submodule
fendor Oct 1, 2019
07f1dcd
Keep token stream and unset warning for missing home modules
fendor Oct 1, 2019
3fb0985
Dont generate .ghc.env files by default
fendor Oct 1, 2019
4c96f82
Disable HaRe casesplit test and code action
fendor Oct 1, 2019
3f84a89
Update gitmodules url for hie-bios
fendor Oct 1, 2019
794aa9a
Disable test for finding def across components
fendor Oct 1, 2019
bc5ff6f
Merge pull request #8 from fendor/merge-hie-bios
fendor Oct 1, 2019
57737df
Update README to contain information about hie-bios
fendor Oct 2, 2019
4afb084
Fix liquid test (#12)
fendor Oct 2, 2019
3752ac9
Better README
fendor Oct 2, 2019
a7ec5fc
Dont enable profiling in cabal.project (#17)
fendor Oct 2, 2019
568cca1
Enable pedantic CI/CD
fendor Oct 2, 2019
7fbacf7
Remove undefined with well defined result value
fendor Oct 2, 2019
db18602
Merge pull request #13 from fendor/document-hie-bios
mpickering Oct 2, 2019
dd9cbdd
Fix makeRefactorResult
fendor Oct 3, 2019
15037a4
Try to fix makeRefactorResult again
fendor Oct 3, 2019
48d29b1
Undo changes to shell.nix
fendor Oct 3, 2019
10355fe
Merge haskell-lsp-0.16 update
lukel97 Oct 5, 2019
fdb4696
Merge pull request #28 from bubba/hie-bios-haskell-lsp-0.16
lukel97 Oct 5, 2019
3be0213
Fix build for stack ghc 8.2.2
fendor Oct 6, 2019
40b6073
Changes from my local branch
mpickering Oct 2, 2019
2505e45
Delete unused function
mpickering Oct 2, 2019
c1824ed
Remove duplication of initializeSession
mpickering Oct 2, 2019
f9756db
Refine module caching variables
mpickering Oct 2, 2019
87eb220
Init before caching
mpickering Oct 3, 2019
5642252
Catch GhcException
mpickering Oct 6, 2019
9e3a4e0
Catch errors in cradle initialisation
mpickering Oct 6, 2019
5b56c15
Remove unused Imports from GhcModuleCache
fendor Oct 7, 2019
2f006c7
Fix minor diagnostics order in test-cases
fendor Oct 7, 2019
fa65724
Move Cradle initialisation into withProgress callback
fendor Oct 7, 2019
4f61966
Add more documentation for hie-bios functions
fendor Oct 8, 2019
eb3d32e
Merge pull request #31 from fendor/fix-missing-documentation
mpickering Oct 8, 2019
48958d8
Replace tracing with appropiate logging
fendor Oct 11, 2019
c52a982
Update hie-bios to current master
fendor Oct 14, 2019
2ff3893
Merge pull request #33 from fendor/hie-bios-master
mpickering Oct 14, 2019
8dae303
documentation about profiling
mpickering Oct 17, 2019
172a557
Merge branch 'master' using haskell-lsp-0.17
jneira Oct 21, 2019
f561472
Integrate changes from hie-bios
jneira Oct 22, 2019
582ff05
Add intermediate progress report notification
jneira Oct 23, 2019
1cf6ab7
Correct progress title of second request
jneira Oct 23, 2019
3dcedf8
Merge branch 'master' (incoming 0.13 release)
jneira Oct 23, 2019
89f8d83
Merge pull request #41 from jneira/hie-bios-haskell-lsp-0.17
fendor Oct 23, 2019
52940fb
Use cabal-helper 1.0
fendor Oct 3, 2019
26d0ddd
Update .gitmodules to use DanielG's cabal-helper
fendor Oct 11, 2019
a1bac07
Re-implement cabal-helper cradle
fendor Oct 13, 2019
294c401
Update hie-bios
fendor Oct 13, 2019
52b60ba
Fix builds for stack
fendor Oct 13, 2019
ae844a0
Change HaRe submodule to use different remote
fendor Oct 14, 2019
7def514
Update .gitmodules
fendor Oct 14, 2019
799bfd6
Fix multi-component support for cabal-helper cradle
fendor Oct 14, 2019
408b0b5
Add real error messages
fendor Oct 14, 2019
2fdcb3a
Add none-cradle if file does not belong to any package
fendor Oct 15, 2019
c41eed0
Fix cabal-helper multi-packages support
fendor Oct 15, 2019
2ffb17e
More Documentation
fendor Oct 15, 2019
b72e606
Refactor functions and add Documentation
fendor Oct 16, 2019
91a56b0
Improve comments
fendor Oct 25, 2019
b28e944
Upgrade stack version in circleci to 2.1.3
fendor Oct 25, 2019
c84b33f
.gitmodules, use https instead of ssh
fendor Oct 25, 2019
ed6d66b
Fix stack for ghc 8.6.5
fendor Oct 26, 2019
83c5090
Bump cabal-helper version to latest master a1c4a37
fendor Oct 26, 2019
cc40b6f
Implement perfect match for c-h-h cradle discovery
fendor Oct 28, 2019
7e7bd1d
Remove unused Language Pragma
fendor Oct 28, 2019
92add4e
Fix stripFilePath function
fendor Oct 29, 2019
c45714e
Remove comments from .gitmodules
fendor Oct 29, 2019
0517eaa
Implement the ancestors function
fendor Oct 29, 2019
97e6617
If not package can be found, return none-cradle
fendor Oct 29, 2019
b775f13
Prefer canonicalisePath over normalise
fendor Oct 29, 2019
b4f2326
Remove redundant check for stack installation
fendor Oct 29, 2019
9ceec1e
Move function relativeTo to the bottom of the file
fendor Oct 29, 2019
4309653
Move utility functions to the bottom of Cradle.hs
fendor Oct 31, 2019
9ee8156
Add exhautive documentation for Cabal-Helper-Helper implementation
fendor Oct 31, 2019
232e7d6
Update Documentation, e.g. fix typos and add explanations
fendor Nov 1, 2019
e1da603
Merge pull request #37 from mpickering/profiling-docs
mpickering Nov 5, 2019
3ed7833
Fix typo in documentation of the project root discovery
fendor Nov 5, 2019
a19ff9c
Catch exceptions on initialisation and add explicit import list
fendor Nov 5, 2019
4a80ec3
Rework comments that do not make sense
fendor Nov 5, 2019
d79e033
Merge pull request #26 from fendor/cabal-helper-helper
fendor Nov 5, 2019
6a9b727
Add proper support for the 'none' cradle
mpickering Oct 19, 2019
52691a6
Merge pull request #40 from mpickering/none-cradle
mpickering Nov 5, 2019
e3fa438
Deal properly with increased GHC verbosity.
mpickering Nov 6, 2019
3bfd965
Add eventlog tracing for ghc-events-analyse
mpickering Nov 6, 2019
e0a30bf
typo fix
mpickering Nov 6, 2019
d109948
Remove mapFileFromVFS and some more refactoring in this area
mpickering Nov 6, 2019
e8b4bee
Fix version number back to 1.0
mpickering Nov 6, 2019
b0a01e7
Track changes to haskell-lsp
mpickering Nov 6, 2019
9fc2dcc
Revert "Track changes to haskell-lsp"
mpickering Nov 7, 2019
73fcf4b
Some documentation
mpickering Nov 7, 2019
702a5f5
Fix profiling docs
mpickering Nov 7, 2019
1ca4e0a
docs typo
mpickering Nov 7, 2019
d228c02
modifyModuleCache rather than setModuleCache
mpickering Nov 8, 2019
523da4d
Revert "Revert "Track changes to haskell-lsp""
mpickering Nov 8, 2019
dc8dab1
Fix module cache
mpickering Nov 8, 2019
714f42a
Use direct cradle for tests when stack is not available
expipiplus1 Oct 18, 2019
dcf81a1
Use the LSP provided root directory to find the cradle
lukel97 Nov 14, 2019
3795616
Remove unused imports
jneira Nov 18, 2019
532aa60
Demote no access to virtual file to debug messages
fendor Nov 18, 2019
61b6ba8
Filter out projects if the build tool is not installed
lukel97 Nov 18, 2019
d30d058
Display hie.yaml parse errors in LSP
lukel97 Nov 18, 2019
32a6739
Add a comment
lukel97 Nov 18, 2019
c2e4bfc
Merge pull request #56 from haskell/hie-yaml-parse-error
lukel97 Nov 18, 2019
c6e7f31
Detect files in main-is of components
lukel97 Nov 19, 2019
924de7c
Use fork for cabal-helper submodule with cabal v2 fixes
lukel97 Nov 19, 2019
d467264
Remove writeMTS
mpickering Nov 19, 2019
a0296ae
Merge remote-tracking branch 'upstream/master' into wip/friday-fixes
mpickering Nov 19, 2019
58c4019
Merge remote-tracking branch 'mpickering/hie-bios' into wip/friday-fixes
mpickering Nov 19, 2019
8c3c350
Fix HaRe submodule
mpickering Nov 19, 2019
4c5308b
Remove eventlog, by default, should add a way to turn this on with a …
mpickering Nov 19, 2019
7541d1e
Merge pull request #44 from mpickering/wip/friday-fixes
mpickering Nov 19, 2019
7c206de
Fix name shadowing
reactormonk Nov 21, 2019
c983469
Move errorHandlers to GhcUtils
jneira Nov 25, 2019
4bd1e75
Use errorHandlers in cradle intialization
jneira Nov 25, 2019
90e1444
Correct typo
jneira Nov 25, 2019
7681038
Remove unused export
jneira Nov 25, 2019
e212df1
Log SourceError in cradle init
jneira Nov 25, 2019
d3d8ac2
Update hie-plugin-api for use with HaRe (#61)
alanz Nov 25, 2019
41b9cab
Fix import dirs of c-h-h (#55)
fendor Nov 25, 2019
8701f8b
specific ghc-exactprint for all-hies HaRe
reactormonk Nov 27, 2019
9f5ef1b
Update cabal-helper to include changes from dxld/master
lukel97 Dec 2, 2019
fea7271
Create empty hie.yaml to trigger a parse error
jneira Dec 3, 2019
62267a5
Display type of cradle in "initializing cradle" message
lukel97 Dec 2, 2019
361f6ef
Merge pull request #71 from jneira/fix-hie-bios-test
lukel97 Dec 4, 2019
ec3d362
Fix stack build
fendor Dec 4, 2019
b0b0c95
Fix init cradle message changed with 62267a
jneira Dec 9, 2019
16f2580
Restore typed holes substitution list from master
jneira Dec 9, 2019
31209a6
Remove HaRe, move some utils from it into FromHaRe module
alanz Dec 10, 2019
9ce648a
Removed HaRe submodule
alanz Dec 10, 2019
a173297
Working on tests
alanz Dec 11, 2019
25bcde6
Some minor test tweaks
alanz Dec 12, 2019
43cf0d1
Merge pull request https://github.com/mpickering/haskell-ide-engine/p…
fendor Dec 13, 2019
bc079e9
Display which cradle was used when testing for mismatching GHC versions
lukel97 Dec 16, 2019
bd40ac3
Add back much needed import
lukel97 Dec 16, 2019
03d9bf2
Add some comments for 'only' test
lukel97 Dec 16, 2019
0d44704
Update to haskell-lsp 0.19.0.0
mpickering Nov 26, 2019
3ff767e
Update to use hie-bios 0.3.0 from hackage
fendor Dec 15, 2019
0effcf4
Create a custom hie.yaml for testdata
fendor Dec 16, 2019
305b2d5
Remove unused dependency rope-utf16-splay
fendor Dec 16, 2019
67d0903
Fix the expected indefinite progress message
fendor Dec 16, 2019
8e91d80
Comment out tests that depend on HaRe
fendor Dec 16, 2019
9819903
Add CodeActionRename as a executable to test project
fendor Dec 16, 2019
ae8aa22
Fix wrapper tests when cabal is installed
lukel97 Dec 16, 2019
b7dfd2b
Merge remote-tracking branch 'upstream/master' into merge-upstream
fendor Dec 16, 2019
1b9767d
Remove unused import of HIE.Bios.Types
fendor Dec 17, 2019
8e0241c
Patch test case for whilst HaRe is gone
lukel97 Dec 17, 2019
49582c2
Disable type definition test across modules
fendor Dec 17, 2019
3476f19
Add explicit hie.yaml to force the project type
fendor Dec 17, 2019
1a05e42
Merge pull request #86 from fendor/add-hie-yaml-for-wrapper-tests
lukel97 Dec 17, 2019
501cb28
Merge pull request https://github.com/mpickering/haskell-ide-engine/p…
fendor Dec 17, 2019
cd0d1eb
Update hie-bios version to at least 0.3.2
fendor Dec 19, 2019
a79ec33
Clarify difference between lsp and hie-bios configuration
lukel97 Dec 20, 2019
c5b8a4b
Various updates to sync with hie-bios
jneira Dec 20, 2019
b1363df
Make 3.0.0.0 the required minimum version for windows
jneira Dec 20, 2019
c4c04ce
Update build docs to match hie-bios branch
jneira Dec 20, 2019
89fe99d
Correct phrasing in README
jneira Dec 20, 2019
20255f2
Add table for automatic cradle discovery
lukel97 Dec 20, 2019
84e645c
Remove unused code for logging setup
fendor Dec 20, 2019
c94b45e
Update multi-cradle instructions
fendor Dec 18, 2019
cd3cd02
Remove unused bios log level function
fendor Dec 20, 2019
c193254
Remove unused .hie-bios files
fendor Dec 20, 2019
df1ac8a
Remove unneeded floskell:newer in cabal.project
fendor Dec 20, 2019
6cbadc7
Remove commented out code (https://github.com/mpickering/haskell-ide-…
fendor Dec 20, 2019
5dfc446
Remove unused old code
fendor Dec 20, 2019
6f1c220
Minor format changes
fendor Dec 20, 2019
8e9bb3d
Rename GhcModPluginSpec to GenericPluginSpec
fendor Dec 20, 2019
58ac672
Fix project selected for plain hs files
lukel97 Dec 20, 2019
bfedd03
Merge pull request #92 from haskell/project-config-readme
lukel97 Dec 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .azure/linux-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
source .azure/linux.bashrc
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
stack install --stack-yaml $(YAML_FILE) # `hie` binary required for tests
stack --stack-yaml $(YAML_FILE) exec hoogle generate
fendor marked this conversation as resolved.
Show resolved Hide resolved
displayName: Build Test-dependencies
- bash: |
sudo apt update
Expand Down
1 change: 0 additions & 1 deletion .azure/macos-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
source .azure/macos.bashrc
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
stack install --stack-yaml $(YAML_FILE) # `hie` binary required for tests
stack --stack-yaml $(YAML_FILE) exec hoogle generate
fendor marked this conversation as resolved.
Show resolved Hide resolved
displayName: Build Test-dependencies
- bash: |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Expand Down
1 change: 0 additions & 1 deletion .azure/windows-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ jobs:
source .azure/windows.bashrc
stack build --stack-yaml $(YAML_FILE) --test --bench --only-dependencies
stack install --stack-yaml $(YAML_FILE) # `hie` binary required for tests
stack exec --stack-yaml $(YAML_FILE) hoogle generate
fendor marked this conversation as resolved.
Show resolved Hide resolved
displayName: Build Test-dependencies
- bash: |
# TODO: try to install automatically (`choco install z3` fails and pacman is not installed)
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ defaults: &defaults
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "stack-build.txt" }}
- stack-cache-{{ .Environment.HIE_CACHE }}-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ checksum "resolver.txt" }}

# - run:
# name: Stack upgrade
# command: stack upgrade
- run:
name: Stack upgrade
command: stack upgrade

- run:
name: Stack setup
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@ _build/
# stack 2.1 stack.yaml lock files
stack*.yaml.lock
shake.yaml.lock

# ignore hie.yaml's for testdata
test/**/*.yaml
Comment on lines +78 to +79
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably want to ignore any hie.yaml

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we automatically generate the hie.yaml files again?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the tests. The tests need a hie.yaml to configure the project context properly.

14 changes: 3 additions & 11 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,12 @@
# rm -rf path_to_submodule


[submodule "submodules/HaRe"]
path = submodules/HaRe
# url = https://github.com/bubba/HaRe.git
url = https://github.com/alanz/HaRe.git

[submodule "submodules/cabal-helper"]
path = submodules/cabal-helper
# url = https://github.com/arbor/cabal-helper.git
url = https://github.com/alanz/cabal-helper.git
# url = https://github.com/DanielG/cabal-helper.git
# Change this back once https://github.com/DanielG/cabal-helper/pull/85/ merged
url = https://github.com/bubba/cabal-helper.git
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these still the right remotes?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, we could look at DanielG c-h directly.


[submodule "submodules/ghc-mod"]
path = submodules/ghc-mod
# url = https://github.com/arbor/ghc-mod.git
# url = https://github.com/bubba/ghc-mod.git
url = https://github.com/alanz/ghc-mod.git

url = https://github.com/fendor/ghc-mod.git
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need an issue which details what to do to remove this?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, we want to subsume ghc-project-types to make us independent of ghc-mod.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moreover, if we take ghc-project-types and turn it into its own project, we are almost ready to go to hackage.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did discuss that with @DanielG , he is happy for us to move it elsewhere, possibly as a sub-project inside haskell-ide-engine.

136 changes: 134 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ we talk to clients.__
- [Windows-specific pre-requirements](#windows-specific-pre-requirements)
- [Download the source code](#download-the-source-code)
- [Building](#building)
- [Install via cabal](#install-via-cabal)
- [Install specific GHC Version](#install-specific-ghc-version)
- [Multiple versions of HIE (optional)](#multiple-versions-of-hie-optional)
- [Configuration](#configuration)
- [Explicit Configuration](#explicit-configuration)
- [Editor Integration](#editor-integration)
- [Using HIE with VS Code](#using-hie-with-vs-code)
- [Using VS Code with Nix](#using-vs-code-with-nix)
- [Using HIE with Sublime Text](#using-hie-with-sublime-text)
- [Using HIE with Vim or Neovim](#using-hie-with-vim-or-neovim)
- [Coc](#Coc)
- [LanguageClient-neovim](#LanguageClient-neovim)
- [Coc](#coc)
- [LanguageClient-neovim](#languageclient-neovim)
- [vim-plug](#vim-plug)
- [Clone the LanguageClient-neovim repo](#clone-the-languageclient-neovim-repo)
- [Sample `~/.vimrc`](#sample-vimrc)
Expand Down Expand Up @@ -303,6 +305,100 @@ There are some settings that can be configured via a `settings.json` file:
- VS Code: These settings will show up in the settings window
- LanguageClient-neovim: Create this file in `$projectdir/.vim/settings.json` or set `g:LanguageClient_settingsPath`

## Explicit Configuration

**For a full explanation of possible configuration, we refer to [hie-bios/README](https://github.com/mpickering/hie-bios/blob/master/README.md).**

The user can place a `hie.yaml` file in the root of the workspace which
describes how to setup the environment. For example, to explicitly state
that you want to use `stack` then the configuration file would look like:

```yaml
cradle: {stack}
fendor marked this conversation as resolved.
Show resolved Hide resolved
```

If you use `cabal` then you probably need to specify which component you want
to use.

```yaml
cradle:
cabal:
component: "lib:haskell-ide-engine"
```

Or you can explicitly state the program which should be used to collect
the options by supplying the path to the program. It is interpreted
relative to the current working directory if it is not an absolute path.

```yaml
cradle:
bios:
program: ".hie-bios"
```

The complete configuration is a subset of

```yaml
cradle:
cabal:
component: "optional component name"
stack:
bazel:
obelisk:
bios:
program: "program to run"
dependency-program: "optional program to run"
direct:
arguments: ["list","of","ghc","arguments"]
default:
none:

dependencies:
- someDep
```
fendor marked this conversation as resolved.
Show resolved Hide resolved

There is also support for multiple cradles in a single `hie.yaml`. An example configuration for Haskell IDE Engine:

```yaml
cradle:
multi:
- path: ./test/dispatcher/
config:
cradle:
cabal:
component: "test:dispatcher-test"
- path: ./test/functional/
config:
cradle:
cabal:
component: "test:func-test"
- path: ./test/unit/
config:
cradle:
cabal:
component: "test:unit-test"
- path: ./hie-plugin-api/
config:
cradle:
cabal:
component: "lib:hie-plugin-api"
- path: ./app/MainHie.hs
config:
cradle:
cabal:
component: "exe:hie"
- path: ./app/HieWrapper.hs
config:
cradle:
cabal:
component: "exe:hie-wrapper"
- path: ./
config:
cradle:
cabal:
component: "lib:haskell-ide-engine"
```
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the lightweight-cabal syntax here I think.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it should show how to define multi-cradles. Mutli-Cabal version is a bit above


## Editor Integration

Note to editor integrators: there is now a `hie-wrapper` executable, which is installed alongside the `hie` executable. When this is invoked in the project root directory, it attempts to work out the GHC version used in the project, and then launch the matching `hie` executable.
Expand Down Expand Up @@ -659,3 +755,39 @@ can happen because cabal-helper compiles and runs above executable at runtime wi

Liquid Haskell requires an SMT solver on the path. We do not take care of installing one, thus, Liquid Haskell will not run until one is installed.
The recommended SMT solver is [z3](https://github.com/Z3Prover/z3). To run the tests, it is also required to have an SMT solver on the path, otherwise the tests will fail for Liquid Haskell.

### Profiling `haskell-ide-engine`.

If you think `haskell-ide-engine` is using a lot of memory then the most useful
thing you can do is prepare a profile of the memory usage whilst you're using
the program.

1. Add `profiling: True` to the cabal.project file of `haskell-ide-engine`
2. `cabal new-build hie`
3. (IMPORTANT) Add `profiling: True` to the `cabal.project` file of the project you want to profile.
4. Make a wrapper script which calls the `hie` you built in step 2 with the additional options `+RTS -hd -l-au`
5. Modify your editor settings to call this wrapper script instead of looking for `hie` on the path
6. Try using `h-i-e` as normal and then process the `*.eventlog` which will be created using [`eventlog2html`](http://hackage.haskell.org/package/eventlog2html).
7. Repeat the process again using different profiling options if you like.

#### Using `ghc-events-analyze`

`haskell-ide-engine` contains the necessary tracing functions to work with [`ghc-events-analyze`](http://www.well-typed.com/blog/2014/02/ghc-events-analyze/). Each
request which is made will emit an event to the eventlog when it starts and finishes. This way you
can see if there are any requests which are taking a long time to complete or are blocking.

1. Make sure that `hie` is linked with the `-eventlog` option. This can be achieved by adding the flag
to the `ghc-options` field in the cabal file.
2. Run `hie` as normal but with the addition of `+RTS -l`. This will produce an eventlog called `hie.eventlog`.
3. Run `ghc-events-analyze` on the `hie.eventlog` file to produce the rendered SVG. Warning, this might take a while and produce a big SVG file.

The default options for `ghc-events-analyze` will produce quite a wide chart which is difficult to view. You can try using less buckets in order
to make the chart quicker to generate and faster to render.

```
ghc-events-analyze hie.eventlog -b 100
```

This support is similar to the logging capabilities [built into GHC](https://www.haskell.org/ghc/blog/20190924-eventful-ghc.html).


16 changes: 7 additions & 9 deletions app/HieWrapper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import Data.Semigroup
import Data.List
import Data.Foldable
import Data.Version (showVersion)
import qualified GhcMod.Monad as GM
import qualified GhcMod.Monad.Types as GM
import qualified GhcMod.Types as GM
import HIE.Bios
import Haskell.Ide.Engine.MonadFunctions
import Haskell.Ide.Engine.Cradle (findLocalCradle)
import Haskell.Ide.Engine.Options
import Haskell.Ide.Engine.Plugin.Base
import qualified Language.Haskell.LSP.Core as Core
Expand All @@ -23,6 +22,7 @@ import System.Environment
import qualified System.Log.Logger as L
import System.Process
import System.Info
import System.FilePath

-- ---------------------------------------------------------------------

Expand Down Expand Up @@ -73,15 +73,13 @@ run opts = do
logm $ "Current directory:" ++ d
logm $ "Operating system:" ++ os

-- Get the cabal directory from the ghc-mod cradle
(mcr,_) <- GM.runGhcModT GM.defaultOptions GM.cradle
dir <- case mcr of
Left err -> error (show err)
Right cr -> return $ GM.cradleRootDir cr
-- Get the cabal directory from the cradle
cradle <- findLocalCradle (d </> "File.hs")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure this will work well with multi-cradle projects.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wont, we have to tackle it in hie-bios

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this will work in a best effort manner, imo.

let dir = cradleRootDir cradle
logm $ "Cradle directory:" ++ dir
setCurrentDirectory dir

ghcVersion <- getProjectGhcVersion
ghcVersion <- getProjectGhcVersion cradle
logm $ "Project GHC version:" ++ ghcVersion

let
Expand Down
44 changes: 20 additions & 24 deletions app/MainHie.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@ import qualified Paths_haskell_ide_engine as Meta
import System.Directory
import System.Environment
import qualified System.Log.Logger as L
import HIE.Bios.Types
import System.IO

-- ---------------------------------------------------------------------
-- plugins

import Haskell.Ide.Engine.Plugin.ApplyRefact
import Haskell.Ide.Engine.Plugin.Base
import Haskell.Ide.Engine.Plugin.Brittany
import Haskell.Ide.Engine.Plugin.Build
import Haskell.Ide.Engine.Plugin.Example2
import Haskell.Ide.Engine.Plugin.GhcMod
import Haskell.Ide.Engine.Plugin.HaRe
import Haskell.Ide.Engine.Plugin.Bios
-- import Haskell.Ide.Engine.Plugin.HaRe
import Haskell.Ide.Engine.Plugin.Haddock
import Haskell.Ide.Engine.Plugin.HfaAlign
import Haskell.Ide.Engine.Plugin.Hoogle
Expand All @@ -36,6 +37,7 @@ import Haskell.Ide.Engine.Plugin.Liquid
import Haskell.Ide.Engine.Plugin.Package
import Haskell.Ide.Engine.Plugin.Pragmas
import Haskell.Ide.Engine.Plugin.Floskell
import Haskell.Ide.Engine.Plugin.Generic

-- ---------------------------------------------------------------------

Expand All @@ -50,16 +52,16 @@ plugins includeExamples = pluginDescToIdePlugins allPlugins
[ applyRefactDescriptor "applyrefact"
, baseDescriptor "base"
, brittanyDescriptor "brittany"
, buildPluginDescriptor "build"
, ghcmodDescriptor "ghcmod"
, haddockDescriptor "haddock"
, hareDescriptor "hare"
-- , hareDescriptor "hare"
, hoogleDescriptor "hoogle"
, hsimportDescriptor "hsimport"
, liquidDescriptor "liquid"
, packageDescriptor "package"
, pragmasDescriptor "pragmas"
, floskellDescriptor "floskell"
, biosDescriptor "bios"
, genericDescriptor "generic"
]
examplePlugins =
[example2Descriptor "eg2"
Expand Down Expand Up @@ -98,39 +100,33 @@ main = do

run :: GlobalOpts -> IO ()
run opts = do
hSetBuffering stderr LineBuffering
mpickering marked this conversation as resolved.
Show resolved Hide resolved
let mLogFileName = optLogFile opts

logLevel = if optDebugOn opts
then L.DEBUG
else L.INFO

Core.setupLogger mLogFileName ["hie"] logLevel

projGhcVersion <- getProjectGhcVersion
when (projGhcVersion /= hieGhcVersion) $
warningm $ "Mismatching GHC versions: Project is " ++ projGhcVersion
++ ", HIE is " ++ hieGhcVersion
Core.setupLogger mLogFileName ["hie", "hie-bios"] logLevel
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add TODO here about configuring logging levels separately.


origDir <- getCurrentDirectory

maybe (pure ()) setCurrentDirectory $ projectRoot opts

progName <- getProgName
logm $ "Run entered for HIE(" ++ progName ++ ") " ++ version
d <- getCurrentDirectory
logm $ "Current directory:" ++ d
logm $ "Current directory:" ++ origDir
args <- getArgs
logm $ "args:" ++ show args

let vomitOptions = defaultOptions { boLogging = BlVomit}
let defaultOpts = if optGhcModVomit opts then vomitOptions else defaultOptions
-- Running HIE on projects with -Werror breaks most of the features since all warnings
-- will be treated with the same severity of type errors. In order to offer a more useful
-- experience, we make sure warnings are always reported as warnings by setting -Wwarn
biosOptions = defaultOpts { boGhcUserOptions = ["-Wwarn"] }
let initOpts = defaultCradleOpts { cradleOptsVerbosity = verbosity }
fendor marked this conversation as resolved.
Show resolved Hide resolved
verbosity = if optBiosVerbose opts then Verbose else Silent
-- biosLogLevel = if optBiosVerbose opts then L.DEBUG else L.INFO
fendor marked this conversation as resolved.
Show resolved Hide resolved
fendor marked this conversation as resolved.
Show resolved Hide resolved

-- Core.setupLogger mLogFileName ["hie-bios"] biosLogLevel
fendor marked this conversation as resolved.
Show resolved Hide resolved

when (optGhcModVomit opts) $
logm "Enabling --vomit for ghc-mod. Output will be on stderr"
when (optBiosVerbose opts) $
logm "Enabling verbose mode for hie-bios. This option currently doesn't do anything."
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it not do anything? Make an issue describing what needs to be done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be in favour of removing these manual command line arguments in favour for LSP's InitialiseParams.trace

Copy link
Collaborator

@fendor fendor Dec 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of legacy reasons, we had two flags --vomit for ghc-mod and -d for lsp stuff. However, now hie-bios is also using the same logging mechanism like haskell-lsp, and we set the loggers to the same level. So, We should not remove it right away, because lsp-clients might set --vomit and otherwise, all lsp-clients for haskell need to be updated.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the feature freeze, I would like to create an issue for this after merge. would that be ok @bubba?


when (optExamplePlugin opts) $
logm "Enabling Example2 plugin, will insert constant diagnostics etc."
Expand All @@ -139,8 +135,8 @@ run opts = do

-- launch the dispatcher.
if optJson opts then do
scheduler <- newScheduler plugins' biosOptions
scheduler <- newScheduler plugins' initOpts
jsonStdioTransport scheduler
else do
scheduler <- newScheduler plugins' biosOptions
scheduler <- newScheduler plugins' initOpts
lspStdioTransport scheduler origDir plugins' (optCaptureFile opts)
Loading