Skip to content

Miscellaneous commits in preparation for background indexing #1214

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 15 commits into from
May 5, 2024

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented May 2, 2024

A collection of unrelated commits that background indexing and preparation will build upon (and a few unrelated cleanup commits).

Best reviewed commit by commit.

@ahoppen ahoppen requested a review from bnbarham May 2, 2024 15:39
@ahoppen ahoppen requested a review from benlangmuir as a code owner May 2, 2024 15:39
@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test

@ahoppen ahoppen force-pushed the background-index-preparation branch from 9bdc440 to 4791ea7 Compare May 2, 2024 18:38
@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the background-index-preparation branch from 4791ea7 to f27e4b4 Compare May 2, 2024 20:47
@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the background-index-preparation branch from f27e4b4 to c18634a Compare May 2, 2024 21:47
@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test

@ahoppen ahoppen force-pushed the background-index-preparation branch from c18634a to 1a64da0 Compare May 2, 2024 21:47
@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 2, 2024

@swift-ci Please test Windows

@@ -20,6 +20,8 @@ public enum TaskDependencyAction<TaskDescription: TaskDescriptionProtocol> {
case cancelAndRescheduleDependency(TaskDescription)
}

private let taskSchedulerSubsystem = "org.swift.sourcekit-lsp.task-scheduler"
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't we just have a separate logger?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just preferred to stick to the withLoggingSubsystem, which we’ll also use for indexing (indexing will be in a different subsystem) instead of having two different notions of how to create loggers for subsystems.

And logging needs to store the subsystem in a task local variable because otherwise all log messages from SwiftPMBuildSystem that were called from the indexer would end up in the org.swift.sourcekit-lsp subsystem instead of org.swift.sourcekit-lsp.indexing.

ahoppen added 13 commits May 3, 2024 14:48
This way we’ll be able to use it from the semantic indexer.
This will allow us to conditionally enable background indexing in tests
This allows us to enable background indexing for a workspace based on a value in `SourceKitLSPServer.Options`.
…erver` to `BuildSystemManager`

This allows us to determine the toolchain to use during background indexing. It also moves toolchain selection closer to the build system, which is good because when we support multiple toolchains for a single workspace, the build system is what decides which toolchain to use for which document.
The build system has potentially  more information about a document's language than we do based on the file’s extension.
This allows us to get rid of the lock.
@ahoppen ahoppen force-pushed the background-index-preparation branch from 1a64da0 to 28d0dd3 Compare May 3, 2024 21:48
@ahoppen
Copy link
Member Author

ahoppen commented May 3, 2024

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented May 4, 2024

@swift-ci Please test Windows

@ahoppen ahoppen merged commit e71aa5d into swiftlang:main May 5, 2024
3 checks passed
@ahoppen ahoppen deleted the background-index-preparation branch May 5, 2024 21:26
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