lark-parser / lark

Lark is a parsing toolkit for Python, built with a focus on ergonomics, performance and modularity.
MIT License
4.77k stars 404 forks source link

Generate `vscode` / `tmLanguage` / `.sublime-syntax` files from `.lark` files #1259

Open rickmark opened 1 year ago

rickmark commented 1 year ago

Suggestion Lark is a clear and simple way to express a grammar, but since the age of TextMate, language definitions have been in the form of tmLanguage JSON files. We should either 1) build a way to express .lark files into tmLanguage files, or drive the feature into IDEs to support .lark for syntax highlighting.

1) Seems the most pragmatic path, but requires mapping a new concept of "contexts" into the existing lark system.

2) Seems a better long term approach, but requires moving the community and likely is simpler after 1

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

MegaIng commented 1 year ago

With regards to 2, There has been work to create a language server implementation, although that development hasn't gotten that far.

For the title and 1), this is something that could well be added in the tools directory of lark. You can start work on that, it will probably be added.