Skip to content

Commit 3f8c5ae

Browse files
authored
Merge pull request #469 from berberman/args
Make sure no empty strings in server executable args
2 parents f2fff2d + c54ff4c commit 3f8c5ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/extension.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
197197
}
198198

199199
let extraArgs: string = workspace.getConfiguration('haskell', uri).serverExtraArgs;
200-
if (extraArgs !== null) {
200+
if (extraArgs !== '') {
201201
args = args.concat(extraArgs.split(' '));
202202
}
203203

@@ -214,6 +214,9 @@ async function activateServerForFolder(context: ExtensionContext, uri: Uri, fold
214214
cwd: folder ? undefined : path.dirname(uri.fsPath),
215215
};
216216

217+
// We don't want empty strings in our args
218+
args = args.map((x) => x.trim()).filter((x) => x !== '');
219+
217220
// For our intents and purposes, the server should be launched the same way in
218221
// both debug and run mode.
219222
const serverOptions: ServerOptions = {

0 commit comments

Comments
 (0)