Skip to content

Add a section to the Enable Experimental Background Indexing document to describe the behavior without background indexing #1611

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

Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 2, 2024

No description provided.

@ahoppen ahoppen requested a review from bnbarham August 2, 2024 17:52
@ahoppen
Copy link
Member Author

ahoppen commented Aug 2, 2024

@swift-ci Please test


Background indexing in SourceKit-LSP is available as an experimental feature. This guide shows how to set up background indexing and which caveats to expect.

## Behavior Without Background Indexing

By default SourceKit-LSP does not update its global index in the background or build Swift modules in the background. Thus, a lot of cross-module or global functionality is limited if the project hasn't been built recently. For example consider two modules: `Lib` and `Exec`, where `Exec` depends on `Lib`: Without background indexing, if a function is added to `Lib`, completion/jump to definition/etc in `Exec` would not be able to see that function until after a build. Background solves that issue.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
By default SourceKit-LSP does not update its global index in the background or build Swift modules in the background. Thus, a lot of cross-module or global functionality is limited if the project hasn't been built recently. For example consider two modules: `Lib` and `Exec`, where `Exec` depends on `Lib`: Without background indexing, if a function is added to `Lib`, completion/jump to definition/etc in `Exec` would not be able to see that function until after a build. Background solves that issue.
By default SourceKit-LSP does not update its global index in the background or build Swift modules in the background. Thus, a lot of cross-module or global functionality is limited if the project hasn't been built recently. For example consider two modules: `Lib` and `Exec`, where `Exec` depends on `Lib`: Without background indexing, if a function is added to `Lib`, completion/jump to definition/etc in `Exec` would not be able to see that function until after a build. Background indexing solves that issue.

…nt to describe the behavior without background indexing
@ahoppen ahoppen force-pushed the behavior-without-background-indexing branch from 7aad471 to 241f8ad Compare August 3, 2024 01:10
@ahoppen
Copy link
Member Author

ahoppen commented Aug 3, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Aug 3, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 0d2a159 into swiftlang:main Aug 5, 2024
3 checks passed
@ahoppen ahoppen deleted the behavior-without-background-indexing branch August 5, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants