renzmann / treesit-auto

Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29
GNU General Public License v3.0
396 stars 32 forks source link

File mode specification error: (wrong-type-argument treesit-node-p typescript) #114

Open apoorv569 opened 2 months ago

apoorv569 commented 2 months ago

Here is my treesit config,

(use-package treesit
  :config
  (treesit-major-mode-setup)
  (setq treesit-language-source-alist
    '((bash "https://github.com/tree-sitter/tree-sitter-bash")
      (c "https://github.com/tree-sitter/tree-sitter-c")
      (cmake "https://github.com/uyha/tree-sitter-cmake")
      (common-lisp "https://github.com/theHamsta/tree-sitter-commonlisp")
      (cpp "https://github.com/tree-sitter/tree-sitter-cpp")
      (css "https://github.com/tree-sitter/tree-sitter-css")
      (csharp "https://github.com/tree-sitter/tree-sitter-c-sharp")
      (elisp "https://github.com/Wilfred/tree-sitter-elisp")
      (go "https://github.com/tree-sitter/tree-sitter-go")
      (go-mod "https://github.com/camdencheek/tree-sitter-go-mod")
      (html "https://github.com/tree-sitter/tree-sitter-html")
      (js . ("https://github.com/tree-sitter/tree-sitter-javascript" "master" "src"))
      (json "https://github.com/tree-sitter/tree-sitter-json")
      (lua "https://github.com/Azganoth/tree-sitter-lua")
      (make "https://github.com/alemuller/tree-sitter-make")
      (markdown "https://github.com/ikatyang/tree-sitter-markdown")
      (python "https://github.com/tree-sitter/tree-sitter-python")
      (r "https://github.com/r-lib/tree-sitter-r")
      (rust "https://github.com/tree-sitter/tree-sitter-rust")
      (toml "https://github.com/tree-sitter/tree-sitter-toml")
      (tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src"))
      (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))
      (yaml "https://github.com/ikatyang/tree-sitter-yaml"))))

here is treesit-auto config,

(use-package treesit-auto
  :custom
  (treesit-auto-install 'prompt)
  :config
  (treesit-auto-add-to-auto-mode-alist 'all)
  (global-treesit-auto-mode))

Now when I open a typescript file I get this error,

File mode specification error: (wrong-type-argument treesit-node-p typescript)

and the file looks like this, 2024-08-30_15-36

there is no syntax highlighting at all.