Paper.Yellow

vscode Snippet 설정 본문

Tools

vscode Snippet 설정

Paper.Y 2022. 12. 6. 01:40

{
	// Place your snippets for java 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"
	// }
	"Junit Test Method": {
		"prefix": "tt",
		"body": [
			"@Test",
			"public void $1_test() throws Exception {",
			"    // given",
			"    $2",
			"",
			"    // when",
			"",
			"",
			"    // then",
			"",
			"}"
		],
		"description": "Junit Test Method"
	},
	"Log": {
		"prefix": "logd",
		"body": [
			"log.debug(\"디버그 : $1\"$2);"
		],
		"description": "log"
	},
	"GetMapping": {
		"prefix": "getm",
		"body": [
			"@GetMapping(\"/$1\")",
			"public ResponseEntity<?> $2(){",
			"    $3",
			"    return new ResponseEntity<>(new ResponseDto<>(ResponseEnum.GET_SUCCESS, null), HttpStatus.OK);",
			"}",
		],
		"description": "Mapping"
	},
	"PostMapping": {
		"prefix": "postm",
		"body": [
			"@PostMapping(\"/$1\")",
			"public ResponseEntity<?> $2(){",
			"    $3",
			"    return new ResponseEntity<>(new ResponseDto<>(ResponseEnum.POST_SUCCESS, null), HttpStatus.CREATED);",
			"}",
		],
		"description": "Mapping"
	},
	"PutMapping": {
		"prefix": "putm",
		"body": [
			"@PutMapping(\"/$1\")",
			"public ResponseEntity<?> $2(){",
			"    $3",
			"    return new ResponseEntity<>(new ResponseDto<>(ResponseEnum.PUT_SUCCESS, null), HttpStatus.OK);",
			"}",
		],
		"description": "Mapping"
	},
	"DeleteMapping": {
		"prefix": "gm",
		"body": [
			"@DeleteMapping(\"/$1\")",
			"public ResponseEntity<?> $2(){",
			"    $3",
			"    return new ResponseEntity<>(new ResponseDto<>(ResponseEnum.DELETE_SUCCESS, null), HttpStatus.OK);",
			"}",
		],
		"description": "Mapping"
	},
	"Logger": {
		"prefix": "logf",
		"body": [
			"private final Logger log = LoggerFactory.getLogger(getClass());"
		],
		"description": "Logger Field"
	},
	"MapToList": {
		"prefix": "mapToList",
		"body": [
			"$1.stream().map($2::new).collect(Collectors.toList());"
		],
		"description": "MapToList"
	},
	"AssertThatEquals": {
		"prefix": "asse",
		"body": [
			"assertThat($1).isEqualTo($2);"
		],
		"description": "AssertThatEquals"
	},
}

'Tools' 카테고리의 다른 글

sublime text  (0) 2022.12.04
Gmail SMTP  (0) 2022.11.20
이클립스 - 여러줄 한번에 주석처리하기  (0) 2022.07.28
이클립스 - 글씨체 바꾸기  (0) 2022.07.28