louis,
@louis@emacs.ch avatar

I think the whole treesitter train passed me. Having separate ts major modes for every major mode, that are not derivates any more, makes configuration complex.

I'm not sure if the advantages of treesitter merit the complexity that was introduced into Emacs with this.

Some treesitter modes don't support certain features and I have constantly switch modes.

Perhaps I'll remove treesitter completely for now as I don't see any gains for the moment.

What are your experiences? What features do you get out of a specific treesitter mode that are not available in non-treesitter modes?

holgerschurig,

@louis For me the TS modes are useless ... but mostly because I program un C and C++ and the simplest macro disturbs TS so much that it gets useless.

ankit,
@ankit@emacs.ch avatar

@louis For me, I was able to drop the go-mode from MELPA and use built-in go-ts-mode. It does lack some features like functions for running Tests, etc but I was able to chain together some custom functions very easily using the Treesitter functions. I've also enabled it for Python and haven't faced any problems so far.

For the Lisp modes (Guile and Elisp) I don't feel the need to use Treesitter.

tsdh,
@tsdh@emacs.ch avatar

@louis You are right with the configuration issue. I hope that will clear up in the future.

Wrt. the question what treesitter-modes do better than their classical counter-parts: they get syntax highlighting, formatting, and navigation right because they know the actual syntactic role of every buffer text. Classical modes use regular expressions and heuristics which cannot work reliably for context-free languages.

And from a language mode writers POV, treesitter modes are easier to write because the hard work is done and maintained somewhere else. For example, the c/c++ treesitter modes are only 1878 LOC whereas the classical cc-*.el files amount to almost 43.000 LOC. Ok, cc-mode also supports java, objective-c, pike, and awk but still.

And it just occurred to me that c-ts-mode supports preprocessor macros nicely, that is, forward-sexp on some ... moves point to the closing (which also means that marking preprocessor blocks with expand-region just works). Not so much with the standard c-mode.

ctietze,
@ctietze@mastodon.social avatar

@louis I found it sucked that there's no tree-sitter counterpart for php-mode, because all I had was text parsing. In order to reformat a list of function parameters onto multiple lines requires custom regex solutions, or a capable LSP server (which isn't a given, either).

But it was still fine to work that way and I wasn't actually bothered that much :)

I'm too lazy to really customize things with the AST,, so in practice I'm fine without ts for a couple more years.

Maybe JS devs love this?

etenil,
@etenil@emacs.ch avatar

@louis at best the treesitter modes work the same for me, at worst they bug out like python-ts-mode sometimes and I need to switch it back out. So not sure if anything has gotten any better.

grtcdr,
@grtcdr@emacs.ch avatar

@louis I feel the exact same way, treesitter enjoyers keep mentioning structural navigation and editing but for a caveman, avy and isearch work pretty well.

skybert,
@skybert@emacs.ch avatar

@louis you're right on the money, as far as I'm concerned.

I've read the pro treesitter arguments, read the blog posts, seen the screencasts. Sorry to say, I'm not that enthusiastic about it. If it makes all the existing modes better, great. If it creates a parallel set of programming modes, not so much.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • emacs
  • InstantRegret
  • DreamBathrooms
  • ngwrru68w68
  • osvaldo12
  • cubers
  • magazineikmin
  • ethstaker
  • Youngstown
  • rosin
  • slotface
  • everett
  • kavyap
  • Durango
  • khanakhh
  • megavids
  • thenastyranch
  • anitta
  • modclub
  • GTA5RPClips
  • mdbf
  • cisconetworking
  • tester
  • tacticalgear
  • provamag3
  • Leos
  • normalnudes
  • JUstTest
  • lostlight
  • All magazines