It continues to seem to me like #Neovim plugin authors haven't yet fully understood the power of #treesitter. I wish I had the time to explore the possibilities more thoroughly.
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: https://github.com/pursvir/zed-todo.txt/pull/1
I feel like I know even less about #treesitter grammars than I did before and a mix of #scheme and #javascript is so weird.
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?
https://github.com/firstrow/mcwig #texteditor #revolution #programming #HackerNews #ngated
Vim-like text editor in go. (LSP, TreeSitter, Themes)
Am I the only person who feels TreeSitter's approach is just weird and the niche it tries to occupy is very small?
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] https://www.wilfred.me.uk/blog/2022/09/06/difftastic-the-fantastic-diff/
[2] https://www.masteringemacs.org/article/combobulate-structured-movement-editing-treesitter
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.
#Mergiraf 0.7 is released
! It includes quite a few bug fixes and UX improvements, so it's worth upgrading :)
https://codeberg.org/mergiraf/mergiraf/releases/tag/v0.7.0
#git #treesitter #codeberg #jujutsu
@nixternal Yes. I never noticed this issue. But, I think there is a simple workaround.
@nixternal I don't think it's weird for me ...
1. You mean indent with 4 spaces. Then, yea I think I have a config.
2. I also use #treesitter and smartindent. So, it would be really helpful if you could elaborate your issue.
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: https://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.
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. https://tree-sitter.github.io/tree-sitter/using-parsers/queries/index.html
Now I’ll see whether I want to do something with them beyond what comes stock in #neovim and the nvim-treesitter plugin.
First time writing tree-sitter definitions, so any feedback would be appreciated... This is a tree-sitter definition for OpenSIPS configurations: https://code.wedotstud.io/patrick/tree-sitter-opensips
@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.