Adds functionality to be help write c++ code.
This extension was developed for personal use and does not fully work in some scenarios, it is still in development.
Any feedback or suggestions is welcomed
Describe specific features of your extension including screenshots of your extension in action. Image paths are relative to this README file.
- Moving specific functions from header files to cpp files
- Moving all function from header file to cpp file
- Moving functions, generates new header file if it does not exist
- Move content to a new header file
- Creates common default implemented constructors
- Generate constructor with all attributes as parameters
- Create destructor
- Add all includes
- Add specific includes via context menu, or quick fix
- Add missing virtual functions
All context menu items can be removed in the settings, by default they are all present.
Include/external folders can added in the config settings, to make includes correct.
Creates a new file if it does not already exist
Moves selection to a new header file
- creates the file, adds #pragma once
- if selection is embedded in namespaces creates those as well
- adds include of new file to original
Works best when all symbols can be found, else uses best guess when not, for example std::string is unknown in this example
Creates the basic default constructors and assignment operator
Creates the default destructors
Adds all the missing includes. Works by looking at every word and seeing if its declaration is missing from the includes.
It contains hardcoded mappings of the standard library so similar named symbols might get resolve to the std lib instead of user defined.
Adds specific include that is currently selected.
It contains hardcoded mappings of the standard library so similar named symbols might get resolve to the std lib instead of user defined.
Available as command or in context menu or as a quick fix.
Forward declaring is useful on large projects as it can reduce build time significantly.
As if person.h includes dog.h, we can image lots of other files like world.h including person.h implicitly including dog.h even if it does not use dog.
Thus if any change is made to dog.h a lot of build system will then rebuild person.h and world.h, but by forward declaring we can remove these dependencies.
When a type is only mention as a pointer/reference and without any dereferencing, it can be forward declared.
The steps are:
- Move/delete existing include for type to cpp file if cpp exists.
- Add in forward declaration. Does not handle spacing currently
Click on the specific interface that a class extends, a quick fix will appear to add the missing virtual functions
- Moving constructors does not correctly remove initializer list
- Creating constructor of unknown types that are comma separate, for example std::string me, you; if std::string is not resolved.
Initial release of cpp helper
- added basic functionality of moving functions
Major bug fixes and additional documentation
Added move to header file command
Fixed create constructor command not working with structs
Fixed create constructor command not working with comments
Added add includes automatically
Add specific include for clicked on symbol
Add quick fix suggestion to include symbol
Add include quick fix to show multiple options for include
Added forward declare, does not handle name spacing
Fixed relative includes using ../ notation
Fixed relative includes not removing same root paths
Fixed bad import
Added move to cpp to quick fix
Fixed a back slash forward slash problem when generating include
Added creating destructor
Added create con/destructor to quick fix
Added move to header to quick fix
Added include all to quick fix
Can now undo file creation for move to
Added quick fix to add all virtual functions
Adds virtual functions recursively
Does not add already existing functions
Fixed include generated by Move to Impl from backslashes
Fixed Create Constructor bug when class is templated
Fixed move all impl when generating a new file
Add file extension setting to chang cpp file extensions for different projects