Description
Swift version
main-snapshot-2025-04-12
Platform
MacOS 15.0.1
Editor
Helix 25.01.1
Description
Hello!
I have been trying to get sourcekit-lsp to work properly with Helix for a few days, but I haven't been able to crack it. My main use case is embedded Swift with ESP-IDF. There are two scenarios:
- No workspace folder in initialize request -> LSP mostly works, but does not pick up on C/C++ imports from BridgingHeader.h despite having
compile_commmands.json
- Workspace folder in initialize request -> LSP fails to start at all, getting this error:
2025-04-30T17:58:16.883 helix_lsp::transport [ERROR] sourcekit-lsp <- ServerError(-32001): sourcekitd request failed: error response (Request Failed): Loading the standard library failed
Note that the first scenario is possible because Helix won't consider an open folder a workspace unless it has a .git
or .helix
directory in it.
Seems that the VSCode extension works perfectly, but I wasn't able to find anything that stuck out while comparing the LSP messages to/from Helix vs VSCode.
Any guidance would be greatly appreciated! If this seems to be more of a Helix issue, I'd be happy to make an issue on their side and link here in case anyone else runs into this. I'm pretty new to Swift as well, so this may also simply be a skill issue.
Steps to Reproduce
The project I'm working on is here. It's a copy of swift-matter-examples/empty-template with minimal changes. I did add <driver/gpio.h>
along with some others to BridgingHeader.h
, which is needed for the gpio_num_t
type in main/LightbarController.swift
. I did also add set(CMAKE_EXPORT_COMPILE_COMMANDS, ON)
to the root CMakeLists.txt as a sanity check.