inblog logo
|
keepgoing
    FlutterInstall

    [Flutter] 3 VSCode 세팅

    vscode 로 코드 작성할 거니까 세팅을 해보자 !
    김호정's avatar
    김호정
    Sep 27, 2024
    [Flutter] 3 VSCode 세팅
     
    https://getinthere.notion.site/VSCODE-9ac044b1e7f3466aa03bcb04612e838c
    참고
     

     
     
    extensions 가서 4개 install 먼저 해주자
     
    notion image
    notion image
    notion image
    notion image
     
    그리고 Preference → setting 가서
     
    notion image
     
    format on save 체크
     
    notion image
     
    view → command palette 가서 ( 단축키 : ctrl + shift + A )
     
    notion image
     
    세개가 나오는데
     
    User세팅은 어디서든 적용되고
    workspace는 지금 로컬 컴퓨터에서 적용됨
     
    → fleet 적용할라면 여기에 넣어야 함
     
    notion image
     
    installation 설명 부분에 네모안에거 복사해서
     
    notion image
     
    “workSpace” settings에 넣어준다.
     
    그럼 왼쪽에 settings.json 파일이 프로젝트 안에 나타남.
     
    다시 Ctrl + shift + A 가서
     
    notion image
     
    spring 검색하면 나오는 요거 선택
     
    notion image
    notion image
    notion image
     
    com.exmaple
    demo 로 하고
     
    자바 버전 21 선택
     
    notion image
     
    일단 3개만 추가해주자
     
    selected 3 dependencies 눌러서
     
    notion image
     
    vswork 폴더 만들어서 이 폴더 안에서 제너레이트
     
    notion image
     
    OK하고 새로운 창 열리면 기존창 끄면된다.
     
    notion image
     
    왼쪽에 이렇게 gradle 생성되어 있음
     
    .vscode는 아까본 settings.json 같은거!
     
    폰트나 기타 등등 다 여기서 설정해준다.
     
    notion image
     
    extensions 가서 이거 설치하면
     
    아이콘이
     
    notion image
     
    이렇게 이뻐진다.
     
    notion image
     
    이거 파일명 리드미로 수정하기
     
    수정 단축키 F2
     
    notion image
     
    리드미 안에 내용 다 지우기
     
    그리고 리드미 파일명은 대문자로 써줘야함
     
    notion image
     
     
    notion image
     
    run 해보고
     
    8080 때려보면
     
    notion image
     
    404 나오면 서버 잘 돌아가는거!
     
    notion image
     
    빨간 네모 뉼러서 꺼주기
    notion image
     
    터미널말고 디버그콘솔에서 서버 실행시키도록 설정하자.
     
     
    notion image
    preferences → settings 가서
     
    User 탭 선택한 상태에서
     
    notion image
     
    하면
    notion image
     
    디버그 콘솔에서 실행된다.
     
    notion image
    notion image
    User의 settings.json파일임
    "editor.fontFamily": "JetBrains Mono, Consolas, 'Courier New', monospace", "editor.fontSize": 16, "editor.lineHeight": 1.6,
    notion image
    User 파일에 넣어준다.
     
    notion image
     
    properties 를 yml로 바꾸기
     
    spring: output: ansi: enabled: always
    notion image
     
    넣어주고 DemoApplication으로 와서 서버 재실행하면
    이쁘게 나온다.
     
     
    notion image
     
    notion image
    jetbrains fleet 테마로 설정 가능
     
     
    notion image
    아이콘 바꿀 수 있음 (아까설치한 아이콘테마 선택하기)
     
     
    notion image
     
    lombok 설치해주기
     
    notion image
     
    실행 shitft + f9
     
    끄는거 shift + f5
     
     
    notion image
     
    컨트롤러 만들어주기
     
    ALT + SHIFT + O 하면 필요없는 Import 사라짐
     
     
    그리고 실행하면 ok 나온다.
     
     
     
     
    notion image
     
    즐겨찾기 해두기
     
    자바 관련된 라이브러리 다 있음
     
    notion image
    notion image
    notion image
    // https://mvnrepository.com/artifact/org.mindrot/jbcrypt implementation group: 'org.mindrot', name: 'jbcrypt', version: '0.4'
    notion image
    notion image
     
    넣어주고 저장하면 Gradle 이 돌아야 하는데
    왜 gradle build error 가 뜰까
     
    notion image
     
    이거 설치되어져있는데 ?
     
    notion image
     
    reload 는 build.gradle 우측에서 한다.
    ( 버전마다 다름 )
     
    reload 해줬는데도 build error 상태네? 일단 패스
     
     
    notion image
    컨트롤러단에서 이렇게 작성했을 때
     
    BCrypt 가 뜨면 build.gradle에 의존성 추가 잘 된것이다!
     
     
    notion image
     
    레인보우 테이블
     
    해시 비밀번호
     
    안털릴려면 솔트 넣어야함
     
    ( 솔트를 털리면 안됨 … ^^ )
     
    솔트는 지금 시간? 같은걸로 알고리즘 가지고 만드는거라 나도 모름
     
     
    package com.example.demo; import org.mindrot.jbcrypt.BCrypt; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class IndexController { @GetMapping("/") public ResponseEntity<?> home() { return new ResponseEntity<>("ok", HttpStatus.OK); } @GetMapping("/user") public ResponseEntity<?> user() { String rawPassword = "1234"; String salt = BCrypt.gensalt(); String encPassword = BCrypt.hashpw(rawPassword, salt); System.out.println("salt : " + salt); return new ResponseEntity<>(encPassword, HttpStatus.OK); } @GetMapping("/verify") public ResponseEntity<?> verify() { String requestBody = "1234"; String dbPassword = "$2a$10$mgr2Z6HHWb.OpErcvpKc1.W.zE3QBxqNnbkc.m94oP13/iGcBDR7S"; boolean isSame = BCrypt.checkpw(requestBody, dbPassword); return new ResponseEntity<>(isSame, HttpStatus.OK); } }
     
    notion image
     
    notion image
     
    notion image
     
    salt 해서 나온거 잘못된거면 verify 할때 false 가 뜸
     
    자 이제 스니펫 설정
     
    notion image
    notion image
    notion image
    { "Code Split": { "prefix": "mcs", "body": [ "/**", "* $1", "* $2", "**/" ], "description": "Code Split" }, "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": "logd" }, "Sysout": { "prefix": "syst", "body": [ "System.out.println(\"테스트 : $1\"$2);" ], "description": "sysout" }, "ReturnMapping": { "prefix": "rr", "body": [ "return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", ], "description": "ResponseMapping" }, "ErrorMapping": { "prefix": "err", "body": [ "return new ResponseEntity<>(new ResponseDto<>(-1, \"\", null), HttpStatus.BAD_REQUEST);", ], "description": "ResponseMapping" }, "GetMapping": { "prefix": "getm", "body": [ "@GetMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", "return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", "}", ], "description": "Mapping" }, "PostMapping": { "prefix": "postm", "body": [ "@PostMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", " return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.CREATED);", "}", ], "description": "Mapping" }, "PutMapping": { "prefix": "putm", "body": [ "@PutMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", " return new ResponseEntity<>(new ResponseDto<>(1, \"\", null), HttpStatus.OK);", "}", ], "description": "Mapping" }, "DeleteMapping": { "prefix": "delm", "body": [ "@DeleteMapping(\"/$1\")", "public ResponseEntity<?> $2(){", " $3", " return new ResponseEntity<>(new ResponseDto<>(1, \"\", 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((e)-> e).collect(Collectors.toList());" ], "description": "MapToList" }, "AssertThatEquals": { "prefix": "asse", "body": [ "assertThat($1).isEqualTo($2);" ], "description": "AssertThatEquals" }, }
    이거 넣어주라
     
    notion image
    다 넣어준다.
     
    notion image
     
    이제 tt 엔터, mcs 엔터 이렇게 해서 사용하면된다.
     
    커서가 $로 간다. 탭하면 다음 $로 감 (편함)
     
    $는 shell 문법이다.
     
    os랑 이런거 공부해라.
     
    선생님 aws 강의 보기 !!! 리눅스 !!!
     
    ++
     
    아까 gradle error 나는거
     
     
    notion image
     
    User settings 로 가서
     
    notion image
     
    경로 추가 해줘야 자바홈 인식함ㅎ
     
    (나는 경로가 달라서 내꺼로 넣었다)
     
     
    notion image
    "java.import.gradle.java.home": "C:/Program Files/Java/jdk-21",
     
    자바 21 경로를 넣어준다.
     
    그럼
     
    notion image
     
    gradle error 사라짐 : )
     
    notion image
     
    이제 코끼리로 가서 reload도 할 수 있다. (버튼 생김)
     
    ++
    만약에 자동리로드 안되면
     
    notion image
    Language Support for java → uninstall
     
    notion image
    ctrl + shift + a
    clean 하고 (releoad and clean)
     
    notion image
    재설치
     
    해보자.
     
    ++
     
    notion image
    이거 체크하면 휠로 폰트크기 줄이고 키울수 있다.
     
     
    ++
    SpringBoot) vsCode에서 reload하기
    .
    SpringBoot) vsCode에서  reload하기
    https://velog.io/@hke2/SpringBoot-on-vsCode-build.gradle-dependency-추가-후-reload
    SpringBoot) vsCode에서  reload하기
     
    Share article

    keepgoing

    RSS·Powered by Inblog