Skip to content

Harden script execution, value semantics, and LSP diagnostics - #208

Merged
Mike Krüger (mkrueger) merged 44 commits into
mainfrom
dev/mkrueger/script-language-hardening
Sep 28, 2026
Merged

Mike Krüger (mkrueger) merged 44 commits into
mainfrom
dev/mkrueger/script-language-hardening

Conversation

@mkrueger

@mkrueger Mike Krüger (mkrueger) commented Sep 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Harden the scripting language against inconsistent value conversion, invalid control flow, unbounded recursion, and loss of source diagnostics, while aligning editor analysis with runtime validation.

  • Validate complete inputs before execution; correct nested return/break/continue propagation and preserve function argument types and local assignments.
  • Bound parser nesting, expression-tree depth, and active function/script calls; preserve cancellation and unwind scopes/source context.
  • Preserve source locations, call sites, original failures, and exit-code categories. Incorrect function arity is a usage error.
  • Keep JSON null, numeric truthiness, string concatenation, and decimal JSON roundtrips consistent across value origins.
  • Recognize document-local functions and nested commands/options in LSP; fix case-sensitive variable references and hover ranges.
  • Add a 384-case value-origin matrix covering raw and shell-constructed JSON, plus runtime, process, scope, diagnostics, and editor regression tests.
  • Document language behavior, limits, and the testing strategy.

Boundaries / Follow-ups

This remains a trusted local shell, not a sandbox for untrusted scripts. Process cancellation for jq and overall execution budgets remain follow-ups. LSP function discovery is document-wide, variable analysis is not runtime-scope-aware, and existing equality semantics remain unchanged.

Serialize shell and MCP execution and invalidate destructive confirmations after context changes. Preserve replayable interactive history while omitting MCP command echo and history entries.

Write exports through temporary files, stop pagination at the requested limit, dispose iterators, and spool CSV exports to disk. Stream CSV imports with CsvHelper and report malformed record line numbers.

Add regression tests and document history policy, context sharing, and export guarantees. Offline validation: 2315 passed, 2 interactive-console tests skipped.
Validate scripts before execution, preserve control flow across nested blocks, and share non-mutating command argument binding.

Preserve typed function arguments with isolated stack scopes, normalize JSON numbers, detect integer overflow, and implement compound assignments. Add regression coverage and document language semantics.

Validation: 2367 offline tests passed, 2 interactive console tests skipped; warning-free build and git diff --check.
Share parser nesting budgets across statement, expression and interpolation parsing. Limit active function/script calls to 64, unwind scopes after failures and preserve cancellation.

Add deep-input, recursion and interpreter-reuse regressions. Document fixed safety limits.

Validation: 2378 offline tests passed, 2 interactive console tests skipped; warning-free build.
Retain original error states, failure categories, source files and function/script call sites across execution boundaries. Capture function definition sources and include source diagnostics in human, JSON and redacted diagnostic-log output. Reuse runtime control-flow validation in LSP with exclusive-end ranges. Add regression tests and document the diagnostic contract.

Validation: 2399 offline tests passed, 2 interactive-console tests skipped; app and test builds warning-free.
Evaluate the return expression before setting return state, and clear stale return values for bare return. Cover a multi-statement inner function and unreachable code after the outer return.

Validation: 63 focused tests passed; app and test projects built successfully.
Iteratively enforce a 128-node expression depth limit independently of recursive parser nesting. Return safe error nodes for overdeep operator chains, including contained JSON, arrays, interpolation and command arguments. Add parser boundary, LSP and isolated process regression coverage; document the additional limit.

Validation: 2421 offline tests passed; 2 interactive-console tests skipped. App and tests built without warnings.
Exclude OperationCanceledException from positional wrapping in blocks, loops and exec so host cancellation and timeout handling retain their original exception type. Add deterministic cancellation-during-execution tests across files and function calls, verifying neutral results, cancellation diagnostics and scope/source restoration. Document cancellation semantics.

