pest-parser / pest-ide-tools

IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors
https://pest.rs
Apache License 2.0
48 stars 8 forks source link

Allow VSCode to show parsing output same as pest.rs website. #31

Open actengage opened 1 year ago

actengage commented 1 year ago

Disclosure, I'm senior engineer but new to Rust (using Pest.rs to learn Rust). Currently I am porting my logic from Peggy.js into Rust so I run the code with a CLI or WASM without the need for a Node runtime. I'm no doubt doing things incorrectly being new to Rust, but here is my process. As far as I can tell, the VSCode extension just validate, highlight, and help with the writing syntax. Since I'm new to Rust, I currently I find myself using the Pest.rs website to quickly create complex grammars and check the parse tree, then write the code in Rust to do what i need on the AST.

Or is this just the wrong approach entirely? Is there a way to do use Rust Analyzer and the compiler to do what I'm doing on the website?

Feature Request:

Assuming I'm not overlooking the obvious, It would be great if I could just use VSCode to define some my grammar, my input string, and get the same parse tree output on pest.rs inside of VSCode. Perhaps its in the output tab in the console, or perhaps its like markdown previews work and I can split screen with the editor on one side, and preview on the other. Parsing errors of course would still do the same thing it does now.

PS, I love the Pest.rs parser and website. Very well done. It happened to be the perfect excuse to learn Rust and starting to replace Node with better tools.

Jamalam360 commented 1 year ago

This was on my personal radar but didn't have a specific issue. I think it can be done, just not sure what the best UI for it is yet

actengage commented 1 year ago

Cool, thanks for the reply. The UI is definitely a bit of a challenge inside VSCode.