/MacroDefineHelper-vscode

Iterate through the macro helper configuration file in the directory and generate a configuration tree. Then generate a series of macros in head files. 遍历目录中的宏助手配置文件并生成配置树,再根据配置树生成一系列宏

Primary LanguageTypeScript

中文

MacroDefineHelper README

A vscode extension to generate a config tree from the describe files in project.

Then you can edit the describe tree and generate head files from the tree

image-20210613185245774

image-20210613185555981

image-20210613184934920

image-20210613185038846

developement

  1. pack

    vsce package

  2. first open

    npm install

install

You can download it from releases.

use

  1. generate and open config file

    image-20210613192841677

    image-20210613192714030

    right click side bar or input command

    choose the first selection

    image-20210613192958303

    remove the ’//‘ and set the values


    "libConfFilePath" the path of generated headers

    "defaultConfFileName" default head file name

    "libSrcPath" the directory path need to look for describe file

    "describeFileFolderName" the name of the folder which contains the describe file

    "describeFileName" the name of describe file


    for example

    {
        "libConfFilePath": "./AutoGenHeader",
        "defaultConfFileName": "AllConfig.h",
        "libSrcPath": "./paLibSubs",
        "describeFileFolderName": "",
        "describeFileName": "describe.txt"
    }
  2. add describe file(describe.txt in the example above) in libs need define setting

    for example:

    image-20210613200523702

    there is a define value needed in my oled lib

    then I created a describe.txt in oled lib's directory

    use a | to divide the define value and default value


    if it needs a special head file we can add a line like following:

    image-20210613195854159

  3. generate config json tree

    right click or input command, choose the second option

    image-20210613200017719

    we will get a json tree file

    image-20210613200107695

    we can easily change the tree node value and save the file

  4. generate head files from tree

    right click or input command, choose the third option

    the head file will be generated in the target directory

    image-20210613200340874