I am trying to make SourceKit-LSP work on Neovim.
sourcekitd can successfully auto-complete the functions from the third party frameworks,
but it fails to find UIKit (no such module 'UIKit').
I have added the platform setting to the package.swift, but sourcekitd still fails to find UIKit.
What is the correct setting for iOS projects?
Are you able to build this package using swift build? When I tried this it gives the same error. @Aciid, does the open source swiftpm (or libSwiftPM) support building for iOS?
If you can configure your editor to launch sourcekit-lsp with extra command line options, you should be able to pass the same -Xswiftc options to sourcekit-lsp. I haven't tried this, but in principle it should work.
If this is a common use-case, we could look at more convenient ways to pass these external flags in so they can be per-project instead of global to the server configuration.
I tried this in Sublime text with the -Xswiftc flags and it worked. I think there must be something wrong in how the command is configured or with the lsp plugin not using those arguments when launching.
True. I think sourcekit-lsp can support iOS projects.
I was trying to make SDE of vscode work on UIKit.
The readme says it will work on UIKit, but it doesn't.
After a little bit of searching, I found SDE doesn't use the arguments from .vscode/settings.json.
Instead, it reads the arguments directly from .build/debug.yaml, which is generated by swift build
If I could apply build arguments for swift build, I can make SDE works on UIKit.