Replacing consulo.ide.impl.idea.openapi.vfs.VfsUtil with consulo.virtualFileSystem.util.VirtualFileUtil. Replacing consulo.ide.impl.idea.openapi.util.io.FileUtil with consulo.util.io.FileUtil#43
Merged
VISTALL merged 1 commit intoconsulo:masterfrom Apr 18, 2026
Conversation
…ualFileSystem.util.VirtualFileUtil. Replacing consulo.ide.impl.idea.openapi.util.io.FileUtil with consulo.util.io.FileUtil.
There was a problem hiding this comment.
Pull request overview
This PR replaces usages of IntelliJ-platform VfsUtil/VfsUtilCore and the old IDEA FileUtil implementation with Consulo’s VirtualFileUtil and consulo.util.io.FileUtil, reducing reliance on consulo.ide.impl.idea.* internals and aligning file/VFS access with the Consulo API.
Changes:
- Replaced
VfsUtil.loadText/VfsUtilCore.getRelativePath/VfsUtilCore.visitChildrenRecursivelywithVirtualFileUtilequivalents across production and test code. - Replaced IDEA
FileUtil.copy/ensureCanCreateFilecalls withconsulo.util.io.FileUtil(including explicit permission copier for file copy on Windows). - Minor related API alignment:
ApplicationManager.getApplication()→Application.get(),SystemInfo.isWindows→Platform.current().os().isWindows(), and bundle message →PyLocalize.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| python-impl/src/main/java/consulo/python/buildout/module/extension/BuildoutModuleExtension.java | Switches script/site.py text loading to VirtualFileUtil.loadText. |
| python-impl/src/main/java/com/jetbrains/python/impl/run/PyVirtualEnvReader.java | Uses consulo.util.io.FileUtil for temp file copy/append and adds FilePermissionCopier. |
| python-impl/src/main/java/com/jetbrains/python/impl/psi/impl/PyFileImpl.java | Uses VirtualFileUtil.getRelativePath instead of VfsUtilCore. |
| python-impl/src/main/java/com/jetbrains/python/impl/packaging/PyPackageUtil.java | Migrates VFS traversal/relative path to VirtualFileUtil, updates progress text localization, and switches to Application.get(). |
| python-impl/src/main/java/com/jetbrains/python/impl/packaging/PyPackageManagerImpl.java | Uses consulo.util.io.FileUtil.ensureCanCreateFile and Platform for Windows detection. |
| python-impl/src/main/java/com/jetbrains/python/impl/buildout/BuildoutFacet.java | Updates commented-out legacy code snippets to refer to VirtualFileUtil.loadText. |
| plugin/src/test/java_/com/jetbrains/python/refactoring/PyCodeFragmentTest.java | Updates test data file loading to VirtualFileUtil.loadText. |
| plugin/src/test/java_/com/jetbrains/python/fixtures/PyResolveTestCase.java | Updates test file loading to VirtualFileUtil.loadText and adjusts imports. |
| plugin/src/test/java_/com/jetbrains/python/fixtures/LightMarkedTestCase.java | Updates test file loading to VirtualFileUtil.loadText and adjusts imports/order. |
| plugin/src/test/java_/com/jetbrains/python/PyQuickDocTest.java | Updates HTML baseline loading to VirtualFileUtil.loadText and adjusts imports. |
| plugin/src/test/java_/com/jetbrains/python/PyControlFlowBuilderTest.java | Updates control flow golden file loading to VirtualFileUtil.loadText. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.