Skip to content

feat(core): support selecting Jetbrains IDEs as preferred editor#21397

Open
SoLoHiC wants to merge 3 commits intogoogle-gemini:mainfrom
SoLoHiC:feature/preferedJetbrainsIde
Open

feat(core): support selecting Jetbrains IDEs as preferred editor#21397
SoLoHiC wants to merge 3 commits intogoogle-gemini:mainfrom
SoLoHiC:feature/preferedJetbrainsIde

Conversation

@SoLoHiC
Copy link
Copy Markdown
Contributor

@SoLoHiC SoLoHiC commented Mar 6, 2026

Summary

make a series of JetBrains IDE(IntelliiJ, WebStorm, PyCharm, GoLand, Android Studio, CLion, DataGrip, PhpStorm, RubyMine) as preferred editor option. How it looks like in Terminal:

image

Details

This helps all Gemini CLI x JetBrains IDE users keep all code displaying on tools they're familiar with. How it looks like in integrated terminal window of an IDE:
image

However, It seems JetBrains IDE's cmd is not created by default. A way to enable it via Settings in ToolBox App:
image

Related Issues

#21389

How to Validate

  1. install a local built version of gemini including this PR.
  2. install at least one JetBrains IDE mentioned above.
  3. set switch on Shell Script in ToolBox App Settings.
  4. run gemini in terminal.
  5. run /editor in gemini, editor options should be shown like pic above at Summary sec.
  6. select the one you like like pic above at Details sec.
  7. make a change request to gemini in Plan Mode.
  8. press Ctrl + X when gemini asks for exiting Plan Mode, IDE selected in step 7 would be opened (, in lightEdit mode though), like pic above at Details sec.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@SoLoHiC SoLoHiC requested a review from a team as a code owner March 6, 2026 13:00
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the Gemini CLI's editor integration by introducing support for a wide array of JetBrains IDEs. Users can now select their preferred JetBrains development environment to open files and view diffs, streamlining their workflow and providing a more familiar editing experience directly from the CLI.

Highlights

  • Expanded Editor Support: Added a comprehensive list of JetBrains IDEs, including IntelliJ IDEA, WebStorm, PyCharm, GoLand, Android Studio, CLion, RustRover, DataGrip, PhpStorm, and RubyMine, to the supported GUI editors.
  • Platform-Specific Commands: Implemented platform-specific commands for launching each new JetBrains IDE on both Windows and default (Unix-like) operating systems.
  • Diff Command Integration: Extended the getDiffCommand function to enable viewing file differences directly within the newly supported JetBrains IDEs.
Changelog
  • packages/core/src/utils/editor.ts
    • Added new JetBrains IDEs to the GUI_EDITORS list.
    • Defined display names for each new JetBrains IDE in EDITOR_DISPLAY_NAMES.
    • Configured platform-specific commands for launching each JetBrains IDE in editorCommands.
    • Extended the getDiffCommand logic to support diff operations for the newly added JetBrains IDEs.
Activity
  • The pull request was opened by SoLoHiC.
  • No human review comments or approvals have been recorded yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for various JetBrains IDEs as preferred editors. The changes correctly add the new IDEs to the list of GUI editors, provide their display names, and define their command-line launchers. My review identified a critical issue in the implementation of the getDiffCommand function for these new editors, which would prevent the diff functionality from working correctly. My review includes a specific code suggestion to fix this.

Comment thread packages/core/src/utils/editor.ts
@SoLoHiC SoLoHiC changed the title feat(core): support selecting Jetbrains IDEs as prefered editor feat(core): support selecting Jetbrains IDEs as preferred editor Mar 6, 2026
@gemini-cli gemini-cli bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Mar 6, 2026
@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Mar 6, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for several JetBrains IDEs as preferred editors. However, a high-severity command injection vulnerability was identified where the construction of diff commands for these IDEs, combined with the use of shell: true in openDiff on Windows, could allow an attacker to execute arbitrary commands. It is recommended to avoid shell: true for these editors on Windows or to implement robust argument escaping. Additionally, the test file packages/core/src/utils/editor.test.ts introduces significant code duplication and inefficiencies, particularly with duplicated editor lists and functions redefined inside loops, which should be refactored for better maintainability.

Comment thread packages/core/src/utils/editor.ts
Comment thread packages/core/src/utils/editor.test.ts Outdated
Comment thread packages/core/src/utils/editor.test.ts Outdated
Comment thread packages/core/src/utils/editor.test.ts Outdated
@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Mar 7, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for various JetBrains IDEs as preferred editors. No security vulnerabilities were found. The implementation correctly adds the necessary configurations for editor commands and display names; however, the changes introduce significant code duplication in the test file packages/core/src/utils/editor.test.ts, which should be addressed to improve maintainability and reduce brittleness, as highlighted by the specific comments.

Comment thread packages/core/src/utils/editor.test.ts
Comment thread packages/core/src/utils/editor.test.ts
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli bot commented Mar 21, 2026

Hi there! Thank you for your interest in contributing to Gemini CLI.

To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383).

We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'.

This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community!

@gemini-cli gemini-cli bot closed this Mar 21, 2026
@cocosheng-g cocosheng-g reopened this Apr 8, 2026
@cocosheng-g
Copy link
Copy Markdown
Contributor

@SoLoHiC, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest main and we will have someone review it shortly.

@gemini-cli gemini-cli bot added the help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! label Apr 8, 2026
@SoLoHiC SoLoHiC force-pushed the feature/preferedJetbrainsIde branch from ede0535 to 519e26a Compare April 10, 2026 16:14
@SoLoHiC
Copy link
Copy Markdown
Contributor Author

SoLoHiC commented Apr 10, 2026

@SoLoHiC, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest main and we will have someone review it shortly.

hi @cocosheng-g , I rebased the latest main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants