Repository navigation
"See code in" example links incorrectly group multiple examples, don't linkify entire path #4181
Description
When navigating to an example in the Flutter repo source code in the form of:
/// {@tool dartpad}
/// This example shows various [ClipRRect]s applied to containers.
///
/// ** See code in examples/api/lib/widgets/basic/clip_rrect.0.dart **
/// {@end-tool}
/// ...
/// {@tool dartpad}
/// This example shows a [ClipRRect] that adds round corners to an image.
///
/// ** See code in examples/api/lib/widgets/basic/clip_rrect.1.dart **
/// {@end-tool}If there are multiple examples in the comment then it says that there are two possible "definitions" for the destination, when the analyzer should be supplying the full path to the destination under the pointer, and so VSCode should be linkifying the entire path, not just the path element.
If there is only one example in the dartdoc block, then it more correctly links to just the link under the pointer:
However, it seems to me that VSCode should be rendering the links in another color (the "link" color that is used by symbol refs in brackets) so that users even know that they can click on them. It's not very discoverable to have to ctrl-click on the path in a comment, since it's not expected that it is a symbol.
It also seems like in that screenshot that the tooltip/hover text is showing an empty tip, which also shouldn't happen.
To Reproduce
Steps to reproduce the behavior:
- Open
flutter/packages/flutter/lib/src/widgets/basic.dartin the Flutter repo. - Point at the path in the "See code in" marker in the dartdoc block for
ClipRRect. - If you press Ctrl/Cmd while pointing at parts of the path, it will only highlight that part of the path, and will think there are two destinations.
Expected behavior
- Draw the link in the "link" color, even when not pointing at it.
- When pointing at it with Ctrl/Cmd down, linkify the entire path, not just the component under the pointer.
- When clicking on the path, it should just navigate without having to disambiguate, even if there are multiple examples.
- When pointing at a link, don't show an empty tooltip.
Please complete the following information:
- Operating System and version: Debian GNU/Linux rodete 5.18.16-1rodete1-amd64
- VS Code version: 1.71.2
- Dart extension version: v3.48.4
- Flutter extension version: v3.48.0
- Dart/Flutter SDK version: Dart version 2.19.0 (build 2.19.0-229.0.dev)/Flutter version 3.4.0-29.0.pre.111


Activity
DanTup commentedon Sep 28, 2022
This one seems to be a VS Code bug (I've verified the ranges the server returns are correct) - Wrong ctrl+click underline with multiple definitions microsoft/vscode#160958
I've split this to Improve colouring of clickable path links in dartdocs #4186
Got a fix open at https://dart-review.googlesource.com/c/sdk/+/261365/.
I've split this to Ctrl+hover over file paths shows empty tooltip #4187
I'll use this issue for (3) above, since the others have their own issues and that seems like the biggest issue.
[analysis_server] Filter "see code in" navigation regions to requeste…
DanTup commentedon Sep 29, 2022
dart-lang/sdk@dd12cfd fixes the issue with multiple results being returned instead of only the one at the location requested. It's an SDK change, so will show up based on your SDK version (not Dart-Code version).