Hey there!
I hope this is in the right forum, if not please move it.
I am trying to use VSCode (or specifically, windsurf) to code for iOS.
As such I have downloaded Swift 2.2.0 .vix and other tools (SweetPad) to help with development. In order to get the symbols working they use sourcekit-lsp, and I am having trouble getting it to load the iOS SDKs!
As I am new to this I've been sitting with it for a day trying to figure it out and have asked ChatGPT for assistance, but no luck! I am pasting everything I tried below.
I am stumped on how to progress xD Any help appreciated.
1 Project & baseline
- Xcode 16 / Swift 6.1 on Apple Silicon
- Dummy
Package.swift
at repo root (platforms: [.iOS(.v17), .macOS(.v10_15)]
)- Builds fine with Supabase dependency.
- Hand build succeeds when flags are supplied:
SDK=$(xcrun --sdk iphonesimulator --show-sdk-path)
TRIPLE=arm64-apple-ios18.4-simulator
swift build \
-Xswiftc -sdk "$SDK" -Xswiftc -target "$TRIPLE" \
-Xcc -isysroot "$SDK" -Xcc -target "$TRIPLE"
→ 0 errors.
2 Goal
Get VS Code (v2.2.0 Swift extension installed from .vsix) to recognise iOS-only
SwiftUI modifiers (.textInputAutocapitalization
, .keyboardType
) instead of
flagging them as “no member”.
3 What I tried inside VS Code
Attempt | What we did | Result |
---|---|---|
a | Added the four flag pairs to swift.sourcekit-lsp.serverArguments and swift.buildArguments |
Flags appear in settings.txt but do not appear in OUTPUT in VSCode → server still launches with macOS SDK |
b | Used Swift → Select Toolchain and Swift → Select Target Platform (iOS Simulator 18.4) | swift.swiftSDK shows arm64-apple-ios , but launch line still macOS |
c | Workspace reset / language-server restart / re-index | No change |
d | Captured minimal diagnostics – always reports Default SDK: …MacOSX15.4.sdk / Default Target: arm64-apple-macosx15.0 |
|
e | Wrote .sourcekit-lsp/config.json next to Package.swift :json<br>{ "sdk": "/…/iPhoneSimulator18.4.sdk",<br> "target": "arm64-apple-ios18.4-simulator" } Restarted server |
Launch line in OUTPUT still shows macOS; SourceKit-LSP apparently not reading the file |
f | Ran xcrun sourcekit-lsp (no args) from repo root |
Process waits silently (expected), so can’t confirm which SDK it picked |
4 Current symptoms
- VS Code red-squiggle diagnostics
- “Value of type ‘some View’ has no member ‘textInputAutocapitalization’”
- “Cannot infer contextual base … ‘never’ / ‘emailAddress’”
- “No such module ‘PackageDescription’” on
Package.swift
- OUTPUT ▸ Swift Language Server first line (after restart) always shows
/Applications/.../sourcekit-lsp -module-cache-path ...
-sdk /Applications/.../MacOSX15.4.sdk
-target arm64-apple-macosx15.0
→ iOS flags never applied.
.sourcekit-lsp/config.json
exists and is valid JSON, but seems ignored.
5 What does work
- Xcode resolves the symbols.
- Command-line
swift build
resolves everything when the same four
-sdk/-target pairs (and their -Xcc twins) are supplied.
Key open questions for maintainers
- Why are
serverArguments
/buildArguments
silently ignored in extension v2.2.0? - Does SourceKit-LSP still auto-discover
.sourcekit-lsp/config.json
in Swift 6.1?
If so, where should it live relative to multi-package workspaces? - Is there a recommended flag or env-var to print the active SDK & target on launch so I can confirm which path the server finally uses?
(Full minimal-diagnostics output attached below.)
extension-logs.txt
07:52:25: Activating Swift for Visual Studio Code...
07:52:25: Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Platform: darwin
Swift Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Toolchain Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr
Runtime Library Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx:/usr/lib/swift
Default Target: arm64-apple-macosx15.0
Default SDK: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk
XCTest Path: /Applications/Xcode.app/Contents/Developer/usr/bin
07:52:25: SourceKit-LSP setup
07:52:26: iOSApp: add: /Users/ca_ai/Desktop/Projects/3.Swift_Unity_ExerciseGames/iOSApp
07:52:26: iOSApp: Resolving Dependencies: starting ...
07:52:26: Exec Task: (iOSApp) swift package resolve --swift-sdk arm64-apple-ios
07:52:26: iOSApp: focus: /Users/ca_ai/Desktop/Projects/3.Swift_Unity_ExerciseGames/iOSApp
07:52:26: iOSApp: Resolving Dependencies: ... done.
07:52:27: iOSApp: pluginsUpdated: /Users/ca_ai/Desktop/Projects/3.Swift_Unity_ExerciseGames/iOSApp
settings.txt
Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Platform: darwin
Swift Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Toolchain Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr
Runtime Library Path: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx:/usr/lib/swift
Default Target: arm64-apple-macosx15.0
Default SDK: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk
XCTest Path: /Applications/Xcode.app/Contents/Developer/usr/bin
Settings:
{
"path": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin",
"buildArguments": [
"-Xswiftc",
"-sdk",
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
"-Xswiftc",
"-target",
"arm64-apple-ios18.4-simulator",
"-Xcc",
"-isysroot",
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
"-Xcc",
"-target",
"arm64-apple-ios18.4-simulator"
],
"scriptSwiftLanguageVersion": "6",
"packageArguments": [],
"additionalTestArguments": [],
"testEnvironmentVariables": {},
"sanitizer": "off",
"searchSubfoldersForPackages": false,
"autoGenerateLaunchConfigurations": true,
"disableAutoResolve": false,
"diagnosticsCollection": "keepSourceKit",
"diagnosticsStyle": "llvm",
"backgroundCompilation": false,
"actionAfterBuildError": "Focus Terminal",
"buildPath": "",
"disableSwiftPackageManagerIntegration": false,
"warnAboutSymlinkCreation": true,
"enableTerminalEnvironment": true,
"pluginArguments": [],
"pluginPermissions": {},
"attachmentsPath": ".build/attachments",
"excludeFromCodeCoverage": [],
"excludePathsFromPackageDependencies": [
".git",
".github"
],
"showBuildStatus": "swiftStatus",
"showCreateSwiftProjectInWelcomePage": true,
"openAfterCreateNewProject": "prompt",
"sourcekit-lsp": {
"serverPath": "",
"serverArguments": [
"-Xswiftc",
"-sdk",
"-Xswiftc",
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
"-Xswiftc",
"-target",
"-Xswiftc",
"arm64-apple-ios18.4-simulator",
"-Xcc",
"-isysroot",
"-Xcc",
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk",
"-Xcc",
"-target",
"-Xcc",
"arm64-apple-ios18.4-simulator"
],
"supported-languages": [
"swift",
"objective-c",
"objective-cpp",
"c",
"cpp"
],
"backgroundIndexing": "auto",
"trace": {
"server": "verbose"
},
"disable": false
},
"debugger": {
"debugAdapter": "auto",
"path": "",
"setupCodeLLDB": "prompt",
"useDebugAdapterFromToolchain": false
},
"swiftEnvironmentVariables": {
"DEVELOPER_DIR": "/Applications/Xcode.app/Contents/Developer"
},
"runtimePath": "",
"SDK": "",
"swiftSDK": "arm64-apple-ios",
"disableSandox": false,
"diagnostics": {
"exclude": [
"Package.swift"
]
},
"index": {
"store": {
"path": "${workspaceFolder}/.build/Index.noindex/DataStore"
}
}
}