Validation: 2430 offline tests passed; 2 interactive-console tests skipped. App and test projects built without warnings; git diff --check clean.
Preserve JSON null in loops, normalize numeric truthiness, and concatenate JSON strings consistently. Report function arity errors as usage errors and accept bare return before block endings.

Resolve document-local functions, analyze nested commands, and preserve case-sensitive variable references and hover ranges. Add value-origin matrix coverage and script regression tests, and document behavior and remaining limitations.

Validation: 2679 offline tests passed, 2 interactive console tests skipped; warning-free builds and clean git diff --check.
Keep a decimal suffix or exponent when serializing shell doubles to JSON scalars, objects, and arrays so integral decimal values do not become integer arithmetic after reconstruction.

Expand the value-origin matrix to cover raw and shell-constructed JSON. Add repeated reconstruction, signed zero, double boundary, and non-finite value tests. Update language documentation and contribution guidance.

Validation: 2889 offline tests passed, 2 interactive tests skipped. Warning-free builds, no editor diagnostics, and clean git diff --check.
Comment thread CosmosDBShell.Tests/ScriptExecutionScopeTests.cs Fixed
Comment thread CosmosDBShell.Tests/Parser/StatementExecutionTests.cs
Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/StatementParser.cs
Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ExportCommand.cs Fixed
Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ExportCommand.cs Fixed
Comment thread CosmosDBShell.Tests/CommandTests/ExportCommandTests.cs Fixed
Comment thread CosmosDBShell.Tests/CommandTests/ExportCommandTests.cs Fixed
Comment thread CosmosDBShell.Tests/CommandTests/ExportCommandTests.cs Fixed
@github-code-quality

github-code-quality Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall line coverage in commit 52e5930 in the dev/mkrueger/script-... branch is 64%. The line coverage in commit c614f52 in the main branch is 63%.

Show a line coverage summary of the most impacted files.
File main c614f52 dev/mkrueger/script-... 52e5930 +/-
D:\a\CosmosDBSh...essionParser.cs 83% 84% +1%
D:\a\CosmosDBSh...lInterpreter.cs 67% 69% +2%
D:\a\CosmosDBSh...tementParser.cs 75% 77% +2%
D:\a\CosmosDBSh...HoverHandler.cs 90% 92% +2%
D:\a\CosmosDBSh...andStatement.cs 84% 87% +3%
D:\a\CosmosDBSh...DefStatement.cs 87% 93% +6%
D:\a\CosmosDBSh...nticAnalyzer.cs 71% 84% +13%
D:\a\CosmosDBSh...urnStatement.cs 78% 95% +17%
D:\a\CosmosDBSh...ndExpression.cs 76% 95% +19%
D:\a\CosmosDBSh...ShellDecimal.cs 75% 95% +20%

Updated September 26, 2026 16:38 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

LSP variable completion still de-duplicates case-insensitively, which breaks the newly documented case-sensitive variable model by hiding distinct names (e.g., $value vs $Value).

Pull request overview

This PR strengthens CosmosDBShell’s scripting runtime and language-server analysis by enforcing full preflight validation before execution, bounding parse/execution resources, preserving source-level diagnostics and exit-code categorization, and aligning value semantics across JSON/shell origins. It also extends import/export operational hardening and adds broad regression coverage plus updated documentation.

Changes:

  • Add script pre-validation (control-flow placement, duplicate parameters), resource limits (parser nesting, expression depth, call depth), and improved cancellation/unwinding/diagnostics tracing.
  • Unify value semantics across origins (JSON null preservation, numeric truthiness, string concatenation behavior, integer overflow checks, decimal JSON roundtrips).
  • Improve LSP semantics (document-local functions, nested command/option validation, case-sensitive variable references, corrected hover/diagnostic ranges) and add extensive tests/docs.
