关于使用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"
},
}