Skip to content

Merge main into release/6.0 #1341

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 36 commits into from
May 24, 2024

Conversation

ahoppen and others added 30 commits May 21, 2024 18:05
…task hasn't been started yet and the document is no longer active

When the user opens documents from three targets A, B, and C in quick succession, then we don’t want to schedule preparation of wait until A *and* B are finished preparing before preparing C.

Instead, we want to
- Finish for preparation of A to finish if it has already started by the time the file in C is opened. This is done so we always make progress during preparation and don’t get into a scenario where preparation is always cancelled if a user switches between two targets more quickly than it takes to prepare those targets.
- Not prepare B because it is no longer relevant and we haven’t started any progress here. Essentially, we pretend that the hop to B never happened.
…-for-editor

Cancel preparation tasks for editor functionality if the preparation task hasn't been started yet and the document is no longer active
Fix issue that caused topological order to be incorrect
…ets being prepared in the work done progress
This allows a user of SourceKit-LSP to inspect the result of background indexing. This allows a user of SourceKit-LSP to inspect the result of background indexing. I think this gives useful insights into what SourceKit-LSP is indexing and why/how it fails, if it fails, also for users of SourceKit-LSP.

rdar://127474136
Fixes swiftlang#1265
This allows us to run `sourcekit-lsp index --project /path/to/project` to index a project. Intended to debugging purposes, eg.
- Profile the time it takes to index a project
- See if the project can be indexed successfully
- Look at signposts generated during indexing in Instruments to see whether indexing or preparation is the bottleneck and how well we can parallelize tasks.
…-scheduler-test

Fix a non-deterministic test failure of `testTaskSuspension`
Produce an index log for the client
Add a development subcommand to index a project
This allows nice visualization of the indexing progress in Instruments.
We were calling `TaskScheduler.schedule` inside a `Task` in `TaskSchedulerTests`. This means that Swift concurrency could re-order the execution of those tasks and thus change the order in which tasks were enqueued to the `TaskScheduler`.

Caused by e295a4e#diff-6a451b3244d65ded9386e2816360b7b1debbe6a519e3795d2046c7dbefa7a7d7R351
When the client replies with an error to the `CreateWorkDoneProgressRequest`, we shouldn’t be sending updates for it.
Fix a non-deterministic test failure in the task scheduler
…-creates-two-workdoneprogress

Fix a race condition that caused `IndexProgressManager` to create two `WorkDoneProgress`
Add signposts for background preparation and indexing
…uest`

Since `handleNextRequest` handling doesn’t have to be in the order that the request handlers were specified anymore, the naming was misleading.
…Dependency`

We could get a `DiagnosticsRefreshRequest` before the modified target had been re-prepared.
…ne-progress-creation

Respect failed work done progress creation
Disable `testTasksWithElevatedPrioritiesGetExecutedFirst`
…oneProgress`

We didn’t take into account that there are also work done progress notifications for package reloading. Only listen for
…-test-failure

Fix a non-deterministic failure of `testBackgroundIndexingStatusWorkDoneProgress`
ahoppen and others added 6 commits May 23, 2024 13:41
In SourceKit-LSP, we can get into the following situation:
1. We open A.swift
2. We issue a request for A.swift, the request takes a while to execute
3. The dependencies of A.swift are updated, which causes us to reopen the document in sourcekitd, so that the AST is rebuilt
4. This shouldn’t cause the request from (2) to be cancelled. We should continue executing it and only re-open the document after the request from (2) has finished

rdar://127475366
@ahoppen ahoppen requested a review from bnbarham May 24, 2024 04:15
@ahoppen ahoppen requested a review from benlangmuir as a code owner May 24, 2024 04:15
@ahoppen
Copy link
Member Author

ahoppen commented May 24, 2024

@swift-ci Please test

@ahoppen ahoppen merged commit d5993b6 into swiftlang:release/6.0 May 24, 2024
3 checks passed
@ahoppen ahoppen deleted the 6.0/merge-main-2024-05-23 branch May 24, 2024 17:12
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.

4 participants