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>
dwf<p>It continues to seem to me like <a href="https://social.linux.pizza/tags/Neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Neovim</span></a> plugin authors haven't yet fully understood the power of <a href="https://social.linux.pizza/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a>. I wish I had the time to explore the possibilities more thoroughly.</p>
hobbsc has moved<p>Spent a little time messing with an extension for the <a href="https://social.sdf.org/tags/zed" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>zed</span></a> editor. I make heavy use of the todo.txt file format and a kind soul created a syntax highlighting extension for it.</p><p>I promptly added a simple but ham-fisted way to highlight kv strings and due dates: <a href="https://github.com/pursvir/zed-todo.txt/pull/1" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/pursvir/zed-todo.tx</span><span class="invisible">t/pull/1</span></a></p><p>I feel like I know even less about <a href="https://social.sdf.org/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> grammars than I did before and a mix of <a href="https://social.sdf.org/tags/scheme" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>scheme</span></a> and <a href="https://social.sdf.org/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a> is so weird.</p>
N-gated Hacker News<p>🖥️ Ah, yet another "revolutionary" text editor, because clearly the world needs more barely-functional <a href="https://mastodon.social/tags/Vim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Vim</span></a> <a href="https://mastodon.social/tags/clones" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>clones</span></a> written in <a href="https://mastodon.social/tags/Go" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Go</span></a>. 🎉 Expect the same old confusion with a sprinkle of modern buzzwords like <a href="https://mastodon.social/tags/LSP" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LSP</span></a> and <a href="https://mastodon.social/tags/TreeSitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TreeSitter</span></a>. 🌲🤖 Why innovate when you can just slap a theme on it and call it a day? 🙄<br><a href="https://github.com/firstrow/mcwig" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/firstrow/mcwig</span><span class="invisible"></span></a> <a href="https://mastodon.social/tags/texteditor" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>texteditor</span></a> <a href="https://mastodon.social/tags/revolution" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>revolution</span></a> <a href="https://mastodon.social/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a> <a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/ngated" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ngated</span></a></p>
Hacker News<p>Vim-like text editor in go. (LSP, TreeSitter, Themes)</p><p><a href="https://github.com/firstrow/mcwig" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/firstrow/mcwig</span><span class="invisible"></span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/Vim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Vim</span></a> <a href="https://mastodon.social/tags/Text" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Text</span></a> <a href="https://mastodon.social/tags/Editor" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Editor</span></a> <a href="https://mastodon.social/tags/Go" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Go</span></a> <a href="https://mastodon.social/tags/LSP" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LSP</span></a> <a href="https://mastodon.social/tags/TreeSitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TreeSitter</span></a> <a href="https://mastodon.social/tags/Themes" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Themes</span></a></p>
soc<p>Am I the only person who feels TreeSitter's approach is just weird and the niche it tries to occupy is very small?</p><p><a href="https://chaos.social/tags/compilers" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>compilers</span></a> <a href="https://chaos.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a></p>
Shae Erisson<p>Does anyone know of other tools that use <a href="https://recurse.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> to do something nifty?</p><p>I'm a recent convert to both difftastic[1] and combobulate[2], what else is in that space?</p><p>There must be more awesome uses of concrete syntax trees?</p><p>[1] <a href="https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fantastic-diff/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">wilfred.me.uk/blog/2022/09/06/</span><span class="invisible">difftastic-the-fantastic-diff/</span></a></p><p>[2] <a href="https://www.masteringemacs.org/article/combobulate-structured-movement-editing-treesitter" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">masteringemacs.org/article/com</span><span class="invisible">bobulate-structured-movement-editing-treesitter</span></a></p>
Jason<p>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.)</p><p>Just having trouble with syntax highlighting for the HTML parts in .njk files. </p><p><a href="https://mas.to/tags/Neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Neovim</span></a> <a href="https://mas.to/tags/11ty" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>11ty</span></a> <a href="https://mas.to/tags/Jinja2" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Jinja2</span></a> <a href="https://mas.to/tags/Treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Treesitter</span></a></p>
werdahias (tired)<a class="hashtag" href="https://pleroma.debian.social/tag/debian" rel="nofollow noopener" target="_blank">#Debian</a> work I did the this month (in no particular order):<br><br>- Fixed RC bugs for arduino-ide, rust-graphene, rust-safe-arch, rust-gdk4-sys, arduino-builder and arduino-core-avr<br>- Fixed a bug in tex-fmt<br>- Enabled static-built-using for Loupe and glycin<br>- Uploaded a new version of ani-cli, gnome-podcasts<br>- Packaged the <a class="hashtag" href="https://pleroma.debian.social/tag/treesitter" rel="nofollow noopener" target="_blank">#treesitter</a> ASM grammar today and uploaded it to NEW
Antonin Delpeuch<p><a href="https://mamot.fr/tags/Mergiraf" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Mergiraf</span></a> 0.7 is released 🪂 🦒! It includes quite a few bug fixes and UX improvements, so it's worth upgrading :)</p><p><a href="https://codeberg.org/mergiraf/mergiraf/releases/tag/v0.7.0" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">codeberg.org/mergiraf/mergiraf</span><span class="invisible">/releases/tag/v0.7.0</span></a><br><a href="https://mamot.fr/tags/git" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>git</span></a> <a href="https://mamot.fr/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://mamot.fr/tags/codeberg" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>codeberg</span></a> <a href="https://mamot.fr/tags/jujutsu" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jujutsu</span></a></p>
JavAlps<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@nixternal" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>nixternal</span></a></span> Yes. I never noticed this issue. But, I think there is a simple workaround.</p><p><a href="https://mastodon.social/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a></p>
JavAlps<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@nixternal" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>nixternal</span></a></span> I don't think it's weird for me ...</p><p><a href="https://mastodon.social/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mastodon.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a></p>
JavAlps<p><span class="h-card" translate="no"><a href="https://fosstodon.org/@nixternal" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>nixternal</span></a></span> </p><p>1. You mean indent with 4 spaces. Then, yea I think I have a config.</p><p>2. I also use <a href="https://mastodon.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> and smartindent. So, it would be really helpful if you could elaborate your issue.</p><p><a href="https://mastodon.social/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a> <a href="https://mastodon.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a></p>
Xavier<p>I finally got around to wrapping up and publishing a first version of my <a href="https://sunny.garden/tags/Rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rust</span></a> 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: <a href="https://crates.io/crates/ts-typed-ast" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">crates.io/crates/ts-typed-ast</span><span class="invisible"></span></a></p><p>It works similarly to Rowan and Swift's libsyntax. tree-sitter provides the green nodes, while this crate generates the red nodes.</p><p>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.</p><p>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.</p><p>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.</p><p><a href="https://sunny.garden/tags/parser" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>parser</span></a> <a href="https://sunny.garden/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://sunny.garden/tags/pl" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pl</span></a> <a href="https://sunny.garden/tags/programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>programming</span></a></p>
Dale Emery<p>I’ve looked briefly at <a href="https://mstdn.social/tags/Treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Treesitter</span></a> queries a few times, and bailed out each time because at a glance it looks more complicated than I was motivated to push through.</p><p>Turns out they’re not very complicated. A little weird… until you realize they’re structured similarly to LISP things.</p><p>Once I grokked that, it didn’t take long to undersand the syntax. <a href="https://tree-sitter.github.io/tree-sitter/using-parsers/queries/index.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">tree-sitter.github.io/tree-sit</span><span class="invisible">ter/using-parsers/queries/index.html</span></a></p><p>Now I’ll see whether I want to do something with them beyond what comes stock in <a href="https://mstdn.social/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a> and the nvim-treesitter plugin.</p>
Patrick Wu :neocat_flag_bi:<p>First time writing tree-sitter definitions, so any feedback would be appreciated... This is a tree-sitter definition for OpenSIPS configurations: <a href="https://code.wedotstud.io/patrick/tree-sitter-opensips" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">code.wedotstud.io/patrick/tree</span><span class="invisible">-sitter-opensips</span></a></p><p><a href="https://o0o.social/tags/opensips" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>opensips</span></a> <a href="https://o0o.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://o0o.social/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a> <a href="https://o0o.social/tags/voip" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>voip</span></a></p>
robinm<p><span class="h-card" translate="no"><a href="https://mamot.fr/@mdk" class="u-url mention">@<span>mdk</span></a></span> I&#39;m using [mergiraf](mergiraf.org/) since about 2 months. It&#39;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.</p><p><a href="https://fosstodon.org/tags/treesitter" class="mention hashtag" rel="tag">#<span>treesitter</span></a> <a href="https://fosstodon.org/tags/mergiraf" class="mention hashtag" rel="tag">#<span>mergiraf</span></a> <a href="https://fosstodon.org/tags/difftastic" class="mention hashtag" rel="tag">#<span>difftastic</span></a></p>