Skip to content

Commit 984a43d

Browse files
committed
Add an option to set server command line arguments. Fixes haskell#462
1 parent 5ab7fac commit 984a43d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,12 @@
144144
"default": "",
145145
"markdownDescription": "Manually set a language server executable. Can be something on the $PATH or a path to an executable itself. Works with `~,` `${HOME}` and `${workspaceFolder}`. **Deprecated scope**: This option will be set to `machine` scope in a future release, so it can be changed only globally, not per workspace."
146146
},
147+
"haskell.serverExtraArgs": {
148+
"scope": "resource",
149+
"type": "string",
150+
"default": "",
151+
"markdownDescription": "Pass additional arguments to the language server."
152+
},
147153
"haskell.updateBehavior": {
148154
"scope": "machine",
149155
"type": "string",

src/extension.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
196196
args = args.concat(['-l', logFile]);
197197
}
198198

199+
let extraArgs: string = workspace.getConfiguration('haskell', uri).serverExtraArgs;
200+
if (extraArgs !== null) {
201+
args = args.concat(extraArgs.split(' '));
202+
}
203+
199204
// If we're operating on a standalone file (i.e. not in a folder) then we need
200205
// to launch the server in a reasonable current directory. Otherwise the cradle
201206
// guessing logic in hie-bios will be wrong!

0 commit comments

Comments
 (0)