From b0421ba67241ab00eb8ba088960a4b9d687fc6a5 Mon Sep 17 00:00:00 2001 From: Hai Feng Date: Mon, 9 Mar 2020 18:33:57 +0800 Subject: [PATCH] support ios for Sourcekit-lsp --- src/clientMain.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/clientMain.ts b/src/clientMain.ts index c00f185..0b49cc9 100644 --- a/src/clientMain.ts +++ b/src/clientMain.ts @@ -100,11 +100,17 @@ function currentServerOptions(context: ExtensionContext) { const toolchain = workspace .getConfiguration("sourcekit-lsp") .get("toolchainPath"); + + // sourcekit-lsp takes -Xswiftc arguments like "swift build", but it doesn't need "build" argument + let sourceKitArgs = (( + workspace.getConfiguration().get("sde.swiftBuildingParams") + ) || []).filter(param => param !== "build") + const env: NodeJS.ProcessEnv = toolchain ? { ...process.env, SOURCEKIT_TOOLCHAIN_PATH: toolchain } : process.env; - const run: Executable = { command: executableCommand, options: { env } }; + const run: Executable = { command: executableCommand, options: { env }, args: sourceKitArgs}; const serverOptions: ServerOptions = run; return serverOptions; }