gahhu
gahhu

Reputation: 31

C++ type complementation in vscode extensions

I am learning C++ on docker using the template project at https://github.com/cpp-best-practices/gui_starter_template in C++.

I have the following code, where name: and text:are not originally written code, but it is completed so that I can see which type it is.
It is not a problem because it disappears when it is executed.
Which extension is this?
It is useful, but I would like to know which extension it is.
I use C++ better syntax, Clang tidy and Clang Format.

struct IMG : Tag
{
  explicit IMG(std::string url) : Tag{ name : "img", text : "" } { attributes.emplace_back(make_pair("src", std::move(url))); }
};
}// namespace html

Upvotes: 0

Views: 274

Answers (1)

ramsay
ramsay

Reputation: 3845

I think the inlay hints is a built-in feature now. And VS Code introduced some new values to control how inlay hints behaves since v 1.67 :

Editor › Inlay Hints: Enabled value:

  • on - Inlay hints are enabled.
  • off - Inlay hints are disabled.
  • onUnlessPressed - Inlay hints shown and hidden with Ctrl+Alt.
  • offUnlessPressed - Inlay hints hidden and shown with Ctrl+Alt.

Check this GitHub issue for more detail about inlay hints

When I set inlay hints to offUnlessPressed, it looks like this while I press Ctrl + Alt(Please ignore that it's a Rust project):

enter image description here

Upvotes: 1

Related Questions