- Notifications
You must be signed in to change notification settings - Fork12.9k
Don't inherit JSDocs from unrelated base properties onto constructor parameters with the same names#62077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…parameters with the same names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR fixes an issue where JSDoc comments from base class properties were incorrectly being inherited by constructor parameters that happened to have the same name. The fix ensures that JSDoc inheritance only occurs for constructor parameters that are actually property declarations (those with accessibility modifiers likepublic
,private
, orprotected
).
- Modifies the logic in
findBaseOfDeclaration
to check for accessibility modifiers on constructor parameters - Adds a test case to verify that regular constructor parameters don't inherit JSDoc from unrelated base class properties
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/services/services.ts | Updates JSDoc inheritance logic to only apply to constructor parameters with accessibility modifiers |
tests/cases/fourslash/jsDocDontInheritFromSameNamedPropertyOnParameter1.ts | Adds test case verifying constructor parameters don't inherit unrelated JSDoc |
Uh oh!
There was an error while loading.Please reload this page.
fixes#62069