Skip to content

@template documents declared on extension aren't shown elsewhere #5284

@dickermoshe

Description

@dickermoshe

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Declare a template doccomment on a method in an extension
  2. Use elsewhere
  3. Hover over method
```dart
class Foo {
  /// {@macro baz}
  ///
  /// {@macro pink}
  ///
  ///
  ///
  ///
  ///
  ///
  ///
  void bar() {}

  /// {@template pink}
  /// this works
  /// {@endtemplate}
  void pink() {}
}

extension on Foo {
  /// {@template baz}
  /// This does not work
  /// {@endtemplate}
  void baz() {}
}

Expected behavior
See the referenced template.
The template is shown if running dart doc, so this isn't an issue there.

Screenshots

As you can see, the baz template isn't rendered in the hover.

image
Workspace Environment
Dart Code extension: 3.96.0
Flutter extension: 3.96.0 (not activated)

App: Visual Studio Code
App Host: desktop
Remote: wsl
Host Kind: wsl
Version: linux 1.93.1

Workspace type: Dart (LSP)
Workspace name: hi [WSL: Ubuntu]

Dart (3.5.3): /home/mick/development/flutter/bin/cache/dart-sdk
Flutter (3.24.3): /home/mick/development/flutter (No device)

Output from 'dart info'

/home/mick/development/flutter/bin/cache/dart-sdk/bin/dart info

If providing this information as part of reporting a bug, please review the information
below to ensure it only contains things you're comfortable posting publicly.

General info

Project info

  • sdk constraint: '^3.5.3'
  • dependencies:
  • dev_dependencies: lints, test

Process info

Memory CPU Elapsed time Command line
72 MB 0.0% 11:11 dart devtools --machine --allow-embedding --dtd-uri ws:/4yC8DSkXExpGaiRX
951 MB 1.7% 11:11 dart language-server --protocol=lsp --client-id=VS-Code-Remote --client-version=3.96.0
544 MB 1.7% 10:57 dart language-server --protocol=lsp --client-id=VS-Code-Remote --client-version=3.96.0
81 MB 0.0% 11:11 dart tooling-daemon --machine
82 MB 0.0% 10:57 dart tooling-daemon --machine
90 MB 0.1% 11:11 flutter_tools.snapshot daemon --show-web-server-device

Metadata

Metadata

Assignees

No one assigned

    Labels

    in editorRelates to code editing or language featuresin lsp/analysis serverSomething to be fixed in the Dart analysis serveris bugrelies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions