Skip to content

Support indexing a file in the context of multiple targets #2038

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 7 commits into from
Mar 18, 2025

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Mar 6, 2025

If a source file is part of multiple targets, we should index it in the context of all of those targets because the different targets may produce different USRs since they might use different build settings to interpret the file.

This also requires us to have a mapping from source file to output file, which is why I made the output path a property on the buildTarget/sources BSP request instead of having a standalone request that returns all output paths for a target.

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the multi-target-support branch from ba1d435 to 2aa53d4 Compare March 7, 2025 19:49
@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the multi-target-support branch from 2aa53d4 to 4a6ea29 Compare March 7, 2025 21:53
@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

2 similar comments
@ahoppen
Copy link
Member Author

ahoppen commented Mar 7, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Mar 8, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the multi-target-support branch from 4a6ea29 to b3b65a2 Compare March 8, 2025 08:05
@ahoppen
Copy link
Member Author

ahoppen commented Mar 8, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 8, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

@ahoppen
Copy link
Member Author

ahoppen commented Mar 8, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test macOS

ahoppen added 6 commits March 14, 2025 15:12
…f a separate request

We need a mapping from source file to its output path in order to support source files that are part of multiple targets (because we need the output path to check if we have an up-to-date unit for a file in a given target). To achieve this mapping, it’s easier to tag the output path for each source file onto the `buildTarget/sources` request.
If a source file is part of multiple targets, we should index it in the context of all of those targets because the different targets may produce different USRs since they might use different build settings to interpret the file.
@ahoppen ahoppen force-pushed the multi-target-support branch from b3b65a2 to 88b40f3 Compare March 14, 2025 22:50
@ahoppen
Copy link
Member Author

ahoppen commented Mar 14, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Mar 14, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 18, 2025

@ahoppen
Copy link
Member Author

ahoppen commented Mar 18, 2025

swiftlang/swift-package-manager#8332

@swift-ci Please test Windows

@ahoppen ahoppen merged commit cef212f into swiftlang:main Mar 18, 2025
3 checks passed
ahoppen added a commit to swiftlang/swift-package-manager that referenced this pull request Mar 18, 2025
… a `BuildDescription` (#8332)

We need the mapping from source file to output file in SourceKit-LSP, so
the old approach of returning all output paths in a separate property
does not work. Return them in a single property instead.

This will be used in SourceKit-LSP by
swiftlang/sourcekit-lsp#2038.
@ahoppen ahoppen deleted the multi-target-support branch March 18, 2025 20:56
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