A single instruction inserts code snippets in multiple places, based on file extension matching
Features
When you enter a directive, you can insert the template in multiple places in the file according to the configured rules
Extension Settings
This extension contributes the following settings:
snippets-by-extension.maxInputLength: The maximum length of the instruction (default 6).
snippets-by-extension.configJsonUrl: Required, folder address of the configuration file. should be added \ to the end of the address, for example: D:\CODE\snippets-config\
Configuration description
Note: Formatting issues when regular expressions are written as strings
Note: When adding rules to different file extensions, you need to create a JOSN file and name it with the file extension
// The plugin matches the rules based on the name of the profile
// Like the vue.json file below, the plugin will use the rules when editing the .vue file
// vue.json
{
"tmp-cp": {
"default": [
"<div id=\"test\"></div>"
],
"rules": [
["\\s+computed:\\s*{", [
"value2() {",
" return 2;",
"},"
]],
["\\s+watch:\\s*{", [
"text: 2"
]]
]
}
}