feat: Add Monaco autocompletion for CosmosDB NoSQL query language#2968
Merged
feat: Add Monaco autocompletion for CosmosDB NoSQL query language#2968
Conversation
- Refactor bulkInsertDocuments: always use executeBulkOperations first, fall back to one-by-one insert for any failures (removes emulator-specific code path) - Extract executeBulkChunk and executeBulkChunkWithRetries helpers for readability - Add cancellation support to document import via CancellationToken - Add 'Wipe current schema' menu item in Schema button - Add wipeCurrentSchema command in QueryEditorTab and context provider
- Refactor bulkInsertDocuments: always use executeBulkOperations first, fall back to one-by-one insert for any failures (removes emulator-specific code path) - Extract executeBulkChunk and executeBulkChunkWithRetries helpers for readability - Add cancellation support to document import via CancellationToken - Add 'Wipe current schema' menu item in Schema button - Add wipeCurrentSchema command in QueryEditorTab and context provider
- Register custom nosql Monaco language with Monarch tokenizer for CosmosDB NoSQL-specific syntax highlighting (keywords, built-in functions, operators, comments, strings, quoted identifiers) - Implement context-aware CompletionItemProvider with: SQL keyword completions, 80+ built-in function completions with signatures, schema-driven property suggestions after dot notation, nested property resolution, bracket notation for special property names, and lightweight FROM-clause alias tracking - Pipe container schema from extension host to webview: add containerSchema field to QueryEditorState, send schema on ready/generation/merge/wipe, listen for schemaUpdated event in QueryEditorContextProvider - Enable fixedOverflowWidgets so autocomplete popup floats above Allotment split panes
- Register custom nosql Monaco language with Monarch tokenizer for CosmosDB NoSQL-specific syntax highlighting (keywords, built-in functions, operators, comments, strings, quoted identifiers) - Implement context-aware CompletionItemProvider with: SQL keyword completions, 80+ built-in function completions with signatures, schema-driven property suggestions after dot notation, nested property resolution, bracket notation for special property names, and lightweight FROM-clause alias tracking - Pipe container schema from extension host to webview: add containerSchema field to QueryEditorState, send schema on ready/generation/merge/wipe, listen for schemaUpdated event in QueryEditorContextProvider - Enable fixedOverflowWidgets so autocomplete popup floats above Allotment split panes
- Register custom nosql Monaco language with Monarch tokenizer for CosmosDB NoSQL-specific syntax highlighting (keywords, built-in functions, operators, comments, strings, quoted identifiers) - Implement context-aware CompletionItemProvider with: SQL keyword completions, 80+ built-in function completions with signatures, schema-driven property suggestions after dot notation, nested property resolution, bracket notation for special property names, and lightweight FROM-clause alias tracking - Pipe container schema from extension host to webview: add containerSchema field to QueryEditorState, send schema on ready/generation/merge/wipe, listen for schemaUpdated event in QueryEditorContextProvider - Enable fixedOverflowWidgets so autocomplete popup floats above Allotment split panes
- Revert importDocuments.ts as not related with task
…ed definitions - Extract shared language definitions into src/cosmosdb/language/nosqlLanguageDefinitions.ts (keywords, functions, schema helpers) with no vscode/monaco imports - Add TextMate grammar (syntaxes/nosql.tmLanguage.json) for VS Code editor syntax highlighting - Add language-configuration.json for comment toggling, bracket matching, auto-closing pairs - Add VS Code CompletionItemProvider for keyword and function completions in .nosql files - Register completion provider at extension activation, add onLanguage:nosql activation event - Add file icon (CosmosDBAccount.svg) for .nosql files - Refactor webview Monarch tokenizer and Monaco completion provider to import from shared module - Add webpack copy rules for syntaxes/ and language-configuration.json - Replace plan document with docs/nosql-language-support.md describing architecture and file roles
- Revert importDocuments.ts as not related with task
…e completion provider
# Conflicts: # l10n/bundle.l10n.json # package.json # src/panels/QueryEditorTab.ts # src/utils/json/nosql/SchemaAnalyzer.ts # src/webviews/cosmosdb/QueryEditor/QueryPanel/QueryToolbarOverflow.tsx # src/webviews/cosmosdb/QueryEditor/state/QueryEditorContextProvider.tsx # src/webviews/cosmosdb/QueryEditor/state/QueryEditorState.tsx
…e completion provider
…e completion provider
…ontext and auto-formatting
sevoku
reviewed
Apr 9, 2026
Member
sevoku
left a comment
There was a problem hiding this comment.
First Pass: looks great!
Couple of thoughts:
- "Delete current schema" should maybe have a confirmation? Or maybe let's call it "Remove current schema" which sounds less dangerous?
- Do we need this feature at all? Why would one want to remove it at this point anyways?
- "Generate schema based on queries" opens Settings, can't we turn it into a Checkmark/box? We could keep the setting to be the default value for freshly opened query editors.
…p and streamline rendering logic
…nd refactor related components
…nd refactor related components
…nd generation actions
…nd generation actions
sevoku
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Register custom nosql Monaco language with Monarch tokenizer for CosmosDB NoSQL-specific syntax highlighting (keywords, built-in functions, operators, comments, strings, quoted identifiers)
Implement context-aware CompletionItemProvider with: SQL keyword completions, 80+ built-in function completions with signatures, schema-driven property suggestions after dot notation, nested property resolution, bracket notation for special property names, and lightweight FROM-clause alias tracking
Pipe container schema from extension host to webview: add containerSchema field to QueryEditorState, send schema on ready/generation/merge/wipe, listen for schemaUpdated event in QueryEditorContextProvider
Enable fixedOverflowWidgets so autocomplete popup floats above Allotment split panes