Questions tagged [tree-sitter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers

Cannot get forward-token right using treesit node functions

I'm trying to figure out how to create a forward-token function using treesit. So far I have the following. (defun forward-token (&optional arg limit past-ws named) "Move point forward ARG ...
Nordlöw's user avatar
  • 497
0 votes
1 answer

How to point eglot to project-specific typescript-language-server

I have set up tree-sitter and typescript-ts-mode. But if I activate eglot using M-x eglot it complains that it can't find the typescript-language-server executable – well duh, I didn't install it ...
malthe's user avatar
  • 103
0 votes
1 answer

treesit-install-language-grammar on Windows with Clang

I'm trying to use tree sitter on Windows with Emacs 29.1, but running into trouble when installing a language grammar. When I invoke the treesit-install-language-grammar function with the arguments ...
Charles Lowell's user avatar
0 votes
1 answer

How to build Emacs29 with tree-sitter without sudo

Here are the commands I'm running First I install tree-sitter make PREFIX=${HOME}/.tree-sitter make PREFIX=${HOME}/.tree-sitter install This populates ~/.tree-sitter directory ├── include │   └── ...
phoxd's user avatar
  • 231
0 votes
0 answers

A script to export org with highlighted code block

I've written the script to export all of my ORG files into HTML files. It takes the files from the folder "content" and saves the results to "public". (setq user-emacs-directory &...
ANtlord's user avatar
0 votes
1 answer

How to use tree-sitter parser for syntax highlighting?

I'm trying to setup Emacs for editing Roc ( source code. I have an LSP server for Roc and tree-sitter parser for Roc installed. Unfortunately I failed to find tree-sitter ...
Yuriy Al. Shirokov's user avatar
0 votes
1 answer

C offset is 2 with treesit

I recently started using treesit and I'm noticing with C files, my auto-indent is 2 spaces. How can I fix this to make it 4 spaces again? I've tried c-basic-offset.
user129393192's user avatar
0 votes
1 answer

How to use multiple tree-sitter parsers in buffer

How does one use local treesit parsers/multiple parsers to fontify different regions in a buffer? I haven't been able to find any tree-sitter modes that are currently using local parsers to see how ...
Rorschach's user avatar
  • 125
0 votes
2 answers

How enable tree-sitter modes (*-ts-mode) that aren't built-in?

My Emacs (29.1) comes with the some tree-sitter modes: c-ts-mode go-ts-mode js-ts-mode ... I downloaded the compiled .dll and they work out of box. However, there are some languages that tree-sitter ...
Lai Yu-Hsuan's user avatar
0 votes
0 answers

Ruby Eglot Tree-Sitter Configuration

Has anyone managed an eglot and tree-sitter configuration for ruby that has a reasonably full feature set. I have both activated, but here are some things that don't work: xref jumping code folding ...
Daniel Doherty's user avatar
1 vote
1 answer

language specific tree-sitter major mode wont show up

I'm using GNU Emacs 29.1 and have installed the tree-sitter haskell grammar: via treesit-install-language-grammar but somehow haskell-ts-mode wont show up as a major mode ...
bird-dancer's user avatar
2 votes
2 answers

How to highlight documentation comments with tree-sitter?

In c-mode it's possible to show doxygen comments /** ... */ using font-lock-doc-face. See: docs for c-doc-comment-style. How can this be done in c-ts-mode ? I can find documentation pointing to ...
ideasman42's user avatar
  • 8,736
3 votes
2 answers

C/C++ with tree sitter: how to change indent?

I use Emacs with tree sitter for c++ code (c++-ts-mode). With usual c++-mode I've used this fix for me: (c-set-offset 'inline-open '0) but I don't understand how to do it in new c++-ts-mode. In ...
Sergey's user avatar
  • 243
0 votes
2 answers

How do I check if the current buffer has a treesit parser?

Starting with Emacs 29, we've got native TreeSitter support using treesit. My question is: how do I know I can use treesit-* functions in the current buffer? The feature check only checks if Emacs ...
Aleksandar Dimitrov's user avatar
1 vote
0 answers

How do I use a local tree-sitter grammar in my emacs major mode?

I want to create a new major mode for a language with tree-sitter. I am working on the tree-sitter parser locally and It's working (tested in neovim and helix) Now I want to tell emacs to use the ...
Abdellah Stands with Gaza's user avatar