This is a plugin for the IntelliJ IDE that adds support for the XML Query (XQuery) and XML Path (XPath) languages. This covers support for:
- XPath 2.0, 3.0, and 3.1;
 - XQuery 1.0, 3.0, and 3.1;
 - XQuery and XPath Full Text extension;
 - XQuery Update Facility 1.0, and 3.0 extension;
 - XQuery Scripting extension;
 - EXPath extensions;
 - BaseX, MarkLogic, and Saxon vendor extensions.
 
This plugin also has limited support for the following XML-based languages that use XPath:
- XSLT 1.0-3.0 (active when the IntelliJ XPathView plugin is disabled);
 - XProc 1.0-3.0.
 
See https://rhdunn.github.io/xquery-intellij-plugin/ for the plugin documentation and tutorials.
The latest development version of this plugin supports IntelliJ 2022.3 – 2025.2. Older versions of the plugin are compatible with older versions of IntelliJ.
This plugin provides support for the following implementations of XQuery:
- BaseX 7.0 – 9.3;
 - eXist-db 4.4 – 5.3;
 - FusionDB alpha;
 - MarkLogic 8.0 – 10.0;
 - Saxon 9.2 – 10.0.
 
For those XQuery implementations, this plugin supports:
- Running XQuery, XSLT, XPath, SPARQL, SQL, and JavaScript queries where supported by the implementation;
 - Profiling XQuery and XSLT queries;
 - Debugging MarkLogic XQuery-based queries, with expression breakpoint support;
 - Viewing access and error log files.
 
This plugin provides additional integration support for the following query processor file types and standards:
- MarkLogic rewriter XML files;
 - EXQuery RESTXQ 1.0.
 
This plugin adds support for the following project frameworks:
- MarkLogic Roxy – source root detection;
 - MarkLogic ml-gradle – source root detection.
 - Support running and profiling XRay unit tests.
 
This plugin provides support for the following IntelliJ features:
- Resolving URI string literal, function, and variable references;
 - Code folding;
 - Find usages and semantic usage highlighting;
 - Rename refactoring for variables;
 - Code completion;
 - Parameter information;
 - Parameter inlay hints;
 - Structure view;
 - Breadcrumb navigation, including highlighting XML tags in the editor like the IntelliJ XML plugin;
 - Paired brace matching;
 - Commenting code;
 - Integrated function documentation ("Quick Documentation", Ctrl+Q);
 - Context information (Alt+Q) for XQuery function declarations;
 - Spellchecking support with bundle dictionaries with XPath, XQuery, and XSLT terms.
 - Language injection support on various elements, including string literals.
 
The plugin also supports the following IntelliJ Ultimate features:
- Support displaying MarkLogic rewriter files in the Endpoints tool window;
 - Support displaying EXQuery RESTXQ endpoints in the Endpoints tool window.
 
This project uses gradle. It requires gradle 8.5 or later. You can then use:
gradle ....
If you open the project in IntelliJ it will install and configure the gradle wrapper for you. You can then use:
./gradlew ...if using a bash or similar shell;gradlew.bat ...if using Windows.
The Java version depends on the version of IntelliJ being targeted:
- IntelliJ 2022.3 - 2024.1 require Java 17;
 - IntelliJ 2024.2 - 2025.2 require Java 21.
 
In IntelliJ you need to specify the Gradle JVM property (File | Settings |
Build, Execution, Deployment | Build Tools | Gradle) to that Java version.
The version of IntelliJ to build can be configured as follows:
| Environment Variable | System Property | Default | Description | 
|---|---|---|---|
IDEA_TYPE | 
platform.type | 
IU | 
IntelliJ platform type. | 
IDEA_VERSION | 
platform.version | 
2025.1 | 
IntelliJ version. | 
The following are some useful gradle tasks:
clean-- clear previous build artifacts;:buildPlugin-- build the plugin to thebuild/distributionsdirectory;:runIde-- run an instance of the specified IntelliJ IDE with the plugin installed;check-- run the tests;:verifyPlugin-- run the IntelliJ plugin verifier to check for compatibility.
Copyright (C) 2016-2025 Reece H. Dunn
This software and document includes material copied from or derived from the XPath and XQuery specifications. Copyright © 1999-2017 W3C® (MIT, ERCIM, Keio, Beihang).
The IntelliJ XQuery Plugin is licensed under the Apache 2.0 license.