File summaries
File Description
README.md Documents hardened script semantics, diagnostics behavior, and import/export/MCP operational guarantees.
docs/programming.md Adds detailed language rules (types, precedence, grammar, validation/errors, resource limits).
docs/navigation.md Documents history sensitivity and MCP history/echo behavior.
docs/mcp.md Documents serialized MCP execution and context-invalidation confirmation behavior.
docs/commands.md Documents safer export replacement semantics and streaming/spooling behaviors for import/export.
Directory.Packages.props Adds CsvHelper package pin.
CosmosDBShell/lang/en.ftl Adds new localized strings for script/CSV/import errors and limits.
CosmosDBShell/CosmosDBShell.csproj Adds CsvHelper reference.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/StatementParser.cs Adds shared parse budget entry/exit and introduces ScriptParseResult preflight validation API.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/WhileStatement.cs Preserves cancellation and correctly propagates return/break/continue through loops.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/ReturnStatement.cs Ensures return value is consistently set (including bare return).
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/PositionalException.cs Adds source-trace extraction for chained positional frames.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/PipeStatement.cs Ensures cancellation and control-flow signals stop pipeline execution.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/LoopStatement.cs Adds cancellation checks and correct return propagation for infinite loops.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/ForStatement.cs Preserves JSON null/numeric typing and cancellation behavior inside loops.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/ExecStatement.cs Preserves cancellation semantics and positional wrapping for exec failures.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/DoWhileStatement.cs Adds cancellation checks and correct return propagation for do/while loops.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/DefStatement.cs Preserves typed arguments, enforces arity, fixes scope push/pop, and improves positional diagnostics for function calls.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/CommandStatement.cs Ensures script preflight, proper scope shadowing, correct return-from-file behavior, and avoids mutating option AST.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/BlockStatement.cs Corrects nested control-flow propagation and cancellation behavior for blocks.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/AssignmentStatement.cs Implements compound assignment semantics via binary operator evaluation and improves ToString().
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/ShellObject/ShellNumber.cs Adds JSON-number normalization helpers to unify numeric semantics.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/ShellObject/ShellJson.cs Makes numeric truthiness use double conversion for fractional/large numbers.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/ShellObject/ShellDecimal.cs Adds JSON serialization options/converter to preserve decimal-ness across JSON roundtrips.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Lexer.cs Adds shared parsing budget and early stop on exceeded budget.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/ExpressionParser.cs Enforces expression-tree depth and shared nesting budget across nested parses/interpolations.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Expression/UnaryOperatorExpression.cs Normalizes JSON numbers before unary ops and checks integer overflow.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Expression/JsonExpression.cs Serializes JSON using decimal-preserving options.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Expression/JSonArrayExpression.cs Serializes JSON arrays using decimal-preserving options.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Expression/CommandExpression.cs Propagates command-expression failures as typed exceptions and preserves typed function args.
CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Expression/BinaryOperatorExpression.cs Normalizes JSON numbers, adds checked integer arithmetic, and supports JSON string concatenation.
CosmosDBShell/Azure.Data.Cosmos.Shell.Mcp/ToolOperations.cs Serializes MCP execution and invalidates confirmations when shell context changes.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp/WorkspaceDocument.cs Aligns editor diagnostics with runtime semantic validation and fixes exclusive-end ranges.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp/CosmosShellHoverHandler.cs Improves hover range accuracy by using the specific reference occurrence span.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp/CosmosShellCompletionHandler.cs Adjusts variable completion to enumerate current scope ordering.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/Symbol.cs Updates symbol kind documentation for user-defined functions.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/SemanticModel.cs Makes symbol lookup consider references as well as definitions.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/SemanticAnalyzer.cs Adds document-wide local function discovery, nested command/option checks, and case-sensitive variable tracking.
CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/FunctionSymbol.cs Updates function symbol documentation to reflect document-local analysis.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ShellInterpreter.cs Adds serialized execution gate, call-depth limits, Stack-based scopes, improved parser-error reporting, and richer positional traces.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ShellExitCode.cs Preserves exit categories through nested wrappers and expression-failure propagation.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/ParserErrorCommandState.cs Carries source name/text for file-origin parser errors.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/DiagnosticLog.cs Logs positional source traces and resolves parser errors to file coordinates.
CosmosDBShell/Azure.Data.Cosmos.Shell.Core/CommandState.cs Introduces FailureException to preserve underlying CommandState/exit code for expression failures.
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ImportCommand.cs Switches CSV parsing to CsvHelper with streaming + physical line tracking and cancellation.
CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ExportCommand.cs Adds atomic export via temp file + move, disk spooling for CSV, and max-page boundary enforcement.
CosmosDBShell.Tests/ToolOperationsCallToolTests.cs Adds MCP context-change confirmation regression tests and verifies no echo/history for tools.
CosmosDBShell.Tests/Shell/ExecuteCommandExceptionTests.cs Adds regression tests for file-origin parser errors and nested positional traces.
CosmosDBShell.Tests/ScriptExecutionScopeTests.cs Adds coverage for return/cancellation/call-depth/invalid-script behaviors restoring scope.
CosmosDBShell.Tests/Runtime/ShellExitCodeTests.cs Adds exit-code preservation tests across nested positional wrappers and expression failures.
CosmosDBShell.Tests/Runtime/SerializedExecutionTests.cs Adds coverage for serialized execution gate behavior and cancellation of queued operations.
CosmosDBShell.Tests/Runtime/DiagnosticLogTests.cs Adds tests for source-chain logging/redaction and file-coordinate parser error logging.
CosmosDBShell.Tests/Parser/StatementPositionalErrorTests.cs Adds tests ensuring function definition + caller source locations are preserved.
CosmosDBShell.Tests/Parser/StatementExecutionTests.cs Adds large value-origin matrix and many runtime semantic/cancellation/control-flow regressions.
CosmosDBShell.Tests/Parser/ShellObjectConversionTests.cs Adds decimal JSON roundtrip tests and numeric truthiness parity tests.
CosmosDBShell.Tests/Parser/OperatorEvaluationTests.cs Adds integer overflow tests, JSON-number arithmetic consistency tests, and eval-once test for !=.
CosmosDBShell.Tests/Parser/FunctionDefinitionTests.cs Adds extensive coverage for return semantics, typed args, arity validation, scoping, and recursion limits.
CosmosDBShell.Tests/Parser/ExpressionParserErrorTests.cs Adds depth/budget regression tests (flat operator chains, deep nesting, interpolation budget).
CosmosDBShell.Tests/Lsp/CosmosShellWorkspaceTests.cs Adds LSP tests for runtime-semantic validation, local functions, nested commands/options, and case sensitivity.
CosmosDBShell.Tests/Lsp/CosmosShellHoverHandlerTests.cs Adds tests for correct hover ranges and case-sensitive definition selection.
CosmosDBShell.Tests/Integration/ShellProcessTests.cs Adds process-level tests for wrong-arity exit code and deep-expression preflight behavior.
CosmosDBShell.Tests/Integration/ScriptArgumentTests.cs Ensures post-return statements don’t execute and functions aren’t registered after return.
CosmosDBShell.Tests/CommandTests/ImportCommandTests.cs Adds streaming CSV + malformed record line/cancellation/blank-line line-number tests.
CosmosDBShell.Tests/CommandTests/ExportCommandTests.cs Adds atomic export/overwrite/cancellation preservation and iterator page-boundary tests.
CONTRIBUTING.md Documents the preferred regression-test extension strategy for script semantics and editor changes.
Review details

