Changelog
All notable changes to the C-mantic extension will be documented in this file.
[0.9.0] - June 2, 2021
Added
- Added
Update Function Signaturecode-action. After changing a function signature, this code-action will be provided to update that function’s declaration or definition. - Added a setting
Code Actions: Enable Update Function Signature. When disabled, C-mantic will not spend any time tracking changes to function signatures. - Added completion suggestions to
Add Include. - C-mantic now has full documentation at https://bigbahss.github.io/vscode-cmantic/. Documentation can be opened directly from VS Code through the
Refactor...andSource Actions...menus.
Fixed
- Fixed another bug when determining if an existing header guard matches the configured settings.
[0.8.1] - May 1, 2021
Changed
- Improved UI elements (For example, when generating a constructor, you may not select delegating constructor with other initializers. Invalid options will automatically uncheck themselves.)
Fixed
- Fixed a bug when determining if an existing header guard matches the configured settings.
- Improved the performance of generating getters and setters. (#29)
[0.8.0] - April 17, 2021
Added
- Extended the capability of
Add Header Guardto update existing header guards if they do not match the configured settings. The code-action will display asAmend Header Guard. (#26) - Added
cmantic.generateRelationalOperatorscommand/code-action. Works very similar tocmantic.generateEqualityOperatorsandcmantic.generateStreamOutputOperator. (#28)
Fixed
- Fixed a bug where
Add Includewould place the include between the#ifndefand#defineof a header guard when there are no includes yet in the file. - Fixed some problems stemming from anonymous scopes (#27):
- Definitions can now be properly generated from anonymous namespaces.
- Getters/Setters can now be generated for members of anonymous sub-classes (the functions are generated as members of the named parent class).
- With the cursor inside of an anonymous sub-class,
Generate Equality OperatorsandGenerate Stream Output Operatorwill now operate on the named parent class.
- Fixed an error thrown while trying to generate code after the last line or before the first line in the file (realistically this would only happen if the file did not end in a newline and a better position could not be found). (#27)
[0.7.1] - April 14, 2021
Added
- Added a setting
Cpp: Friend Comparison Operatorsto generate equality operators as friend functions rather than member functions.
Changed
Create Matching Source Filewill no longer ask to add definitions if there are no eligible functions.
Fixed
- Fixed a bug when parsing the first preprocessor statement in a file.
- Fixed C++ specific code-actions getting provided for C files.
[0.7.0] - April 8, 2021
Added
- Added
cmantic.generateStreamOutputOperatorcommand/code-action. Works very similar tocmantic.generateEqualityOperators. (#23) - Added
cmantic.addDefinitionscommand/code-action, accessible through theRefactor...menu. (#25) - Expanded support for multi-root workspaces. Most settings can now be configured per workspace folder.
Changed
- Removed the setting
C_mantic.cpp.indentation.namespace. Namespace indentation will always be auto-detected now.
Fixed
- Fixed a bug when determining if a cached matching header/source file still exists. This would cause some commands to throw an error if the file has been removed.
- Fixed a bug where name qualification of generated code would contain duplicate namespace names.
[0.6.3] - March 31, 2021
Added
- Added a setting
Accessor: Bool Getter Is Prefixto prefix getters ofboolmembers with ‘is’ (e.g.bool enabledgeneratesbool isEnabled() const). - Base classes can now be selected to compare when using
Generate Equality Operators.
Changed
- Searching for matching header/source files will now take into account the settings
Files: ExcludeandSearch: Exclude. - Setters will now be generated with a more appropriate parameter name instead of ‘value’.
Add Definitionwill now check for C++20’sconstevalkeyword when determining where a definition can be placed.- Extension is now packaged with webpack to improve load times.
Fixed
- Fixed a bug where
Add DeclarationandMove Definition into classquick-fixes weren’t accessible from theRefactor...menu. - Fixed an oversight where attributes would end up in getters and setters return/parameter type.
- Fixed a bug in identifying ranges of member access levels when consecutive access levels are the same.
[0.6.2] - March 14, 2021
Changed
- Generating getters, setters, and equality operators will now insert a
public:access specifier if one is not found in the class.
Fixed
- Fixed recognition of function definitions and declarations. Before, if a function definition ended with a semi-colon, it was recognized as a declaration.
- Improved recognition of virtual functions, and functions that are deleted or defaulted.
- Fixed
Move Definition into/out-of class bodycode-action being suggested for free functions. - Fixed
Generate Constructorrecognizing thevirtualkeyword as a base class. - Fixed namespace generation for qualified namespace names and
inlinenamespaces. - Improved
Autonamespace indentation. - Fixed a bug when finding matching header/source files and when sorting directories displayed by
Create Matching Source File. - Fixed a bug where using
Move Definition into classand selecting public access would do nothing. - Fixed an error thrown on
clangdwhen anonymous structs exist in the file.
[0.6.1] - March 11, 2021
Added
- Added support for explicit template specialization. Definitions for specialized function templates/member functions of specialized class templates can now be generated in the matching source file.
- Added support for nested templates.
Changed
- Placement of generated code will now account for trailing comments.
- Template parameter(s) will now be added to the parameter of equality operators.
Fixed
- Fixed title of
Add Declarationcode-action displaying the wrong target file. - Fixed recognition of explicit template specializations, and multi-lined template statements.
- Fixed placement of
inlinespecifier for function templates (inlinewas getting inserted before the template statement, which was a syntax error). - Fixed an issue where, under certain conditions, generated definitions/declarations would be placed within unrelated blocks of code (this only happened on
ms-vscode.cpptoolsand was a result of how it provides definitions/declarations for overloaded functions and undefined functions). - Fixed name qualification of generated code in the case that a parent scope has a qualified name.
- Fixed a bug that would throw an error when generating equality operators for an empty class/struct.
- Fixed
Add DeclarationandMove Definitionnot recognizing parent class templates. - Fixed recognition of leading comments. Comments that had multiple newlines in-between it and a symbol were incorrectly being recognized as leading comments.
- Fixed a bug where generated code would be placed at the very top of the file.
[0.6.0] - March 09, 2021
Added
- Added
cmantic.addDeclarationcommand/code-action.Add Declarationwill 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 Declarationwill be provided as aQuick Fix(suggested in the blue light-bulb menu), because defining a member function outside of the class with no declaration is an error. (#21) - Added a setting
Code Actions: Enable Add Declarationto control whether theAdd Declarationcode-action is suggested (light-bulb menu). (#21) - Added more variables for generating header guard
#define’s. SeeHeader Guard: Define Formatin the settings for the full list of available variables.
Changed
Move Definition into classwill now be available for member functions that are not declared in the class. Similar toAdd Declaration, this code-action will be provided as aQuick Fix, since it also fixes the underlying error. (#21)- Changed the way that code generation determines line-spacing: If code is being inserted between 2 non-empty lines, it will no longer place an empty line in-between.
Fixed
- Fixed whitespace alignment of
Add Definitionfor member functions in the case that the declaration is not indented. - Fixed indentation of code generated in classes in the case that the class is empty (before, if the class was empty, the new code would not be indented).
[0.5.2] - February 28, 2021
Added
- Template support has been expanded to properly generate member functions of class templates. Template parameter packs and default template arguments are now handled properly. (#18)
Changed
- Function templates and member functions of class templates can no longer be generated outside of header files. If getter/setter definition locations are set to generate in source files, it will fallback to generating in the current file. (#18)
- Generating constructors will no longer prompt the user to select initializers if the class has no initializers, instead of showing an empty prompt.
- Generating equality operators will no longer prompt the user to select member variables to compare if the class has no member variables, instead of showing an empty prompt.
[0.5.1] - February 27, 2021
Added
- Added a setting
Cpp: Use Explicit This Pointerto control whether generated member functions prefix class members withthis->. (#17)
Changed
- Handling of the
inlinespecifier has changed. Definitions generated within header files will have theinlinespecifier to prevent ODR violations. Additionally, inline functions can now be moved to source files and theinlinespecifier will be removed. Definitions moved to header files will gain theinlinespecifier. - Generating getters and setters for static members will now prefix the member with the class name (ClassName::staticMember).
Fixed
- Fixed
Add Definition’s whitespace alignment for multi-line declarations when removing leading specifiers (such asvirtual,static, etc.). (#19)
[0.5.0] - February 25, 2021
Added
Add Definitionfor 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.- Added a setting
Cpp: Braced Initializationto control whether member initializers use parentheses or curly braces. - Added
cmantic.generateEqualityOperatorscommand/code-action.
Changed
- Code-actions (refactorings) will now always appear in the
Refactor...menu, even if they are disabled from being suggested in the light-bulb menu.
Fixed
- Performance of finding header/source pairs has been improved for complex/remote workspaces. (#13)
- Fixed an issue where the header/source cache could be invalidated by file changes outside of VS Code. (#13)
[0.4.2] - February 20, 2021
Added
- Added a setting
Case Styleto control whether getters and setters are generated with names in snake_case, camelCase, or PascalCase. (#11)
Changed
volatilequalifier will now be stripped from getter return types as it has no effect.
Fixed
- Fixed setter generation for reference types. (#12)
- Fixed a bug where primitive/pointer types would sometimes generate setters with a const-reference parameter.
- Fixed a bug where ‘east’
constandmutablequalifiers would not be stripped from getter return types.
[0.4.1] - February 19, 2021
Added
- Added support for
s_static member naming scheme when generating getters and setters. - Added settings to control what code-actions are suggested (light-bulb menu).
- Added a setting to control the verbosity of alerts that are shown (Information, Warning, Error).
Changed
- Code-actions for generating getters and setters will now only be suggested when you select the name of the member variable.
Fixed
- Fixed a bug where classes/structs defined within a class/struct could affect the placement of getters and setters.
- Fixed a bug where getters and setters could not be generated for static members on
clangd.
[0.4.0] - February 14, 2021
Added
- Added
cmantic.moveDefinitionIntoOrOutOfClasscommand/code-action. Additionally, definitions within classes can be moved to a matching source file. (#7)
Changed
Add Definitionwill no longer reveal existing definitions ifReveal New Definitionsis turned off in the settings.
Fixed
- Fixed a bug when determining the scope of a new function definition. Definitions were sometimes generated with namespaces prepended to their scope-string (namespace::class::functionName) even if the definition was being placed within the corresponding namespace block.
- Fixed
Move Definitionnot accounting for changes in scope at the target position. (#6) - Parsing has been improved to accurately find matching parentheses, brackets, etc.
- Improved parsing of preprocessor directives.
- Raw string literals are now accounted for. This may have caused parsing issues before. (#8)
- Improved parsing of access specifiers when looking for a location for new getters and setters. Under some conditions, getters and setters may have been placed in non-public access.
- Improved smart-placement of function definitions.
- Implemented a workaround for
Add Definitionsometimes not revealing the new definition in the editor. (#2) - Code-actions will no longer be suggested for deleted, defaulted, and pure virtual functions.
[0.3.1] - February 08, 2021
Added
- Added an Output channel to log info, warnings, and errors.
- Generating a setter will now recognize
enumtypes and use a pass-by-value parameter type. - Generating a setter can now resolve
typedef’s andtype-alias’s in order to determine if the parameter should be pass-by-value instead of pass-by-const-reference. - Added an opt-in setting to resolve
typedef’s,type-alias’s, andenum’s when generating setters because this may impact the performance of the command.
Changed
- Changed the UI appearance of getter and setter commands and messages. This is to differentiate from languages that have ‘get’ and ‘set’ keywords.
- Changed incorrect usage of ‘method’ to ‘member function’. This is a semantic change in order to match the C++ standard.
Fixed
- Fixed a bug where member variables having an inline-block-comment would be recognized as being a pointer, and thus would generate a setter with a pass-by-value parameter type.
- Fixed a bug where having an
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. - Fixed placement of getter/setter definitions on
clangdandccls. - Fixed a bug where a type with a pointer template parameter would generate a pass-by-value setter.
- Fixed a bug where a type with a const template parameter wouldn’t allow generating a setter, because the whole type was being recognized as const.
- Fixed a bug where a type with a const template parameter would generate a getter with const stripped from the template parameters.
[0.3.0] - February 05, 2021
Added
- Added
cmantic.moveDefinitionToMatchingSourceFilecommand/code-action. (#3)
Changed
- Preemptively find header/source pairs to improve performance of commands.
Fixed
- Fixed generated getter/setter placement in the case that the relative declaration is multi-lined.
- Fixed smart-placement of function definitions on Windows.
- Fixed ‘Auto’ namespace body indentation for
Add Definitionin an empty namespace. - Fixed placement of new accessor declarations for
clangdandccls.
[0.2.2] - February 02, 2021
Added
- Added configurations to customize where definitions of getters and setters are placed. (#1)
- Added
Autoconfiguration forCurly Brace Format: Namespace. - Added configuration to control whether
Add Definitionreveals new definitions in the editor.
Fixed
- Improved performance of
Add Definitioncommands/code-actions. - Improved
Add Definitionsometimes not scrolling to the new definition in large files. (This still happens, but less often. It is unclear why.) (#2) - Fixed
cmantic.addHeaderGuardplacement of#endifin the case that the file does not end in a newline. - Improved parameter parsing of
Add Definition. - Fixed
Add Definitiontext alignment in the case that text appearing before the parameter list is multi-line. - Fixed
Add Definitionparsing of function templates.
[0.2.1] - January 29, 2021
Changed
cmantic.addHeaderGuardwill now validate static text given by the user in theC_mantic.headerGuard.defineFormatsetting by replacing illegal symbols with underscores.cmantic.createMatchingSourceFilewill 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 directory the user wants to put the new file in, and can just press enter.cmantic.createMatchingSourceFilewill 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.- Invoking the
cmantic.addHeaderGuardcommand directly now checks for an existing header guard. - Directly invoking commands to generate accessor functions now checks for existing accessor functions.
Fixed
- Improved performance of
cmantic.switchHeaderSourceInWorkspaceby caching header/source pairs after they are found. - Improved performance of
Add Definitioncommands/code-actions. - Fixed where
cmantic.addIncludeplaces new includes in the case that the file has no existing include statements and is non-empty. - Fixed
Add Definitionadding extra end-parenthesis forcclsandclangd. - Fixed
cmantic.addDefinitionInCurrentFileplacement forccls. Certain macros within classes confusesccls’s DocumentSymbols, such as Qt’s Q_OBJECT macro. - Fixed
cmantic.addIncludepositioning forcclsandclangd. - Fixed
Add Definitionofoperatoroverload functions forcclsandclangd. - Fixed
Add Definitionnot recognizing static member functions forccls.
[0.2.0] - January 22, 2021
Added
cmantic.generateGetterSetter,cmantic.generateGetter, andcmantic.generateSettercommands/code-actions.cmantic.createMatchingSourceFilecan now generate namespace blocks. Configurations were added to customize this behavior.
Changed
Curly Brace Formatfor functions was split into separate configurations for C and C++.
Fixed
cmantic.addHeaderGuardwill now replace any illegal symbols found in the file name with an underscore when creating a#definename.- Removed
cmantic.addDefinitionfrom appearing in the command palette as this is an internal command and would throw an error if invoked this way. - Removed duplicate entries of
Refactor...andSource Action...from appearing in the command palette. - Fixed issues pertaining to how the placement of new function definitions is determined.
- Fixed
Add Definitionnot recognizingoperatoroverload functions. - Fixed
Add Definitionnot placing function into a corresponding namespace block when that block was empty. - Various minor fixes.
[0.1.0] - January 15, 2021
Added
cmantic.switchHeaderSourceInWorkspacecommandcmantic.addDefinitionInSourceFilecommand/code-actioncmantic.addDefinitionInCurrentFilecommand/code-actioncmantic.createMatchingSourceFilecommand/code-actioncmantic.addIncludecommand/code-actioncmantic.addHeaderGuardcommand/code-action