Conversation
Replace format pattern 'yyyy-MM-ddTHH:mm:ssZ' with a valid example '2025-01-01T00:00:00Z'. The format pattern was confusing — users typed over it with values like '2222-11-11T11:11:111' which fail ISODate validation. Also update date range snippet with realistic start/end dates.
… and improved sorting
… for unknown identifiers
Previously `new Daddddte()` was not flagged because the validator only handled CallExpression nodes. NewExpression has the same callee shape but was not visited. Now unknown constructors in `new Foo()` produce error diagnostics (red squiggles), and near-miss typos like `new Dae()` produce warnings.
Add Date.now(), Math.floor(), Math.ceil(), Math.round(), Math.min(), Math.max() as individual completion items alongside the class-level Date/Math entries. Removed the bare `Math` entry since the individual methods are more useful. All entries use sort prefix 4_ (after BSON constructors at 3_).
…_COMPLETION_META PROJECTION_COMPLETION_META was ['field:identifier'] which returned 0 static entries — projection operators ($slice, $elemMatch, $) and BSON constructors were never shown in project/sort editors. Added 'query:projection' and 'bson' to the meta preset.
Never use git add -f to override .gitignore. Files in docs/plan/ and docs/analysis/ are local planning documents excluded from the repo.
- Remove unnecessary escape in template literal (no-useless-escape) - Formatter-applied changes to imports and whitespace
Tests were using 'int' but the schema analyzer produces 'int32' (BSONTypes.Int32). Also fixed applicableBsonTypes in documentdb-constants bitwise operators to use 'int32' to match, which was a real production mismatch.
When cursorContext is undefined or 'unknown', show the full set of completions (fields, all operators, BSON constructors, JS globals) instead of only key-position items. This is a better UX fallback — when context can't be determined, the user is better served by seeing everything available.
These debug logs were used during development and logged full editor text and completion items to the webview console on every keystroke. Removed to avoid unnecessary noise and potential data exposure.
…nd include JS globals
Documentation links like [DocumentDB Docs](https://...) were not rendered as
clickable hyperlinks in Monaco's completion detail panel. Monaco requires
{ value: string, isTrusted: true } on MarkdownStrings to enable link rendering.
Set isTrusted: true on operator documentation MarkdownStrings in
mapOperatorToCompletionItem. This is safe because the documentation content
comes entirely from documentdb-constants (operator descriptions we control),
not from user-generated content.
…oft/vscode-documentdb into feature/shell-integration
Add informational messages when: - Playground file is empty (runAll) - No code to run / no code block at cursor (runSelected) - No database connection (executePlaygroundCode) - A playground is already running (executePlaygroundCode) Previously these cases returned silently with no feedback.
|
C1 Fix: Silent Failures — Added user feedback for blocked operations Multiple early-return paths in playground commands now show informational messages instead of silently returning:
Commit: 9b956fb |
Add initialization promise lock so concurrent evaluate() calls during initialization await the same promise instead of spawning duplicate workers.
|
C2 Fix: Race condition — concurrent shell worker initialization Added initialization promise lock in Commit: d7eecae |
Wrap evaluateFresh() body in try/finally to call instanceState.close() after each evaluation. Prevents leaking ShellInstanceState, ShellEvaluator, and vm.Context resources on every playground run.
|
C3 Fix: Fresh mode resource leak Wrapped Commit: 9f2a544 |
Add assertDocumentObject() guard after parseShellBSON() for projection and sort parameters. Rejects scalars, arrays, and null with a clear QueryError instead of passing invalid values to the driver.
|
H2 Fix: parseShellBSON type validation for projection/sort Added Commit: bc2fcd6 |
…rs (M5, M7, M8)
M5: Replace toLocaleString() with toISOString() for playground filenames
to avoid locale-dependent characters in file paths.
M7: Replace localeCompare with sensitivity:'base' with strict === equality
for query cache keys. Prevents false cache hits (e.g., café vs cafe).
M8: Log unexpected errors during AST walk instead of silently swallowing
all exceptions. SyntaxErrors are still suppressed as expected.
|
M5, M7, M8 Fixes: Three medium-severity cleanups
Commit: d60288b |
Show the human-readable clusterDisplayName when credential lookup fails instead of the internal clusterId.
|
M6 Fix: Display name in credential error Error message in Commit: d1ad9b1 |
… M4)
M3: Add 300ms debounce to onDidChangeTextDocument handler in
PlaygroundDiagnostics to avoid O(n) regex scans on every keystroke.
M4: Clear existing schema data before scanning in scanCollectionSchema()
so users get a fresh scan result instead of accumulated stale entries.
|
M3, M4 Fixes: Diagnostics debounce & schema scan cleanup
Commit: 20f608c |
Replace four separate nullable fields (_persistentInstanceState, _persistentEvaluator, _persistentContext, _persistentVmContext) and _persistentInitialized flag with a single _persistent compound object. Eliminates partial initialization risk and removes all non-null assertions. Also fix test mock to include close() method for C3 compatibility.
|
M9 Fix: Consolidate persistent shell state into single compound object Commit: c6d0558 |
Replace space-only word delimiter with alphanumeric+underscore+dollar pattern for word navigation. Now db.collection.find() navigates by word boundaries (db, collection, find) instead of requiring one space per word.
|
M12 Fix: Word navigation uses proper word boundaries
Commit: 2a0f689 |
…(H4) dropCollection/createCollection now clear the collections cache for that database. dropDatabase/createDatabase clear the databases cache. Prevents stale entries in autocomplete and tree views after mutations.
|
H4 Fix: ClustersClient cache invalidation after CRUD operations
Commit: 78d719f |
Add documentDB.shell.initTimeout setting (default: 60 seconds) to prevent the shell from hanging indefinitely if worker spawn or connection fails. Wraps ensureWorker() in Promise.race against a timeout.
|
M2 Fix: Configurable shell initialization timeout Added Commit: 8c3b760 |
- Update l10n bundle with new user-facing strings from review fixes - Fix no-unsafe-assignment lint errors in ClustersClient parseShellBSON - Apply prettier formatting to newPlayground.ts and runSelected.ts
Shell Integration — DocumentDB Query Language & Autocomplete
Umbrella PR for the shell integration feature: a custom
documentdb-queryMonaco language with intelligent autocomplete, hover docs, and validation across all query editor surfaces (filter, project, sort, aggregation, query playground).Work is organized as incremental steps, each delivered via a dedicated sub-PR merged into
feature/shell-integration.Progress
SchemaAnalyzer(JSON Schema output, incremental merge, 24 BSON types)@vscode-documentdb/schema-analyzerpackage, enrichedFieldEntrywith BSON types, added schema transformers, introduced monorepo structuredocumentdb-constantsPackage · feat: add documentdb-constants package — operator metadata for autocomplete #513 — 308 operator entries (DocumentDB API query operators, update operators, stages, accumulators, BSON constructors, system variables) as static metadata for autocompletedocumentdb-querycustom language with JS Monarch tokenizer (no TS worker), validated via POC across 8 test criteriaCompletionItemProvider· feat: documentdb-query language — CompletionItemProvider, HoverProvider, acorn validation #518 —documentdb-querylanguage registration, per-editor model URIs, completion data store,CompletionItemProvider(filter/project/sort),HoverProvider,acornvalidation,$-prefix fix, query parser replacement (shell-bson-parser), type-aware operator sorting, legacy JSON Schema pipeline removalcompletions/folderconnectToClient,mongoConnectionStrings).documentdbfiles with JS syntax highlighting, CodeLens (connection status, Run All, per-block Run), in-process@mongosheval reusing existingMongoClient, result formatting with headers/code echo/error hintsSchemaStore) · feat: Shared Schema Cache (SchemaStore) — Step 6.1 #538 — SharedSchemaStoresingleton for cross-tab and query playground schema sharing, Quick Scan action for on-demand schema samplingMongoClientfor infinite-loop safety and eval isolationCompletionItemProvider· Step 7 WI-1/2/3/4/5: Scratchpad IntelliSense — Shell API types, TS Plugin, CompletionItemProvider, Dynamic Schema, Refinements, Shared Logic #543 — VS Code extension-hostCompletionItemProviderfordb.chains, operators, schema fields via.d.ts+ TS server plugin (inline snapshot injection) + custom provider. Fixed VSIX packaging: TS plugin stub now created at runtime (Vue/Volar pattern) since vsce hardcodesnode_modules/**exclusion. Tracked for npm publishing: WIP: Publish TS server plugin as standalone npm package #548query-language/directory: platform-neutral core →shared/, scratchpad completions →playground-completions/, webview folder renamed toquery-language-support/. Pure refactoring, no functionality changes.console.log(),print(), andprintjson()support via@mongoshevaluation listener; dedicated output channel; customPlaygroundResultProviderwith stable per-file result tabs, DocumentDB icon, JSONC grammar, unified error display; console output hint in results; help command updated with Console Output section.shell-runtimepackage extraction,@mongoshmain bundle removal (−47% main.js), wiredisplayBatchSizesetting, help text audit,PlaygroundDiagnosticsprovidershow dbs,use db,help,it,exit/quit; persistent eval context;CommandInterceptor; Ctrl+C cancellation; terminal links;WorkerSessionManagerrefactoring; legacylaunchShellremovalPost-Step 8 — UX Polish & Tree View Enhancements (direct pushes)
After merging Step 8 (Interactive Shell), the following UX improvements were pushed directly to the branch:
Inline action buttons in tree view — Added inline icon buttons to database and collection tree items across Connections, Discovery, and Azure views:
$(terminal) Open Interactive Shelland$(keyboard) New Query Playgroundinline buttons$(files) Open Collection,$(terminal) Open Interactive Shell, and$(keyboard) New Query Playgroundinline buttons$(terminal), collection open →$(files), playground →$(keyboard)Custom editor tab icons — Added dedicated SVG icons for webview editor tabs:
playground-light.svg/playground-dark.svg)Double-click to open Collection View — The
Documentstree item now requires a double-click to open the Collection View, preventing accidental tab opens on single-click browse. Implemented via a reusableregisterDoubleClickCommand()utility (500ms debounce window). Tooltip updated to hint at the double-click behavior.Published AI & dev documentation — Committed the full series of planning documents used during development (
docs/ai-and-plans/interactive-shell/anddocs/ai-and-plans/future-work/), covering the high-level plan, all step-level design docs, and future work proposals.Key Architecture Decisions
documentdb-querycustom language — JS Monarch tokenizer, no TS worker (~400-600 KB saved)CompletionItemProvider+ URI routing (documentdb://{editorType}/{sessionId})documentdb-constantsbundled at build time; field data pushed via tRPC subscriptionacorn.parseExpressionAt()for syntax errors;acorn-walk+documentdb-constantsfor identifier validationlanguage="json"with JSON Schema validationlanguage="documentdb-playground"referencing built-in JS grammar; in-process eval with@mongoshpackages reusing existingMongoClient@mongoshcontext,CommandInterceptorfor shell commands