C/C++ code generation for VS Code: Generate Definitions, Getters, Setters, and much more.
Cpp: Use Explicit This Pointer
to control whether generated member functions prefix class members with this->
. (#17)inline
specifier has changed. Definitions generated within header files will have the inline
specifer to prevent ODR violations. Additionally, inline functions can now be moved to source files and the inline
specifier will be removed. Definitions moved to header files will gain the inline
specifier.Add Definition
's whitespace alignment for multi-line declarations when removing leading specifiers (such as virtual
, static
, etc.). (#19)Add Definition
for constructors will now prompt the user for what they want to initialize (delegating constructor, base class constructor(s), member variables) and generate the boiler-plate for the initializer list.Cpp: Braced Initialization
to control whether member initializers use parentheses or curly braces.cmantic.generateEqualityOperators
command/code-action.Refactor...
menu, even if they are disabled from being suggested in the light-bulb menu.Case Style
to control whether getters and setters are generated with names in snake_case, camelCase, or PascalCase. (#11)volatile
qualifier will now be stripped from getter return types as it has no effect.const
and mutable
qualifiers would not be stripped from getter return types.s_
static member naming scheme when generating getters and setters.clangd
.cmantic.moveDefinitionIntoOrOutOfClass
command/code-action. Additionally, definitions within classes can be moved to a matching source file. (#7)Add Definition
will no longer reveal existing definitions if Reveal New Definitions
is turned off in the settings.Move Definition
not accounting for changes in scope at the target position. (#6)Add Definition
sometimes not revealing the new definition in the editor. (#2)enum
types and use a pass-by-value parameter type.typedef
's and type-alias
's in order to determine if the parameter should be pass-by-value instead of pass-by-const-reference.typedef
's, type-alias
's, and enum
's when generating setters because this may impact the performance of the command.operator->
function defined/declared anywhere in the file would throw an exception (vscode notified of the error 'name must not be falsy
'). This bug also prevented code-actions from being provided for that file.clangd
and ccls
.cmantic.moveDefinitionToMatchingSourceFile
command/code-action. (#3)Add Definition
in an empty namespace.clangd
and ccls
.Auto
configuration for Curly Brace Format: Namespace
.Add Definition
reveals new definitions in the editor.Add Definition
commands/code-actions.Add Definition
sometimes not scrolling to the new definition. (This still happens occasionally, but far less often. It is unclear why.)cmantic.addHeaderGuard
placement of #endif
in the case that the file does not end in a newline.Add Definition
.Add Definition
text alignment in the case that text appearing before the parameter list is multi-line.Add Definition
parsing of function templates.cmantic.addHeaderGuard
will now validate static text given by the user in the C_mantic.headerGuard.defineFormat
setting by replacing illegal symbols with underscores.cmantic.createMatchingSourceFile
will now sort directory suggestions based on their similarity to the header file's directory. This means that the top directory in the list is most likely the directoy the user wants to put the new file in, and can just press enter.cmantic.createMatchingSourceFile
will now look at the file extensions in the selected directory and automatically pick one when there is only one type of source file extension found.cmantic.addHeaderGuard
command directly now checks for an existing header guard.cmantic.switchHeaderSourceInWorkspace
by caching header/source pairs after they are found.Add Definition
commands/code-actions.cmantic.addInclude
places new includes in the case that the file has no existing include statements and is non-empty.Add Definition
adding extra end-parenthesis for ccls
and clangd
.cmantic.addDefinitionInCurrentFile
placement for ccls
. Certain macros within classes confuses ccls
's DocumentSymbols, such as Qt's Q_OBJECT macro.cmantic.addInclude
positioning for ccls
and clangd
.Add Definition
of operator
overload functions for ccls
and clangd
.Add Definition
not recognizing static methods for ccls
.cmantic.generateGetterSetter
, cmantic.generateGetter
, and cmantic.generateSetter
commands/code-actions.cmantic.createMatchingSourceFile
can now generate namespace blocks. Configurations were added to customize this behavior.Curly Brace Format
for functions was split into separate configurations for C and C++.cmantic.addHeaderGuard
will now replace any illegal symbols found in the file name with an underscore when creating a #define
name.cmantic.addDefinition
from appearing in the command palette as this is an internal command and would throw an error if invoked this way.Refactor...
and Source Action...
from appearing in the command palette.Add Definition
not recognizing operator
overload functions.Add Definition
not placing function into a cooresponding namespace block when that block was empty.