swiftlang / sourcekit-lsp

Language Server Protocol implementation for Swift and C-based languages
Apache License 2.0
3.2k stars 264 forks source link

Unable to enable background indexing as per instructions #1529

Closed tonyarnold closed 6 days ago

tonyarnold commented 6 days ago

Swift version

swift-driver version: 1.110 Apple Swift version 6.0 (swiftlang-6.0.0.4.52 clang-1600.0.21.1.3)

Platform

macOS 14.5

Editor

Visual Studio Code with Swift extension version v1.10.3

Does the issue reproduce with Swift 6?

Yes

Description

I'm unable to start SourceKit LSP from within VSCode.

Steps to Reproduce

I followed the instructions at https://github.com/apple/sourcekit-lsp/blob/main/Documentation/Enable%20Experimental%20Background%20Indexing.md

Now I get the following error within VSCode:

[Error - 20:28:54] SourceKit Language Server client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error: Unknown option '--experimental-feature'
Usage: source-kit-lsp <options> <subcommand>
  See 'source-kit-lsp --help' for more information.
[Error - 20:28:54] Server process exited with code 64.
[Error - 20:28:54] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 

Logging

sourcekit-lsp-diagnose-2024-06-27T20-37-58+10-00.zip

ahoppen commented 6 days ago

Hey @tonyarnold,

Could it be that you didn’t set swift.path in VS Code to point to the installed toolchain?

tonyarnold commented 6 days ago

It looks like it was because I was using the version included with Xcode 16 beta 2. Using a nightly toolchain works fine.

ahoppen commented 6 days ago

That's good to hear. If you see any issues with background indexing, please let me know.