Comments (9)
Hi @vergenzt, the branch has not been created yet and the API is under design. I will create an issue to track the progress of it.
Thanks for your support 👍
from ast-grep.
thanks for the suggestion! debugger repl looks like a very interesting topic and I will investigate it later.
At the moment, ast-grep's top priority is to ship fix
support in napi and python API.
Better debugging experience will be explored later.
from ast-grep.
Oooh! That's exciting! Is there an issue and/or branch I can follow with updates on fix
support in the programmatic APIs? I've thought about switching to API usage for my use case but the lack of easy fix
support (without having to manually transform ranges) has tipped the balance in favor of YAML for now. I'd love to help test out programmatic fix
support!
from ast-grep.
How would you feel about me attempting this debugger feature on my own in parallel? I'm new to Rust so it would take me a while, but I'm curious whether you're open to reviewing progress / a design proposal.
from ast-grep.
A few thoughts:
-
I'm seeing it looks like
sg scan
andsg run
both spawn multiple threads, one per file? So I'm guessing we need a way to force single-threaded one-at-a-time mode if breakpoints are enabled. (Perhaps via a--debug
flag? And maybe if that flag is not passed then breakpoints are skipped with a warning to stderr.) -
I also see that rules don't run one-by-one but appear to be keyed by
kind
(when present) and run simultaneously. I'm still thinking through how to represent that in debug mode... maybe we just don't do this and instead run rules one by one when--debug
is true? Would that be easy to accomplish? IMO performance needn't really be an issue in debug mode.
from ast-grep.
Hi! Thanks for your input!
I'm more leaning toward to have a debugger on the web playground. https://ast-grep.github.io/playground.html
Reasoning:
- building a debugger is pretty hard and requires ncurses or other TUI package
- setting a breakpoint is hard (gdb/lldb is a little bit too arcane magic to me)
Pros for building debugger on playground
- easier to build UI since it is in web
- setting breakpoint is trivial (clicking on node )
- it will not bloat shipped binary
from ast-grep.
I didn't think it would be a proper gdb-level breakpoint, just a "breakpoint" as in a place where we tell the code to stop and await user input (i.e. it could just output a prompt token, wait for an input command, respond to that input command, and repeat). But I hear ya that a web debugger makes more sense - I hadn't thought of that since I haven't been able to use the web debugger much yet as I'm using a custom language.
from ast-grep.
How do you think about making the playground load WASM file?
from ast-grep.
How do you think about making the playground load WASM file?
That would be awesome! Great idea.
from ast-grep.
Related Issues (20)
- [feature] Language request: Jsonnet
- [feature] Command line flag to output rewrites only HOT 3
- [feature] I wish utility rule metavars could be available to the caller's `transform`/`fix` blocks
- [feature] add fix/replace/edit feature in napi and pyo3
- support napi fix
- support python fix
- test napi fix
- test python fix
- [bug] `has` skips siblings after a near-miss HOT 1
- [feature] support more languages in napi HOT 1
- [RFC] Using fix in JS/Python API HOT 3
- [bug] The `import_statement` syntax does not match the internal string node HOT 2
- [bug] windows rewite and match error
- [bug] TypeScript non-null assertion operator `!` parsed with wrong precedence HOT 2
- [bug] issue in python pattern related to async and await HOT 3
- [feature] Python: Ability to import Edit HOT 2
- [bug] Identifiers in C++ initializer lists or as class members not detected HOT 3
- [feature] implement more matching algorithm for pattern HOT 4
- [feature] Python: Equality Operator for SgNode HOT 1
- [bug] Some Kotlin pattern works differently between CLI and Playground HOT 13
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 ast-grep.