🤖

MLCopilot

Your intelligent AI companion for MarkLogic development — XQuery, XSLT, MLCP, CoRB, and beyond.

VS Code Extension
v1.0.3 VS Code 1.115+ By Akbar Ali
Language Support
📝
XQuery & XSLT Syntax Highlighting
Language

Full syntax highlighting for .xq, .xqy, .xquery, .xql, .xqm and .xsl, .xslt files with theme-aware colors for light and dark modes. Variables, functions, types, keywords, and operators are all distinctly colored.

⚠️
Real-time XQuery Error Detection
LSP

Language Server Protocol (LSP) integration performs live static analysis of XQuery files and surfaces errors instantly in the Problems panel. Catches syntax and type errors before you even run the code.

✂️
Code Snippets
Snippets

Curated XQuery snippets (FLWOR, module namespace, imports, function declarations) and XSLT snippets (stylesheets 2.0/3.0, templates, for-each, if, choose) for rapid scaffolding. Just type the trigger prefix and press Tab.

IntelliSense & Hover Docs
💡
MarkLogic Function Autocomplete
IntelliSense

3 000+ built-in MarkLogic functions available as completions, triggered automatically by : and -. Each completion shows the full signature and documentation inline.

📖
Hover Documentation
Hover

Hover over any MarkLogic built-in function to see its signature, parameters, return type, and usage examples in a rich tooltip. Works both in XQuery files and in build.gradle for MLCP/CoRB properties.

🔧
MLCP & CoRB IntelliSense in build.gradle
Gradle

Autocomplete and hover for MLCP (IMPORT / EXPORT / COPY properties) and CoRB task properties directly inside build.gradle. Each suggestion includes type, valid values, and examples.

AI-Powered Features
✨
Natural Language → XQuery
AI

Describe your query in plain English and AI generates optimized XQuery code in a side panel with a one-click copy button. Saves hours on complex FLWOR expressions and MarkLogic API calls.

Ctrl+Shift+X
🔍
Explain Selected XQuery Code
AI

Select any XQuery block and get an AI-powered plain-English explanation covering constructs, purpose, and potential gotchas — displayed in a side panel. Also available via right-click context menu.

Ctrl+Shift+E
🛠️
Hover Error Explanation & Fix Suggestion
AI

Hover over a syntax error underline to get an AI-generated explanation of why the error occurs and a concrete fix suggestion. Eliminates the need to look up cryptic error messages in documentation.

Task Generators
📦
MLCP Task Generator
MLCP

Interactively build MarkLogic Content Pump (MLCP) Gradle tasks for CSV, TSV, JSON, XML import, or export — right inside VS Code. Prompts for task name, database, collection, batch size, threads, and transaction size.

Ctrl+Shift+Min build.gradle
🔄
CoRB Task Generator
CoRB

Generates Content on Request (CoRB) Gradle task definitions interactively — choose module-based or file-based URIs, thread count, and optional export file. Produces a fully configured task block in seconds.

Ctrl+Shift+Cin build.gradle
Navigation & References
🎯
Go to Definition
Navigation

Right-click any function or variable in XQuery and jump directly to its definition across all XQuery module files in the workspace. Works for user-defined functions and imported module members.

🔗
Find All References
Navigation

Lists every reference to a symbol across the workspace in a dedicated References panel via right-click context menu. Ideal for refactoring or understanding the blast radius of a change.

▶️
Run on MarkLogic
Execute

Execute any .xqy file directly against a configured MarkLogic server from the Explorer or editor context menu and see results in the output panel. No separate client or tooling required.

Query Editor
🖊️
Dedicated Query Editor Panel
Query

A full-featured Activity Bar query editor for writing and running XQuery, JavaScript, SQL, or SPARQL directly against MarkLogic's REST API — without leaving VS Code. Supports F5 / Ctrl+Enter to run, partial-selection execution, on-demand database refresh, and Copy URI hover button in the document explorer.

📂
Multi-Workspace Query Management
Workspaces

Switch, create, clone, and delete named query workspaces via the Workspace menu in the Queries rail — each with its own set of tabs and active state. Export all workspaces to XML or import from XML / legacy JSON for team sharing and backup.

Tasks Panel
📋
Auto-Discovery of MLCP & CoRB Tasks
Tasks

Automatically scans all build.gradle files in the workspace and lists every MLCP and CoRB task in organized tables with type badges. No manual configuration needed.

🚀
One-Click Task Execution
Tasks

Run tasks with DEV, PROD, or LOCAL environment buttons that spawn a terminal automatically. Shows real-time animated running status and prevents duplicate task executions.

Multi-Provider AI Support
🤖
Auto
Tries Claude → ChatGPT → Gemini automatically
⚡
Claude Code
Free · No API key needed
💬
ChatGPT
OpenAI API · gpt-4o default
💎
Gemini
Google · Free tier available
Commands & Keyboard Shortcuts
Feature Command Windows / Linux Mac Context
NL → XQuery MLCopilot: Natural Language to XQuery Ctrl+Shift+X Cmd+Shift+X Any XQuery file
Explain Code MLCopilot: Explain Selected XQuery Code Ctrl+Shift+E Cmd+Shift+E XQuery + selection
MLCP Task MLCopilot: Generate MLCP Task Ctrl+Shift+M Cmd+Shift+M build.gradle
CoRB Task MLCopilot: Generate CoRB Task Ctrl+Shift+C Cmd+Shift+C build.gradle
Go to Definition MLCopilot: definition Right-click context menu XQuery file
Find References MLCopilot: FindAllReferences Right-click context menu XQuery file
Run on MarkLogic MLCopilot: Run on MarkLogic Right-click context menu Editor / Explorer
Query Editor MLCopilot: Open Query Editor Activity Bar / Command Palette Global
Switch AI Provider MLCopilot: Switch AI Provider Command Palette Global
Refresh Tasks MLCopilot: Refresh Tasks Tasks Panel title bar icon Tasks Panel