emacs-lsp / lsp-sourcekit

lsp-mode :heart: Apple's sourcekit
https://emacs-lsp.github.io/lsp-sourcekit
GNU General Public License v3.0
103 stars 13 forks source link

lisp-sourcekit doesn't support LSP server of Xcode 11.4 #7

Closed webcpu closed 4 years ago

webcpu commented 4 years ago

Xcode 11.4 supports LSP server, however lsp-sourcekit doesn't support LSP server of Xcode 11.4. I have tried Sublime Text, it works like a charm. So I think it could be a bug of lsp-sourcekit.

danielmartin commented 4 years ago

I've updated the setup instructions for Xcode 11.4+ (https://github.com/emacs-lsp/lsp-sourcekit/blob/master/README.md). The fact that the language server is included with Xcode makes the process a bit simpler. Could you try configuring the extension again? If it fails, I'd need some more detail: Sample project you tried, what's happening exactly, etc.

webcpu commented 4 years ago

Thanks a lot! I have changed the configuration according to the latest README, it works like a charm. I have found the problem. I shouldn't use expand-file-name, I should use the path of sourcekit-lsp directly.

(use-package lsp-sourcekit
  :after lsp-mode
  :config
  (setenv "SOURCEKIT_TOOLCHAIN_PATH" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain")
  (setq lsp-sourcekit-executable (expand-file-name "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/sourcekit-lsp")))