Swift version
Swift version 6.5-dev (LLVM 18d2bfb70c14d89, Swift c13d82e5987aecb)
Platform
Linux
Editor
Visual Studio Code, latest Swift plugin version
Description
Navigating via textDocument/definition on a reference to a package of the local workspace opens a .swiftinterface representation of that package.
IMHO, instead, it should either reference the source folder of the package or reject the request.
I have not researched if a folder is a valid response to textDocument/definition.
In an ideal world, the folder would be returned and a rename request would rename references to the package, the directory and update the setup in the Package.swift file. But that's probably out-of-scope for SourceKit LSP.
I originally noticed this with a cloned https://github.com/swiftlang/swift-subprocess, but created a small example to reproduce the problem.
Thank you for your hard work!
Steps to Reproduce
- Clone https://github.com/jansorg/sourcekit-lsp-bug-demo
- Open
Tests/swift_sourcekit_demoTests/swift_sourcekit_demoTests.swift
- Ctrl+Click on package reference (
swift_sourcekit_demo, line 5)
Now VSCode (via SourceKit LSP) opens a .swiftinterface. Depending on previous work, it's either empty or not.
In my tests it was usually empty
Logging
No response
Swift version
Swift version 6.5-dev (LLVM 18d2bfb70c14d89, Swift c13d82e5987aecb)
Platform
Linux
Editor
Visual Studio Code, latest Swift plugin version
Description
Navigating via
textDocument/definitionon a reference to a package of the local workspace opens a.swiftinterfacerepresentation of that package.IMHO, instead, it should either reference the source folder of the package or reject the request.
I have not researched if a folder is a valid response to
textDocument/definition.In an ideal world, the folder would be returned and a rename request would rename references to the package, the directory and update the setup in the Package.swift file. But that's probably out-of-scope for SourceKit LSP.
I originally noticed this with a cloned https://github.com/swiftlang/swift-subprocess, but created a small example to reproduce the problem.
Thank you for your hard work!
Steps to Reproduce
Tests/swift_sourcekit_demoTests/swift_sourcekit_demoTests.swiftswift_sourcekit_demo, line 5)Now VSCode (via SourceKit LSP) opens a .swiftinterface. Depending on previous work, it's either empty or not.
In my tests it was usually empty
Logging
No response