Comments (3)
Hey ubolonton!
This is something I admittedly haven't thought about but completely agree that this will become an issue if left unaddressed.
Point 1. would be ideal, I've started an issue on upstream about some of the issues I've ran into for this usecase (which sadly has not been responded to), but maybe we can add that onto the issue. Not sure how I can get more visibility on that issue though...
If we could add an API for this to tree-sitter-langs
that would be awesome :).
I've been seriously considering using/requiring forked grammars for languages, as it's becoming painfully clear that tree-sitter grammars are not being designed for this usecase.
I.e. in Python types introduce unnecessary nesting, C hides the true types of fields, and so on. I've been trying to hack around these issues in hopes of not needing to diverge from the community's grammars but I think I'm reaching the limits of what can be hacked around.
I think this usecase is far more powerful and game changing than enabling highlighting etc, so my hope is to fork and clean up the grammars in a way that supports both structural editing and highlighting/querying cases, and eventually merge back into the community (possibly after some new TS APIs are exposed).
Not really directly related but curious what your thoughts are on forking are, and what changes to tree-sitter could be made to better support structural editing. This is also why I'm looking forward to installation for abritrary parsers via github.
This project looks very cool, by the way.
Thank you! Couldn't have done it without your packages ;)
I think keeping the grammars up-to-date should be a community effort. I probably haven't done a good job organizing that. Grammar update PRs are welcome though. Relatedly, do you think the current way
tree-sittter-langs
uses git submodules to track grammars is too much of a hassle?
My personal opinion is that it may be better to try to move away from a central language package (which puts alot of burden on you to maintain!) and just let people install grammars as they wish via. the method in the issue above. Maybe some sort of highlights API would be needed for packages to provide that as well.
Perhaps once that issue is merged in you could replace the submodules with whatever the new method is: (tsc-require "github/tree-sitter-python..")
, though that would require users to build all their grammars (builds quite fast, though.)
Then a grammar update could be as simple as bumping a hash, and start the transition away from central language authority.
from tree-edit.
Since the expected way to use tree sitter grammars now is compiling locally, we're just layering a grammar post-processing on top of that.
from tree-edit.
Side note: I noticed this:
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.
I think keeping the grammars up-to-date should be a community effort. I probably haven't done a good job organizing that. Grammar update PRs are welcome though. Relatedly, do you think the current way tree-sittter-langs
uses git submodules to track grammars is too much of a hassle?
from tree-edit.
Related Issues (20)
- Add move up/down editing operation
- Special case block nodes for performance HOT 1
- Preserve surrounding formatting during editing operations HOT 1
- Add raise-some editing operation
- Proper error message if `tree-edit-grammar` isn't loaded HOT 1
- `tree-edit-view-mode` very slow on large buffers
- `evil-tree-edit` operator state?
- Jumping to nodes with the same start range
- `tree-view-mode` hardcoded to work only with `evil-tree-edit` HOT 2
- Add tree-edit error type
- Ensure all tree-edit functions that evil-tree-edit uses are public
- C support
- Cannot insert new child node in empty module HOT 2
- Raising outside of a wrapping statement leads to a user-ptrp, "Tree-edit could not restore location" error HOT 3
- How to add new languages link is broken HOT 1
- Java error: Symbol’s value as variable is void: q When trying to insert anything in java mode HOT 4
- Test native-compiled code in CI
- `dash` not found when attempting to generator new language files HOT 3
- Not working on Windows with Emacs 29 when tree-sitter already loaded HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tree-edit.