Skip to content

#2174: store VSCode user-data under $IDE_HOME/.ide/vscode/<workspace>/config - #2201

Open
quando632 wants to merge 11 commits into
devonfw:mainfrom
quando632:feature/2174-vscode-metadata
Open

#2174: store VSCode user-data under $IDE_HOME/.ide/vscode/<workspace>/config#2201
quando632 wants to merge 11 commits into
devonfw:mainfrom
quando632:feature/2174-vscode-metadata

Conversation

@quando632

@quando632 quando632 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2174 (part of #2142)

Moves VSCode user-data out of the workspace into the dedicated $IDE_HOME/.ide/vscode/«workspace»/config folder so workspaces stay clean and independent of the IDE.

Stacked on #2175 (#2172getIdeMetadataPath()); its commits appear here until #2175 is merged, then this branch is rebased onto main.

Implemented changes:

  • Vscode.configureToolArgs now points --user-data-dir to getIdeMetadataPath().resolve("config") instead of «workspace»/.vscode/.userdata. The folder VSCode opens (getWorkspacePath()) is unchanged.
  • Migration Mig202608001 (target 2026.08.001) moves any existing .vscode/.userdata of every workspace to the new location. It is idempotent: skips workspaces already migrated and skips (with a warning, no overwrite) if a target already exists. Registered in IdeMigrator.
  • Tests: VscodeTest.testConfigureToolArgsUsesIdeMetadataPathForUserData, Mig202608001Test (move, no-op, and target-exists cases).

Testing instructions

  1. cd cli && mvn -Dtest=VscodeTest,Mig202608001Test,IdeMigratorTest test — all pass.
  2. Manual: create $IDE_HOME/workspaces/main/.vscode/.userdata/state.json, run ide update, verify it moved to $IDE_HOME/.ide/vscode/main/config/state.json and the workspace no longer contains .vscode/.userdata.

Checklist for this PR

Coordination note

IdeMigrator requires strictly ascending migration versions. The JetBrains subtask (#2173) also adds a migration — whichever merges second must adjust its version to stay ascending.

@coveralls

coveralls commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 33606129092

Coverage increased (+0.01%) to 73.626%

Details

  • Coverage increased (+0.01%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 4 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

4 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
com/devonfw/tools/ide/migration/IdeMigrator.java 3 89.83%
com/devonfw/tools/ide/tool/ide/IdeToolCommandlet.java 1 87.42%

Coverage Stats

Coverage Status
Relevant Lines: 18380
Covered Lines: 14147
Line Coverage: 76.97%
Relevant Branches: 8142
Covered Branches: 5380
Branch Coverage: 66.08%
Branches in Coverage %: Yes
Coverage Strength: 3.29 hits per line

💛 - Coveralls

@quando632 quando632 added enhancement New feature or request workspace workspaces sub-folder to manage sub-projects labels Jul 22, 2026
@quando632
quando632 marked this pull request as ready for review July 22, 2026 11:50
@quando632 quando632 moved this from 🆕 New to Team Review in IDEasy board Jul 22, 2026
@quando632 quando632 moved this from Team Review to 👀 In review in IDEasy board Jul 22, 2026
@quando632 quando632 moved this from 👀 In review to Team Review in IDEasy board Jul 22, 2026
@quando632 quando632 moved this from Team Review to 🏗 In progress in IDEasy board Jul 23, 2026
@quando632 quando632 moved this from 🏗 In progress to Team Review in IDEasy board Jul 23, 2026
@quando632

Copy link
Copy Markdown
Contributor Author

Update: the JetBrains PR #2208 no longer adds a migration (the vmoptions cleanup migration was dropped as unnecessary — vmoptions regenerate at the new location). So there is no migration-version coordination needed anymore; this PR's Mig202608001 stands alone.

@QuangAnhLe

Copy link
Copy Markdown
Contributor

Core implementation is correct and well-tested. Merge-ready after rebase

@QuangAnhLe

QuangAnhLe commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@quando632 and @hohwille : Should PyCharm, AndroidStudio, and Eclipse Move Metadata Like VSCode?

@quando632

Copy link
Copy Markdown
Contributor Author

We decided not to move the .idea folder because IntelliJ already excludes .idea from its own search/indexing, .idea is effectively the project definition. Relocating it would be only possible via symlink and that would add risk for a little benefit

@quando632 quando632 moved this from Team Review to 👀 In review in IDEasy board Jul 30, 2026
@quando632 quando632 added the internal Nothing to be added to CHANGELOG, only internal story label Aug 4, 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 your PR. Your change and migration looks good. Nice job 👍
Please fix the build:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/runner/work/IDEasy/IDEasy/cli/src/test/java/com/devonfw/tools/ide/tool/vscode/VscodeTest.java:[170,4] error: cannot find symbol
  symbol:   class Path
  location: class VscodeTest

And we need to update to the recent version due to my late review...

Comment thread cli/src/main/java/com/devonfw/tools/ide/migration/v2026/Mig202608001.java Outdated
Comment thread CHANGELOG.adoc
@quando632

Copy link
Copy Markdown
Contributor Author

Thanks @hohwille, all points addressed in b432f9e:

  • Build: added the missing import java.nio.file.Path and fixed a merge artifact in VscodeTest (a test method had lost its closing brace against the new testRunAddsVscodeOptions). Compile and tests are green.
  • Migration version: renamed the migration to Mig202609002 with target 2026.09.002.
  • CHANGELOG: the Move IDE-specific metada (.idea, .vscode) out of workspace #2142 entry is now under the 2026.09.002 section.

Ready for re-check.

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.

VSCode: store metadata under $IDE_HOME/.ide/vscode/<workspace> + migration

5 participants