Skip to content

Add an option to set server command line arguments #464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@
"default": "",
"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."
},
"haskell.serverExtraArgs": {
"scope": "resource",
"type": "string",
"default": "",
"markdownDescription": "Pass additional arguments to the language server."
},
"haskell.updateBehavior": {
"scope": "machine",
"type": "string",
Expand Down
5 changes: 5 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
args = args.concat(['-l', logFile]);
}

let extraArgs: string = workspace.getConfiguration('haskell', uri).serverExtraArgs;
if (extraArgs !== null) {
args = args.concat(extraArgs.split(' '));
}

// If we're operating on a standalone file (i.e. not in a folder) then we need
// to launch the server in a reasonable current directory. Otherwise the cradle
// guessing logic in hie-bios will be wrong!
Expand Down