Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enables the interactive connect command to accept a previously hidden VS Code reconnect credential flag (e.g. -vscode-credential / --connect-vscode-credential) and routes it to the existing VisualStudioCodeCredential connection path, while ensuring hidden options remain excluded from public help/completion/MCP surfaces but are still recognized by highlighting and LSP diagnostics.
Changes:
- Add a
Hiddenflag toCosmosOptionAttributeand introduceCommandFactory.AllOptionsto track hidden + public options separately. - Update shell option-prefix highlighting and LSP semantic option validation to recognize hidden options via
AllOptions. - Add hidden VS Code credential flag to
connectand add tests validating binding + metadata visibility + LSP diagnostics behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/SemanticAnalyzer.cs | Uses AllOptions so hidden options don’t trigger unknown-option diagnostics. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CosmosOptionAttribute.cs | Adds Hidden attribute property to mark options excluded from public surfaces. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CommandRunner.cs | Uses AllOptions for option-prefix recognition (highlighting/diagnostics friendliness). |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ConnectCommand.cs | Adds hidden -vscode-credential/--connect-vscode-credential option and forwards it into ConnectAsync. |
| CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/CommandFactory.cs | Builds AllOptions + filtered Options list to keep hidden flags out of public surfaces. |
| CosmosDBShell.Tests/CommandTests/ConnectCommandTests.cs | Adds tests covering hidden option binding, metadata visibility, option-prefix recognition, and semantic diagnostics. |
sevoku
approved these changes
May 5, 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.
Summary
-vscode-credential/--connect-vscode-credentialoption on the interactiveconnectcommand.VisualStudioCodeCredentialreconnect path.Fixes AzureCosmosDB/cosmosdb-shell-preview#24
Validation
dotnet test .\CosmosDBShell.Tests\CosmosDBShell.Tests.csproj --filter "FullyQualifiedName~ConnectCommandTests|FullyQualifiedName~CosmosShellCompletionHandlerTests" -p:BaseOutputPath=.\obj\agent-hidden-test\