virtual_file.md.md: do not use deflist

This commit is contained in:
Yann Cébron 2021-10-13 16:48:45 +02:00
parent 87b8f78185
commit 201e401466

View File

@ -1,6 +1,6 @@
[//]: # (title: Virtual Files) [//]: # (title: Virtual Files)
<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. --> <!-- Copyright 2000-2021 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
A [`VirtualFile`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java) (VF) is the IntelliJ Platform's representation of a file in a [Virtual File System (VFS)](virtual_file_system.md). A [`VirtualFile`](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java) (VF) is the IntelliJ Platform's representation of a file in a [Virtual File System (VFS)](virtual_file_system.md).
@ -12,18 +12,18 @@ Contents of a `VirtualFile` are treated as a stream of bytes, but concepts like
## How do I get a virtual file? ## How do I get a virtual file?
From an action #### From an Action
: `e.getData(PlatformDataKeys.VIRTUAL_FILE)` or `e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY)` for multiple selection `e.getData(PlatformDataKeys.VIRTUAL_FILE)` or `e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY)` for multiple selection
From a path in the local file system: #### From Path in Local File System
: - `LocalFileSystem.getInstance().findFileByIoFile()` - `LocalFileSystem.getInstance().findFileByIoFile()`
- `VirtualFileManager.findFileByNioPath()`/`refreshAndFindFileByNioPath()` (2020.2 and later) - `VirtualFileManager.findFileByNioPath()`/`refreshAndFindFileByNioPath()` (2020.2 and later)
From a PSI file #### From a PSI File
: `psiFile.getVirtualFile()` (may return `null` if the PSI file exists only in memory) `psiFile.getVirtualFile()` (may return `null` if the PSI file exists only in memory)
From a document #### From a Document
: `FileDocumentManager.getInstance().getFile()` `FileDocumentManager.getInstance().getFile()`
## What can I do with it? ## What can I do with it?
@ -91,4 +91,4 @@ To hook into operations performed in the local file system (for example, when de
## What are the rules for working with VFS? ## What are the rules for working with VFS?
See [Virtual File System](virtual_file_system.md) for a detailed description of the VFS architecture and usage guidelines. See [Virtual File System](virtual_file_system.md) for a detailed description of the VFS architecture and usage guidelines.