amir9480 / vscode-cpp-helper

vscode extension to create implementation for c++ function prototypes.
https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.cpp-helper
MIT License
355 stars 31 forks source link
code-generation cplusplus typescript vscode vscode-extension

C++ Helper

Screen Shot C++ Helper extension for VSCode.

Features

Configuration

CppHelper.SourcePattern:

The array of possible patterns to find the source of a header file.

Example:

"CppHelper.SourcePattern": [
    "{FILE}.cpp",
    "{FILE}.c",
    "{FILE}.inl",
    "/src/{FILE}.cpp"
]

Where {FILE} is your active header file name.

If you don't want a relative pattern then put a / as first character.

CppHelper.HeaderGuardPattern:

The pattern of header guard. Example:

"CppHelper.HeaderGuardPattern": "{FILE}_H"

Where {FILE} is your active header file name in UPPERCASE format.

CppHelper.ContextCreateImplementation

Show or hide "Create Implementation" in context menu.

CppHelper.ContextCreateImplementationHere

Show or hide "Create Implementation Here" in context menu.

CppHelper.ContextCopyImplementation

Show or hide "Copy Implementation" in context menu.

CppHelper.ContextCreateHeaderGuard

Show or hide "Create Header Guard" in context menu.

CppHelper.SourceNotFoundBehavior

What happen if source file of a header file not found.

CppHelper.FindReplaceStrings

Pairs of strings to find/replace within the path

Example:

"CppHelper.FindReplaceStrings": [
    {
        "find": "/include/Public",
        "replace": "/src/Private"
    }
],

Above configuration will replace all /include/Public in your path to /src/Private when trying to find source code of header file. You can also use regular expressions.

"CppHelper.FindReplaceStrings": [
    {
        "find": "/include/Public/([^\\/]+)",
        "replace": "/src/Private/$1"
    }
],

Known Issues

If you implement a previously implemented function duplicate implementation will happen.

This extension created using regex and there is no parser/compiler. so any wrong implementation may happen. If you found any wrong implementation please let me know in issues and also don't forget to send your code sample.

Change Log

0.3.3

Add new CppHelper.FindReplaceStrings configuration (#70)

0.3.1

0.3.0

0.2.1

0.2.0

0.1.0

0.0.7

0.0.6

0.0.5

0.0.4

0.0.3