microsoft / microsoft/vscode-cpptools

Doc comments don't show for overloaded methods

Open
#6,008 7 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Feature: Doc comments Language Service Works in VS
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the shown overloaded declarations in a C++ header and the VS Code C/C++ LanguageService. Inspect how completion or signature-help entries associate documentation with each overload. Done means IntelliSense shows the corresponding doc comment for every overload, not only the last declaration.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.