Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background indexing doesn't index packages in edit mode #1877

Open
adam-fowler opened this issue Dec 8, 2024 · 5 comments
Open

Background indexing doesn't index packages in edit mode #1877

adam-fowler opened this issue Dec 8, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@adam-fowler
Copy link
Contributor

Swift version

Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)

Platform

macOS 15

Editor

VS Code

Description

If I open a swift package and set one of its dependencies to be in edit mode the background indexing ignores this and still tries to index the project as if it is using the version of the dependency in .index-build.

Steps to Reproduce

  • Open package with dependencies in VSCode
  • Clone one of its dependencies in a separate folder
  • Right click on dependency in package dependencies view, select "Use Local Version" and select your local clone of that dependency. This is the equivalent of running `swift package edit -path
  • In main package right click on symbol from dependency and jump to definition
  • Note you jump to version in .index-build and not the local version

This is most likely caused by the fact that the package edit commands edit the workspace-state.json file and these changes are not propagated to the .index-build folder.

Logging

No response

@adam-fowler adam-fowler added the bug Something isn't working label Dec 8, 2024
@ahoppen
Copy link
Member

ahoppen commented Dec 8, 2024

Synced to Apple’s issue tracker as rdar://141113619

@adam-fowler
Copy link
Contributor Author

@ahoppen what are the chances this will get fixed for 6.1? This really breaks editing packages in VSCode

@ahoppen
Copy link
Member

ahoppen commented Jan 16, 2025

The fix for this would require a major architectural redesign of how SourceKit-LSP interacts with SwiftPM’s workspace state and integrates with SwiftPM’s build folder. It’s out-of-scope for 6.1.

@adam-fowler
Copy link
Contributor Author

Ok is there going to be a way to disable background indexing because editing packages just doesn't work with it.

@ahoppen
Copy link
Member

ahoppen commented Jan 17, 2025

Yes, you can disable it via the SourceKit-LSP Configuration file and there’s also a setting in VS Code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants