update
This commit is contained in:
parent
b66a71129e
commit
3251bca29a
299 changed files with 7589 additions and 37 deletions
47
vscode/snippets/MySnippets.code-snippets
Normal file
47
vscode/snippets/MySnippets.code-snippets
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
// Place your global 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"
|
||||
// }
|
||||
|
||||
//--------------------------------------------JAVA--------------------------------------------------//
|
||||
|
||||
"Game Loop": {
|
||||
"scope": "java",
|
||||
"prefix": "gloop",
|
||||
"body": [
|
||||
"@Override",
|
||||
"public void run(){",
|
||||
"",
|
||||
" long updateInterval = 1000000000/60;",
|
||||
" long nextUpdateTime = System.nanoTime() + updateInterval;",
|
||||
"",
|
||||
" while(true){",
|
||||
" update();",
|
||||
" repaint();",
|
||||
" long timeRemaining = nextUpdateTime - System.nanoTime();",
|
||||
" try{",
|
||||
" if(timeRemaining>0) Thread.sleep(timeRemaining/1000000);",
|
||||
" }"
|
||||
" catch(InterruptedException e){",
|
||||
" e.printStackTrace();"
|
||||
" }",
|
||||
" nextUpdateTime = System.nanoTime() + updateInterval;",
|
||||
" }",
|
||||
"}"
|
||||
]
|
||||
}
|
||||
|
||||
}
|
121
vscode/snippets/cpp.json
Normal file
121
vscode/snippets/cpp.json
Normal file
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
// 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": {
|
||||
"prefix": "rafay",
|
||||
"body": [
|
||||
"#include <iostream>",
|
||||
"using namespace std;",
|
||||
"",
|
||||
"int main(){",
|
||||
"",
|
||||
"\t$0",
|
||||
"",
|
||||
"\treturn 0;",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"Better Cout": {
|
||||
"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"
|
||||
},
|
||||
|
||||
}
|
183
vscode/snippets/java.json
Normal file
183
vscode/snippets/java.json
Normal file
|
@ -0,0 +1,183 @@
|
|||
{
|
||||
"sysout": {
|
||||
"prefix": ["sou"],
|
||||
"body": [
|
||||
"System.out.println($1);$0"
|
||||
],
|
||||
"description": "Print to standard out"
|
||||
},
|
||||
"syserr": {
|
||||
"prefix": ["syserr", "serr"],
|
||||
"body": [
|
||||
"System.err.println($1);$0"
|
||||
],
|
||||
"description": "Print to standard err"
|
||||
},
|
||||
"fori": {
|
||||
"prefix": ["fo"],
|
||||
"body": [
|
||||
"for(${1:int} ${2:i}=${3:0};${2:i}<${4:max};${2:i}${5:++}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Indexed for loop"
|
||||
},
|
||||
"foreach": {
|
||||
"prefix": ["fore"],
|
||||
"body": [
|
||||
"for(${1:type} ${2:var} : ${3:iterable}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Enhanced for loop"
|
||||
},
|
||||
"if": {
|
||||
"prefix": ["ifi"],
|
||||
"body": [
|
||||
"if(${1:condition}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement"
|
||||
},
|
||||
"ifelse": {
|
||||
"prefix": ["ife"],
|
||||
"body": [
|
||||
"if(${1:condition}){",
|
||||
"\t$2",
|
||||
"}",
|
||||
"else{",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if/else statement"
|
||||
},
|
||||
"ifnull": {
|
||||
"prefix": ["ifn"],
|
||||
"body": [
|
||||
"if(${1:condition}==null){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement checking for null"
|
||||
},
|
||||
"ifnotnull": {
|
||||
"prefix": ["ifnn"],
|
||||
"body": [
|
||||
"if(${1:condition}!=null){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "if statement checking for not null"
|
||||
},
|
||||
"While Statement": {
|
||||
"prefix": ["whi"],
|
||||
"body": [
|
||||
"while(${1:condition}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "While Statement"
|
||||
},
|
||||
"Do-While Statement": {
|
||||
"prefix": ["do"],
|
||||
"body": [
|
||||
"do{",
|
||||
"\t$0",
|
||||
"}while(${1:condition});"
|
||||
],
|
||||
"description": "Do-While Statement"
|
||||
},
|
||||
"Switch Statement": {
|
||||
"prefix": "swi",
|
||||
"body": [
|
||||
"switch(${1:key}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Switch Statement"
|
||||
},
|
||||
"trycatch": {
|
||||
"prefix": "try",
|
||||
"body": [
|
||||
"try{",
|
||||
"\t${TM_SELECTED_TEXT:$1}",
|
||||
"}",
|
||||
"catch(${2:Exception} ${3:e}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "try/catch block"
|
||||
},
|
||||
"tryresources": {
|
||||
"prefix": "tryr",
|
||||
"body": [
|
||||
"try($1){",
|
||||
"\t$2",
|
||||
"}",
|
||||
"catch(${3:Exception} ${4:e}){",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"Startup": {
|
||||
"prefix": ["rafay"],
|
||||
"body": [
|
||||
"public class ${1:${TM_FILENAME_BASE}}{",
|
||||
"\tpublic static void main(String[] args){",
|
||||
"\t\t$0",
|
||||
"\t}",
|
||||
"}"
|
||||
],
|
||||
"description": "Startup"
|
||||
},
|
||||
"class": {
|
||||
"prefix": ["cla"],
|
||||
"body": [
|
||||
"${1:public} class ${2:name}{",
|
||||
"\t$0",
|
||||
"}"
|
||||
]
|
||||
},
|
||||
"main": {
|
||||
"prefix": ["mai"],
|
||||
"body": [
|
||||
"public static void main(String[] args){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Public static main method"
|
||||
},
|
||||
"Constructor": {
|
||||
"prefix": "cstr",
|
||||
"body": [
|
||||
"${1:public} ${2:${TM_FILENAME_BASE}}($3){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Constructor"
|
||||
},
|
||||
"method": {
|
||||
"prefix": "meth",
|
||||
"body": [
|
||||
"${1:public}$2 ${3:void} ${4:name}($5){",
|
||||
"\t$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Method"
|
||||
},
|
||||
"newObject": {
|
||||
"prefix": "obj",
|
||||
"body": [
|
||||
"${1:Object} ${2:foo} = new ${1}($3);$0",
|
||||
],
|
||||
"description": "Create new Object"
|
||||
},
|
||||
"Field": {
|
||||
"prefix": "var",
|
||||
"body": [
|
||||
"${1:public} ${2:String} ${3:name};"
|
||||
],
|
||||
"description": "Field"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue