C/C++ code generation for VS Code: Generate Definitions, Getters, Setters, and much more.
Update Function Signature
code-action. After changing a function signature, this code-action will be provided to update that function's declaration or definition.Code Actions: Enable Update Function Signature
. When disabled, C-mantic will not spend any time tracking changes to function signatures.Add Include
.Refactor...
and Source Actions...
menus.Add Header Guard
to update existing header guards if they do not match the configured settings. The code-action will display as Amend Header Guard
. (#26)cmantic.generateRelationalOperators
command/code-action. Works very similar to cmantic.generateEqualityOperators
and cmantic.generateStreamOutputOperator
. (#28)Add Include
would place the include between the #ifndef
and #define
of a header guard when there are no includes yet in the file.Generate Equality Operators
and Generate Stream Output Operator
will now operate on the named parent class.Cpp: Friend Comparison Operators
to generate equality operators as friend functions rather than member functions.Create Matching Source File
will no longer ask to add definitions if there are no eligible functions.cmantic.generateStreamOutputOperator
command/code-action. Works very similar to cmantic.generateEqualityOperators
. (#23)cmantic.addDefinitions
command/code-action, accessible through the Refactor...
menu. (#25)C_mantic.cpp.indentation.namespace
. Namespace indentation will always be auto-detected now.Accessor: Bool Getter Is Prefix
to prefix getters of bool
members with 'is' (e.g. bool enabled
generates bool isEnabled() const
).Generate Equality Operators
.Files: Exclude
and Search: Exclude
.Add Definition
will now check for C++20's consteval
keyword when determining where a definition can be placed.Add Declaration
and Move Definition into class
quick-fixes weren't accessible from the Refactor...
menu.public:
access specifier if one is not found in the class.Move Definition into/out-of class body
code-action being suggested for free functions.Generate Constructor
recognizing the virtual
keyword as a base class.inline
namespaces.Auto
namespace indentation.Create Matching Source File
.Move Definition into class
and selecting public access would do nothing.clangd
when anonymous structs exist in the file.Add Declaration
code-action displaying the wrong target file.inline
specifier for function templates (inline
was getting inserted before the template statement, which was a syntax error).ms-vscode.cpptools
and was a result of how it provides definitions/declarations for overloaded functions and undefined functions).Add Declaration
and Move Definition
not recognizing parent class templates.cmantic.addDeclaration
command/code-action. Add Declaration
will add a declaration of a function to the corresponding header file if the function is not already declared there. If the function is a member function, the declaration will be added to the class, wherever it is defined. Additionally for member functions, Add Declaration
will be provided as a Quick Fix
(suggested in the blue light-bulb menu), because defining a member function outside of the class with no declaration is an error. (#21)Code Actions: Enable Add Declaration
to control whether the Add Declaration
code-action is suggested (light-bulb menu). (#21)#define
's. See Header Guard: Define Format
in the settings for the full list of available variables.Move Definition into class
will now be available for member functions that are not declared in the class. Similar to Add Declaration
, this code-action will be provided as a Quick Fix
, since it also fixes the underlying error. (#21)Add Definition
for member functions in the case that the declaration is not indented.