Document code and commits

Gemini in Android Studio can suggest documentation and commit messages to help you explain and track your work.

Generate documentation

You can use Gemini in Android Studio to generate documentation for your code. Generate clear and concise documentation for your code with instant drafts that you can refine and perfect.

  1. Select a code snippet and right-click in the code editor and select Gemini > Document Function from the context menu. (You might also see Document Class or Document Property depending on the context.)
  2. Review proposed changes and refine if necessary before you click Accept changes.
The Document Function option appears near the top of the list
Gemini can suggest documentation for your code.

Suggest commit message

When committing changes to your version control system from the IDE, Gemini can use the context from the code changes in the current commit and recent past commits to suggest a detailed commit message. To generate a commit message, click the Suggest commit message button above the text input field in the Commit tool window.

Commit dialog showing a suggested message for the commit.
Gemini can suggest a detailed message for your commit.