Suppressed comments (1)

CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp/CosmosShellCompletionHandler.cs:164

  • Variable completion currently de-duplicates variable names case-insensitively (via seen), which hides distinct variables like $value vs $Value. This conflicts with the new case-sensitive variable semantics and the LSP’s case-sensitive symbol/hover behavior.
  • Files reviewed: 65/65 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 7, 2026 11:44
@mkrueger

Copy link
Copy Markdown
Collaborator Author

Addressed the suppressed Copilot completion finding in ec3e971: variable names are now de-duplicated with StringComparer.Ordinal, preserving distinct case-sensitive names while retaining case-insensitive prefix discovery. A regression checks both labels and insertion text directly. Merge 9c66fec brings forward the two validated MCP/export follow-ups from #207 without duplicating their commits. All nine inline threads have individual replies and are resolved. Validation: 2,894 offline tests passed, two interactive-console skips, 96 focused integration-of-changes tests passed, both projects built without warnings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The LSP semantic analyzer currently records assignment RHS variable occurrences before the LHS, which can misidentify the “definition” span for self-referential assignments and break hover/go-to-definition accuracy.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

CosmosDBShell/Azure.Data.Cosmos.Shell.Lsp.Semantics/SemanticAnalyzer.cs:127

  • In the LSP semantic analyzer, assignment statements currently analyze the RHS before recording the LHS variable. For a self-referential assignment like $x = $x + 1, this causes the RHS $x to be treated as the variable definition ("first occurrence"), and the LHS becomes a reference, which breaks hover/go-to-definition and reference classification.
  • Files reviewed: 66/66 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 7, 2026 11:56
