dart-lang/dart-syntax-highlight

Highlighting for type arguments in documentation comment references: `[Map<K, V>]` (vscode)

jonasfj opened this issue · 1 comments

Example

  /// Create a [Map<K, V>] from all elements.
  ///
  /// This is a short-hand for [Map.fromEntries].
  Map<K, V> toMap() => Map<K, V>.fromEntries(this);

On Github (as illustrated above)

image

In VSCode

image

@DanTup it's unclear to me if this is a vscode bug, or?

In generated dartdoc

Just to show that writing [Map<K, V>] in a documentation does work as expected.

image

DanTup commented

It seems like a bug, though not here :-)

If you disable semantic tokens in VS Code (which means it'll be coloured according to this grammar) then it'll show the same as GitHub:

image

My recollection was that we don't have the correct info in the server to mark these up (and there's an existing issue about this at Dart-Code/Dart-Code#3648), however I'm questioning this now (because usually we support ctrl+click navigation), and also I see that Ctrl+Click doesn't work on this item either, so I think there is more to it than just that.

Could you file this in https://github.com/dart-lang/sdk (that you can't ctrl+click it and the colouring is bad) and I will try to do some digging when I can? Thanks!