Skip to content

Doc comments don't show for overloaded methods #6008

Open

Description

Type: LanguageService

Describe the bug

  • OS and Version: Windows 10 2004
  • VS Code Version: 1.49.0-insiders
  • C/C++ Extension Version: 0.30.0-insiders3
  • Other extensions you installed (and if the issue persists after disabling them): CMake, CMake tools. Still continues after disabling both
  • Does this issue involve using SSH remote to run the extension on a remote machine?: No
  • Small, simple project, with 2 .cpp files and one .hpp; When I try to use doc comments (///, //, /*, /**, tried all types) on overloaded methods, only the last comment appears on the last overloaded method in the intellisense list;

Steps to reproduce
Import a header file with a class defining

    /// Test i
    void test(int i);

    /// Test f
    void test(float f);

    /// Test d
    void test(double d);

When I try accessing this method (so foo.test()) I get a nice intellisense list with the parameters for the method and I can navigate up/down to see other overloads. However, the doc comment only appears for the first overload in the list, the others just show the argument list. The first overload (so the one that works as expected) is always the last method defined in the .hpp (so in this case, void test(double d); works correctly and the others only show parameters, without the comment).

Expected behaviour
Show all doc comments on their respective methods

Logs
N/A

Screenshots

Additional context

Activity

  1. added
    Feature: Doc comments
    Works in VS
    on Aug 24, 2020
  2. michelleangela commented on Aug 24, 2020

    @michelleangela
    Contributor

    This is related to #2206

    VS Code doesn't let us know if you changed which overload you're looking at, so we don't have any control over how they reset the selected overload as you type. All extensions I've used suffer from that.

  3. davystrong commented on Aug 24, 2020

    @davystrong
    Author

    Ok, I've upvoted that issue. Thanks for your response! Do you know of any issue for vscode itself?

  4. removed this from the 0.30.0 milestone on Aug 25, 2020
  5. sean-mcmanus commented on Aug 25, 2020

    @sean-mcmanus
    Contributor

    We're currently only show doc comments for the "active signature", but for when the overloads differ by type, we end up choosing the wrong overload (i.e. #2206).

    We intentionally skipped sending additional overload doc comments because it potentially could take too long. We had the idea of sending the doc comments if they able to get computed in < 1 second, but we were worried that users might get confused by the inconsistent results.

    We're expecting that this will get fixed after we fix the performance issue with doc comments later on.

  6. davystrong commented on Aug 25, 2020

    @davystrong
    Author

    Ok, thanks!

  7. removed this from the Backlog milestone on Dec 30, 2024
  8. added
    enhancement
    and removed on Dec 30, 2024
  9. github-actions commented on Mar 1, 2025

    @github-actions

    This feature request is being closed due to insufficient upvotes. Please leave a 👍-upvote or 👎-downvote reaction on the issue to help us prioritize it. When enough upvotes are received, this issue will be eligible for our backlog.

  10. added
    more votes needed
    on Mar 1, 2025
  11. added this to the Triage milestone on Mar 1, 2025
  12. modified the milestones: Triage, Backlog on Apr 11, 2025
  13. removed
    more votes needed
    on Apr 11, 2025
  14. github-actions commented on Apr 11, 2025

    @github-actions

    This feature request has received enough votes to be added to our backlog.

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

    Feature: Doc commentsLanguage ServiceWorks in VSenhancement

    Type

    No type

    Projects

    • Status
      Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions