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

Configuration Help #5

Closed rudedogg closed 5 years ago

rudedogg commented 5 years ago

I'm trying to configure doom-emacs (develop branch of https://github.com/hlissner/doom-emacs) and lsp-sourcekit, but can't seem to get it working. Here's what I have in my config.el:

(after! lsp-sourcekit
  :config
  (setenv "SOURCEKIT_TOOLCHAIN_PATH" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain")
  (setq lsp-sourcekit-executable "/Users/rudedogg/Desktop/Contrib/sourcekit-lsp/.build/debug/sourcekit-lsp"))

But when I try to enable lsp, I get LSP :: No LSP server for swift-mode.. I think the toolchain/sourcekit-lsp is working with Sublime Text 3 and VS Code, but can't seem to get it going with emacs.

I know this is probably a config issue on my end, and understand if it's out of scope. If so feel free to close.

yyoncho commented 5 years ago

Take a look at *lsp-log* buffer it should provide some more info.

rudedogg commented 5 years ago

@yyoncho Thanks, I actually don't get a lsp-log buffer. When I try M-x lsp in doom-emacs I get "No lsp server for swift-mode".

To debug I moved my doom-emacs config (~/.emacs.d) and started with a plain emacs config. Adding the melpa, swift-mode, lsp-mode, and lsp-sourcekit packages. Then I added this to my ~/.emacs.d/init.el:

(require 'lsp-sourcekit)
(setenv "SOURCEKIT_TOOLCHAIN_PATH" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain")
(setq lsp-sourcekit-executable "/Users/rudedogg/Desktop/Contrib/sourcekit-lsp/.build/debug/sourcekit-lsp")

Running M-x lsp connects the server and does stuff. I didn't bother installing company and figuring out completions, but the issue definitely seems to be with how I am configuring doom-emacs. So I'll work on figuring that out by asking on their Discord.

fluffybeing commented 4 years ago

Hi @rudedogg I am also facing the same issue for the doom emacs. Have you found the solution?