You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, we often type the `if...else` structure. In HBuilderX, you can directly generate the corresponding code structure by hitting `ife` and enter.
HBuilderX uses json to define the format of the Snippets, which is compatible with the Snippets format of vscode, that is, you can easily move the custom Snippets that has been configured in vscode to HBuilderX for use.
|key |Snippets display name, the name displayed in the code assistant list. The key cannot be repeated.|
85
+
|prefix |Trigger character of Snippets|
86
+
|body |The content of the Snippets.|
87
+
|triggerAssist |True means that the code prompt is triggered on the first tabtop immediately after the code block is entered into the document, and the code assistant is pulled out. The default is false.|
88
+
|project |Control the code block to take effect under the specified project type. Possible values are: `uni-app`, `Web`, `App`, `Wap2App`.<br/>To set multiple item types, separate them with commas. For example: `"project": "uni-app,App"`|
-`$1`The position of the cursor after the code block is entered. If you need multiple cursors, configure `$1` in multiple places; if there are preset data at this location and need to be selected, the writing method is `${1:selectedtext}`; here also supports drop-down candidate menus, multiple options are drop-down candidates The list uses `${1:foo1/foo2/foo3}`
93
+
-`$2`After the code block is entered, the cursor switch position after pressing tab again.
94
+
-`$0` The final cursor position after the code block is entered.
94
95
95
-
特别说明:
96
-
1.**双引号使用`\"`转义**
97
-
2.**换行使用多个数组表示,每个行一个数组,用`双引号`包围,并用`逗号`分隔**
98
-
3.**缩进需要用`\t`表示,不能直接输入缩进或空格!**
96
+
Remark:
97
+
1.**Double quotes are escaped with `\"`**
98
+
2.**Line breaks are represented by multiple arrays, one array per line, surrounded by `double quotes` and separated by `commas`**
99
+
3.**The indentation needs to be indicated by `\t`, you cannot directly enter the indentation or spaces! **
99
100
100
101
101
-
### 注意事项
102
+
### Matters needing attention
102
103
103
-
1.每个代码块以`key`为主键,多个代码块需要`逗号`分隔。
104
-
2.如果json语法不合法,编辑器状态栏会弹出错误信息,json中会画出红波浪线,请注意修正。
104
+
1.Each code block uses `key` as the main key, and multiple code blocks need to be separated by `commas`.
105
+
2.If the json syntax is illegal, an error message will pop up in the editor status bar, and a red wavy line will be drawn in the json, please pay attention to the correction.
105
106
106
-
## 注释模板同步时间
107
+
## Comment template For Datetime
107
108
108
-
> HBuilderX 2.7.5+版本起,支持主持注释模板同步时间
109
+
> From HBuilderX 2.7.5+ version, it supports the synchronization time of host annotation template
109
110
110
-
点击菜单【工具】【代码块设置】【javascript代码块】,输入如下内容:
111
+
Click the menu [Tools - Snippets settings - javascript snippets], and enter the following:
0 commit comments