mirror of
https://gitlab.com/prpl-foundation/prplmesh/prplMesh.git
synced 2025-12-20 01:21:22 +08:00
these should only be applicable for cpp-associated files. if these don't work, try creating a cpp language snippet config file using F1->Preferences: Configure Code Snippets Signed-off-by: Gal Wiener <gal.wiener@intel.com>
46 lines
1.4 KiB
Plaintext
46 lines
1.4 KiB
Plaintext
{
|
|
// Place your prplMesh workspace 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"
|
|
// }
|
|
"Create and check a variable that might be null": {
|
|
"prefix": "mbnull",
|
|
"body": [
|
|
"auto ${1:varname} = ${2:declaration};",
|
|
"if(!$1){",
|
|
"\tLOG(ERROR) << \"${3:failed creating $1}\";",
|
|
"\t${4://BODY}",
|
|
"}"
|
|
],
|
|
"description": "Create and check a variable that might be null, name is short for 'may be null'"
|
|
},
|
|
"Log DEBUG": {
|
|
"prefix": "dbg",
|
|
"body": [
|
|
"LOG(DEBUG) << ${1:your code here};"
|
|
],
|
|
"description": "Log DEBUG",
|
|
"scope": "cpp"
|
|
},
|
|
"Log ERROR": {
|
|
"prefix": "err",
|
|
"body": [
|
|
"LOG(ERROR) << ${1:your code here};"
|
|
],
|
|
"description": "Log DEBUG",
|
|
"scope": "cpp"
|
|
}
|
|
}
|