doomemacs/modules/lang/swift/config.el

35 lines
1.1 KiB
EmacsLisp
Raw Normal View History

;;; lang/swift/config.el -*- lexical-binding: t; -*-
(after! swift-mode
(set-repl-handler! 'swift-mode #'run-swift))
2017-02-19 18:57:16 -05:00
(use-package! flycheck-swift
:when (featurep! :tools flycheck)
:unless (featurep! +lsp)
:after swift-mode
:config (flycheck-swift-setup))
2017-02-19 18:57:16 -05:00
(use-package! company-sourcekit
:when (featurep! :completion company)
:unless (featurep! +lsp)
2017-02-19 18:57:16 -05:00
:after swift-mode
:config
(set-company-backend! 'swift-mode '(company-sourcekit company-yasnippet)))
(use-package! lsp-sourcekit
:when (featurep! +lsp)
:after swift-mode
:init (add-hook 'swift-mode-hook #'lsp!)
:config
(unless (getenv "SOURCEKIT_TOOLCHAIN_PATH")
(setenv "SOURCEKIT_TOOLCHAIN_PATH" "/Library/Developer/Toolchains/swift-latest.xctoolchain"))
(setq lsp-sourcekit-executable
(cl-find-if #'executable-find
(list lsp-sourcekit-executable ; 'sourcekit' by default
"sourcekit-lsp"
"/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/sourcekit"
"/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin/sourcekit-lsp"))))