Skip to content

Commit 3bbe2cc

Browse files
committed
Add configuration to enable/disable HIE
1 parent 0349b98 commit 3bbe2cc

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ There are a few placeholders which will be expanded:
6464

6565
This can be beneficial if you are using something like nix, to have a wrapper script tailored to your setup.
6666

67+
#### Enable/disable HIE
68+
69+
You can enable or disable HIE via configuration. This is useful, because multi-root workspaces do not yet allow you to manage extensions at the folder level, which can be necessary.
70+
71+
```json
72+
"languageServerHaskell.enableHIE": true
73+
```
74+
6775
## Manual Installation
6876
Either install the extension via the marketplace (preferred), or if you are testing an unreleased version by,
6977

@@ -103,7 +111,14 @@ You can then define how to start HIE for each of these folders, by going into `S
103111
}
104112
```
105113

106-
to launch HIE via `hie.sh` inside the backend folder, while the frontend, because of being GHCJS, might not use HIE and use something else instead. This provides a very flexible way of customizing your setup.
114+
to launch HIE via `hie.sh` inside the _backend_ and _common_ folder, while the _frontend_, because of using GHCJS, might not want to use HIE, and therefore needs to disable HIE,
115+
116+
```json
117+
{
118+
"languageServerHaskell.useHieWrapper": false
119+
}
120+
```
121+
This provides a very flexible way of customizing your setup.
107122

108123
## Release Notes
109124

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@
121121
],
122122
"default": "off",
123123
"description": "Traces the communication between VSCode and the languageServerHaskell service."
124+
},
125+
"languageServerHaskell.enableHIE": {
126+
"scope": "resource",
127+
"type": "boolean",
128+
"default": true,
129+
"description": "Enable/Disable HIE (useful for multi-root workspaces)."
124130
}
125131
}
126132
},

src/extension.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ async function activateHie(context: ExtensionContext, document: TextDocument) {
8989
}
9090

9191
function activateHieNoCheck(context: ExtensionContext, folder: WorkspaceFolder, uri: Uri) {
92+
// Stop right here, if HIE is disabled in the resource/workspace folder.
93+
const enableHIE = workspace.getConfiguration('languageServerHaskell', uri).enableHIE;
94+
if (!enableHIE) {
95+
return;
96+
}
97+
9298
// Set up the documentation browser.
9399
if (!docsBrowserRegistered) {
94100
const docsDisposable = DocsBrowser.registerDocsBrowser();

0 commit comments

Comments
 (0)