Changes

Jump to navigation Jump to search
1,740 bytes added ,  12:51, 2 July 2020
m
Text replacement - "[http://basex.org/" to "[https://basex.org/"
* The [https://plugins.jetbrains.com/plugin/8612-xquery-intellij-plugin xquery-intellij-plugin] by Reece H. Dunn.
* The [https://plugins.jetbrains.com/plugin/7262-xquery-support XQuery Support] plugin by Grzegorz Ligas.
* Both plugins offer support for XQuery 3.1 and can be run as a client or standalone instance. Please note that the two plugins are mutually exclusive and cannot be activated at the same time in IntelliJ.
* '''Note:''' BaseX itself is a highly compliant XQuery 3.1 processor. We strongly encourage you to use the [[Graphical_User_Interface#Text_Editor|XML editor]] integrated into the BaseX GUI to edit and query your XML data!<br/><br/>
* Install either version of IntelliJ IDEA: [https://www.jetbrains.com/idea/#chooseYourEdition the Community or Ultimate edition].
* Download your favorite [httphttps://basex.org/download BaseX distribution] (JAR, ZIP, EXE).
* Start BaseX (see [[Startup]]).
* Create a BaseX database (see [[Databases]]).
This section focuses on Reece H. Dunn's [https://plugins.jetbrains.com/plugin/8612-xquery-intellij-plugin xquery-intellij-plugin].
 
The plugin is very well maintained! It adds support for various XQuery Implementations to the IntelliJ IDEA (among them BaseX). It provides syntax highlighting for XQuery and XML and detects syntactical errors while you type offering a description for each error. Queries are executed using Run Configurations for which you can configure various query processors, e.g. BaseX.
 
The plugin contains some minor flaws regarding the static binding of BaseX namespaces. Also, the IntelliJ ''Find Usages'' and ''Go To'' options did not work as expected in some cases, especially with regard to functions and across modules. The plugin does not yet include a code completion feature.
==Installation==
* In the ''Manage Query Processors'' dialog, click on the {{Code|+}} button.
* In the ''New Query Processor Instance'' dialog, set the following preferences:
** <code>Name Description = BaseX</code> (optional; if you leave this field blank, <code>[Implementation] [Version]</code> will be used as namedescription)
** <code>Implementation = BaseX</code> (should be preset!)
** <code>JAR File = BaseX.jar</code> (name and location of the JAR file may differ depending on your BaseX distribution and version)
* Enter a name, e.g. "BaseX", into the ''Name'' field.
* The query processor should be preset to "BaseX [''Version''] (BaseX)".
* In the ''Script FileRun the query from'' fieldarea, either enter the path to your query fileinto the ''Local file'' field to limit the run configuration to that query or choose the ''Active editor file'' option to make the configuration run the script that is currently opened in the IntelliJ editor panel.
[[File:Intellij-xquery-configuration.png]]
* Click ''Apply'' and then ''OK'' to close the ''Run/Debug Configurations'' dialog.
* If the configuration does not run as a standalone instance, make sure that BaseX is up and running.
* Click the ''Run'' button to execute your query.
 
==Conclusion==
 
The plugin is very well maintained! It adds support for various XQuery Implementations to the IntelliJ IDEA (among them BaseX). It provides syntax highlighting for XQuery and XML, code completion and detects syntactical errors while you type offering a description for each error. Queries are executed using Run Configurations for which you can configure various query processors, e.g. BaseX.
 
BaseX's admin log can be accessed and displayed using the '''Query Log''' button on the bottom left corner of the IntelliJ IDEA project window.
 
The plugin contains some minor flaws regarding the use of functions declared in user-defined modules. Such functions are not included in the code completion list and marked as unknown in the code. However, query execution in the BaseX backend works fine nonetheless.
=XQuery Support Plugin=
* Now, the configuration should be set and the green ''Run'' button should be available below the IntelliJ IDEA menu bar.
[[File:Intellij-run-button.png]]
 
'''Execute Your Query'''
* If the configuration does not run as a standalone instance, make sure that BaseX is up and running.
* Click the ''Run'' button to execute your query.
 
==Conclusion==
The plugin adds support for various XQuery Implementations to the IntelliJ IDEA (among them BaseX). It provides syntax highlighting for XQuery and XML and detects syntactical errors while you type offering a description for each error. Queries are executed using Run Configurations for which you can configure various query processors, e.g. BaseX. The plugin offers code completion for XQuery functions, integrated library modules, such as FunctX or the BaseX Module Library, and user-defined modules. IntelliJ’s Find Usages and Go To options seem to work fine for variables and functions, even across modules. Users can set XQuery-specific code style preferences.
 
This plugin also has a few minor drawbacks. If no path is specified, syntax highlighting marks user-defined modules as unknown, even if they reside in the designated BaseX module repository. However, the BaseX query processor, resolves them correctly during query execution. Error messages in the editor seem to be kept rather general and should me more specific.
Parameter lists of code completion may be quite extensive and clog the screen.
Leading tab space can be increased in user-defined steps, but neither decreased in single, nor user-defined steps.
Bureaucrats, editor, reviewer, Administrators
13,550

edits

Navigation menu