-
Notifications
You must be signed in to change notification settings - Fork 314
Merge main
into release/6.0
#1324
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
ahoppen
merged 59 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-05-21
May 22, 2024
Merged
Merge main
into release/6.0
#1324
ahoppen
merged 59 commits into
swiftlang:release/6.0
from
ahoppen:6.0/merge-main-2024-05-21
May 22, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Swift-Next syntax highlight added
…-mode Make tests build in Swift 6 mode
Fixes swiftlang#1251 rdar://127476161
Update Editors/README.md
Update index as files are modified on disk
Address review comment to swiftlang#1216
When a header is modified, we don’t we want to re-index all main files that include it. Instead, we just want to index one main to effectively re-index the header itself. I originally implemented re-indexing of all files that include the header but on second thought, headers are like Swift modules, where we also don’t re-index all dependencies either. And if you change a low-level header that’s included by the entire project, you probably don’t want the indexer to go off and re-index the entire project.
…-files Don’t re-index all files that include a header when a header is modified
…hat are known to be up-to-date Fixes swiftlang#1258 rdar://127475948
Whenever we get request for a document, open it or edit it, trigger a preparation of its target, but don’t block any interaction based on it. This should ensure that the target is usually prepared when the user is interacting with it. We need to track the preparation status of targets somewhat accurately in `SemanticIndexManager`, so we don’t unnecessarily re-prepare a target. When updating the index store, it is acceptable to schedule another `UpdateIndexStoreTaskDescription` because it will early exit based on an `mtime` check with the unit file. Null builds of a target take significantly longer and thus we want to avoid them. Fixes swiftlang#1252 rdar://127474003
…gets When interacting with a document, prepare the target it belongs to
The existing ad-hoc logic was not quite correct because it didn’t eg. remove `-MT/depfile` because it assumed that `-MT` was followed by a space. It also didn’t take into account that `serialize-diagnostics` can be spelled with a single dash or two dashes. Create a `CompilerCommandLineOption` type that forces decisions to be made about the dash spelling and argument styles, which should help avoid problems like this in the future.
Address review comments to swiftlang#1249
Add code actions for adding library/executable/macro targets to a package manifest
Don't re-prepare a target if there is already a smaller preparation task for it scheduled
Essentially fix two issues in updating the index store: 1. If there was one task to index `HeaderA.h` through `main.c` and one to index `HeaderB.h` through `main.c`, we would not declare a dependency between them in the task scheduler, which meant that we could have two concurrent and racing index tasks for `main.c`. Declare a dependency between any two files that have the same main file 2. `UpdateIndexStoreTaskDescription` was computing the target to index a file in independently of `SemanticIndexManager`. While they currently always line up, we should pass the target in which to index a file to the `UpdateIndexStoreTaskDescription`. Only this way can we guarantee that we actually prepared the target that the file will be indexed in.
The logging from `TaskScheduler` was really verbose (and somewhat useful during its development) but it turns out that it’s just noise in real-world debugging. So, let’s remove it.
…TestHooks` struct
… index tasks finish
…ogging Remove status logging from `TaskScheduler`
…ilure Fix non-deterministic test failure in `BackgroundIndexingTests.testPrepareTarget`
Move `LocalConnection` to `LSPTestSupport`
Address review comments to swiftlang#1302
Generalize the removal of compiler argument options during indexing
…rgets-as-out-of-date When a file is changed, only mark targets that depend on it as out-of-date
Address review comments to swiftlang#1306
We were mixing the up-to-date status and in-progress status of an index task in `SemanticIndexManager`. This meant that a single `QueuedTask` in the task scheduler could be needed for eg. both preparation for editor functionality in a file of that target and to re-index a file in that target. This dual ownership made it unclear, which caller would be entitled to cancel the task. Furthermore, we needed to duplicate some logic from the preparation task dependencies in `SemanticIndexManager.prepare`. To simplify things: - Split the up-to-date status and the in-progress status into two different data structures - Make the caller of `prepare` and `scheduleIndex` responsible for cancellation of the task it has scheduled. `TaskScheduler` might receive more scheduled tasks this way but the additional tasks should all be no-ops because the status is known to be up-to-date when they execute.
…ess-tracking Split up-to-date status tracking and index progress tracking
# Conflicts: # Sources/SKSwiftPMWorkspace/SwiftPMBuildSystem.swift
@swift-ci Please test |
bnbarham
approved these changes
May 21, 2024
@swift-ci Please test Windows |
1 similar comment
@swift-ci Please test Windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Merge the following PRs into
release/6.0
IfConfigClauseSyntax
#1287TaskScheduler
#1319BackgroundIndexingTests.testPrepareTarget
#1317LocalConnection
toLSPTestSupport
#1318