microsoft / microsoft/vscode-cpptools

derived class show base class virtual method's comments when hovering

Open
#5,187 3 comments 11 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Doc comments Language Service more votes needed Visual Studio
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
  • VS Code Version: 1.43.0
  • C/C++ Extension Version: 0.26.3
  • Other extensions you installed (and if the issue persists after disabling them):
  • Does this issue involve using SSH remote to run the extension on a remote machine?:
  • A clear and concise description of what the bug is, including information about the workspace (i.e. is the workspace a single project or multiple projects, size of the project, etc).

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Logs
Insert logs here.

Screenshots

Additional context

class base {
  // I'm comment
  virtual void foo() {}
};
class derive : public base {
  void foo() {}
};

As we often write comments on base class's (pure) virtual methods instead of repeating them on every derived classes, we hope these information could be passed to derived class when we hover the cursor on the method. Just like clion does like the following. It explicitly tells that the comment comes from base class, which will be very nice to readers.

image

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 in the C++ language service's hover handling and reproduce the behavior with the provided base and derived class sample. The change is complete when hovering over the derived class's foo method displays the comment from the base virtual method and identifies its source.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.