[null,null,["最后更新时间 (UTC):2025-07-31。"],[],[],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\""]]