VScode c語言代碼片段


{
    "Print Note before function": {
        "prefix": "gcw_function_note",
        "body": [
            "/********************************************************************************",
            "* 函 數 名: $1 ",
            "* 功能描述: $2",
            "* 輸    入:無",
            "* 輸    出:無",
            "* 設 計 者: James_Gao                    日期:  2019年10月21日",
            "* 修 改 者:                              日期:",
            "********************************************************************************/",
            "int $1($3)",
            "{",
            "\t$0",
            "\treturn 0;",
            "}",
        ],
        "description": "Print Note before function"
    },

    "Add a comment at the beginning of the file": {
        "prefix": "gcw_file_note",
        "body": [
            "/***********************************文件說明************************************* ",
            "* 版    權:---------------------------",
            "* 項目名稱: 煤礦用智能運輸管理系統   ",
            "* 產品名稱:(Can總線驅動)待補充 ",
            "* 創建日期: 2019年9月12日",
            "* 創 建 人:-------",
            "* 文 件 名:-------",
            "* 文件功能: --------",
            "* 工 具 鏈:MDK-ARM-Standard Version 5.16a",
            "* 編 譯 器:Armcc.exe  V5.06(build 20)",
            "* 修 改 者:                         日期:",
            "* 備    注: ",
            "********************************************************************************/",
            "$0",
        ],
        "description": "Add a comment at the beginning of the file"
    },

    "For statement" :{
        "prefix": "gcw_for",
        "body": [
            "for(i=0;i<$1;i++)",
            "{",
            "$2",
            "}",
            "$0",
        ],
        "description": "For statement"
    },

    "While statement" :{
        "prefix": "gcw_while",
        "body": [
            "while($1)",
            "{",
            "$2",
            "}",
            "$0",
        ],
        "description": "while statement"
    },

    "Switch statement" :{
        "prefix": "gcw_switch",
        "body": [
            "switch($1)",
            "{",
            "case $2 :",
            "\tbreak;",
            "case $3 :",
            "\tbreak;",
            "case $4 :",
            "\tbreak;",
            "default:",
            "\tbreak;",
            "}",
            "$0",
        ],
        "description": "Switch statement"
    },

    "ADD COMMENT":{
        "prefix": "gcw_comment",
        "body": [
            "/************** $1 **************/",
        ],
        "description": "添加/**/型注釋"
    },
    "ADD COMMENT0":{
        "prefix": "gcw_lcomment",
        "body": [
            "/* $1 */",
        ],
        "description": "添加/**/型注釋"
    },

}
View Code

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM