Skip to content

Wrong SDK updated when Select Target Platform is used #1335

@rbenegal

Description

@rbenegal

Describe the bug
Support for Swift SDKs was added in #1191 however it seems like the wrong SDK may be updated.

To Reproduce
Steps to reproduce the behaviour:

  1. Create a new Library project with >Swift: Create new project such as MyLibrary
  2. Put some code in MyLibrary.swift such as:
import SwiftUI

public struct MyLibraryView: View {
  public init() {}  // Add an initializer if needed

    public var body: some View {
    VStack {
        Text("Hello")
    }
  }
}
  1. Use Select Target Platform to switch to iOS
  2. Reload Extensions using the prompt popup
  3. Try to use code completion by changing Text("Hello") to something like
Text("Hello").frame(width: 100, height: 100, alignment: .center)

Code will not work, as it seems like the wrong SDK is being updated:

Image

Also, it would be good to reduce to just one SDK setting to avoid confusion in the future.

.Expected behavior
Code completion should work correctly.

Environment

  • OS: macOS 15.1
  • Swift version (output of swift --version)
  • swift-driver version: 1.116.1 Apple Swift version 6.1 (swiftlang-6.1.0.101.37 clang-1700.0.4.30)
    Target: arm64-apple-macosx15.0
  • Visual Studio Code version: 1.96.4
  • vscode-swift version: 2.0.0

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions