Plantuml VsCode Sequence Diagram Snippets Setting

关于使用Plantuml + VsCode进行时序图绘制,可以使用VsCode Snippet功能,如下是本人编写的部分设置:

{
	// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and 
	// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope 
	// is left empty or omitted, the snippet gets applied to all languages. 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": {
	// 	"scope": "javascript,typescript",
	// 	"prefix": "log",
	// 	"body": [
	// 		"console.log('$1');",
	// 		"$2"
	// 	],
	// 	"description": "Log output to console"
	// }

	//for plant uml
	"shiweiz auto code segment 00 ": {
		"prefix": "afunccom",
			"body": [
			"$1 -> $2 : $3",
			"activate $2",
			"deactivate $2",
			"$5"
		],
	},
	
	"shiweiz auto code segment 01 ": {
		"prefix": "afuncsuc",
			"body": [
			"$1 -> $2 : $3",
			"activate $2",
			"$2 --> $1 : ${4:success}",
			"deactivate $2",
			"$5"
		],
		"description": "synchronous call"
	},

	"shiweiz auto code segment 02 ": {
		"prefix": "amsgcom",
			"body": [
			"$1 ->> $2 : $3",
			"activate $2",
			"deactivate $2",
			"$4"
		],
		"description": "asynchronous message common format"
	},

	"shiweiz auto code segment 03 ": {
		"prefix": "amsgbegin",
			"body": [
			"$1 ->> $2 : $3",
			"activate $1",
			"deactivate $1",
			"activate $2",
			"deactivate $2",
			"$4"
		],
		"description": "asynchronous message begin format"
	},

	"shiweiz auto code segment 04 ": {
		"prefix": "anote",
			"body": [
			"note over $1 : $2",
			"$3"
		],
		"description": "note format"
	},

	"shiweiz auto code segment 05 ": {
		"prefix": "astatus",
			"body": [
			"hnote over $1 : $2",
			"$3"
		],
		"description": "note format"
	},

	"shiweiz auto code segment 06 ": {
		"prefix": "aref",
			"body": [
			"ref over $1, $2 : $3",
			"$4"
		],
		"description": "note format"
	},
	//for code
	"shiweiz auto code segment 10 ": {
	"prefix": "cheader",
		"body": [
			"#ifndef $1",
			"#define $1",
			"\n\n#endif /**< $1 */"
	],
	"description": "header file header define"
	},

	"shiweiz auto code segment 11 ": {
	"prefix": "clcomment",
		"body": [
			"/**< $1 */",
	],
	"description": "common comment for one line"
	},

	"shiweiz auto code segment 12 ": {
	"prefix": "cbcomment",
		"body": [
			"/**",
			" * $1",
			"*/",
	],
	"description": "block comment for one block"
	},

	"shiweiz auto code segment 13 ": {
	"prefix": "cfunccom",
		"body": [
			"/**",
			" * @brief none",
			" * @detail none",
			" * ",
			" * @param void",
			" * @return Result",
			" *   @retval none",
			" * @note none",
			" */"
	],
	"description": "define for function"
	},

	"shiweiz auto code segment 14 ": {
	"prefix": "cftitle",
		"body": [
			"/**",
			" * @file $TM_FILENAME",
			" * @brief none",
			" * @details none",
			" * @author wee_Chang",
			" * @version 1.0.0",
			" * @date $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE",
			" */"
	],
	"description": "define for function"
	},
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
VSCode是一款开源的、跨平台的代码编辑器,它拥有丰富的扩展功能,可满足不同开发者的需求。其中一个常用的扩展是支持序列图的插件。 序列图是一种描述系统中不同对象之间交互行为的图形表示方法。它能够展示对象之间的消息传递,包括调用方法、接收返回值等。在软件开发过程中,序列图可以帮助开发者更好地理解系统的设计和交互流程。 通过VSCode的序列图扩展,我们可以在编辑器中直接编写和绘制序列图,在代码中的关键位置插入对应的图形表示。这样一来,我们可以更方便地分析和调试代码中的交互过程,尤其对于复杂的系统来说,序列图可以提供一种清晰可视化的描述方式。 VSCode序列图插件通常支持以下功能: 1. 语法高亮:在编辑器中为序列图的关键元素(如对象、消息、生命周期等)提供颜色和样式的区分,使得代码更易读。 2. 自动补全:插件根据已定义的对象和方法来自动补全代码,减少手动输入的错误。 3. 快速导航:用户可以通过插件提供的导航功能,快速定位到特定的对象或消息,方便代码的浏览和修改。 4. 导出功能:插件还支持将序列图导出为常见的图片格式,如PNG、SVG等,便于共享和展示。 总的来说,VSCode的序列图插件为开发者提供了一个方便、直观的方式来描述和理解系统的交互行为,能够帮助我们更好地分析代码和进行调试,提高开发效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值