Overview of Editors Supporting Tree-sitter Grammars #1
tajmone
started this conversation in
Editor Support
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Once the ALAN Tree-sitter grammar is ready we'll be able to use it to create plug-ins/packages for various editors and IDEs.
Editors that Support Tree-sitter
Here's a list of editors that support Tree-sitter grammars, either natively or via third party extensions.
Atom
The Atom editor (FOSS) now natively supports Tree-sitter grammars, along with the old TextMate-like grammars. For more details, see:
VSCode
Although VSCode doesn't natively support Tree-sitter grammars, there are two packages that integrate syntax highlighting (for various languages) via Tree-sitter:
There isn't an extension to enable generic Tree-sitter grammars support, allowing to install packages based on Tree-sitter grammars. So the best solution for an ALAN package would be to fork one of the above repositories and adapt its code for an ad hoc package.
Emacs
@thoni56, I'm sure you'll be glad to learn that I've found two modules for integrating Tree-sitter in Emacs:
Editor that Could Support Tree-sitter
In theory, any open source editor could integrate Tree-sitter grammars, via bindings to the generated parser (through the various bindings) and some custom code to handle it.
But for all practical purposes, the best candidates would be editors that support TextMate like semantic scoping and third party languages via plug-ins/extensions.
I'd like to add candidates to the thread, in the future, if they are popular enough and seem worth the initial work effort (maintenance should be minimal, since the same grammar would be used by all).
Sublime Text 4
Since there's a third party extension adding LSP support to Sublime Text, in theory it should be possible to also support Tree-sitter, but I haven no idea how this could be done (if it can be done indeed).
So far, users' request to add support for Tree-sitter grammars haven't resulted in any commitment in that direction, and discussion between Tree-sitter developers and the ST team didn't take a constructive direction. Therefore, I don't think that we should expect any official support for Tree-sitter, but instead see if it's doable via the new ST4 API (which promised to aid LSP interaction and similar).
But then, even though ST is a popular editor (not as popular as before, though, since it lost a lot of users to VSCode) it might not be worth the effort, especially since it's a commercial tool (time-based license) while ALAN is a FOSS project. But surely, if someone were to create a Tree-sitter package we could than integrate the ALAN grammar with little effort, so let's wait and see.
Textadept
Textadept is a really nice FOSS IDE, fully customizable via Lua and quite performant. I've always liked it and often thought it's a good IDE if one wants to create a customized version dedicated to ALAN (i.e. distributing a version with custom settings, extensions, etc.).
It's already been a while since Textadept added a module for supporting LSP:
https://github.com/orbitalquark/textadept-lsp
So, if it can support LSP it probably can also integrate Tree-sitter grammars (if it doesn't already, since it's been a long time since I last visited the project).
This is an editor worth looking into, because it's the ideal tool to create an ALAN IDE: it's cross platform, it's portable (unzip and run), and it's packed with tons of modern editing features (fuzzy matching, multi cursor, etc.), and it's very well documented. A custom version for ALAN could be hosted independently of other Textadept versions (or installations) on the same machine, and still benefit from the auto-update mechanism.
Beta Was this translation helpful? Give feedback.
All reactions