Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit f9abcf8

Browse files
committed
Use xcrun to find sourcekit-lsp
1 parent ff35894 commit f9abcf8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ See [sourcekit-lsp].
2626
|Key|Description|Default|
2727
|----|------------|-----|
2828
|`sourcekit.enable`|Enable sourcekit extension|true|
29-
|sourcekit.commandPath|Path to sourcekit-lsp binary|
29+
|`sourcekit.commandPath`|Path to sourcekit-lsp binary|Output of `xcrun --toolchain swift --find sourcekit-lsp`|
3030

3131
## Development
3232

src/extension.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ export async function activate(context: ExtensionContext): Promise<void> {
1919
return
2020
}
2121

22+
const commandPath = (await workspace.runCommand('xcrun --toolchain swift --find sourcekit-lsp')).trim()
2223
const serverOptions: ServerOptions = {
23-
command: config.commandPath,
24+
command: config.commandPath || commandPath,
2425
transport: TransportKind.stdio
2526
}
2627

0 commit comments

Comments
 (0)