mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 19:40:24 +10:00
Moving to Doom Emacs!
This commit is contained in:
34
.emacs.d/modules/lang/swift/config.el
Normal file
34
.emacs.d/modules/lang/swift/config.el
Normal file
@@ -0,0 +1,34 @@
|
||||
;;; lang/swift/config.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! swift-mode
|
||||
(set-repl-handler! 'swift-mode #'run-swift))
|
||||
|
||||
|
||||
(use-package! flycheck-swift
|
||||
:when (featurep! :tools flycheck)
|
||||
:unless (featurep! +lsp)
|
||||
:after swift-mode
|
||||
:config (flycheck-swift-setup))
|
||||
|
||||
|
||||
(use-package! company-sourcekit
|
||||
:when (featurep! :completion company)
|
||||
:unless (featurep! +lsp)
|
||||
: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-local-vars-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"))))
|
||||
11
.emacs.d/modules/lang/swift/packages.el
Normal file
11
.emacs.d/modules/lang/swift/packages.el
Normal file
@@ -0,0 +1,11 @@
|
||||
;; -*- no-byte-compile: t; -*-
|
||||
;;; lang/swift/packages.el
|
||||
|
||||
(package! swift-mode)
|
||||
|
||||
(if (featurep! +lsp)
|
||||
(package! lsp-sourcekit)
|
||||
(when (featurep! :completion company)
|
||||
(package! company-sourcekit))
|
||||
(when (featurep! :tools flycheck)
|
||||
(package! flycheck-swift)))
|
||||
Reference in New Issue
Block a user