techhub.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A hub primarily for passionate technologists, but everyone is welcome

Administered by:

Server stats:

4.7K
active users

#treesitter

2 posts2 participants0 posts today
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>
hobbsc<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>
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>
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" 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>
shom ✊🏽🐧📷🤿🏔️🪚<p>Hey language/IDE nerds, check out <a href="https://bablr.org/" rel="nofollow noopener" target="_blank">Bablr-lang</a> by <span class="h-card"><a href="https://fosstodon.org/@stirlhoss" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>stirlhoss</span></a></span>, I resonate with the mission</p><blockquote><p>The BABLR organization's mission is to build a new ecosystem of next-generation developer tools to radically raise computer code literacy around the world. It aims to do this by creating a common "math-y" system for representing code to that unlocks new coding workflows for all developers while changing the way that language and tooling authors collaborate to deliver rich IDE functionality.</p></blockquote><p>A lot of the specifics are a beyond my pay-grade but <a href="https://gts.shom.dev/tags/lsp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>LSP</span></a> and <a href="https://gts.shom.dev/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> have really moved the needle in this space and I think innovation is better than a mono-culture. Love that people are making cool things, <a href="https://gts.shom.dev/tags/bablr" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>bablr</span></a>!</p>
razzlom is always sad<p><span>Do tree-sitter works out of the box in Emacs 30 or I need configure something?<br><br></span><a href="https://quietplace.xyz/tags/Emacs" rel="nofollow noopener" target="_blank">#Emacs</a> <a href="https://quietplace.xyz/tags/TreeSitter" rel="nofollow noopener" target="_blank">#TreeSitter</a></p>
you╭👺+300╭🐈x5╭⁂+3╭(Ⓐ+a<p><a href="https://mastodon.social/tags/helix" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>helix</span></a> vs <a href="https://mastodon.social/tags/neovim" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>neovim</span></a>. spot the differences!</p><p>the main one isn't really visible, though: helix has a built-in <a href="https://mastodon.social/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a>, and it does a great job at highlighting <a href="https://mastodon.social/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> out of the box, with zero configuration and dependencies!</p><p>this way, i don't have 20 plugins in <a href="https://mastodon.social/tags/lua" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lua</span></a> and/or <a href="https://mastodon.social/tags/vimscript" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>vimscript</span></a> running in the background and autoupdating from <a href="https://mastodon.social/tags/github" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>github</span></a> - awesome! 🌈🦄 config is plain <a href="https://mastodon.social/tags/toml" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>toml</span></a> - no need to write it in turing-complete languages which i only know poorly</p><p>shout out <span class="h-card" translate="no"><a href="https://fosstodon.org/@bobulous" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>bobulous</span></a></span> 🙌 <a href="https://www.bobulous.org.uk/coding/Helix-crib-sheet.html" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://www.</span><span class="ellipsis">bobulous.org.uk/coding/Helix-c</span><span class="invisible">rib-sheet.html</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>
Ténno Seremél’<p>There is a new lua-ts-mode now, but treesit-install-language-grammar doesn’t know about Lua (i.e. there is nothing at the default path to a repository). What do I do? 🤔</p><p><a href="https://lor.sh/tags/lang_en" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>lang_en</span></a> <a href="https://lor.sh/tags/emacs" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>emacs</span></a> <a href="https://lor.sh/tags/treesitter" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>treesitter</span></a> <a href="https://lor.sh/tags/questions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>questions</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>