swiftlang / vscode-swift

Visual Studio Code Extension for Swift
https://marketplace.visualstudio.com/items?itemName=sswg.swift-lang
Apache License 2.0
708 stars 47 forks source link

Code autocompletion stop working after specify SDK #810

Open leozhao0709 opened 1 month ago

leozhao0709 commented 1 month ago

Describe the bug As long as I specify the SDK to iOS in settings or use "Select target platform" to select iOS, then code completion is stop working. Seems currently only MacOS SDK is working for me....

To Reproduce Steps to reproduce the behavior:

  1. create a swift package by using xcode. And then create a simple swiftui view:
// Sources/MyLibrary/MyLibrary.swift

import SwiftUI

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

  public var body: some View {
    VStack {
      Text("Hello, iOS!")
        .frame(width: 100, height: 100, alignment: .center)
    }
  }
}
  1. specify the sdk path to simulator sdk or use "Select target platform" to select iOS
  2. All the code completion is stop working
  3. I am not seeing any errors in output

Expected behavior The code completion should always working not matter what sdk are using.

Environment

Additional context NA

adam-fowler commented 1 month ago

Is that code completion for your symbols, or symbols coming from a framework?

leozhao0709 commented 1 month ago

@adam-fowler it's symbols from framework. Like SwiftUI provided View or Text etc.