其他分享
首页 > 其他分享> > 一.关于vscode配置快速文件注释和函数注释功能。

一.关于vscode配置快速文件注释和函数注释功能。

作者:互联网

1.打开配置在这里插入图片描述

在这里插入图片描述

2.格式如下

此类注释实际使用的是一种打印输出:
文件中有实例说明,这不光可以配置注释还可以配置for,while以及switch等,需要自定义的函数。(注意文件类型的对应的关系,c.json
仅适用于c,c++.json又需要进行配置)

{
	// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	// "Print to console": {
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }
	"HEADER": {
		"prefix": "header",
		"body": [
			"/***********************************************************************************************************************",
			"@! Copyright(c) 2014-2021 Shenzhen Siliconductor Co.Ltd.All rights reserved",
			"@File:       hal_rf.h",
			"@Brief:      RF driver header file",
			"@Details:",
			
			"@Author:   	 xxx",
			"@Version:    V1.0.0",
			"@Date:       2021-10-27",
			"@Warning:",
			"@Change Logs:",
			"@Date               Author           Notes",
			"@2021-10-27         xxxx           the first version",
			"***********************************************************************************************************************/",
			"$0"
		],
	},
	"function": {
		"prefix": "function",
		"body": [
			"/***********************************************************************************************************************",
			"@brief:    -- Initialize GPADC",
			"@param:  -> none",
			"@retval:   -< none",
			"***********************************************************************************************************************/",
			"$0"
		],
	}
}

3.演示:

这里都是在c文件下,才会有提示。更换文件类型就不会再有提示,即在.h文件等其他类型的文件下不会出现提示。
在这里插入图片描述
在这里插入图片描述

标签:body,snippet,console,函数,vscode,注释,prefix,2021
来源: https://blog.csdn.net/weixin_44386927/article/details/121223125