docs(code-style): clarify that member links are allowed#63
Open
javier-godoy wants to merge 1 commit intomainfrom
Open
docs(code-style): clarify that member links are allowed#63javier-godoy wants to merge 1 commit intomainfrom
javier-godoy wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Barbecause it's already in the method signatureFoo(Bar bar)."Bar, I must also not linkBar#getName()."Bar#getName()is a member identifier, which remains linkable on its first occurrence regardless of its parent type's status.