Install swift-ts-mode and swift treesitter grammar
This commit is contained in:
parent
79105e12f7
commit
a115d31f07
3 changed files with 18 additions and 9 deletions
|
|
@ -184,8 +184,9 @@
|
||||||
(add-to-list 'eglot-server-programs
|
(add-to-list 'eglot-server-programs
|
||||||
`(,mode . ("vscode-json-language-server" "--stdio"))
|
`(,mode . ("vscode-json-language-server" "--stdio"))
|
||||||
0))
|
0))
|
||||||
(add-to-list 'eglot-server-programs
|
(dolist (mode '(swift-mode swift-ts-mode))
|
||||||
'(swift-mode . ("xcrun" "sourcekit-lsp"))))
|
(add-to-list 'eglot-server-programs
|
||||||
|
`(,mode . ("xcrun" "sourcekit-lsp")))))
|
||||||
|
|
||||||
(use-package emacs
|
(use-package emacs
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
|
@ -682,6 +683,10 @@
|
||||||
swift-mode:basic-offset 2
|
swift-mode:basic-offset 2
|
||||||
swift-mode:repl-executable "xcrun swift repl"))
|
swift-mode:repl-executable "xcrun swift repl"))
|
||||||
|
|
||||||
|
(use-package swift-ts-mode
|
||||||
|
:custom
|
||||||
|
(swift-ts-mode-indent-offset 2))
|
||||||
|
|
||||||
(use-package tab-bar
|
(use-package tab-bar
|
||||||
:config
|
:config
|
||||||
(tab-bar-mode)
|
(tab-bar-mode)
|
||||||
|
|
@ -706,12 +711,6 @@
|
||||||
:custom
|
:custom
|
||||||
(treesit-auto-install 'prompt)
|
(treesit-auto-install 'prompt)
|
||||||
:config
|
:config
|
||||||
(add-to-list 'treesit-auto-recipe-list
|
|
||||||
(make-treesit-auto-recipe
|
|
||||||
:lang 'swift
|
|
||||||
:ts-mode 'swift-ts-mode
|
|
||||||
:remap '(swift-mode)
|
|
||||||
:ext "\\.swift\\'"))
|
|
||||||
(setq treesit-auto-langs
|
(setq treesit-auto-langs
|
||||||
'(swift
|
'(swift
|
||||||
python
|
python
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1,7 +1,16 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
swiftTreeSitterGrammar = pkgs.tree-sitter-grammars.tree-sitter-swift;
|
||||||
|
swiftTreeSitterLibraryName =
|
||||||
|
if pkgs.stdenv.hostPlatform.isDarwin then
|
||||||
|
"libtree-sitter-swift.dylib"
|
||||||
|
else
|
||||||
|
"libtree-sitter-swift.so";
|
||||||
|
in
|
||||||
{
|
{
|
||||||
home.file.".emacs.d/early-init.el".source = ./config/early-init.el;
|
home.file.".emacs.d/early-init.el".source = ./config/early-init.el;
|
||||||
home.file.".emacs.d/tree-sitter/libtree-sitter-swift.dylib".source = ./config/tree-sitter/libtree-sitter-swift.dylib;
|
home.file.".emacs.d/tree-sitter/${swiftTreeSitterLibraryName}".source =
|
||||||
|
"${swiftTreeSitterGrammar}/parser";
|
||||||
home.file.".emacs.d/snippets".source = ./config/snippets;
|
home.file.".emacs.d/snippets".source = ./config/snippets;
|
||||||
|
|
||||||
programs.emacs = {
|
programs.emacs = {
|
||||||
|
|
@ -64,6 +73,7 @@
|
||||||
restclient
|
restclient
|
||||||
smartparens
|
smartparens
|
||||||
swift-mode
|
swift-mode
|
||||||
|
swift-ts-mode
|
||||||
super-save
|
super-save
|
||||||
terraform-mode
|
terraform-mode
|
||||||
treesit-auto
|
treesit-auto
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue