Skip to content
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

Support opening documents within the same workspace with sourcekitd/clangd from different toolchains #1934

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jan 18, 2025

rdar://142909783

/// Otherwise, return `nil`.
package func toolchain(withCompiler compiler: URL) -> Toolchain? {
for toolchain in toolchains {
if [toolchain.clang, toolchain.swift, toolchain.swiftc].contains(compiler) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Depending on how often this is called, we could instead store a mapping of compiler URL -> toolchain in the registry?

Copy link
Member Author

@ahoppen ahoppen Jan 24, 2025

Choose a reason for hiding this comment

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

Good call. Turns out we can do a bit more clean-up in the ToolchainRegistry initializer. I’ve opened #1953 for that.

@ahoppen
Copy link
Member Author

ahoppen commented Jan 24, 2025

@swift-ci Please test

…langd from different toolchains

rdar://142909783
@ahoppen ahoppen force-pushed the multi-toolchain-support branch from b109ba4 to 98b1294 Compare January 25, 2025 06:32
@ahoppen
Copy link
Member Author

ahoppen commented Jan 25, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Jan 25, 2025

@swift-ci Please test Windows

@ahoppen ahoppen merged commit ed098f5 into swiftlang:main Jan 25, 2025
3 checks passed
@ahoppen ahoppen deleted the multi-toolchain-support branch January 25, 2025 16:52
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