Vscode自定義注釋模板的實現示例
首先安裝插件Doxygen Documentation Generator,安裝完成之后點擊Doxygen插件的設置,按照下面的步驟打開settings.json進行編輯:
在settings.json中追加如下代碼:
"doxdocgen.file.copyrightTag": [ "Copyright (C), 2023," ], "doxdocgen.file.fileTemplate": "@file \t 【文件名稱,不包含絕對路徑】", "doxdocgen.generic.authorTag": "@author \t 【作者】", "doxdocgen.generic.dateTemplate": "@date \t {date}", "doxdocgen.generic.briefTemplate": "@brief \t 【簡介】", "doxdocgen.generic.returnTemplate": "@return \t 【解釋返回值】 ", "doxdocgen.file.customTag": [ //文件級的自定義注釋 "@note \t 【重大修改可以放在這里】", ], "doxdocgen.generic.customTags": [ "@warning\t 【不可重入、阻塞等屬性特殊說明】", "@note\t 【重大修改】", ], "doxdocgen.generic.paramTemplate": "@param \t {param} [in/out], 參數意義", "doxdocgen.file.fileOrder": [ "copyright", "", //這個地方表示換行 "file", "author", "date", "brief", "custom", ], "doxdocgen.generic.order": [ "brief", "param", "return", "custom" ]
切回vscode,在函數上方輸入/***/,然后再第二個*后面按一下enter鍵,自定義注釋模板即可生效,如下圖:
多插一句嘴,我的主題插件是Visual Assist Dark Theme插件,改編自visual studio上的西紅柿助手 主題顏色。個人感覺還是挺好看的
到此這篇關于Vscode自定義注釋模板的實現示例的文章就介紹到這了,更多相關Vscode自定義注釋模板內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
C語言中動態(tài)內存分配malloc、calloc和realloc函數解析
C語言跟內存申請相關的函數主要有 alloca、calloc、malloc、free、realloc等,下面這篇文章主要給大家介紹了關于C語言中動態(tài)內存分配malloc、calloc和realloc函數的相關資料,需要的朋友可以參考下2022-03-03C++ STL關聯(lián)式容器自定義排序規(guī)則的2種方法
這篇文章主要介紹了C++ STL關聯(lián)式容器自定義排序規(guī)則的2種方法,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2021-03-03