fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.6K
active users

#treesitter

0 posts0 participants0 posts today
dwf<p>Genuinely don't know how I lived without a split-join plugin in <a href="https://social.linux.pizza/tags/vim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vim</span></a> and later <a href="https://social.linux.pizza/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a>.</p><p>The original: <a href="https://github.com/AndrewRadev/splitjoin.vim" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/AndrewRadev/splitjo</span><span class="invisible">in.vim</span></a><br>mini.nvim's take: <a href="https://github.com/echasnovski/mini.splitjoin" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/echasnovski/mini.sp</span><span class="invisible">litjoin</span></a><br>And my preference, the more robust <a href="https://social.linux.pizza/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> version: <a href="https://github.com/Wansmer/treesj" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/Wansmer/treesj</span><span class="invisible"></span></a></p>
snamellitRecently with verion 0.25 the treesitter library changed ABI version<br> to 15. Newer parsers will complain about a version mismatch if the<br> installed library used by emacs is lower than this version. This ABI<br> version was introduced in the 0.25 branch of treesitter.<br><br> The best course of action till lib treesitter is updated is to pin<br> the version of the parser to the last version supporting ABI 14.<br><br> With the new ABI 15 version, parsers are required to provide a<br> ~treesitter.json~ file with additional metadata which can be used as<br> proxy to find a version which still supports ABI-14, i.e. the commit<br> before that.<br><br> A lot of the parsers are provided by the treesitter project as sub<br> repos, and they follow the same version convention as the library,<br> selecting the last tag before the 0.25 tag is a good way to find a<br> compatible version.<br><br> This branch can be added after the repo url in the<br> ~treesit-language-source-alist~ variable. Note that if you use<br> ~treesit-auto-install-all~ to get it over with, you have to probably<br> restart your emacs as treesit-auto apparently caches the value<br> during iniitialisation and changes are not picked up. <a class="hashtag" href="https://social.snamellit.com/tag/emacs" rel="nofollow noopener" target="_blank">#emacs</a> <a class="hashtag" href="https://social.snamellit.com/tag/treesitter" rel="nofollow noopener" target="_blank">#treesitter</a>
andie :oh_no_bubble:<p><span>I made a small NeoVim Plugin and custom Tree-Sitter parser to enhance the journalling experience with Fern Log files. It supports various syntax and entry highlights, header folds, and a few keybindings for toggling statuses and folds quickly (for now).<br><br>Blog post introducing it: </span><a href="https://bugwhisperer.dev/blog/fern-neovim-plugin-treesitter-parser/" rel="nofollow noopener" target="_blank">https://bugwhisperer.dev/blog/fern-neovim-plugin-treesitter-parser/</a><span><br>Code repo: </span><a href="https://github.com/bugwhisperer418/fern.nvim" rel="nofollow noopener" target="_blank">https://github.com/bugwhisperer418/fern.nvim</a><span><br><br>Excited to keep improving it! </span>​:celsilvercrystalheart:​<span> I welcome any feedback or suggestions. Thank yooou!! <br></span><a href="https://blahaj.zone/tags/neovim" rel="nofollow noopener" target="_blank">#neovim</a> <a href="https://blahaj.zone/tags/treesitter" rel="nofollow noopener" target="_blank">#treesitter</a> <a href="https://blahaj.zone/tags/journalling" rel="nofollow noopener" target="_blank">#journalling</a></p>
Zenie<p>I'm having adventures with <a href="https://piaille.fr/tags/Emacs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Emacs</span></a> and <a href="https://piaille.fr/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a>.</p><p>I started out trying to install c-ts-mode.<br>It wasn't happy. I installed treesit-auto and used that.<br>I had some success.</p><p>C mode has a version problem.</p><p>I'm thinking I just need to compile tree-sitter from source and recompile emacs. I really wish this machine was on <a href="https://piaille.fr/tags/arch" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>arch</span></a>. </p><p>I build emacs anyway.<br>In the mean time I thought I'd just turn it off.<br>The warning about the version is annoying.<br>I deleted the tree-sitter directory, deleted the treesit-auto package and removed all references to treesit.<br>Also all the generated files, custom, recentf, savehist, etc.</p><p>It's still trying to load the .so files.</p>

