diff --git a/modules/languages/siren-golang.el b/modules/languages/siren-golang.el index 313111d2..d6a5955f 100644 --- a/modules/languages/siren-golang.el +++ b/modules/languages/siren-golang.el @@ -71,6 +71,16 @@ (add-to-list 'projectile-globally-ignored-directories "vendor/github.com") (add-to-list 'projectile-globally-ignored-directories "vendor/gopkg.in")) + (with-eval-after-load 'tree-sitter-langs + (tree-sitter-hl-add-patterns 'go + [ + ;; Highlight built-in functions with the built-in face, based on: + ;; 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)$")) + ])) + :config (siren-define-golines-format-mode) diff --git a/modules/text-editing/siren-tree-sitter.el b/modules/text-editing/siren-tree-sitter.el index 85607593..decf259c 100644 --- a/modules/text-editing/siren-tree-sitter.el +++ b/modules/text-editing/siren-tree-sitter.el @@ -11,15 +11,7 @@ (use-package tree-sitter-langs :hook - (tree-sitter-after-on . tree-sitter-hl-mode) - - :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)$"))]) - ) + (tree-sitter-after-on . tree-sitter-hl-mode)) (provide 'siren-tree-sitter) ;;; siren-tree-sitter.el ends here