Questions tagged [tree-sitter]
The tree-sitter tag has no summary.
28 questions
0
votes
1
answer
36
views
Having issue with syntax highlighting in rust-ts-mode in emacs 30
I'm using Emacs 30 on macOS 26.0.1. I've tried both emacs-plus@30 and compiling Emacs 30.2.5 from source with --with-tree-sitter.
I'm not sure if this is an issue or expected behavior, but in my Rust ...
1
vote
0
answers
31
views
typescript-ts-mode requires manual font-lock-update call after first visiting a file
I've been using typescript-mode and tide for a long time but I wanted to try out tree-sitter and lsp-mode. I've got most things working except for one problem with syntax highlighting. When I first ...
0
votes
1
answer
45
views
emacs30.2 jump to function define with treesitter
I am using emacs 30.2 with c++ treesit mode enabled. I can jump to function end with C-M-e, how can I jump to function define under current cursor?
1
vote
2
answers
86
views
What is the purpose of tree-sitter-mode minor mode when Emacs has -ts-mode for a major mode?
As of Emacs 30, what would be the purpose of using the tree-sitter-mode minor mode for some classic major mode (go-mode or python-mode for example) when it's possible to use a major mode that supports ...
1
vote
1
answer
123
views
Indenting c++ line beginning with '<<' with tree-sitter
I'm running emacs 30.2 (built locally from source), on Ubuntu, using doom. Today, I was editing some c++ code that uses iostreams, and I had multiple lines that started with the '<<' operator. ...
0
votes
2
answers
210
views
Emacs 30 and Java tree sitter, how?
When I run M-x java-ts-mode it complains
Tree-sitter for Java isn't available
With C-h f java-ts-mode I see that the mode is built-in, but in the *Warnings* buffer I also see
No such file or ...
0
votes
1
answer
93
views
Indentation width in yaml-ts-mode
I know I can set the indentation width with yaml-indent-offset in yaml-mode. How can I set the indentation in yaml-ts-mode? (Which I would prefer for more native folding, breadcrumbs, etc.)
0
votes
0
answers
125
views
Using .clang-format or cc-mode indent style for c-ts-mode, c++-ts-mode
Manually converting a .clang-format file or a c-style-alist style to a c-ts-mode-indent-style function is tedious, error-prone, and impractical when working on a large number of different open source ...
1
vote
0
answers
75
views
How to customise `forward-sexp` for treesit modes?
In c++-mode (and c-mode), forward/backward-sexp behave how I expect:
int foo = bar(1, 2);
// ^ point here
int foo = bar(1, 2);
// ^ forward-sexp moves point here
int foo = bar(1, 2);
...
0
votes
1
answer
66
views
treesit query grouping won't create multiple captures with the same capture-name
I'm writing my own "implement given interface for a given struct" functionality for Golang based on tree-sitter.
I can't figure out how to write a treesit-query that would capture a list of ...
0
votes
0
answers
67
views
Embed HTML in Typescript with tree sitter
I would like emacs to parse the template string with the html parser in the following typescript code.
const template = document.createElement('template');
template.innerHTML = /* html */ `
<div ...
0
votes
0
answers
118
views
`treesit-major-mode-setup` causing substantial pause when finding a file
System
aarch64-apple-darwin24.5.0 (Apple Mac Studio M1 Max running macOS 15.5 Sequoia).
Emacs
I've now tried two versions of Emacs, and the differences between the two have helped me narrow down the ...
1
vote
1
answer
204
views
Parameter indentation in C in tree-sitter mode
I can't get c-ts-mode to indent function parameters properly. I want it to use "lineup indentation" if there is a parameter on the function identifier line and otherwise "one-step ...
2
votes
2
answers
2k
views
Setting up Eglot in Emacs 30
I am trying to use emacs for programming python and c/c++. I recently upgraded my MacOS setup to emacs-plus@30 --with-ctags--with-dbus --with-debug --with-mailutils --with-no-frame-refocus --with-...
0
votes
1
answer
275
views
Trying to get treesitter indents to work with multiple languages for a major mode
I am working on a major mode using treesitter as my parser. It's been pretty intuitive but I ran into an issue. When trying to use multiple languages, you have to specify ranges using nodes in the AST ...