Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces source offset and length tracking for inline code spans in the markdown package, and improves error recovery for list entries missing the - prefix in the yaml package. Feedback on the changes highlights a critical bug in code_syntax.dart where accessing match.match will cause an error, suggesting match[0]!.length instead. Additionally, the reviewer notes that the yaml package updates are out of scope for this pull request and recommends moving them to a separate PR.
| final offsetMapper = parser.offsetMapper; | ||
| if (offsetMapper != null) { | ||
| final matchStart = parser.pos; | ||
| final matchEnd = matchStart + match.match.length; |
There was a problem hiding this comment.
The match variable is an instance of Match from dart:core, which does not have a match property. Accessing match.match will result in a compile-time error or a runtime NoSuchMethodError. It should be replaced with match[0]!.length to get the length of the matched string.
| final matchEnd = matchStart + match.match.length; | |
| final matchEnd = matchStart + match[0]!.length; |
| if (token.type == TokenType.key) { | ||
| _scanner.scan(); | ||
| _states.add(_State.BLOCK_SEQUENCE_ENTRY); | ||
| return _parseNode(block: true); | ||
| } |
There was a problem hiding this comment.
This change in the yaml package is out of scope for this pull request, which is focused on tracking offset/length for inline code spans in the markdown package. Per the general rules, please avoid addressing out-of-scope issues in the same PR and move these changes to a separate pull request.
References
- Avoid addressing pre-existing, out-of-scope issues within a pull request. Keep the changes focused on the PR's primary objective and address pre-existing issues in separate pull requests.
| final _indentLevels = <({int column, TokenType? type})>[ | ||
| (column: -1, type: null), | ||
| ]; |
There was a problem hiding this comment.
This change in the yaml package is out of scope for this pull request, which is focused on tracking offset/length for inline code spans in the markdown package. Per the general rules, please avoid addressing out-of-scope issues in the same PR and move these changes to a separate pull request.
References
- Avoid addressing pre-existing, out-of-scope issues within a pull request. Keep the changes focused on the PR's primary objective and address pre-existing issues in separate pull requests.
Replaced by: #2530
Fixes part of #1287.
This is the initial work that covers tracking the offset/length of inline code spans.
Contribution guidelines:
dart format.Many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.
Note: The Dart team is trialing Gemini Code Assist. Don't take its comments as final Dart team feedback. Use the suggestions if they're helpful; otherwise, wait for a human reviewer.