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

incorrectly identifying syntax error in kube.libsonnet #19

Open
Datamance opened this issue Dec 10, 2019 · 17 comments
Open

incorrectly identifying syntax error in kube.libsonnet #19

Datamance opened this issue Dec 10, 2019 · 17 comments

Comments

@Datamance
Copy link

Screen Shot 2019-12-09 at 7 09 57 PM

It looks like the plugin considers an empty pair of curly braces as a syntax error.

@qeqar
Copy link

qeqar commented Dec 11, 2019

found it too. but it is ok to remove them completely.

@Datamance
Copy link
Author

Sure, but this is a github submodule dependency that I'm not trying to fork in order to get rid of a syntax warning that shouldn't be there in the first place. There's nothing in jsonnet's syntax that suggests overriding with an empty object is a syntax error, and indeed, kube.libsonnet compiles just fine :) the plugin just needs to be fixed.

@bryant1410
Copy link
Contributor

Do you manage to get a *.libsonnet working? Cause I can't, that's why I sent #12

@Datamance
Copy link
Author

yeah - you can see it's coloring the code correctly up until the end of that Namespace definition. So you can't get any *.libsonnet working? What version of the plugin do you have?

@bryant1410
Copy link
Contributor

yeah - you can see it's coloring the code correctly up until the end of that Namespace definition. So you can't get any *.libsonnet working? What version of the plugin do you have?

I'm running 0.9, the one available in the marketplace for PyCharm 2019.3.

Have you guys added support for *.libsonnet?

@qeqar
Copy link

qeqar commented Dec 11, 2019

you can add *.libsonnet manually to jsonnet, then it will use the plugin

@bryant1410
Copy link
Contributor

you can add *.libsonnet manually to jsonnet, then it will use the plugin

Oh, yeah, but I think it'd be good for the plugin to support it.

@Datamance
Copy link
Author

Anyone monitoring this repo? @lihaoyi-databricks ?

@lihaoyi-databricks
Copy link
Contributor

Sure I'm monitoring this repo. It should be a trivial fix, but so far nobody has sent a PR that's in a mergeable state, so it hasn't been fixed

@Datamance
Copy link
Author

@lihaoyi-databricks it's been years since I wrote anything in Java and I've never written an intellij/pycharm plugin, so I wouldn't know where to start. Whereabouts would the trivial fix take place?

@lihaoyi-databricks
Copy link
Contributor

@bryant1410
Copy link
Contributor

@Datamance probably somewhere here https://github.com/databricks/intellij-jsonnet/blob/master/src/com/jsonnetplugin/JsonnetFileTypeFactory.java#L15

Wait, are you talking about the *.libsonnet support or the syntax problem described by the OP? Cause the former is tackled by #12

@Datamance
Copy link
Author

@lihaoyi-databricks see the comment from @bryant1410 above - my issue has nothing to do with *.libsonnet support. It's a parsing bug

@lihaoyi-databricks
Copy link
Contributor

@Datamance got it, sorry I must be mixing up issues. The parsing issue should be fixed by making the objinside call here https://github.com/databricks/intellij-jsonnet/blob/master/resources/com/jsonnetplugin/Jsonnet.bnf#L39 optional via objinside? , similar to the obj ::= declaration below it. Do you want to try making the change locally and verifying that it fixes the problem? If so send a PR and I can publish it to the jetbrains package repo

@Datamance
Copy link
Author

@lihaoyi-databricks I'd love to, but I'm not really sure how to locally test the plugin. Do I just clone this repo, make the changes, and then do "install plugin from disk" ? Do I need to execute a build step first? Or does PyCharm do all the magic?

@lihaoyi-databricks
Copy link
Contributor

@Datamance IIRC you need to install the intellij plugin devkit, import the repo into intellij as an intellij platform plugin, right-click on the .bnf and .flex files and click menu item to generate code, and then you can hit the "package plugin for deployment" button in the "build" dropdown

It's kind of annoying, but that's the way it was when this plugin was written. I heard there's a new CLI-based build system for plugins but we're not on that yet

@Datamance
Copy link
Author

Alright, I don't have IntelliJ on this machine - hacking on this would be a fun weekend project but unfortunately I've got a bit too much on my plate to spend the afternoon figuring this out.

Since it's a small change, and you already have the proper set up, do you think you could test it out quickly?

FWIW, if you'd like other people to drive the project by contributing, I'd recommend having a fleshed out "Contributing" section in your readme, and supply your reader with directions and links on how to get set up developing PyCharm plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants