Repository navigation
Conversation
linawolf
force-pushed
the
task/link-node-line-numbers
branch
3 times, most recently
from
October 5, 2026 13:13
943fe3e to
acbb53e
Compare
Warnings about references that cannot be resolved only name the file, which makes them hard to find in large documents. Links are resolved long after parsing, when the line is no longer known, and text roles only receive the DocumentParserContext, which has no line. Link nodes now carry their source location, like DirectiveNode does since 00e6fab, and the reference resolvers include it in their warnings. It is set centrally by the InlineParser for every link an inline rule or text role returns, so rules and text roles added by extensions are covered without changes, and extensions like render-guides can use it for their own link warnings. Signed-off-by: linawolf Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
linawolf
force-pushed
the
task/link-node-line-numbers
branch
from
October 5, 2026 14:49
acbb53e to
74b96d3
Compare
jaapio
reviewed
Oct 6, 2026
| */ | ||
| public function parse(string $content, BlockContext $blockContext, int|null $firstLineNumber = null): InlineCompoundNode | ||
| { | ||
| $firstLineNumber ??= $blockContext->getCurrentLineNumber(); |
Member
There was a problem hiding this comment.
Can't we simply feth the current line from the $blockContext? Why do we need to pass it in?
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.
[FEATURE] Report the line of unresolved references
Warnings about references that cannot be resolved only name the file,
which makes them hard to find in large documents. Links are resolved
long after parsing, when the line is no longer known, and text roles
only receive the DocumentParserContext, which has no line.
Link nodes now carry their source location, like DirectiveNode does
since 00e6fab, and the reference resolvers include it in their
warnings. It is set centrally by the InlineParser for every link an
inline rule or text role returns, so rules and text roles added by
extensions are covered without changes, and extensions like
render-guides can use it for their own link warnings.
Signed-off-by: linawolf
Assisted-By: Claude Opus 5.5 (1M context) noreply@anthropic.com