On Wed, 7 Nov 2018 at 01:27, Bridger Dyson-Smith <bdysonsm...@gmail.com> wrote:
> Hi Christian - > > thank you for your work on the xqdoc files (and the link to the xquery > used for generating them)! > > The current state of XQuery plugins for the JetBrains/IntelliJ IDEs has > changed a bit since I added the IDEA documentation to the wiki. Grzegorz > Ligas' XQuery Support plugin has been forked by the talented developers at > OverStory, with lots of MarkLogic-specific features added. Reece Dunn also > has been working on an XQuery plugin that takes a slightly different > approach: rather than focusing on one implementation, Reece is working on a > plugin that provides broader language support. > To add some background... My plugin started as an attempt to address various issues in the XQuery parser in Grzegorz' plugin. [1] was the point where I decided to attempt creating my own plugin, after reporting various issues to Grzegorz. Specifically, my plugin aimed to: 1. Address the keyword vs identifier issue in various places [2]. 2. Provide a robust lexer and parser with error recovery. 3. Provide full support for the MarkLogic syntax in addition to XQuery 3 support -- this later evolved into adding support for other XQuery extensions (updating, full text, scripting), XQuery 3.1 support, and BaseX and Saxon vendor extension support. Version 1.2 of my plugin has support for the BaseX update, fuzzy, and non-deterministic extensions. Version 1.3 (in development) adds support for the BaseX 9.1 ternary if, elvis operator, and if without else syntax extensions. My plan is to publish 1.3 when the IntelliJ 2018.3 release candidate is released, so the plugin is available for the full release. My plugin does not currently support running queries, debugging, code reformatting, auto-completion, and various other features that Grzegorz' plugin supports. These are planned (I am currently working on running queries), but these things take time. I've also been improving function lookup in 1.3 to be standards conformant -- this is complex, and is not 100% complete. The technical challenges in implementing XQuery support in an IDE are different to those implementing it in a query processor as it needs to support the functionality and capabiilties of both the IDE and XQuery. My long-term plans are to implement as many of the XPath and XQuery static errors from the error condition list as possible to spot all statically determinable errors in the IDE, as well as various other inspections. I'm also considering adding specific support for the XPath subset of XQuery and integrating that with XSLT for better XPath support in IntelliJ. The very minor work that I've done has been for Reece - I'm (slowly) adding > implementation builtin function signatures that will be used by his plugin > to provide improved static analysis. > My plans have always been to describe the built-in functions and static context as XQuery files. I completed this for the XQuery and MarkLogic functions, and Bridger has added BaseX, EXPath/EXQuery, and Saxon built-in function definitions. In the future, I want to add complete API descriptions using xqdoc comments so I can integrate them into the IDE when my plugin supports displaying the xqdoc information in place. I also want to use the information in the function annotations to report functions that require a different version of the XQuery processor. [1] https://github.com/ligasgr/intellij-xquery/issues/199 [2] I have solved this by making the NCName and keyword tokens implement a common interface, then check for that interface when looking for NCNames. I then remove the keyword styling on keywords in NCName positions after the code has been parsed. I also use this to support the reserved function name functionality. Kind regards, Reece I hope that provides a bit of information regarding news with > XQuery/JetBrains plugins. > Best, > Bridger > > > > On Tue, Oct 30, 2018 at 9:13 AM Christian Grün <christian.gr...@gmail.com> > wrote: > >> Hi Bridger, >> >> I am glad to report I have created new stub files for the BaseX XQuery >> Modules [1]. They’ll now be included in the official releases again >> [2]. I have also uploaded the script that I wrote for generating the >> xqdoc output [3]. It’s far from perfect, but definitely more complete >> than the old version. If you encounter any errors, please don’t >> hesitate to tell me. >> >> Could you give us a little update on your contribution to the IntelliJ >> XQuery plugin? >> >> Cheers, >> Christian >> >> [1] https://github.com/BaseXdb/basex/issues/1623 >> [2] http://files.basex.org/releases/latest/ >> [3] https://github.com/BaseXdb/basex-dist/blob/master/wiki2xqdoc.xq >> >> >> >> On Mon, Sep 17, 2018 at 5:38 PM Bridger Dyson-Smith >> <bdysonsm...@gmail.com> wrote: >> > >> > Hi all - >> > >> > I was curious if there was a way to extract function signatures from >> BaseX. I'm currently reading through the (excellent) wiki but was curious >> if there was a more automated process I might be able to use. I've been >> trying to think of something clever with function-lookup, but I can't seem >> to make it dynamic based on module namespace; e.g. >> > >> > ``` >> > for $fun in function-lookup(xs:QName("archive:delete"), 1) >> > return >> > $fun >> > ``` >> > >> > I may just grab the wiki and parse it :), but I'm also interested in >> changes between versions of the processor. >> > >> > Any thoughts or suggestions would be greatly appreciated! >> > Best, >> > Bridger >> >