-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expose the build triple of a BuildTarget
in SourceKitLSPAPI
#7555
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
Conversation
@@ -23,13 +23,16 @@ import class Build.ClangTargetBuildDescription | |||
import class Build.SwiftTargetBuildDescription | |||
import struct PackageGraph.ResolvedModule | |||
import struct PackageGraph.ModulesGraph | |||
import enum PackageGraph.BuildTriple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaxDesiatov Do you prefer to expose the BuildTriple
type or would you prefer to define an equivalent BuildTriple
type in SourceKitLSPAPI
and then map between the two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now IMO it's best to create public typealias BuildTriple = PackageGraph.BuildTriple
in SourceKitLSPAPI
, which can be replaced with something more advanced later.
1974b4e
to
6b23a47
Compare
@swift-ci Please test |
…tlang#7555) If we have a package like this ```swift let package = Package( name: "MyLibrary", targets: [ .target(name: "Lib"), .executableTarget(name: "MyExec", dependencies: ["Lib"]), .plugin( name: "MyPlugin", capability: .command( intent: .sourceCodeFormatting(), permissions: [] ), dependencies: ["MyExec"] ) ] ) ``` Then the package graph contains two targets for `Lib`. We need to be able to differentiate them in SourceKit-LSP. For that, we need to expose the build triple of a `BuildTarget`.
- **Explanation**: Adds a couple of APIs to the `SourceKitLSPAPI` module that are needed for background indexing in SourceKit-LSP - **Scope**: Purely additive API - **Risk**: Very low, just adds new API - **Testing**: n/a - **Issue**: n/a - **Reviewer**: @MaxDesiatov and @bnbarham on #7540 #7555 respectively
…tlang#7555) If we have a package like this ```swift let package = Package( name: "MyLibrary", targets: [ .target(name: "Lib"), .executableTarget(name: "MyExec", dependencies: ["Lib"]), .plugin( name: "MyPlugin", capability: .command( intent: .sourceCodeFormatting(), permissions: [] ), dependencies: ["MyExec"] ) ] ) ``` Then the package graph contains two targets for `Lib`. We need to be able to differentiate them in SourceKit-LSP. For that, we need to expose the build triple of a `BuildTarget`.
If we have a package like this
Then the package graph contains two targets for
Lib
. We need to be able to differentiate them in SourceKit-LSP. For that, we need to expose the build triple of aBuildTarget
.