Skip to content

Don't wait for build graph generation when file is changed #2051

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
merged 1 commit into from
Mar 26, 2025

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 11, 2025

Since we re-index source files if the build server sends us a buildTarget/didChange notification, we no longer need to wait for an up-to-date build graph when a file is modified. This resolves an issue that causes a Scheduling tasks progress to appear in the status bar whenever a file in the project is changed. Before #1973, this happened fairly frequently during the initial indexing when a header file was written into the build directory. After that PR the Scheduling Indexing status appears a lot more frequently, namely every time the index’s database is modified, which happens quite all the time during indexing...

ahoppen added a commit to ahoppen/sourcekit-lsp that referenced this pull request Mar 11, 2025
… currently happening

- **Issue**: Since swiftlang#1973, we are watching for all changes in SourceKit-LSP. This means that we get notified every time the index database is changed. Each of these modifications triggers a new task that waits for build system updates to determine if the modified file needs to be re-indexed. While this task finishes very quickly, it still causes `Scheduling indexing` to replace the `Indexing x / y` in the index status during initial indexing, which looks very noisy.
- **Explanation**: To avoid this flickering, only show `Scheduling indexing` in the index status if we aren’t already indexing any files
- **Scope**: Index progress status
- **Original PR**: This is a significantly reduced version of swiftlang#2051
- **Risk**: Low, this only changes the precedence of status messages in the indexing status
- **Testing**: Manually verified that we don’t see `Scheduling indexing` appear during initial indexing of a package
- **Reviewer**: @bnbarham
@ahoppen
Copy link
Member Author

ahoppen commented Mar 11, 2025

@swift-ci Please test

@ahoppen ahoppen force-pushed the build-graph-generation branch from b36580f to bade2b7 Compare March 11, 2025 16:23
@ahoppen
Copy link
Member Author

ahoppen commented Mar 11, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Mar 11, 2025

@swift-ci Please test Windows

4 similar comments
@ahoppen
Copy link
Member Author

ahoppen commented Mar 12, 2025

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Mar 13, 2025

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Mar 18, 2025

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Mar 18, 2025

@swift-ci Please test Windows

Since we re-index source files if the build server sends us a `buildTarget/didChange` notification, we no longer need to wait for an up-to-date build graph when a file is modified. This resolves an issue that causes a `Scheduling tasks` progress to appear in the status bar whenever a file in the project is changed. Before swiftlang#1973, this happened fairly frequently during the initial indexing when a header file was written into the build directory. After that PR the `Scheduling Indexing` status appears a lot more frequently, namely every time the index’s database is modified, which happens quite all the time during indexing...
@ahoppen ahoppen force-pushed the build-graph-generation branch from bade2b7 to dcad3f4 Compare March 18, 2025 21:09
@ahoppen
Copy link
Member Author

ahoppen commented Mar 18, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Mar 18, 2025

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Mar 26, 2025

@swift-ci Please test Windows

@ahoppen ahoppen merged commit e474354 into swiftlang:main Mar 26, 2025
3 checks passed
@ahoppen ahoppen deleted the build-graph-generation branch March 26, 2025 21:40
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