MLCopilot — First Marklogic VS Code extension.
Let me tell you the story of why I created this extension. I’ve been in the IT domain since 2014. I worked on many publishing-domain…
MLCopilot — First Marklogic VS Code extension.
Let me tell you the story of why I created this extension. I’ve been in the IT domain since 2014. I worked on many publishing-domain projects, including Walter Cluwer, Apple, BSI (British Standards Institution), Standards Australia, ASTM, Smith & Nephew, and CAS (Chemical Abstracts Service). One thing was common on these projects: I was tackling XML Data with Marklogic database. So on a daily basis, I have to write XQuery, XSLT, XML, and MarkLogic code. Currently, in programming languages, you can get extensions for every language, but for X technologies, there are very few extensions on the market. So you have to work manually on VS Code. Here, one thing comes to mind: let’s create an extension that will focus on these X programming languages. So I created MLCopilot — A VS Code extension that helps developers expedite their daily tasks.
The Problem We HAD — Solved
- No Real-time syntax help
- No Real-time query error detection
- No Intelligence in the build Gradle file for CORB & MLCP
- No generators for MLCP/CORB Task
- No navigation features for XQY in ANY extension ever
- No editor support to run Marklogic script directly
Language Support
XQuery & XSLT Syntax Highlighting: Full syntax highlighting for .xq, .xqy, .xquery, .xql, .xqm and .xsl, .xslt files with theme-aware colours for light and dark modes. Variables, functions, types, keywords, and operators are all distinctly colored.

XQuery & XSLT Syntax Highlighting
Real-time XQuery Error Detection: 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.

Real-time XQuery Error Detection
Code 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.

Code Snippets
INTELLISENSE & HOVER DOCS
MarkLogic Function Autocomplete: 3,000+ built-in MarkLogic functions available as completions, triggered automatically by : and -. Each completion shows the full signature and documentation inline.

MarkLogic Function Autocomplete
Hover Documentation: 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.

Hover Documentation
MLCP & CoRB IntelliSense is in build.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.

MLCP & CoRB IntelliSense
AI-POWERED FEATURES
Natural Language → XQuery: Describe your query in plain English, and AI generates optimised 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).

Natural Language → XQuery
Explain Selected XQuery Code: 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 the right-click context menu (Ctrl + Shift + E).

Explain Selected XQuery Code
Hover Error Explanation & Fix Suggestion: 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.

Hover Error Explanation & Fix Suggestion
**NOTE: **AI-POWERED FEATURES only work when you authenticate with your AI Model keys. You can switch between AI providers at any time via quick pick:
- Auto — tries Claude Code → ChatGPT → Gemini automatically
- Claude Code — free, no API key needed (uses the Claude Code VS Code extension)
- ChatGPT — OpenAI API (requires
mlcopilot.openai.apiKey) - Gemini — Google Gemini API (free tier available, requires
mlcopilot.gemini.apiKey)
TASK GENERATORS
MLCP Task Generator: 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.
Shortcut: Ctrl+Shift+M in build.gradle
CoRB Task Generator: 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.

CoRB Task Generator
Shortcut: Ctrl+Shift+C in build.gradle
NAVIGATION & REFERENCES
Go to Definition: 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: 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 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.

NAVIGATION & REFERENCES
QUERY EDITOR
Dedicated Query Editor Panel: 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: 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.

Dedicated Query Editor Panel
TASKS PANEL
Auto-Discovery of MLCP & CoRB 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: 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.

Auto-Discovery of MLCP & CoRB Tasks
Here is the link to the ML Copilot VS Code extension. Give it a try and let us know if you have any suggestions.
Link: https://marketplace.visualstudio.com/items?itemName=akbar-marklogic.marklogic-copilot
Thank You. Ali
메타데이터
- post_id
- 854e8f6e26fc
- slug
- mlcopilot-first-marklogic-vs-code-extension-854e8f6e26fc
- url
- https://medium.com/@akbar2345/mlcopilot-first-marklogic-vs-code-extension-854e8f6e26fc
- canonical_url
- https://medium.com/@akbar2345/mlcopilot-first-marklogic-vs-code-extension-854e8f6e26fc
- author_url
- https://medium.com/@akbar2345
- status
- ok
- fetched_at
- 2026-06-26 21:52:29