fix: ReadonlySet lacks documentation for has, forEach and size#63517
fix: ReadonlySet lacks documentation for has, forEach and size#63517arnavnagzirkar wants to merge 3 commits into
ReadonlySet lacks documentation for has, forEach and size#63517Conversation
Add JSDoc comments to ReadonlySet.forEach, ReadonlySet.has, and ReadonlySet.size, copied from the corresponding Set<T> documentation (fixes microsoft#63481). Also add documentation to ReadonlyMap.forEach, ReadonlyMap.get, ReadonlyMap.has, and ReadonlyMap.size, copied from Map<K,V> for consistency. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR appears to remove two tsserver reference baseline outputs and adds JSDoc comments to the ReadonlyMap/ReadonlySet declarations in the ES2015 collection lib.
Changes:
- Deleted two
tests/baselines/reference/tsserver/...baseline.jsfiles - Added JSDoc documentation for
ReadonlyMapandReadonlySetmembers insrc/lib/es2015.collection.d.ts
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js | Removes an existing tsserver project references baseline output |
| tests/baselines/reference/tsserver/configuredProjects/Open-ref-of-configured-project-when-open-file-gets-added-to-the-project-as-part-of-configured-file-update-buts-its-open-file-references-are-all-closed-when-the-update-happens.js | Removes an existing tsserver configured projects baseline output |
| src/lib/es2015.collection.d.ts | Adds API docs for ReadonlyMap/ReadonlySet members |
Comments suppressed due to low confidence (2)
tests/baselines/reference/tsserver/projectReferences/solution-with-its-own-files-and-disables-looking-into-the-child-project-if-disableReferencedProjectLoad-is-set-in-first-indirect-project-but-not-in-another-one.js:1
- This change deletes an existing tsserver reference baseline. If the corresponding test still runs, baseline comparison will fail due to the missing expected-output file. Please either (a) regenerate and commit the updated baseline output, or (b) remove/rename the test case that produces this baseline (and any baseline registry entries, if applicable) so CI doesn't look for it.
tests/baselines/reference/tsserver/configuredProjects/Open-ref-of-configured-project-when-open-file-gets-added-to-the-project-as-part-of-configured-file-update-buts-its-open-file-references-are-all-closed-when-the-update-happens.js:1 - This baseline file is removed entirely. If the underlying test still exists, the baseline runner will likely fail because there's no expected output to compare against. Please rebaseline and commit the new expected output, or remove/disable the associated test that references this baseline.
|
@microsoft-github-policy-service agree |
|
This diff appears to be identical to what's already been proposed by #63508 (and is also quite close to #63483 and #63488). Also, you haven't directly disclosed your use of AI coding tools. |
Summary
Root Cause
ReadonlySet<T>insrc/lib/es2015.collection.d.tswas missing JSDoc comments for its three members (forEach,has, andsize), unlike the mutableSet<T>which had full documentation. The same issue also applied toReadonlyMap<K, V>which was missing JSDoc for all four of its members (forEach,get,has,size).Change Made
File:
src/lib/es2015.collection.d.tsAdded JSDoc comments copied from the corresponding mutable interfaces:
ReadonlySet<T>— added docs forforEach,has, andsize(matchingSet<T>)ReadonlyMap<K, V>— added docs forforEach,get,has, andsize(matchingMap<K, V>)The documentation strings are identical to those on the mutable counterparts, which is the right approach for consistency.
Issue
Fixes #63481
Issue URL: #63481
Changes
Testing
Agent ran relevant tests during development
Linting checks passed
Changes are minimal and focused on the issue