How do you setup the MarkLogic XQY Debugger in Visual Studio Code. Can someone direct me to actual sample example of debugging similar to the MarkLogic Java Script (JS) Debugger https://developer.marklogic.com/learn/visual-studio-code/
Asked
Active
Viewed 217 times
1 Answers
0
The steps to add and configure the XQuery debugger are similar to how to configure for JavaScript debugging. When creating a new launch.json
, select MarkLogic XQY Debugger, instead of MarkLogic JS Debugger.
Example entries are documented in the Debugging section of the MarkLogic developer tools marketplace documentation, and on the GitHub project readme:
Debugging
Both JavaScript and XQuery debuggers support two modes of debugging:
- Launch: Evaluates a main module (for JavaScript) or non-library module (for XQuery)
- Attach: Intecepts an existing request, such as from an integration test Where it can, query debugging uses the same VS Code settings used for running queries (for example,
marklogic.host
,marklogic.username
). In addition to these code settings, you will need a launch config in your project (under.vscode/launch.json
) for debug-specific parameters.
Open the
launch.json
from the VS Code command palette with the command:Debug: Open launch.json
.
Below is an example of a
launch.json
file, with JavaScript and XQuery configurations for both launch and attach:
{
"version": "2.0.0",
"configurations": [
{
"request": "launch",
"type": "ml-jsdebugger",
"name": "Evaluate Current JavaScript Module"
},
{
"request": "attach",
"type": "ml-jsdebugger",
"name": "Attach to Debug Request",
"root": "${workspaceFolder}/src/main/ml-modules/root",
"debugServerName": "Enter debug server name"
},
{
"request": "launch",
"type": "xquery-ml",
"name": "Launch XQY Debug Request",
"program": "",
"root": "${workspaceFolder}/src/main/ml-modules/root"
},
{
"request": "attach",
"type": "xquery-ml",
"name": "Attach to XQY Debug request",
"root": "${workspaceFolder}/plugins"
}
]
}

Mads Hansen
- 63,927
- 12
- 112
- 147