Closed slippycheeze closed 3 years ago
Thanks for your contribution!
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)
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:
lsp-dependency
to specify the executable, andxcrun --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.