emacs-lsp/lsp-sourcekit

"could not open compilation database for /path/to/Foo.swift"

dabrahams opened this issue · 2 comments

I can only get lsp-sourcekit to give me the following in *Messages* buffer:

could not find manifest, or not a SwiftPM package: /path/to/current/directory
could not open compilation database for /path/to/current/directory/Foo.swift [3 times]

Do I need to have a SwiftPM package for my project in order to do anything?

Yes, for now sourcekit-lsp requires a Swift PM package that provides the necessary compile flags. The second warning can be ignored for Swift projects. It only applies to projects that provide compilation flags using a compilation database (https://clang.llvm.org/docs/JSONCompilationDatabase.html).

I'm trying to get this working with Xcode 11.4 and I'm seeing the same errors. Is it still the case that lsp-sourcekit only works for projects that have a Swift PM package? If so, perhaps the quickstart guide should indicate that.

I do seem to have things working in a sample project (SourceKittenDaemon actually) that has a PM package. Hoping to get this working for an existing iOS project for which this is not the case. Looks promising so far, thank you!