Best IDE for Marklogic projects


#1

Hi all,

I’m looking for the best IDE to develop with Marklogic (under Windows env).

I currently use WebStorm with XQuery extension. Same for javascript. I like the presentation, very similar to Visual Studio and Resharper refactoring functions.
An extension is available for MarkLogic / XQuery but it seems not to work and throws error.

I haver a dream with an IDE that I could use for XQuery and Javascript with autocompletion (even for Marklogic functions) and syntax helper…

So what do you use for your projects ?

Any feedback welcome.

Thanks


#2

Hi @johan,

Excellent question :slight_smile: I don’t know any IDE with out-of-the-box, complete MarkLogic support. Espcially when it comes to supporting both XQuery and Javascript. But here is what I use:

  • oXygen is the XML IDE
  • Emacs with completion for MarkLogic functions

This is probably the best you can have right now: oXygen is the closest to a full IDE, except it lacks support for Javascript, and using my own preferred text editor for JavaScript.

oXygen

This is the best option if you are looking for a graphical IDE, like VS or Eclipse. The only drawback here is that it does not support JavaScript. It supports XQuery, XML, JSON, XSLT, XML Schema, but not JavaScript. Depending on your project, it might be a problem, or not.

Once you configured the data source for MarkLogic, you can edit XQuery modules with MarkLogic function completion, edit files on place in the database, run queries from within oXygen like you would in QConsole, and much more.

And if you are a debugger kind of guy, there is even a debugger for XQuery on MarkLogic.

Check out the documentation for all details.

Emacs

This part is probably very specific to my own preferences. The general idea is to configure your preferred text editor to support MarkLogic functions, especially for JavaScript.

I have been using Emacs for 2 decades now, for almost everything. oXygen is the only tool to get me out of it sometimes, when I need an easy way to execute transformations or queries.

So I configured it to provide completion for MarkLogic functions, both in XQuery and JavaScript. This is all I need for pure source code typing: https://github.com/fgeorges/company-ml.

If you use something else for JavaScript, check out the extensions for your editor. I think there are several editors with a MarkLogic extension.


#3

@fgeorges

Thanks for you reply.
I will try oXygen if I ever have to work with XQuery project :wink:

For JS, my next step will be to test VS Code which seems to have an evaluator for request (detail here


#4

You should try my MarkLogic Debugger plugin for IntelliJ IDEA. I am a hardcore MarkLogic and XQuery user (I worked at MarkLogic for several years in the early days) and I’m a huge fan of IntelliJ/IDEA for all my coding in all languages.

I’m not a WebStorm user but I know that my plugin has worked on earlier versions of it. If the current version of the plugin is not working I’d like to hear about it, I may be able to help. If anyone else is using it on any of the other JetBrains tools I’d like to know if it’s working for you as well. I use it heavily every day.

I maintain the XQuery plugin in my spare time, which I don’t have much of at the moment, but you can log bug reports here: https://github.com/overstory/marklogic-intellij-plugin/issues and I will get to.

There are several XQuery plugins for IntelliJ out there (including an older one that I started several years ago but eventually abandoned). The one you want is titled “XQuery Support + MarkLogic Debugger”, version 1.0. You can find it within the IDE by going to the Plugins preferences, browsing repositories, then searching for “marklogic”.

The official plugin page is here: https://plugins.jetbrains.com/plugin/9757-xquery-support--marklogic-debugger

Cheers.


#5

@ronhitchens

Thanks for your reply (and for your work on the plugin).
I tried with the latest version of Webstorm and it seems not to work well with your plugin.
May be an issue on my side I think.

As now I’m working with JS on Marklogic, I stopped to test several tools. I’m trying to find a good IDE (with autocomplete, debug, …) but regading your answer, I will install IntelliJ/Idea :wink:

Have a nice day


#6

Make sure you don’t have any other XQuery plugins enabled in your IDE, they will conflict if more that one plugin tries to handle the XQuery file type. It should work fine on the community version of IDEA.

If you can describe the problems you’re having in WebStorm, please long a bug issue on GitHub so I can look into it. I would like the plugin to work on as many JetBrains variants as possible.

I may contact you in the future to do some some testing on WebStorm before I release the next version.


#7

@johan I forgot to mention…

It is a completely different usage, but if you ever need/want to modify a module (or any document) in place, directly on a database, the ML Console comes with an editor.

And it supports completion of MarkLogic functions, in both JavaScript and XQuery:

mlc-complete

It is not an IDE for day to day work, but it can be handy sometimes.


#8

@ronhitchens

By default, Webstorm does not allow to active 2 plugins for Xquery at the same time (conflict message is displayed).
After investigations, I found my issue :slight_smile:

First I have to reference Marklogic folder as Resource Root in my project.

Then I have to replace default header xquery version "3.0" by xquery version "1.0-ml";

And third, with the namespace xdmp for instance, I don’t have to enter xdmp: to get autocompletion.
But just xdmp

image

Feel free to contact me if necessary.

Have a nice day

nb : thanks for your work on this plugin