@mkrueger

Copy link
Copy Markdown
Collaborator Author

Addressed the second review suppressed finding in 4459e40: the semantic analyzer now records the assignment target before visiting the RHS. Self-referential assignments keep their definition at the LHS, and reassignments preserve an existing definition. Added two regressions checking symbol location, reference classification, and lookup at the RHS. All 74 workspace/hover tests pass, and both projects build without warnings. This finding had no inline thread; the nine existing threads remain resolved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It introduces broad, cross-cutting runtime + parser + LSP semantic changes where small edge-case regressions could have high user impact despite strong test additions.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/StatementParser.cs:1273

  • Duplicate-parameter validation reports the diagnostic span on the function name token, not on the function definition/parameter list. This makes editor highlighting misleading (the error is about a parameter, but the underline lands on the name). Consider using the full function-definition span until parameter token spans are available.
  • Files reviewed: 66/66 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 7, 2026 12:09
Copilot AI review requested due to automatic review settings September 23, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Human-readable structured failures from scripts still omit their attached source location and call trace.

Review effort: Balanced
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Preserve script source diagnostics for batch failures in human output

CosmosDBShell/​Azure.Data.Cosmos.Shell.Core/​ShellInterpreter.cs:1887

Structured errors with positional script context are only handled specially in machine mode. In normal output, the earlier RenderUser branch runs first (batch failures have one) and prints only the command's generic failure text, so the PositionalException attached by CommandStatement never surfaces its file/line/call trace. This means a failing batch invoked from a script still loses the human-readable source diagnostics this change promises. Handle positional StructuredErrorCommandState errors in the human path as well while preserving the structured result/renderer.

Copilot AI review requested due to automatic review settings September 25, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Returned structured errors can lose or duplicate call-site diagnostics, and script execution may continue after output rendering fails.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 High severity · 3 Medium severity · 2 Low severity

Open (6)

Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/CommandStatement.cs Outdated
Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Commands/ExportCommand.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 25, 2026 17:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The cross-cutting parser, runtime, concurrency, diagnostics, and LSP changes warrant final human validation despite extensive regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (6)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 26, 2026 09:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Script-expression execution can corrupt enclosing redirection state, and JSON-path variables remain absent from LSP symbol analysis.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Visit JSON path expressions to record base variable references

CosmosDBShell/​Azure.Data.Cosmos.Shell.Lsp.Semantics/​SemanticAnalyzer.cs:323

JSonPathExpression is still omitted from the expression visitor, so variable occurrences such as $source.left produce no variable symbol/reference at all. As a result hover and reference lookup do not benefit from the new case-sensitive handling for a common variable form; record the base variable (excluding the path suffix) when visiting this expression type.

Comment thread CosmosDBShell/Azure.Data.Cosmos.Shell.Parser/Statement/CommandStatement.cs Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 26, 2026 16:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

It changes tightly coupled parser, runtime, diagnostic, serialization, and LSP behavior across a large surface requiring final human validation.

Review effort: Balanced
Findings: None

Resolved since last review (1)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

The cross-cutting parser, runtime, state, diagnostics, and LSP changes warrant final human validation despite strong regression coverage.

Review effort: Balanced
Findings: None

@mkrueger
Mike Krüger (mkrueger) merged commit b5aae39 into main Sep 28, 2026
13 checks passed
@mkrueger
Mike Krüger (mkrueger) deleted the dev/mkrueger/script-language-hardening branch September 28, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants