코드 편집기에서 Gemini에 프롬프트를 입력하여 앱의 코드를 수정, 최적화 또는 추가하도록 요청할 수 있습니다.
프롬프트 입력 필드를 가져오려면 코드 편집기에서 다음 중 하나를 실행하세요.
코드 편집기에서 마우스 오른쪽 버튼을 클릭하고 컨텍스트 메뉴에서 Gemini > 코드 생성을 선택합니다.
Gemini가 수정할 코드를 강조 표시하고 코드 편집기에서 마우스 오른쪽 버튼을 클릭한 다음 컨텍스트 메뉴에서 Gemini > 코드 변환을 선택합니다.
Ctrl+\ (macOS의 경우 Command+\)를 누릅니다.
코드 수정 또는 추가 방법을 설명하여 Gemini에 프롬프트를 입력하고 Enter 키를 누릅니다. Gemini가 요청을 처리하면 코드 차이가 표시됩니다. 코드 차이점을 사용하면 원하는 추천만 검토하고 수락할 수 있습니다.
코드 차이점을 검토하고 다음 중 하나를 수행합니다.
수정을 클릭하고 새 프롬프트를 입력하여 추천 코드를 추가로 수정합니다.
변경사항 수락을 클릭하여 추천 변경사항을 코드에 추가합니다.
시도해 볼 수 있는 작업:
'이 코드를 단순화해 줘'
'이 코드를 관용적으로 만들어 줘'
'<설명>을 수행하는 새 함수 생성'
'이 코드에 관한 문서를 추가해 줘'
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-31(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-31(UTC)"],[],[],null,["# Transform code\n\nYou can prompt Gemini from the code editor for code suggestions to modify,\noptimize, or add code to your app as follows:\n\n1. To get the prompt input field, do one of the following from the code editor:\n - Right-click in the code editor and select **Gemini \\\u003e Generate code** from the context menu.\n - Highlight code that you want Gemini to modify, right-click in the code editor, and select **Gemini \\\u003e Transform code** from the context menu.\n - Press \u003ckbd\u003eCTRL+\\\u003c/kbd\u003e (\u003ckbd\u003eCommand+\\\u003c/kbd\u003e on macOS).\n2. Prompt Gemini by describing how you want to modify or add to your code and press \u003ckbd\u003eEnter\u003c/kbd\u003e. After Gemini processes your request, you should see a code diff. With the code diff, you can review and accept only the suggestions you want.\n3. Review the code diff and do one of the following:\n\n - Further modify the suggested code by clicking **Refine** and entering a new prompt.\n - Click **Accept Changes** to add the suggested changes to your code.\n\nThings to try:\n\n- \"Simplify this code\"\n- \"Make this code idiomatic\"\n- \"Generate a new function that does \\\u003cdescription\\\u003e\"\n- \"Add documentation for this code\""]]