emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter
https://emacs-tree-sitter.github.io
MIT License
816 stars 73 forks source link

How to configure this to make it work with Swift? #205

Closed konrad1977 closed 2 years ago

konrad1977 commented 2 years ago

I cannot get it to work with swift. It hooks in but nothing changes.

If I check my message I can see message like this.

[tree-sitter-langs] Running (git rev-parse --show-toplevel) in /Users/mikaelkonradsson/.emacs.d/elpa/tree-sitter-langs-20211228.1446/ The directory /Users/mikaelkonradsson/.emacs.d/elpa/tree-sitter-langs-20211228.1446/ doesn’t seem to be a git working dir. Grammar-building functions will not work. tree-sitter-langs: Grammar bundle v0.10.13 was already installed; skipped

And if I check the tree-sitter-tree:

Skärmavbild 2022-01-29 kl  09 46 42

My config block for tree-sitter:

(use-package tree-sitter
  :config
  (add-to-list 'tree-sitter-major-mode-language-alist '(swift-mode . swift))
  (add-hook 'swift-mode-hook #'tree-sitter-mode)
  (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode))

(use-package tree-sitter-langs
  :after (tree-sitter))