Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Syntax Highlighting Pycharm #382

Closed
KeitoTobi1 opened this issue May 18, 2019 · 14 comments
Closed

Support Syntax Highlighting Pycharm #382

KeitoTobi1 opened this issue May 18, 2019 · 14 comments

Comments

@KeitoTobi1
Copy link

Hearing the information that Lark library is early, I introduce Lark immediately and develop with Pycharm.
However, the bottleneck is that Pycharm does not support syntax highlighting. So I treat it as a text file.
So, create a plugin that can be syntax highlighted in Pycharm.

@KeitoTobi1 KeitoTobi1 changed the title Support Pycharm Support Syntax Highlighting Pycharm May 18, 2019
@erezsh
Copy link
Member

erezsh commented May 18, 2019

Maybe it's possible to easily adapt the existing highlighting for Sublime or vscode?

@KeitoTobi1
Copy link
Author

Pycharm's custom syntax highlighting really has simple features.
You have to create a plugin to use full-scale syntax highlighting.

@erezsh
Copy link
Member

erezsh commented May 19, 2019

I think even simple syntax highlighting can improve the experience

  • Highlight comments

  • Keywords such as %ignore and %import

@KeitoTobi1
Copy link
Author

Instead, I want a plugin that provides syntax highlighting for the Lark parser syntax.

@MegaIng
Copy link
Member

MegaIng commented Jun 2, 2019

I created a basic syntax highlighting with the file-types menu. It highlights keywords/operators, matches all parenthesis, highlights strings and comments. It is better than nothing but still not perfect (It misses all IntelliSense features)
settings.zip

I might create a plugin, but that will take a bit of time.

@erezsh
Copy link
Member

erezsh commented Jun 2, 2019

@MegaIng That's great! You should create a repo for it in github.

We can then move it to the lark-parser namespace, if you like (https://github.com/lark-parser)

@MegaIng
Copy link
Member

MegaIng commented Jun 3, 2019

A first version of the plugin is up and working (kinda) https://github.com/MegaIng/lark-syntax-highlighting. It sill has a few problems, but it works with basic syntax highlighting. (To install, install the jar file at top-level as a plugin)

@erezsh
Copy link
Member

erezsh commented Jun 3, 2019

Very cool. I think it would be a good idea to add a README to the project, explaining exactly this. Also, a screenshot would be nice :)

It would be great if we could find other pycharm users to test it. Anyone reading this maybe?

@SpencerPark
Copy link

Outstanding timing, pycharm is my favorite python ide and was just googling to see if there was lark support when I came across this thread. Gave the plugin a go and things worked as promised!

Of course there are a few more things that would be nice to have like the standard theme colors for production names, aliases, references, operators (*, ?), regex language injection between / (which actually crashes the parser currently when typing the first /), and the ctrl+click to go to a declaration.

There also seem to be an error with a red underline saying Empty element parsed in 'larkFile' at ... at the end of a file.

I don't want the comments to take away from the project though, really great work on the plugin! I think it is worth bringing into the organization to get some more work behind and it's own issue tracker.

@MegaIng
Copy link
Member

MegaIng commented Jun 18, 2019

Ok, all basic things are fixed. It is usable (The syntax highlighting is adjustable in the settings). We could move it to the organization now, or you I could continue extending it in my private repo. I don't really have a preferred option. (I would greatly appreciate all feedback and improvements)

@erezsh
Copy link
Member

erezsh commented Jun 18, 2019

Well, if we move it to the organization, it will get more exposure and the aura of authority :)

I sent you an invite to the "syntax highlighting" team. Once you join you should be able to import the repo, I think.

@MegaIng
Copy link
Member

MegaIng commented Jun 19, 2019

I was able to move the repo, but now I have very little control over it. I can not change the description or name of the repo, nor can I approve pull request or push directly. Although not required, It would be easier than to always use you as a proxy.

@erezsh
Copy link
Member

erezsh commented Jun 19, 2019

Made you admin. Let me know if you need more ;)

@MegaIng
Copy link
Member

MegaIng commented Jun 19, 2019

Ok, Thanks.
Code completion is now partially done. I would say it is now completely usable and ready for consumption.

@erezsh erezsh closed this as completed Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants