Skip to content

Commit

Permalink
feat(language/go): use tree-sitter-mode and tree-sitter-hl-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jimeh committed Mar 10, 2022
1 parent 11a1a44 commit 92c16d4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/languages/siren-golang.el
Expand Up @@ -14,6 +14,7 @@
(require 'siren-lsp)
(require 'siren-projectile)
(require 'siren-reformatter)
(require 'siren-tree-sitter)

(use-package go-mode
:mode "\\.go\\'"
Expand Down Expand Up @@ -42,6 +43,9 @@
(when (fboundp 'auto-highlight-symbol-mode)
(auto-highlight-symbol-mode -1))

(tree-sitter-mode +1)
(tree-sitter-hl-mode +1)

(siren-display-indentation -1)
(company-mode +1)
(siren-folding)
Expand Down
21 changes: 21 additions & 0 deletions modules/text-editing/siren-tree-sitter.el
@@ -0,0 +1,21 @@
;;; siren-tree-sitter.el --- jimeh's Emacs Siren: tree-sitter

;;; Commentary:

;; Configuration for tree-sitter

;;; Code:

(use-package tree-sitter)

(use-package tree-sitter-langs
:config
(tree-sitter-hl-add-patterns 'go
;; from: https://github.com/tree-sitter/tree-sitter-go/pull/61
[(call_expression
function: (identifier) @function.builtin
(.match? @function.builtin "^(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)$"))])
)

(provide 'siren-tree-sitter)
;;; siren-tree-sitter.el ends here
2 changes: 2 additions & 0 deletions straight/versions/default.el
Expand Up @@ -38,6 +38,7 @@
("editorconfig-emacs" . "3c03cef3110024016c688553733cdc3694a8a799")
("el-get" . "9353309744e4f8a7c9b1adf22ec99536fb2146b0")
("elisp-refs" . "8f84280997d8b233d66fb9958a34b46078c58b03")
("elisp-tree-sitter" . "5e1091658d625984c6c5756e3550c4d2eebd73a1")
("emacs-aio" . "da93523e235529fa97d6f251319d9e1d6fc24a41")
("emacs-async" . "0d52411d3accc3e11a2c64838703a8ce9755c77c")
("emacs-deferred" . "2239671d94b38d92e9b28d4e12fd79814cfb9c16")
Expand Down Expand Up @@ -193,6 +194,7 @@
("tide" . "4bd7f35d8aae160b16642aef3ca205adc71539a9")
("toggle-quotes.el" . "33abc221d6887f0518337851318065cd86c34b03")
("transient" . "72b8c013936b8e8d891105144107781a43516735")
("tree-sitter-langs" . "599570cd2a6d1b43a109634896b5c52121e155e3")
("treemacs" . "b18a05b1f62074a40e6011d83cd4c92cbee040dd")
("treepy.el" . "3ac940e97f3d03e48ca9d7fcd74916a9b01c72f3")
("typescript.el" . "e82416205158d4b21d42d6b60c4385f68f0ae1b1")
Expand Down
5 changes: 5 additions & 0 deletions themes/siren-doom-themes-overrides-theme.el
Expand Up @@ -70,6 +70,11 @@
`(git-gutter-fr:modified ((t ( :foreground ,(doom-blend 'vc-modified 'bg 0.7)
:background ,(doom-blend 'vc-modified 'bg 0.0) ))))

;; tree-sitter
`(tree-sitter-hl-face:property ((t (:inherit font-lock-constant-face)))) ;; disable italic
`(tree-sitter-hl-face:method.call ((t ( :foreground ,(doom-blend 'functions 'keywords 0.6) ))))
`(tree-sitter-hl-face:function.call ((t ( :foreground ,(doom-blend 'functions 'keywords 0.8) ))))

;; hideshowvis
`(hideshowvis-hidable-face ((t ( :foreground ,(doom-color 'base7) ))))

Expand Down

0 comments on commit 92c16d4

Please sign in to comment.