2017-06-08 11:47:56 +02:00
|
|
|
;;; lang/swift/config.el -*- lexical-binding: t; -*-
|
2016-05-21 18:53:31 -04:00
|
|
|
|
2018-07-15 01:01:56 +02:00
|
|
|
(after! swift-mode
|
|
|
|
(set-repl-handler! 'swift-mode #'run-swift))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2018-05-25 00:46:11 +02:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! flycheck-swift
|
2019-09-13 21:59:03 -04:00
|
|
|
:when (featurep! :tools flycheck)
|
|
|
|
:unless (featurep! +lsp)
|
2018-05-25 00:46:11 +02:00
|
|
|
:after swift-mode
|
|
|
|
:config (flycheck-swift-setup))
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2016-05-21 18:53:31 -04:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! company-sourcekit
|
2019-09-13 21:59:03 -04:00
|
|
|
:when (featurep! :completion company)
|
|
|
|
:unless (featurep! +lsp)
|
2017-02-19 18:57:16 -05:00
|
|
|
:after swift-mode
|
|
|
|
:config
|
2018-06-15 02:58:12 +02:00
|
|
|
(set-company-backend! 'swift-mode '(company-sourcekit company-yasnippet)))
|
2016-05-21 18:53:31 -04:00
|
|
|
|
2019-02-21 16:08:27 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! lsp-sourcekit
|
2019-02-21 16:08:27 -05:00
|
|
|
:when (featurep! +lsp)
|
|
|
|
:after swift-mode
|
2019-11-10 16:45:33 -05:00
|
|
|
:init (add-hook 'swift-mode-local-vars-hook #'lsp!)
|
2019-10-27 12:18:13 -04:00
|
|
|
: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"))))
|