Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e796403
feat(scratchpad): Phase 1 — worker thread scaffold
tnaum-ms Mar 25, 2026
088fed0
feat(scratchpad): Phase 2 — main thread integration
tnaum-ms Mar 25, 2026
c82ed50
feat(scratchpad): Phase 3 — worker disposal + lifecycle wiring
tnaum-ms Mar 25, 2026
c415bf7
feat(scratchpad): Phase 5 — SchemaStore doc cap + connection sync
tnaum-ms Mar 25, 2026
bd7c3a8
fix(scratchpad): use EJSON.parse for BSON type fidelity in schema ana…
tnaum-ms Mar 25, 2026
3663860
feat(scratchpad): phased progress notifications
tnaum-ms Mar 25, 2026
e88d390
fix(scratchpad): proper log levels, progress UX, cancel handling
tnaum-ms Mar 25, 2026
c95c106
fix(scratchpad): fix editor close detection + add schema stats command
tnaum-ms Mar 25, 2026
a1fe892
fix(scratchpad): normalize CursorIterationResult to plain Array befor…
tnaum-ms Mar 25, 2026
4909cb2
fix(scratchpad): unwrap CursorIterationResult { documents } wrapper
tnaum-ms Mar 25, 2026
6a825a6
fix(scratchpad): show authoritative result type in output header
tnaum-ms Mar 25, 2026
2f4d90a
fix(scratchpad): show result metadata for untyped results (.toArray, …
tnaum-ms Mar 25, 2026
479257b
fix(scratchpad): polish output headers, logging, schema stats display
tnaum-ms Mar 26, 2026
ef2cc9b
feat(scratchpad): modal connect dialog + multi-statement documentation
tnaum-ms Mar 26, 2026
e2db9fe
fix(scratchpad): use generic 'client' terminology in logs and comments
tnaum-ms Mar 26, 2026
2ff3165
fix(scratchpad): clean up worker on init failure to prevent stranded …
tnaum-ms Mar 26, 2026
12a02e1
fix(scratchpad): use canonical EJSON for worker IPC to preserve BSON …
tnaum-ms Mar 26, 2026
450443e
chore(scratchpad): add TODO comments for unwired displayBatchSize field
tnaum-ms Mar 26, 2026
10976e1
fix(scratchpad): localize user-visible error messages in ScratchpadEv…
tnaum-ms Mar 26, 2026
7eba164
chore: l10n
tnaum-ms Mar 26, 2026
137ddc1
feat(scratchpad): enhance telemetry for scratchpad execution and work…
tnaum-ms Mar 27, 2026
f30c7b6
feat(scratchpad): add runMode parameter to executeScratchpadCode for …
tnaum-ms Mar 27, 2026
986e2b8
fix(scratchpad): tighten cursor unwrap to require full CursorIteratio…
tnaum-ms Mar 27, 2026
497ff53
fix(scratchpad): use generic 'Operation timed out' message for sendRe…
tnaum-ms Mar 27, 2026
ed12046
fix(scratchpad): pass actual duration to formatError instead of hardc…
tnaum-ms Mar 27, 2026
f9cfe22
perf(scratchpad): use partial Fisher-Yates for randomSample
tnaum-ms Mar 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions l10n/bundle.l10n.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
"{0} completed successfully": "{0} completed successfully",
"{0} connections": "{0} connections",
"{0} created": "{0} created",
"{0} documents returned": "{0} documents returned",
"{0} failed: {1}": "{0} failed: {1}",
"{0} file(s) were ignored because they do not match the \"*.json\" pattern.": "{0} file(s) were ignored because they do not match the \"*.json\" pattern.",
"{0} inserted": "{0} inserted",
Expand Down Expand Up @@ -185,6 +184,7 @@
"Authenticate to Connect with Your DocumentDB Cluster": "Authenticate to Connect with Your DocumentDB Cluster",
"Authenticate using a username and password": "Authenticate using a username and password",
"Authenticate using Microsoft Entra ID (Azure AD)": "Authenticate using Microsoft Entra ID (Azure AD)",
"Authenticating…": "Authenticating…",
"Authentication configuration is missing for \"{cluster}\".": "Authentication configuration is missing for \"{cluster}\".",
"Authentication data (primary connection string) is missing for \"{cluster}\".": "Authentication data (primary connection string) is missing for \"{cluster}\".",
"Authentication data (properties.connectionString) is missing for \"{cluster}\".": "Authentication data (properties.connectionString) is missing for \"{cluster}\".",
Expand Down Expand Up @@ -367,6 +367,7 @@
"DocumentDB for VS Code is not signed in to Azure": "DocumentDB for VS Code is not signed in to Azure",
"DocumentDB Local": "DocumentDB Local",
"DocumentDB Performance Tips": "DocumentDB Performance Tips",
"DocumentDB Scratchpad": "DocumentDB Scratchpad",
"DocumentDB Scratchpad connected to {0}": "DocumentDB Scratchpad connected to {0}",
"DocumentDB Scratchpad connected to {0}/{1}": "DocumentDB Scratchpad connected to {0}/{1}",
"Documents": "Documents",
Expand Down Expand Up @@ -600,6 +601,7 @@
"Info from the webview: ": "Info from the webview: ",
"Information was confusing": "Information was confusing",
"Initializing task...": "Initializing task...",
"Initializing…": "Initializing…",
"Inserted {0} document(s).": "Inserted {0} document(s).",
"Install Azure Account Extension...": "Install Azure Account Extension...",
"Internal error: connectionString must be defined.": "Internal error: connectionString must be defined.",
Expand Down Expand Up @@ -710,6 +712,7 @@
"No collection has been marked for copy. Please use \"Copy Collection...\" first to select a source collection.": "No collection has been marked for copy. Please use \"Copy Collection...\" first to select a source collection.",
"No collection selected.": "No collection selected.",
"No Connectivity": "No Connectivity",
"No credentials found for cluster {0}": "No credentials found for cluster {0}",
"No credentials found for id {clusterId}": "No credentials found for id {clusterId}",
"No credentials found for the selected cluster.": "No credentials found for the selected cluster.",
"No database connected": "No database connected",
Expand Down Expand Up @@ -743,6 +746,7 @@
"Open the VS Code Marketplace to learn more about \"{0}\"": "Open the VS Code Marketplace to learn more about \"{0}\"",
"Opening DocumentDB connection…": "Opening DocumentDB connection…",
"Operation cancelled.": "Operation cancelled.",
"Operation timed out after {0} seconds": "Operation timed out after {0} seconds",
"Optimization Opportunities": "Optimization Opportunities",
"Optimize Index Strategy": "Optimize Index Strategy",
"Optimizing the index on {0} can improve query performance by better matching the query pattern.": "Optimizing the index on {0} can improve query performance by better matching the query pattern.",
Expand Down Expand Up @@ -823,18 +827,21 @@
"Report an issue": "Report an issue",
"Resource group \"{0}\" already exists in subscription \"{1}\".": "Resource group \"{0}\" already exists in subscription \"{1}\".",
"Result: {0}": "Result: {0}",
"Result: Array ({0} elements)": "Result: Array ({0} elements)",
"Result: Cursor ({0} documents)": "Result: Cursor ({0} documents)",
"Results found": "Results found",
"Retry": "Retry",
"Reusing active connection for \"{cluster}\".": "Reusing active connection for \"{cluster}\".",
"Revisit connection details and try again.": "Revisit connection details and try again.",
"Right-click a database or collection in the DocumentDB panel and select \"Connect Scratchpad to this database\".": "Right-click a database or collection in the DocumentDB panel and select \"Connect Scratchpad to this database\".",
"Role assignment \"{0}\" created for the {2} resource \"{1}\".": "Role assignment \"{0}\" created for the {2} resource \"{1}\".",
"Role Assignment {0} created for {1}": "Role Assignment {0} created for {1}",
"Role Assignment {0} failed for {1}": "Role Assignment {0} failed for {1}",
"Run": "Run",
"Run All": "Run All",
"Run the entire file ({0}+Shift+Enter)": "Run the entire file ({0}+Shift+Enter)",
"Run this block ({0}+Enter)": "Run this block ({0}+Enter)",
"Running scratchpad query…": "Running scratchpad query…",
"Running query…": "Running query…",
"Running…": "Running…",
"Save": "Save",
"Save credentials for future connections.": "Save credentials for future connections.",
Expand Down Expand Up @@ -1009,7 +1016,6 @@
"This will also delete {0}.": "This will also delete {0}.",
"This will prevent the query planner from using this index.": "This will prevent the query planner from using this index.",
"To connect to Azure resources, you need to sign in to Azure accounts.": "To connect to Azure resources, you need to sign in to Azure accounts.",
"To connect, right-click a database or collection in the DocumentDB panel and select \"Connect Scratchpad to this database\".": "To connect, right-click a database or collection in the DocumentDB panel and select \"Connect Scratchpad to this database\".",
"TODO: Share the steps needed to reliably reproduce the problem. Please include actual and expected results.": "TODO: Share the steps needed to reliably reproduce the problem. Please include actual and expected results.",
"Total documents to import: {0}": "Total documents to import: {0}",
"Total time taken to execute the query on the server": "Total time taken to execute the query on the server",
Expand Down Expand Up @@ -1079,6 +1085,7 @@
"What's New": "What's New",
"Where to save the exported documents?": "Where to save the exported documents?",
"with Popover": "with Popover",
"Worker is not running": "Worker is not running",
"Working...": "Working...",
"Working…": "Working…",
"Would you like to open the Collection View?": "Would you like to open the Collection View?",
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,12 @@
"category": "DocumentDB",
"command": "vscode-documentdb.command.clearSchemaCache",
"title": "Clear Schema Cache"
},
{
"//": "[Diagnostics] Show Schema Store Stats",
"category": "DocumentDB",
"command": "vscode-documentdb.command.showSchemaStoreStats",
"title": "Show Schema Store Stats"
}
],
"submenus": [
Expand Down
38 changes: 38 additions & 0 deletions src/commands/schemaStore/showSchemaStoreStats.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { type IActionContext } from '@microsoft/vscode-azext-utils';
import { SchemaStore } from '../../documentdb/SchemaStore';
import { ext } from '../../extensionVariables';

/**
* Command handler: Show SchemaStore statistics in the output channel.
* Displays collection count, document count, field count, and per-collection breakdown.
*/
export function showSchemaStoreStats(_context: IActionContext): void {
const store = SchemaStore.getInstance();
const stats = store.getStats();

ext.outputChannel.appendLog(
`[SchemaStore] Stats: ${String(stats.collectionCount)} collections, ` +
`${String(stats.totalDocuments)} documents analyzed, ` +
`${String(stats.totalFields)} fields discovered`,
);

if (stats.collections.length > 0) {
for (const c of stats.collections) {
// Key format is "clusterId::db::collection" — show only db/collection
const parts = c.key.split('::');
const displayKey = parts.length >= 3 ? `${parts[1]}/${parts[2]}` : c.key;
ext.outputChannel.appendLog(
`[SchemaStore] ${displayKey}: ${String(c.documentCount)} docs, ${String(c.fieldCount)} fields`,
);
}
} else {
ext.outputChannel.appendLog('[SchemaStore] (empty — no schemas cached)');
}

ext.outputChannel.show();
}
11 changes: 6 additions & 5 deletions src/commands/scratchpad/connectDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ export async function connectDatabase(_context: IActionContext, node?: DatabaseI
l10n.t('DocumentDB Scratchpad connected to {0}/{1}', node.cluster.name, node.databaseInfo.name),
);
} else {
// No tree context — show instructions (per plan §2.3)
void vscode.window.showInformationMessage(
l10n.t(
'To connect, right-click a database or collection in the DocumentDB panel and select "Connect Scratchpad to this database".',
// No tree context — show instructions as modal dialog
void vscode.window.showInformationMessage(l10n.t('No database connected'), {
modal: true,
detail: l10n.t(
'Right-click a database or collection in the DocumentDB panel and select "Connect Scratchpad to this database".',
),
);
});
}
}
Loading
Loading