All Projects â†’ ethan-leba â†’ tree-edit

ethan-leba / tree-edit

Licence: GPL-3.0 License
🌲 Structural editing in Emacs for any™ language!

Programming Languages

emacs lisp
2029 projects

Projects that are alternatives of or similar to tree-edit

tree-sitter-typescript
TypeScript grammar for tree-sitter
Stars: ✭ 154 (-27.01%)
Mutual labels:  tree-sitter
tree-sitter-tlaplus
A tree-sitter grammar for TLA+
Stars: ✭ 31 (-85.31%)
Mutual labels:  tree-sitter
canonix
Experiment in Nix formatting
Stars: ✭ 18 (-91.47%)
Mutual labels:  tree-sitter
tree-sitter-html
HTML grammar for Tree-sitter
Stars: ✭ 56 (-73.46%)
Mutual labels:  tree-sitter
SwiftTreeSitter
Swift wrappers for the tree-sitter incremental parsing system
Stars: ✭ 116 (-45.02%)
Mutual labels:  tree-sitter
tree-sitter-markdown
A markdown grammar for tree-sitter
Stars: ✭ 168 (-20.38%)
Mutual labels:  tree-sitter
tree-sitter-julia
Julia grammar for Tree-sitter
Stars: ✭ 53 (-74.88%)
Mutual labels:  tree-sitter
tree-sitter-vue
Vue grammar for tree-sitter
Stars: ✭ 38 (-81.99%)
Mutual labels:  tree-sitter
tree-sitter-toml
TOML grammar for tree-sitter
Stars: ✭ 23 (-89.1%)
Mutual labels:  tree-sitter
tree-sitter-verilog
Verilog grammar for tree-sitter
Stars: ✭ 49 (-76.78%)
Mutual labels:  tree-sitter
zee
A modern text editor for the terminal written in Rust
Stars: ✭ 1,120 (+430.81%)
Mutual labels:  tree-sitter
tree-hugger
A light-weight, extendable, high level, universal code parser built on top of tree-sitter
Stars: ✭ 96 (-54.5%)
Mutual labels:  tree-sitter
ruby-tree-sitter
Ruby bindings to tree-sitter
Stars: ✭ 48 (-77.25%)
Mutual labels:  tree-sitter
tree-sitter-elisp
tree-sitter grammar for emacs lisp
Stars: ✭ 20 (-90.52%)
Mutual labels:  tree-sitter
dotfiles
Custom dotfile configurations and settings
Stars: ✭ 12 (-94.31%)
Mutual labels:  evil-mode
playground
Treesitter playground integrated into Neovim
Stars: ✭ 467 (+121.33%)
Mutual labels:  tree-sitter
rust-tree-sitter
Rust bindings to Tree-sitter
Stars: ✭ 29 (-86.26%)
Mutual labels:  tree-sitter
tree-sitter-sql
SQL syntax highlighting for tree-sitter
Stars: ✭ 33 (-84.36%)
Mutual labels:  tree-sitter
tree-sitter-clojure
No description or website provided.
Stars: ✭ 71 (-66.35%)
Mutual labels:  tree-sitter
nvim-yati
Yet another tree-sitter powered indent plugin for Neovim.
Stars: ✭ 60 (-71.56%)
Mutual labels:  tree-sitter
MELPA

âš  Tree-edit is very much a work-in-progress. Expect to run into bugs and breaking changes!

Every programming language has a formally defined structure, but most text editors are completely ignorant to it. As a result, editing can oftentimes devolve into a tedious exercise in character manipulation.

Tree-edit provides language-agnostic editing operations that map directly to the structure of the language, abstracting away the process of manually entering syntax. Leveraging the tree-sitter parser, tree-edit always has access to the precise state of the syntax tree – and directly wields the grammars of the languages under edit to power it’s editing capabilities.

Overview

The repository contains two co-existing packages (that will eventually be split).

tree-edit
The core library for structural editing. This library is intended to be used by other elispers who would like to implement their own structural editing or refactoring commands.
evil-tree-edit
An evil state for structural editing with preconfigured bindings and visualization, as seen in the GIF.

To get an overview of tree-edit’s capabilities, check out the EmacsConf talk!

How does it work?

Tree-edit relies heavily on the tree-sitter parser, leveraging the JSON intermediate representation that tree-sitter outputs to have a full understanding of what is valid for a given language with no language specific efforts on tree-edit’s part.

To learn more about how tree-edit works under the hood, see this high-level overview or check out this org doc with executable code examples demonstrating how the syntax generation works.

Supported languages

StatusLanguage
✅Python
🔨C
🔨Java
✅Supported
🔶Requires custom grammar
🔨Under development

Tree-edit is designed to be as language-agnostic as possible. Currently the list of supported languages is not very impressive, but in theory it should be as simple as running a script to preprocess a grammar and adding a configuration file for the language.

See here to learn the process for adding a new language.

Limitations

A non-comprehensive list of some of the larger limitations that tree-edit currently has:

Impedance mismatch
Most tree-sitter grammars were not designed with tree-edit’s usecase in mind, so some grammars may be structured inconveniently for tree-edit’s purposes.
Tree-sitter-langs
Tree-edit currently depends on tree-sitter-langs to power the tree-sitter parsers, however tree-sitter-langs does not always have the most up-to-date grammars and is missing some languages. If this continues to be an issue a fork may be needed.

Contributing

Contributions are very much welcome! In particular, adding language files would be a great place to help. Otherwise, the issues are a good place to propose features or find ones to implement.

The project is fairly complex and the documentation is still in progress, so feel free to open a discussion if you’re interested in helping out but you’re not sure where to start!

Related projects

combobulate
Structural navigation and limited structural editing
grammatical-edit
Smartparens-like using tree-sitter (?)
evil-textobj-tree-sitter
Evil mode text objects using tree-sitter queries.
lispy
Lisp structural editing package – big inspiration for tree-edit!
smartparens
Multilingual package with structural editing limited to matching delimiters.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].