Files
prplMesh/.vscode/prplmesh-snippets.code-snippets
unknown a9b52c076c add debug and error code snippets
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>
2020-03-16 21:55:30 +00:00

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"
}
}