Skip to content

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

Closed

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

Activity

  1. added this to the v3.98.0 milestone on Sep 25, 2024
  2. added
    in editorRelates to code editing or language features
    in lsp/analysis serverSomething to be fixed in the Dart analysis server
    relies on sdk changesSomething that requires changes in the Dart/Flutter SDK to ship before it will become available
    on Sep 25, 2024
  3. added a commit that references this issue on Sep 26, 2024
  4. DanTup commented on Sep 26, 2024

    @DanTup
    Member

    Fixed by dart-lang/sdk@1833e76. The change is in the Dart analysis server, so it'll show up in a future Dart SDK release (not a VS Code extension release).

  5. dickermoshe commented on Sep 26, 2024

    @dickermoshe
    Author

    From a flutter standpoint, this won't be fixed until 3.27, right?

  6. DanTup commented on Sep 26, 2024

    @DanTup
    Member

    Assuming that's the next stable version (which are usually approximately quarterly), yep - this isn't the sort of thing that would be hotfixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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