I'm exploring swift-embedded-examples and would like to have LSP features in VS Code.
When I open Application.swift
file in stm32-uart-echo
example project Swift extension features like code completion and jump to definition do not work. As I understand this features depend on sourcekit-lsp
and I can see the errors in OUTPUT
view in VS Code for SourceKit Language Server
[Error - 11:15:04] Request textDocument/hover failed.
Message: sourcekitd request failed: error response (Request Failed): Loading the standard library failed
Code: -32001
As far I as understand Embedded Swift does not include standard library, so this error might be expected.
I have toolchain path configured.
Here's my settings.json
for VS Code
{
"swift.swiftEnvironmentVariables": {
"DEVELOPER_DIR": "/Applications/Xcode.app"
},
"swift.path": "/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-08-05-a.xctoolchain/usr/bin",
"lldb.library": "/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-08-05-a.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/LLDB",
"lldb.launch.expressions": "native"
}
Do I need to pass a configuration parameter to SourceKit-LSP for it to not try to load standard library ?