5 ms·
This is so hopeless complicated that I'm glad I use VSCode and not Emacs anymore. Sheesh.
by audiodude 3y ago
This is so hopeless complicated that I'm glad I use VSCode and not Emacs anymore. Sheesh.
- okasaki 3y agoOK? It's feature in development. Eventually emacs 29 with tree sitter will be part of distro packaging, and it will just be an "apt install emacs" away.
- audiodude 3y agoThat's not the impression I got from TFA. It sounds like, once you have Emacs compiled with tree-sitter, you also need to have a language binding in a shared library in a known location (that you have to compile yourself or depend on the kindness of strangers). And once you have that, you actually need someone to write a major mode that utilizes it at all. And if you want to make that major mode the default for that file type, there are a few other things you need to do. Etc.
- slondr 3y agoI use emacs 29 beta right now and that is just not how it works. For example for elixir you just install elixir-ts-mode like any other package, answer yes to the prompt to install the elixir ts library, and you’re done. Even that setup step will be unnecessary in emacs 30, when all this stuff will be shipped by default.
- audiodude 3y agoOkay, that's a good thing! From the article: > Neither tree-sitter nor Emacs come installed with language grammars > ...it’ll only work if you don’t have an exceptional setup (so it won’t work well unless you have GCC and run some flavor of Linux.) > Determining if a grammar is available is not intuitive nor obvious unless you use elisp > Note that, just because you have installed a grammar, does not mean Emacs supports it. Someone still has to write the – admittedly, way easier – syntax and indentation logic and all that good stuff. > Annoyingly, there’s no easy way to see if you’re using the normal or the TS-powered major mode > If you use Customize, then you don’t have to do anything, but if you normally use setq, you’ll have to use customize-set-variable instead to ensure the setter is called properly. > That sounds like a great idea until you realize that it is not possible to make one-size-fits all commands that do this. Believe me: I’ve tried.
- natrys 3y ago> once you have Emacs compiled with tree-sitter Once Emacs 29 releases, your distro will package Emacs compiled with tree-sitter. > you also need to have a language binding in a shared library in a known location Emacs already ships with command that clones grammar repo, compiles, and installs the shared library to that known location - this was explained in the article. The only manual thing you need to do is to associate a language with a git repo in your configuration. > And once you have that, you actually need someone to write a major mode that utilizes it at all. Emacs developers have been also been working on covering major languages to provide tree-sitter based major modes. I count 23 major modes already being maintained as part of Emacs that will be shipped soon as part of 29.1, not to mention there are a lot more in Melpa (centralised community package repository). In any case, whole thing with the tree-sitter is that it really makes writing major modes easy. It's all declarative now, including indentation rules that had traditionally been tricky to get right.
- pridkett 3y agoI use both VS Code and Emacs. One of the things I love about Emacs is that if you put enough work into it, it will be like nothing else. There are times when I’m writing code, a text file, or even managing git commits with magit that I can sit back and say “wow, this is genuinely a pleasure to use.” But, it takes a lot of work to get there. I still don’t have everything working super well, debugging is way easier for me in VS Code. But, I’m still learning (after 25+ years as an Emacs user), and that brings me joy. It’s like when I’m working on electronics. There’s a genuine joy I get from using my Hakko soldering station, Mitutoyo calipers, or my Engineer hand tools. Using something that is supremely well designed for a purpose brings me joy. And org-mode. Seriously, org-mode.
- foobarbaz33 3y agoDoes VS code even integrate tree sitter? I'd imagine leveraging tree sitter is even more hairy there.
- audiodude 3y agoI guess the implication was that VS Code works well and I don't need tree-sitter?
- unhammer 3y agoNot yet. If anyone manages to read through all of https://github.com/Microsoft/vscode/issues/50140 https://github.com/Microsoft/vscode/issues/50140 they might find out if it's planned or not; Mickey's article is shorter =P
- ar_lan 3y agoImagine not even desiring to understand the tools that enable you to do your job.