Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit 72a6cb1

Browse files
authored
Merge pull request #64 from haifengkao/iosSupport
support ios for Sourcekit-lsp
2 parents 86f2fd8 + b0421ba commit 72a6cb1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/clientMain.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,17 @@ function currentServerOptions(context: ExtensionContext) {
100100
const toolchain = workspace
101101
.getConfiguration("sourcekit-lsp")
102102
.get<string>("toolchainPath");
103+
104+
// sourcekit-lsp takes -Xswiftc arguments like "swift build", but it doesn't need "build" argument
105+
let sourceKitArgs = (<string[]>(
106+
workspace.getConfiguration().get("sde.swiftBuildingParams")
107+
) || []).filter(param => param !== "build")
108+
103109
const env: NodeJS.ProcessEnv = toolchain
104110
? { ...process.env, SOURCEKIT_TOOLCHAIN_PATH: toolchain }
105111
: process.env;
106112

107-
const run: Executable = { command: executableCommand, options: { env } };
113+
const run: Executable = { command: executableCommand, options: { env }, args: sourceKitArgs};
108114
const serverOptions: ServerOptions = run;
109115
return serverOptions;
110116
}

0 commit comments

Comments
 (0)