Spent a little time messing with an extension for the #zed editor. I make heavy use of the todo.txt file format and a kind soul created a syntax highlighting extension for it.

I promptly added a simple but ham-fisted way to highlight kv strings and due dates: github.com/pursvir/zed-todo.tx

I feel like I know even less about #treesitter grammars than I did before and a mix of #scheme and #javascript is so weird.

GitHubUpdate highlights.scm to highlight kv pairs and due dates by cmhobbs · Pull Request #1 · pursvir/zed-todo.txtBy cmhobbs

🖥️ Ah, yet another "revolutionary" text editor, because clearly the world needs more barely-functional #Vim #clones written in #Go. 🎉 Expect the same old confusion with a sprinkle of modern buzzwords like #LSP and #TreeSitter. 🌲🤖 Why innovate when you can just slap a theme on it and call it a day? 🙄
github.com/firstrow/mcwig #texteditor #revolution #programming #HackerNews #ngated

GitHubGitHub - firstrow/mcwigContribute to firstrow/mcwig development by creating an account on GitHub.

Does anyone know of other tools that use #treesitter to do something nifty?

I'm a recent convert to both difftastic[1] and combobulate[2], what else is in that space?

There must be more awesome uses of concrete syntax trees?

[1] wilfred.me.uk/blog/2022/09/06/

[2] masteringemacs.org/article/com

Wilfred Hughes::BlogDifftastic, the Fantastic Diffprogramming, language design, and human factors

Are there any Neovim users working with 11ty? I’m having a bit of difficulty getting a Jinja2 Treesitter parser setup. Everything else is working properly (lsp, prettier, and properly reading the .njk file type.)

Just having trouble with syntax highlighting for the HTML parts in .njk files.

#Neovim#11ty#Jinja2
#Debian work I did the this month (in no particular order):

- Fixed RC bugs for arduino-ide, rust-graphene, rust-safe-arch, rust-gdk4-sys, arduino-builder and arduino-core-avr
- Fixed a bug in tex-fmt
- Enabled static-built-using for Loupe and glycin
- Uploaded a new version of ani-cli, gnome-podcasts
- Packaged the #treesitter ASM grammar today and uploaded it to NEW

I finally got around to wrapping up and publishing a first version of my #Rust crate ts-typed-ast. It's a crate inspired by Rowan that automatically generates a typed AST from a tree-sitter grammar. You can find it here: crates.io/crates/ts-typed-ast

It works similarly to Rowan and Swift's libsyntax. tree-sitter provides the green nodes, while this crate generates the red nodes.

I've used it a few times already, to prototype various toy programming languages. You write a grammar in tree-sitter, and then either evaluate the ts-typed-ast tree directly, or convert it to some other IR.

Using tree-sitter as the parser generator for a toy project is pretty nice. You get a powerful, declarative way to create a parser, and at the same time you benefit from the whole tree-sitter ecosystem. Things like incremental parsing, syntax highlighting, structural editing, and formatting with Topiary.

Main downside is that tree-sitter does not (yet) offer good error reporting and recovery, so when parsing fails it's often in dramatic, unhelpful ways. Not a big issue for experimenting, which is what this crate is for. Production-ready languages probably need bespoke parsers anyway.

crates.iocrates.io: Rust Package Registry

I’ve looked briefly at #Treesitter queries a few times, and bailed out each time because at a glance it looks more complicated than I was motivated to push through.

Turns out they’re not very complicated. A little weird… until you realize they’re structured similarly to LISP things.

Once I grokked that, it didn’t take long to undersand the syntax. tree-sitter.github.io/tree-sit

Now I’ll see whether I want to do something with them beyond what comes stock in #neovim and the nvim-treesitter plugin.

tree-sitter.github.ioQueries - Tree-sitter
Replied in thread

@mdk I'm using [mergiraf](mergiraf.org/) since about 2 months. It's has much fewer false positive than the default line based merge algorithm, but a bit more false negative. It does use tree sitter to compare and merge, a bit like what [difftastic](difftastic.wilfred.me.uk/) does for diffing files.