Skip to content

docs(code-style): clarify that member links are allowed#63

Open
javier-godoy wants to merge 1 commit intomainfrom
javier-godoy-patch-2
Open

docs(code-style): clarify that member links are allowed#63
javier-godoy wants to merge 1 commit intomainfrom
javier-godoy-patch-2

Conversation

@javier-godoy
Copy link
Copy Markdown
Member

@javier-godoy javier-godoy commented Apr 29, 2026

Clarifying the Boundary Between Type and Member Linking

The Problem: Algorithmic Over-Correction

Our current conventions prohibit linking to specific "restricted" types (such as argument types or the class being documented). While it is clear to a human developer that a method reference (e.g., {@link Bar#getName()}) is a distinct functional entity from a type reference, an LLM can easily fail to make this distinction.

Because LLMs often operate via literal pattern matching, they tend to flag the presence of a restricted identifier (like Bar) inside any {@link} tag as a violation. This leads the AI to aggressively replace necessary method links with {@code}.

The Solution: Explicit Logical Separation

By adding the note—“This restriction applies only to the type identifier itself”—we provide the explicit instruction needed for both humans and AI to understand that mandatory linking for members takes precedence over restricted types, when a member is being referenced.

Example of the Distinction

  • The Intent: "Don't link the class name Bar because it's already in the method signature Foo(Bar bar)."
  • The AI's Mistake: "Because I cannot link Bar, I must also not link Bar#getName()."
  • The Correction: This update clarifies that Bar#getName() is a member identifier, which remains linkable on its first occurrence regardless of its parent type's status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

1 participant