Skip to content

Conversation

@slippycheeze
Copy link
Contributor

Recent XCode ships with the sourcekit-lsp server, but it is a "developer tool"
and so not on the normal path.

This updates the logic for discovering the executable to:

  1. use a lsp-dependency to specify the executable, and
  2. try xcrun --find if the executable is not on the path.

This makes the platform-supplied server work for me, and
is generally how apple treat these development tools.

Additionally, the server is registered with lsp-mode
automatically, through an autoload, so the package will
just work™ after installation.

Recent XCode ships with the `sourcekit-lsp` server, but it is a "developer tool" and so not on the normal path. This updates the logic for discovering the executable to: 1. use a `lsp-dependency` to specify the executable, and 2. try `xcrun --find` if the executable is not on the path. This makes the platform-supplied server work for me, and is generally how apple treat these development tools. Additionally, the server is registered with `lsp-mode` automatically, through an autoload, so the package will just work™ after installation.
@danielmartin danielmartin merged commit aafa987 into emacs-lsp:master Apr 4, 2021
@danielmartin
Copy link
Collaborator

Thanks for your contribution!

@zzak
Copy link

zzak commented Aug 14, 2021

Hello! @danielmartin @slippycheeze this commit broke my setup so I had to revert it, here is my configuration if that helps:

(add-to-list 'auto-mode-alist '("\\.swift\\'" . swift-mode)) (eval-after-load 'lsp-mode (progn (require 'lsp-sourcekit) (setq lsp-sourcekit-executable "/Library/Developer/CommandLineTools/usr/bin/sourcekit-lsp"))) (defun setup-swift-mode () (interactive) (lsp) (flycheck-mode +1) (flycheck-swift-setup) (setq flycheck-check-syntax-automatically '(save mode-enabled))) (add-hook 'swift-mode-hook #'setup-swift-mode) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants