Skip to content

#2173: store JetBrains vmoptions under $IDE_HOME/.ide/<ide>/<workspace> - #2208

Open
quando632 wants to merge 10 commits into
devonfw:mainfrom
quando632:feature/2173-jetbrains-metadata
Open

#2173: store JetBrains vmoptions under $IDE_HOME/.ide/<ide>/<workspace>#2208
quando632 wants to merge 10 commits into
devonfw:mainfrom
quando632:feature/2173-jetbrains-metadata

Conversation

@quando632

@quando632 quando632 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2173 (part of #2142)

Moves the JetBrains VM options out of the workspace into $IDE_HOME/.ide/«ide»/«workspace» for IntelliJ, PyCharm and Android Studio, solved once in their shared superclass.

Stacked on #2175 (#2172getIdeMetadataPath()); its commit appears here until #2175 is merged, then rebase onto main.

Scope

Per the discussion on #2142, only the vmoptions are relocated. .idea and *.properties are intentionally out of scope: .idea is IntelliJ's project-root-bound project definition (excluded from IntelliJ's own search anyway) and idea.properties is an empty template merged into the workspace — relocating them would need symlinks (Windows-permission risk) for little benefit. Spike #2209 was closed as not planned.

Implemented changes

  • IdeaBasedIdeToolCommandlet.runTool: the .«prefix».vmoptions file is now written to getIdeMetadataPath() instead of the workspace (the «IDE»_VM_OPTIONS env var points at the same new path). One change in the shared superclass covers IntelliJ (.idea.vmoptions), PyCharm (.pycharm.vmoptions) and Android Studio (.studio.vmoptions).
  • Updated IntellijTest, PycharmTest, AndroidStudioTest to assert the new location.

No migration is needed: the vmoptions file is regenerated at the new location from the «IDE»_VM_ARGS variable on the next IDE launch.

Testing instructions

  1. cd cli && mvn -Dtest=IntellijTest,PycharmTest,AndroidStudioTest test all pass.
  2. Manual: set INTELLIJ_VM_ARGS in your project, run ide intellij, verify .idea.vmoptions is created under $IDE_HOME/.ide/intellij/«workspace»/ and not in the workspace.

Checklist for this PR

@coveralls

coveralls commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 33490848385

Coverage increased (+0.007%) to 73.62%

Details

  • Coverage increased (+0.007%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 1 coverage regression across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/version/VersionSegment.java 1 91.34%

Coverage Stats

Coverage Status
Relevant Lines: 18360
Covered Lines: 14129
Line Coverage: 76.96%
Relevant Branches: 8134
Covered Branches: 5376
Branch Coverage: 66.09%
Branches in Coverage %: Yes
Coverage Strength: 3.28 hits per line

💛 - Coveralls

@quando632 quando632 self-assigned this Jul 27, 2026
@quando632 quando632 added enhancement New feature or request workspace workspaces sub-folder to manage sub-projects labels Jul 28, 2026
@quando632
quando632 force-pushed the feature/2173-jetbrains-metadata branch from 402f6a4 to 6b3cb19 Compare July 28, 2026 09:26
@quando632 quando632 moved this from 🆕 New to Team Review in IDEasy board Jul 28, 2026
@quando632
quando632 marked this pull request as ready for review July 29, 2026 09:10
@QuangAnhLe QuangAnhLe self-assigned this Jul 29, 2026
@quando632 quando632 added the internal Nothing to be added to CHANGELOG, only internal story label Aug 4, 2026
@QuangAnhLe

Copy link
Copy Markdown
Contributor

Hi @quando632, i have reviewed for your ticket and would like to suggest the following improvements:

1. No migration (assessed as acceptable)

The PR description says "No migration is needed: the vmoptions file is regenerated at the new location on the next IDE launch." This is correct because the file is derived from *_VM_ARGS
environment variables — it's ephemeral, not user-authored. The old workspace .idea.vmoptions becomes a stale orphan but that's harmless (the IDE no longer points to it). Worth a note in the
CHANGELOG so users know old vmoptions files are no longer used.

2. Trailing-whitespace cleanup in IntellijTest is tangential

The diff removes some trailing spaces (lines 218, 253) and a debug System.out.println that was accidentally left in (testIntellijRun). Same in PycharmTest (System.out.println("Starting
testPycharmRun..."). These are good cleanups but they're noise relative to this ticket. Fine to include.

3. MockedPlugin log message change is tangential

AndroidStudioTest.java:117 changes "Successfully ended step 'Install plugin MockedPlugin'." → "Successfully ended step 'Install plugin MockedPlugin (1/1)'." — this is a pre-existing test fix,
not related to this ticket. Fine to include if it's needed to make the test green.

4. Consider: getIdeMetadataPath() directory creation

writeFileContent(..., confPath, true) with createParentDirs=true handles parent directory creation. Verified good.

@quando632

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @QuangAnhLe.

Points 2 and 3 came from an earlier diff base. Since then #2175 (the getIdeMetadataPath() foundation) was merged and this branch was brought up to current main, so the diff is now just 4 files: the vmoptions relocation in IdeaBasedIdeToolCommandlet plus the three test assertions. There is no System.out.println removal, no trailing whitespace change, and no MockedPlugin log message change in the current diff. Could you re-check the current state?

Point 4: agreed, writeFileContent(..., true) creates the parent directory, so the vmoptions land correctly under $IDE_HOME/.ide/<ide>/<workspace>.

Point 1: the feature is already listed under #2142 in the CHANGELOG. Since the stale .*.vmoptions only affects users who set *_VM_ARGS and the file is ephemeral (regenerated at the new location), I would keep it to that single entry unless you feel a dedicated note adds value.

@QuangAnhLe

Copy link
Copy Markdown
Contributor

hi @quando632 Thanks for the clarification. I re-checked the current diff and agree with your assessment on all four points. My comments on points 2 and 3 were based on an older diff and are no longer applicable after #2175 was merged and the branch was updated. Point 4 looks good, and I also agree that the existing CHANGELOG entry in #2142 should be sufficient. Thanks for the explanation. Everythings looks good now, so the Pr can be merged.

@quando632 quando632 moved this from Team Review to 👀 In review in IDEasy board Aug 7, 2026
@hohwille hohwille added this to the release:2026.09.002 milestone Sep 1, 2026

@hohwille hohwille left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@quando632 thanks for splitting this into smaller sub-tasks and PRs. This PR looks straight forward to me. Great work and ready for merge👍
I assume we will do the CHANGELOG entry for the parent story in the main PR. I only have to pay attention that we include both into the same release...

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

Labels

enhancement New feature or request internal Nothing to be added to CHANGELOG, only internal story workspace workspaces sub-folder to manage sub-projects

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

JetBrains: store IntelliJ/PyCharm/Android Studio metadata under $IDE_HOME/.ide + migration

5 participants