1

I'm wondering if there is a functionality in Visual Studio 2017 to automatically generate documentation comments for parameters, return value, etc. in C++.

In Eclipse, Java, I start typing /** above a method and the rest is generated.

As someone answered here this functionality exists for C#, but I can't find any hints for C++.

Sparkofska
  • 1,280
  • 2
  • 11
  • 34
  • Possible duplicate of [How to write C++ comments that show up in Intellisense?](https://stackoverflow.com/questions/8618571/how-to-write-c-comments-that-show-up-in-intellisense) – GSerg Jun 04 '19 at 06:38
  • 1
    Not really a duplicate, since I'm asking for automatic generation to avoid typing. Visual Assist Plugin seems to provide what I'm looking for. But a free solution out of the box is preferable for such a simple task. – Sparkofska Jun 04 '19 at 06:49
  • Your [link](https://stackoverflow.com/a/5301367) only mentions the `///`, and you are saying this is what you are after. – GSerg Jun 04 '19 at 06:59
  • @GSerg Triple slash works only for C# editor. – user7860670 Jun 04 '19 at 07:04
  • @VTT The link disagrees, and so does documentation it points to. – GSerg Jun 04 '19 at 07:11
  • @GSerg C++ is not even mentioned anywhere in the link (I mean OP's link). And anyone can verify that typing triple slash in vanilla C++ editor does nothing. – user7860670 Jun 04 '19 at 07:28
  • @VTT Are you clicking the [same link](https://stackoverflow.com/questions/56438542/how-to-automatically-generate-comments-in-visual-studio-2017-and-c?noredirect=1#comment99470713_56438542) that I am? The [entire question](https://stackoverflow.com/questions/8618571/how-to-write-c-comments-that-show-up-in-intellisense) is about C++. – GSerg Jun 04 '19 at 07:29
  • @GSerg That question you've linked as a duplicate is not really a duplicate at all since it is about making VS parse and display info from comments while this question is about automatically generating those comments (which does not work in case of `///` in C++). – user7860670 Jun 04 '19 at 07:34
  • @VTT I also thought that, but then [why](https://stackoverflow.com/questions/56438542/how-to-automatically-generate-comments-in-visual-studio-2017-and-c?noredirect=1#comment99471206_56438542) did the OP say *"As someone answered [here](https://stackoverflow.com/a/5301367) this functionality exists for C#"*, pointing to the specific answer that tells to use `///`? – GSerg Jun 04 '19 at 07:36
  • 1
    @GSerg This functionality indeed exists for C#, but this question is about C++. – user7860670 Jun 04 '19 at 07:41
  • @VTT I see; I've been arguing that the comment generation works from C++ in the sense that it appears in the intellisense after you type it in, and you've been arguing that the XML comment skeleton does not appear automatically upon `///`. I would still argue it is a duplicate though, as it does mention both that it works if you type it out yourself, and [how](https://stackoverflow.com/questions/8618571/how-to-write-c-comments-that-show-up-in-intellisense#comment47499198_16572701) to make it appear more automatically. – GSerg Jun 04 '19 at 07:47

1 Answers1

1

That's one of the things where C++ tooling really falls behind. For VS you will need to use some third party extension, such as CppTripleSlash or CppDoxyComplete. Both are kinda crappy though (no template support, no exception spec support, no attributes support, no SAL support, etc.).

user7860670
  • 35,849
  • 4
  • 58
  • 84
  • I don't really get why the C++ editor lacks it while the C# editor provides the functionality. Well, that's what plugins are for, but still an overkill in my eyes to install a plugin for this. – Sparkofska Jun 04 '19 at 08:37