Home > Enterprise >  In IntelliJ, using xquery, how do I set up my references?
In IntelliJ, using xquery, how do I set up my references?

Time:09-30

IntelliJ IDEA 2021.2.1 Ultimate

Plugin XQuery and XSLT v1.9.1.212

I can't seem to work out how to get IntelliJ to find the module declarations I've set up in my .xqy modules. The MarkLogic server can find the location, but not IntelliJ. How do I adjust the options of IntelliJ to properly find the references to my modules?

In the "modules" database, the module is at "/code/test/testRecord.xqy"

The modules declaration is thus:

import module namespace testRecord = "testRecord.xqy" at "/code/test/testRecord.xqy"

Locally, the file is located at c:/project/src/main/xquery/testRecord.xqy

Again, the import module works fine in QConsole and when running the module doing the import, but IntelliJ just says "cannot find declaration to go to"

CodePudding user response:

The plugin is using the at path hint to locate the file. That is, it is looking for a path that ends in /code/test/testRecord.xqy. Therefore, you need to ensure that the filesystem path matches, e.g. c:/project/src/main/xquery/code/test/testRecord.xqy.

If the file importing testRecord.xqy is located anywhere under /xquery, you shouldn't need to do anything else -- the plugin should be able to locate the file.

If you are using ml-gradle or roxy to manage the project, the plugin should automatically look in the specified module source root path for those files.

Note: If you want to get the plugin to recognize /MarkLogic paths, you can go to the "Languages & Frameworks > XQuery and XSLT > Modules and Paths" Settings page and set the "Database installation path:" to the root MarkLogic path, e.g. "C:\Program Files\MarkLogic".

If you want to customize this you can specify IntelliJ modules as described in https://rhdunn.github.io/xquery-intellij-plugin/tutorials/module-paths.html.

  • Related