syntax highlighting for XQuery

Asked by David Graf on 2011-10-12

Hello
I am working for an XQuery project that is hosted on launchpad. Unfortunately, launchpad doesn't support XQuery syntax highlighting. Would it be possible to contribute XQuery syntax highlighting somehow? We would be happy to implement it ourselves.

Best
David

Question information

Language:
English Edit question
Status:
Answered
For:
loggerhead Edit question
Assignee:
No assignee Edit question
Last query:
2011-10-12
Last reply:
2011-10-12
Whiteboard:
Assigning to loggerhead, the project that provides code browsing in Launchpad.
Jeroen T. Vermeulen (jtv) said : #1

This looks tightly related to question 53369 in loggerhead: currently there's no support for this, but it ought to be possible to build it.

David Graf (davidagraf) said : #2

Hey

What do you mean with "there's no support for this"? Is there no support for XQuery syntax highlighting or to contribute syntax highlighting? We would really like to contribute.

David

Gary Poster (gary) said : #3

Loggerhead incorporates Pygments now. Loggerhead, via Pygments, does support syntax highlighting.

Pygments thinks it supports XQuery (http://pygments.org/languages/). It may be that Loggerhead/Pygments doesn't identify XQuery correctly somehow in order to trigger the proper highlighting. Could you point to an example of where it is not working, so we can investigate what is going on?

Thanks

Gary

David Graf (davidagraf) said : #4

Here is an example: http://bazaar.launchpad.net/~zorba-coders/zorba/trunk/view/head:/test/unit/guestbook.xq

Some syntax highlighting is done. But it is far from complete.

David

Gary Poster (gary) said : #5

I see, David. Thanks for the example.

You can start by making a branch of Pygments (https://bitbucket.org/birkenfeld/pygments-main) and changing what you want to see. Make a pull request to the Pygments maintainer and have him accept it. Then, hopefully he will make a release, and you can ask us to update to the newer Pygments.

If he doesn't seem to make a release in a timely manner, let us know, and we can make our own internal release just for Loggerhead.

David Graf (davidagraf) said : #6

Hey Gary

Which pygments version do you currently have installed in loggerhead? Because github is using pygments too. There, the syntaxhighlighting is much better (but not complete too), see

https://github.com/cezarfx/zorba/blob/master/test/rbkt/Queries/zorba/extras/functx_index-of-string1.xq
http://bazaar.launchpad.net/~zorba-coders/zorba/trunk/view/head:/test/rbkt/Queries/zorba/extras/functx_index-of-string1.xq

Maybe, an upgrade fixes a lot of issues already.

Gary Poster (gary) said : #7

Hi David. We are currently using the newest released Pygments (1.4) plus an unreleased bugfix. Within seven days we should be using the very newest unreleased Pygments from their trunk, in order to get another bugfix we pushed upstream.

Gary

Jeroen T. Vermeulen (jtv) said : #8

Thanks to Gary for stepping in. I was going by completely obsolete data!

Can you help with this problem?

Provide an answer of your own, or ask David Graf for more information if necessary.

To post a message you must log in.