Skip to content

Fix update operator hover descriptions referencing wrong documentation category#571

Merged
tnaum-ms merged 3 commits intofeature/shell-integrationfrom
copilot/update-operator-descriptions
Apr 13, 2026
Merged

Fix update operator hover descriptions referencing wrong documentation category#571
tnaum-ms merged 3 commits intofeature/shell-integrationfrom
copilot/update-operator-descriptions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 13, 2026

Five update operators had hover descriptions scraped from unrelated category pages (accumulator/aggregation stage/array-expression), producing misleading IntelliSense text. Doc links were correct and are unchanged.

Changes

  • resources/overrides/operator-overrides.md — Added description overrides for five operators with update-context-specific text:

    Operator Before (scraped, wrong context) After (override)
    $min "Retrieves the minimum value for a specified field" "Updates the field only if the specified value is less than the existing field value."
    $max "The $max operator returns the maximum value from a set of input values." "Updates the field only if the specified value is greater than the existing field value."
    $unset "The $unset stage in the aggregation pipeline is used to remove specified fields from documents." "Removes the specified field from a document."
    $slice "The $slice operator returns a subset of an array from any element onwards in the array." "Limits the number of elements in an array during a $push operation."
    $sort "The $sort stage in the aggregation pipeline is used to order the documents in the pipeline..." "Sorts the elements of an array during a $push operation."
  • src/updateOperators.ts — Regenerated via npm run generate.

  • src/operatorReference.test.ts — Improved test resilience by removing 3 fragile tests that exact-matched descriptions and doc links against scraped documentation. These tests broke whenever upstream docs changed, even when our code was correct. The removed tests were:

    • descriptions match the dump (detect drift) — compared implementation descriptions to raw scraped text
    • descriptions match the merged dump+overrides — same fragility with merged data
    • doc links from dump match implementation links — broke on scraped link changes

    Kept all structural tests (operator presence, category mapping, not-listed exclusion) and the key every override with a description was applied test, which validates that overrides defined in operator-overrides.md are correctly reflected in the generated implementation. This is a more robust testing strategy: test the structure and the overrides mechanism, not the volatile scraped content.

Copilot AI changed the title [WIP] Update operator descriptions to match documentation category Fix update operator hover descriptions referencing wrong documentation category Apr 13, 2026
Copilot AI requested a review from tnaum-ms April 13, 2026 05:58
@tnaum-ms tnaum-ms marked this pull request as ready for review April 13, 2026 09:13
@tnaum-ms tnaum-ms requested a review from a team as a code owner April 13, 2026 09:13
Remove 3 tests that exact-matched implementation descriptions and doc
links against scraped documentation content. These broke whenever the
upstream docs changed, even when our code was correct.

Removed tests:
- 'descriptions match the dump (detect drift)'
- 'descriptions match the merged dump+overrides'
- 'doc links from dump match implementation links'

Kept all structural tests (operator presence, category mapping,
not-listed exclusion) and the override-application test that
validates overrides in operator-overrides.md are reflected in
the implementation.

Also cleaned up unused getMergedOperators helper, mergedOperators
variable, and ReferenceOperator type import.
@tnaum-ms tnaum-ms merged commit 95c8fac into feature/shell-integration Apr 13, 2026
5 checks passed
@tnaum-ms tnaum-ms deleted the copilot/update-operator-descriptions branch April 13, 2026 09:37
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.

Update operator descriptions reference wrong documentation category

2 participants