mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.6K
active users

#treesitter

1 post1 participant0 posts today
Florian Pircher<p>I’ve published a <a href="https://typo.social/tags/TreeSitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TreeSitter</span></a> grammar for the Property&nbsp;List format: <a href="https://github.com/Formkunft/tree-sitter-property-list" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/Formkunft/tree-sitt</span><span class="invisible">er-property-list</span></a></p><p>Useful for syntax highlighting, indentation, or any other structural analysis of plist files.</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>
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>
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>
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" rel="nofollow noopener" target="_blank">@<span>mdk</span></a></span> 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.</p><p><a href="https://fosstodon.org/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://fosstodon.org/tags/mergiraf" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>mergiraf</span></a> <a href="https://fosstodon.org/tags/difftastic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>difftastic</span></a></p>
Bozhidar Batsov (a.k.a. Bug)<p>With <a href="https://hachyderm.io/tags/Emacs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Emacs</span></a> 30 recently released I finally felt that the time has come to go all in on <a href="https://hachyderm.io/tags/TreeSitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TreeSitter</span></a>. (I am rarely an early adopter of anything these days) Over the weekend I had a lot of fun playing with TreeSitter and I started a prototype of an <a href="https://hachyderm.io/tags/OCaml" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>OCaml</span></a> major mode using it <a href="https://github.com/bbatsov/neocaml" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">github.com/bbatsov/neocaml</span><span class="invisible"></span></a></p>
SallyABL<p>View from tonight's sunset walk in Canberra. </p><p><a href="https://aus.social/tags/Sunset" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Sunset</span></a> <a href="https://aus.social/tags/TreetrunkTuesday" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TreetrunkTuesday</span></a> <a href="https://aus.social/tags/Nature" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Nature</span></a> <a href="https://aus.social/tags/Photography" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Photography</span></a> <a href="https://aus.social/tags/PhotoOfTheDay" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PhotoOfTheDay</span></a> <a href="https://aus.social/tags/Bushland" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Bushland</span></a> <a href="https://aus.social/tags/Landscape" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Landscape</span></a> <a href="https://aus.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> </p><p><span class="h-card" translate="no"><a href="https://fuzzies.wtf/@altbot" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>altbot</span></a></span></p>
Programming Languages Delft<p>Master thesis by Hendy Liang: "Property-Based ASTs: Enabling Language Parametricity in Refactoring Tools"</p><p>"By leveraging Tree-Sitter, a parser generator that creates parsers that produce generic, property-based ASTs, this research adapts Renaissance, an existing industrial refactoring tool, to support multi-language extensibility with minimal additional effort."</p><p><a href="https://repository.tudelft.nl/record/uuid:6e143a35-32b8-4f7e-928e-52057ea57566" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">repository.tudelft.nl/record/u</span><span class="invisible">uid:6e143a35-32b8-4f7e-928e-52057ea57566</span></a></p><p><a href="https://akademienl.social/tags/LanguageParametricity" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LanguageParametricity</span></a> <a href="https://akademienl.social/tags/refactoring" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>refactoring</span></a> <a href="https://akademienl.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://akademienl.social/tags/thesis" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>thesis</span></a></p>
petrisch<p><span class="h-card" translate="no"><a href="https://mastodon.social/@gbraad" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>gbraad</span></a></span> sounds like <a href="https://swiss.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> magic. Really don't know why nobody wants that in v$code anymore.</p>
Antonin Delpeuch<p>I am looking into starting an organization for collective maintenance of <a href="https://mamot.fr/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> grammars, in the spirit of <span class="h-card" translate="no"><a href="https://fosstodon.org/@jazzband" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>jazzband</span></a></span>. Would anyone be interested in joining?<br>If anyone has insights about how <a href="https://mamot.fr/tags/jazzband" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>jazzband</span></a> (or similar) has been doing, I am also keen to learn more.</p>
aemogie<p>i've only ever seen proper structural editing with lisps. in emacs you have things like paredit. and i get it, parsing lisp is trivial, text wrapped in pairs of parantheses are your parse nodes. but we have treesitter. we can do so much more.</p><p>i could just write code and not care about syntax at all. i shouldn't ever have to fight it. and my editor should be a parse tree editor, not a text editor. text just isn't my interface most of the time. if i'm writing prose, maybe. but usually, i'm not.</p><p>when i hit <code>w</code> in vim style binds often mean to go to the next sibling node. but i'm having to spam that and some amount of <code>h</code> or <code>l</code> to get to where i want to go. when writing code i don't think in words or characters. when i hit <code>j</code> i often mean to go to the next statement or expression.</p><p><a href="https://tech.lgbt/tags/lisp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lisp</span></a> <a href="https://tech.lgbt/tags/paredit" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>paredit</span></a> <a href="https://tech.lgbt/tags/emacs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>emacs</span></a> <a href="https://tech.lgbt/tags/vim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vim</span></a> <a href="https://tech.lgbt/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a></p>
aemogie<p>and most of these modern text editors have the parse trees, for syntax highlighting. treesitter supports how many languages, now?</p><p>why dont they leverage the already existing infrastructure? no extra dependencies to be added or anything. just use what you already bring in, but better.</p><p>theres already selection that leverages treesitter in most editors. im not sure of neovim, but in helix it's built-in with alt-o, and in emacs you can use the expreg package (i think that's what it's called). but why is that all we have? and it's in addition to the existing selection, not in-place of it. why don't we have similar things for the other editing ui, like navigation, deletion, copy, cut, etc.</p><p>i think i know, and i believe it's because selection is the only thing that's been way too painful with traditional line based or word based selection. it's imprecise, cumbersome, and just overall painful. but everything else, it's just okay enough that people are fine with it.</p><p><a href="https://tech.lgbt/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://tech.lgbt/tags/structuralediting" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>structuralediting</span></a></p>
The Last Psion | Alex<p><a href="https://oldbytes.space/tags/Pascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Pascal</span></a> autocomplete and snippets in <a href="https://oldbytes.space/tags/NeoVim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NeoVim</span></a>? Don't mind if I do!</p><p>This is thanks to blink-cmp, using the snippets JSON file from the Pascal plugin for <a href="https://oldbytes.space/tags/VSCode" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>VSCode</span></a>, plus the pasls <a href="https://oldbytes.space/tags/LSP" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LSP</span></a> and <a href="https://oldbytes.space/tags/Treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Treesitter</span></a>.</p><p>The LSP is incomplete, but it's better than nothing.</p><p><a href="https://oldbytes.space/tags/LazyVim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LazyVim</span></a> <a href="https://oldbytes.space/tags/ObjecPascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>ObjecPascal</span></a> <a href="https://oldbytes.space/tags/FreePascal" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>FreePascal</span></a></p>
Space Hobo<p>EDIT: I am not looking to set up TreeSitter on neovim. I have that working fine, but only for bog standard 2024 syntax like awk or C or Makefiles. I want a *new* syntax definition for an old assembler that targets 12-bit minicomputers from the 1960s.</p><p>Hey, are there any <a href="https://teh.entar.net/tags/NeoVim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>NeoVim</span></a> nerds here who can help folks with slightly older versions? I have a goal of "don't make my vi installation a full-time job" and I'm doing a lot of <a href="https://teh.entar.net/tags/PDP8" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>PDP8</span></a> assembly in PAL. I can supply a <a href="https://teh.entar.net/tags/Kate" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Kate</span></a> syntax file that does well enough (I use it for <a href="https://teh.entar.net/tags/pandoc" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>pandoc</span></a>), but I need a <a href="https://teh.entar.net/tags/TreeSitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TreeSitter</span></a> syntax wotsit that I can just Install without having to upgrade NeoVim or TreeSitter past what's in Debian (this is non-negotiable: anything else has always become a full-time job for me).</p><p>All the TreeSitter tutorials say to use an init command that doesn't exist in my copy, and I lost patience right then. The architecture makes it seem like this is only a pain for setting up a new project, but I don't have the attention to devote to this. I'd also like it if PAL8 syntax made it into whatever mainstream syntax repositories TS grabs from.</p>
Antonin Delpeuch<p>New blog post: <a href="https://mergiraf.org" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">mergiraf.org</span><span class="invisible"></span></a>, a syntax-aware merge driver for <a href="https://mamot.fr/tags/Git" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Git</span></a>.</p><p>Supports <a href="https://mamot.fr/tags/Java" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Java</span></a>, <a href="https://mamot.fr/tags/Rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Rust</span></a>, <a href="https://mamot.fr/tags/Golang" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Golang</span></a>, <a href="https://mamot.fr/tags/javascript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>javascript</span></a>, <a href="https://mamot.fr/tags/cpp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>cpp</span></a>, <a href="https://mamot.fr/tags/csharp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>csharp</span></a>, <a href="https://mamot.fr/tags/html" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>html</span></a>, <a href="https://mamot.fr/tags/json" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>json</span></a>, <a href="https://mamot.fr/tags/yaml" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>yaml</span></a> and <a href="https://mamot.fr/tags/xml" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>xml</span></a> so far, and it's quite easy to add support for more thanks to <a href="https://mamot.fr/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a>.</p><p><a href="https://antonin.delpeuch.eu/posts/mergiraf-a-syntax-aware-merge-driver-for-git/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">antonin.delpeuch.eu/posts/merg</span><span class="invisible">iraf-a-syntax-aware-merge-driver-for-git/</span></a></p><p>Get it on <a href="https://mamot.fr/tags/Codeberg" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Codeberg</span></a>: <a href="https://codeberg.org/mergiraf/mergiraf" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="">codeberg.org/mergiraf/mergiraf</span><span class="invisible"></span></a></p>
Bharath M. Palavalli<p>Pfft, <a href="https://mastodon.sdf.org/tags/eglot" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>eglot</span></a> broke again, does anyone have a simple way to set it up with <a href="https://mastodon.sdf.org/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> for <a href="https://mastodon.sdf.org/tags/emacs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>emacs</span></a>? I just haven’t been able to figure out how to set it up without it breaking on me often. I mostly need it for R, Shell, Python, LaTeX, and Go.</p>