test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
255
.config/Code/User/snippets/cpp.json
Normal file
255
.config/Code/User/snippets/cpp.json
Normal file
|
@ -0,0 +1,255 @@
|
|||
{
|
||||
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
|
||||
// description. 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": {
|
||||
// "prefix": "log",
|
||||
// "body": [
|
||||
// "console.log('$1');",
|
||||
// "$2"
|
||||
// ],
|
||||
// "description": "Log output to console"
|
||||
// }
|
||||
|
||||
"Startup": {
|
||||
"scope": "cpp",
|
||||
"prefix": "rafay",
|
||||
"body": [
|
||||
"/*",
|
||||
"Rafay Ahmad",
|
||||
"23I-2526",
|
||||
"*/"
|
||||
"#include <iostream>",
|
||||
"using namespace std;",
|
||||
"",
|
||||
"int main(){",
|
||||
"",
|
||||
" $0",
|
||||
"",
|
||||
" return 0;",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"Better Cout": {
|
||||
"scope": "cpp",
|
||||
"prefix": "co",
|
||||
"body": [
|
||||
"cout<<$1;$0"
|
||||
]
|
||||
},
|
||||
"fori": {
|
||||
"prefix": ["fori"],
|
||||
"body": [
|
||||
"for(${1:int} ${2:i}=${3:0};${2:i}<${4:max};${2:i}${5:++}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Indexed for loop"
|
||||
},
|
||||
"foreach": {
|
||||
"prefix": ["foreach", "iter"],
|
||||
"body": [
|
||||
"for(${1:type} ${2:var} : ${3:iterable}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Enhanced for loop"
|
||||
},
|
||||
"if": {
|
||||
"prefix": ["if"],
|
||||
"body": [
|
||||
"if(${1:condition}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement"
|
||||
},
|
||||
"ifelse": {
|
||||
"prefix": ["ifelse"],
|
||||
"body": [
|
||||
"if(${1:condition}){",
|
||||
"\t$2",
|
||||
"}",
|
||||
"else{",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if/else statement"
|
||||
},
|
||||
"ifnull": {
|
||||
"prefix": ["ifnull"],
|
||||
"body": [
|
||||
"if(${1:condition}==null){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement checking for null"
|
||||
},
|
||||
"ifnotnull": {
|
||||
"prefix": ["ifnotnull"],
|
||||
"body": [
|
||||
"if(${1:condition}!=null){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement checking for not null"
|
||||
},
|
||||
"While Statement": {
|
||||
"prefix": ["while"],
|
||||
"body": [
|
||||
"while(${1:condition}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "While Statement"
|
||||
},
|
||||
"Do-While Statement": {
|
||||
"prefix": ["dowhile"],
|
||||
"body": [
|
||||
"do{",
|
||||
"\t$0",
|
||||
"}while(${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch(${1:key}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Switch Statement"
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
|
||||
// description. 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": {
|
||||
// "prefix": "log",
|
||||
// "body": [
|
||||
// "console.log('$1');",
|
||||
// "$2"
|
||||
// ],
|
||||
// "description": "Log output to console"
|
||||
// }
|
||||
|
||||
"Startup": {
|
||||
"scope": "cpp",
|
||||
"prefix": "rafay",
|
||||
"body": [
|
||||
"/*",
|
||||
"Rafay Ahmad",
|
||||
"23I-2526",
|
||||
"*/"
|
||||
"#include <iostream>",
|
||||
"using namespace std;",
|
||||
"",
|
||||
"int main(){",
|
||||
"",
|
||||
" $0",
|
||||
"",
|
||||
" return 0;",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"Better Cout": {
|
||||
"scope": "cpp",
|
||||
"prefix": "co",
|
||||
"body": [
|
||||
"cout<<$1;$0"
|
||||
]
|
||||
},
|
||||
"fori": {
|
||||
"prefix": ["fori"],
|
||||
"body": [
|
||||
"for(${1:int} ${2:i}=${3:0};${2:i}<${4:max};${2:i}${5:++}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Indexed for loop"
|
||||
},
|
||||
"foreach": {
|
||||
"prefix": ["foreach", "iter"],
|
||||
"body": [
|
||||
"for(${1:type} ${2:var} : ${3:iterable}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Enhanced for loop"
|
||||
},
|
||||
"if": {
|
||||
"prefix": ["if"],
|
||||
"body": [
|
||||
"if(${1:condition}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement"
|
||||
},
|
||||
"ifelse": {
|
||||
"prefix": ["ifelse"],
|
||||
"body": [
|
||||
"if(${1:condition}){",
|
||||
"\t$2",
|
||||
"}",
|
||||
"else{",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if/else statement"
|
||||
},
|
||||
"ifnull": {
|
||||
"prefix": ["ifnull"],
|
||||
"body": [
|
||||
"if(${1:condition}==null){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement checking for null"
|
||||
},
|
||||
"ifnotnull": {
|
||||
"prefix": ["ifnotnull"],
|
||||
"body": [
|
||||
"if(${1:condition}!=null){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement checking for not null"
|
||||
},
|
||||
"While Statement": {
|
||||
"prefix": ["while"],
|
||||
"body": [
|
||||
"while(${1:condition}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "While Statement"
|
||||
},
|
||||
"Do-While Statement": {
|
||||
"prefix": ["dowhile"],
|
||||
"body": [
|
||||
"do{",
|
||||
"\t$0",
|
||||
"}while(${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "switch",
|
||||
"body": [
|
||||
"switch(${1:key}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Switch Statement"
|
||||
},
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue