lark-parser / intellij-syntax-highlighting

intellij plugin for the lark grammar
21 stars 2 forks source link

Is the project maintained? #7

Open evgfilim1 opened 1 year ago

evgfilim1 commented 1 year ago

As the title says, I have a question: is the project maintained and going to be supported? Latest commit was >3 years ago (Feb 1, 2020), but it's still on the main page of Lark parser docs: https://lark-parser.readthedocs.io/en/latest/#syntax-highlighting. Maybe there are any alternatives or forks?

MegaIng commented 1 year ago

There are no alternatives or forks I know of. I at some point want to get back to updating this, but am currently doing other stuff. If you want to make contributions, you are free to do that, I will spend some time reviewing and merging PR if someone else initiates them.

The reason it's still on the docs page is because AFAIK it's still functional, right? It would be nice to update, but AFAIK there is currently no need for, the basic syntax highlighting + navigation still works.

Instead someone could create a full LSP. We started with that, but never really got anywhere.

evgfilim1 commented 1 year ago

@MegaIng thanks for the fast answer.

it's still functional, right?

Yes, it is functional, but lacks any updates and is usable only in very simple cases, which can be handled without the plugin, IMO.

I at some point want to get back to updating this

Nice to hear that. I'd really love to use a plugin for a nicer and more convenient development of parsers with Lark, and this project can really help when the issues will be resolved.

I guess it's better not to close the issue for others to know about the state of the project.

Lampe2020 commented 8 months ago

AFAIK it's still functional

Mostly.
It doesn't seem to support macros, so it throws an exception when seing those (instead of just marking them as an error), because of that PyCharm always says something crashed when starting, despite it still partially working…

Stehlampe2020 commented 4 months ago

It stopped throwing Java errors inside PyCharm (for some reason, maybe the newer version of PyCharm just suppresses those?) but it marks e.g. the following as having syntax errors in it:

_sep{x, sep}:   [ x ( sep x )* ]
_SPACE:         " "
MINUS:          "-"
INT:            MINUS? "0".."9"+
start:          "[" _SPACE* _sep{INT, _SPACE} _SPACE* "]"

(it marks the { and }, as well as the commas between those as syntax errors)

[EDIT]: As I want to become a Minecraft dev at some point I can maybe get some Java experience here, so I may spend some time the next days/weeks (however long it takes me to do this in my spare time) to get myself into this codebase and add template syntax support.

Stehlampe2020 commented 4 months ago

Okay. I've started to get into the code and I see that basically all files that seem relevant are auto-generated and not intended for manual editing.
@MegaIng, where can I find the tools needed to change those files? Or can I just ignore that and proceed to manually edit the whole shebang anyway?

MegaIng commented 4 months ago

I believe I mostly followed one of the official tutorials, maybe this one: https://plugins.jetbrains.com/docs/intellij/custom-language-support-tutorial.html

The tool for the relevant files, i.e. the .bnf file, is Grammar-Kit

I can't currently provide more detailed instructions, I also need to work myself back into all this. But if you provide a PR, I will definitely spend some time on that, and I might also at some point implement this stuff myself. I currently don't actively use lark all that much myself, so it's a bit low priority.

Stehlampe2020 commented 4 months ago

I currently don't actively use lark all that much myself, so it's a bit low priority.

Well, I use it right now to create my own joke esolang, so for me it's quite important :D

IntelliJ automatically suggested Grammar Kit to me, so I already knew that, but I'll look into the docs link tomorrow afternoon when I have some spare time again.

[EDIT]: *the next day* I explained what I'm doing to my mum today (who has no clue of programming, but I never give up trying to explain all of it to her XD) and you know what? Explaining it often helps, even if the one you're explaining it to doesn't understand what you're talking about. So I figured out that the plugin's code was generated by JFlex, which is also mentioned in Grammar-Kit's description. So I suppose there's a way to use Grammar-Kit to generate the Java code, I'll look into it tomorrow and see if that new knowledge helps me maybe implement the template syntax highlighting relatively quickly.