diff --git a/topics/basics/architectural_overview/virtual_file.md b/topics/basics/architectural_overview/virtual_file.md index a8860cf41..cc203e96a 100644 --- a/topics/basics/architectural_overview/virtual_file.md +++ b/topics/basics/architectural_overview/virtual_file.md @@ -15,9 +15,9 @@ Contents of a `VirtualFile` are treated as a stream of bytes, but concepts like | Context | API | |----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Action](basic_action_system.md) | [`AnActionEvent.getData(PlatformDataKeys.VIRTUAL_FILE)`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java)
[`AnActionEvent.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY)`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnActionEvent.java) for multiple selection | -| [Document](documents.md) | [`FileDocumentManager.getInstance().getFile()`](upsource:///platform/core-api/src/com/intellij/openapi/fileEditor/FileDocumentManager.java) | +| [Document](documents.md) | [`FileDocumentManager.getFile()`](upsource:///platform/core-api/src/com/intellij/openapi/fileEditor/FileDocumentManager.java) | | [PSI File](psi_files.md) | [`PsiFile.getVirtualFile()`](upsource:///platform/core-api/src/com/intellij/psi/PsiFile.java) (may return `null` if the PSI file exists only in memory) | -| Local File System Path | [`LocalFileSystem.getInstance().findFileByIoFile()`](upsource:///platform/analysis-api/src/com/intellij/openapi/vfs/LocalFileSystem.java)
[`VirtualFileManager.findFileByNioPath()`/`refreshAndFindFileByNioPath()`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileManager.java) (2020.2+) | +| Local File System Path | [`LocalFileSystem.findFileByIoFile()`](upsource:///platform/analysis-api/src/com/intellij/openapi/vfs/LocalFileSystem.java)
[`VirtualFileManager.findFileByNioPath()`/`refreshAndFindFileByNioPath()`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileManager.java) (2020.2+) | ## What can I do with it? diff --git a/topics/reference_guide/vcs_integration_for_plugins.md b/topics/reference_guide/vcs_integration_for_plugins.md index 916fd34e0..4b2f889ae 100644 --- a/topics/reference_guide/vcs_integration_for_plugins.md +++ b/topics/reference_guide/vcs_integration_for_plugins.md @@ -15,7 +15,7 @@ Unlike a [`VirtualFile`](upsource:///platform/core-api/src/com/intellij/openapi/ The main difference between a `FilePath` and a [`java.io.File`](https://docs.oracle.com/javase/8/docs/api/java/io/File.html) is that a `FilePath` caches the `VirtualFile` corresponding to the path, so it can be retrieved without doing a VFS search. To create instances of `FilePath`, the [`VcsContextFactory`](upsource:///platform/vcs-api/src/com/intellij/openapi/vcs/actions/VcsContextFactory.java) API is used. -It can be accessed as`PeerFactory.getInstance().getVcsContextFactory()` +It can be accessed as `PeerFactory.getVcsContextFactory()`. `FilePath` representing paths in a VCS repository, rather than local paths, are created using `VcsContextFactory.createFilePathOnNonLocal()`. The `FilePath.isNonLocal()` method returns `true` for such files. diff --git a/topics/user_interface_components/editor_components.md b/topics/user_interface_components/editor_components.md index cdfd886a4..0691cd648 100644 --- a/topics/user_interface_components/editor_components.md +++ b/topics/user_interface_components/editor_components.md @@ -25,8 +25,8 @@ Several commonly needed customization implementations exist, including: A common use case for `EditorTextField` is entering the name of a Java class or package. This can be accomplished with the following steps: -* Use [`JavaCodeFragmentFactory.getInstance().createReferenceCodeFragment()`](upsource:///java/java-psi-api/src/com/intellij/psi/JavaCodeFragmentFactory.java) to create a code fragment representing the class or package name; -* Call [`PsiDocumentManager.getInstance().getDocument()`](upsource:///platform/core-api/src/com/intellij/psi/PsiDocumentManager.java) to get the document corresponding to the code fragment; +* Use [`JavaCodeFragmentFactory.createReferenceCodeFragment()`](upsource:///java/java-psi-api/src/com/intellij/psi/JavaCodeFragmentFactory.java) to create a code fragment representing the class or package name; +* Call [`PsiDocumentManager.getDocument()`](upsource:///platform/core-api/src/com/intellij/psi/PsiDocumentManager.java) to get the document corresponding to the code fragment; * Pass the returned document to the [`EditorTextField`](upsource:///platform/platform-impl/src/com/intellij/ui/EditorTextField.java) constructor or its `setDocument()` method. ```java