You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [skip circleci] update troubleshooting
* Removing the old issue about Path_ modules
* Adding the issue about TH and multi component support with stack
* Adding the strategy of disable plugins to help trace the cause
* Rephrasing stack issue
Co-authored-by: Michael Peyton Jones <[email protected]>
* Remove dead bullet
Co-authored-by: Michael Peyton Jones <[email protected]>
* Repharsing/corrections
Co-authored-by: Michael Peyton Jones <[email protected]>
* Rephrasing/corrections
Co-authored-by: Michael Peyton Jones <[email protected]>
* Apply suggestions from code review
Co-authored-by: Michael Peyton Jones <[email protected]>
Co-authored-by: Michael Peyton Jones <[email protected]>
Copy file name to clipboardExpand all lines: docs/troubleshooting.md
+25-8Lines changed: 25 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -21,19 +21,30 @@ Example with `tasty-discover`:
21
21
22
22
This returns an error in HLS if 'tasty-discover' is not in the path: `could not execute: tasty-discover`.
23
23
24
-
## Common issues
25
-
26
-
### Difficulties with Stack and `Paths_` modules
24
+
### Problems with multi component (tests suites, executables, benchmarks) support using stack
27
25
28
-
These are known to be somewhat buggy at the moment: <https://github.com/haskell/haskell-language-server/issues/478>.
29
-
This issue should be fixed in Stack versions >= 2.5.
26
+
Due to some limitations in the interaction between HLS and stack, there are some issues in projects with a main library and executables, test suites or benchmarks:
27
+
- The stack project has to be built succesfully *before* loading it with HLS to get components other than the library work.
28
+
- Changes in the library are not automatically propagated to other components, especially in the presence of errors in the library, so you have to restart HLS to get those components correctly loaded. The usual symptom is the editor showing errors like `Could not load module ...` or `Cannot satisfy -package ...`
29
+
- See https://github.com/haskell/haskell-language-server/issues/366 for more info about.
30
+
## Common issues
30
31
31
32
### Problems with dynamic linking
32
33
33
34
As haskell-language-server prebuilt binaries are statically linked, they don't play well with projects using dynamic linking.
34
35
An usual symptom is the presence of errors containing `unknown symbol` and it is typical in arch linux, where a dynamically linked version of ghc is used.
35
36
36
-
The workaround is to use a version of haskell-language-server compiled from source with `-dynamic` enabled`. See more details [here](https://github.com/haskell/haskell-language-server/issues/1160#issuecomment-756566273).
37
+
The workaround is to use a version of haskell-language-server compiled from source with the ghc option `-dynamic` enabled. See more details [here](https://github.com/haskell/haskell-language-server/issues/1160#issuecomment-756566273).
38
+
39
+
### Problems with Template Haskell
40
+
41
+
Due to how Template Haskell code is evaluated at compile time and some limitations in the interaction between HLS and GHC, the loading of modules using TH can be problematic.
42
+
43
+
The errors thrown are usually related to linking and usually make HLS crash: `Segmentation fault`, `GHC runtime linker: fatal error`, etc
44
+
45
+
A workaround which has helped in some cases is to compile HLS from source with the ghc option `-dynamic` enabled, as in the previous issue.
46
+
47
+
We have a [dedicated label](https://github.com/haskell/haskell-language-server/issues?q=is%3Aissue+is%3Aopen+label%3A%22type%3A+template+haskell+related%22) in the issue tracker and an [general issue](https://github.com/haskell/haskell-language-server/issues/1431) tracking support for TH.
37
48
38
49
## Troubleshooting the server
39
50
@@ -56,11 +67,17 @@ sent, or if there are any errors.
56
67
57
68
To get a more verbose, also pass `--debug` to the executable.
58
69
70
+
### Identify which plugin could be the cause of the issue.
71
+
72
+
Sometimes the issue is produced by one of the plugins included in HLS. To diagnose that and help to trace the final cause one possible strategy is simple disable all plugins, check if the issue is gone and then enable them selectively until the issue is reproduced again.
73
+
74
+
There is a configuration json snippet which disables all plugins [here](https://github.com/haskell/haskell-language-server/issues/2151#issuecomment-911397030).
75
+
59
76
## Troubleshooting the client
60
77
61
78
Many clients provide diagnostic information about a LSP session.
62
79
In particular, look for a way to get the status of the server, the server stderr, or a log of the messages that the client has sent to the server.
63
80
For example, `lsp-mode` provides all of these (see its [troubleshooting page](https://emacs-lsp.github.io/lsp-mode/page/troubleshooting/) for details).
81
+
For vscode you can read how to access the lsp session log [here])https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems).
64
82
65
-
The most common client-related problem is the client simply not finding the server executable, so make sure that you have the right `PATH` and you have configured
66
-
it to look for the right executable.
83
+
The most common client-related problem is the client simply not finding the server executable or the tools needed to load Haskell code (`ghc`, `cabal`, or `stack`). So make sure that you have the right `PATH` and you have configured the client to look for the right executables.
0 commit comments