Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

fixes #62069

@Copilot Copilot AI review requested due to automatic review settings July 15, 2025 22:30
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jul 15, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jul 15, 2025
Copy link

@Copilot Copilot AI left a 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 like public, private, or protected).

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Derived class constructor parameter incorrectly inherits JSDoc from parent class's field of the same name
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy