Repository navigation
fix: a DAP run configuration expands ~ in its paths without FileUtil.expandUserHome, which IntelliJ 2025.3 schedules for removal - #2329
Conversation
…expandUserHome, which IntelliJ 2025.3 schedules for removal Since redhat-developer#2302, the Working directory and the File of a DAP run configuration take a leading ~, which DAPRunConfigurationOptions.resolvePath expanded with FileUtil.expandUserHome. IntelliJ 2025.3 deprecates it and schedules it for removal, and the plugin verifier reports it against 2025.3 to 2026.3: it is the only API scheduled for removal that LSP4IJ uses. Its replacement, OSAgnosticPathUtil.expandUserHome, only exists from 2025.3. No other public API expands ~ on 2024.2 to 2026.3: EelPathUtils.expandUserHome takes an EelDescriptor and doesn't exist in 2024.2, and the file chooser's NioPathCompletion.expandHome is part of its text field. DAPRunConfigurationOptions.expandUserHome does what both platform methods do, in 2024.2 and in 2026.3: ~ alone is the user's home, a ~ before / or \ is replaced with it, and any other path, such as ~user/file, stays as it is. Nothing changes for the user. Fixes redhat-developer#2327
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2329 +/- ##
=========================================
Coverage 58.63% 58.63%
=========================================
Files 849 849
Lines 36704 36709 +5
Branches 7606 5766 -1840
=========================================
+ Hits 21520 21526 +6
- Misses 12183 12184 +1
+ Partials 3001 2999 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Fixes #2327
Since #2302, a DAP run configuration expands a leading
~in its Working directory and File withFileUtil.expandUserHome, which IntelliJ 2025.3 schedules for removal. This replaces it with LSP4IJ's own implementation, as #1927 did forfindInPath. One commit, and no change for the user. For 0.30.2, which is the first release with #2302's call.Why LSP4IJ's own implementation
No public API expands
~on all of 2024.2 to 2026.3. In the jars of each release:FileUtil.expandUserHome(String): public in 2024.2, 2025.1 and 2025.2.@Deprecatedand@ApiStatus.ScheduledForRemovalin 2025.3 and 2026.3, where it calls the next one.OSAgnosticPathUtil.expandUserHome(String): missing in 2024.2, 2025.1 and 2025.2, and public in 2025.3 and 2026.3.EelPathUtils.expandUserHome(EelDescriptor, String), for a path of an Eel environment, andNioPathCompletion.expandHome, asuspendfunction of the file chooser's text field.The jars of 2024.2 and 2026.3 have no other method of these names.
What it does
DAPRunConfigurationOptions.expandUserHomedoes whatFileUtil.expandUserHomedoes in 2024.2, andOSAgnosticPathUtil.expandUserHomein 2026.3, going by their bytecode:~alone is the user's home, fromSystemProperties.getUserHome(), which is public and not deprecated on 2024.2 to 2026.3;~followed by/or\is replaced with the user's home;~user/file,~file, or a path with a~further in.Tests
The new
testOnlyALeadingTildeAloneOrBeforeASeparatorIsTheHomeDirectorycovers each of these cases. The tests of #2302 with~pass unchanged.Headless, with the counts from the JUnit XMLs, for
DAPRunConfigurationOptionsResolvedPathTest,DAPCommandLineStateTest,DAPRunConfigurationCheckTest,DAPSettingsEditorWorkingDirectoryTestandDAPExecutorRoutingTest:main's plugin verifier reports 1 usage of an API scheduled for removal against 2025.3 to 2026.3, this one. ThisPR's reports none: "Compatible. 32 usages of deprecated API" against IU-263.7307.200, the 32 that
mainhas too.