ligasgr / intellij-xquery

Plugin to support XQuery in Intellij Idea
Apache License 2.0
35 stars 23 forks source link

Rock solid syntax highlighting #118

Open wcandillon opened 9 years ago

wcandillon commented 9 years ago

Hello,

We have been using (XQLint)[https://github.com/wcandillon/xqlint] for syntax highlighting for years now and we believe that it is extremely solid. It is used in: ACE, C9, eXide, Atom, and CodeMirror. I was wondering if we could work together on integrating it in intellij-xquery, then you would get a lot of things for free and we can be use that the syntax highlighting is perfect on all these editors.

Is that an idea that you would be willing to explore with me?

On top of syntax highlighting (lexical and semantical highlighting), xqlint provides static code analysis and semantic completion proposals. You can find an examples of XQLint parsing infrastructure integrated into C9 at https://speakerdeck.com/wcandillon/xquery-development-in-cloud9. I'd love it to see XQLint on intellij.

ligasgr commented 9 years ago

Hi,

Thanks for raising the issue. The proposition looks interesting, I have few questions though.

I'm not sure if you did have a look at current features of IntelliJ XQuery and have found some deficiencies but I'd love to hear from you about what you think could be improved in what is currently there even if it's impossible to integrate xqlint into IntelliJ XQuery. Thanks, Grzegorz

wcandillon commented 9 years ago

Hi Grzegorz,

I appreciate your openness to discuss this :)

To run xqlint from Java, nodyn.io or something like: https://github.com/apigee/trireme XQLint does provide partial highlighting updates. And has both a lexer and parser (you can do both lexical and semantical highlighting). And it does handle invalid syntax very well. To try XQLint in the context of an IDE, checkout the atom plugin: https://atom.io/packages/language-jsoniq.

Another possibility, is to use the same ebnf that xqlint is using (The use the following generator that supports Java: http://www.bottlecaps.de/rex/).

We are making the request because this plugin doesn't support the JSONiq syntax (it has slight variations from the XQuery one) nor the scripting extension. And we are big intellij users internally.

ligasgr commented 8 years ago

I'll have a look on adding JSONiq extension to XQuery syntax for Zorba flavour only but can't promise anything. For the time being I'm not considering adding full JSONiq support in the plugin (unless something changes my mind).

wcandillon commented 8 years ago

@ligasgr for the syntax highlighting, there is this grammar from the Atom plugin: https://github.com/wcandillon/language-jsoniq/blob/master/grammars/jsoniq.cson Sharing it in case it would be useful. It contains a bug but I should be able to fix it soon hopefully.