(十九)IntelliJ 插件开发—— Virtual File

2020-03-07  本文已影响0人  秋水畏寒

官方文档

https://www.jetbrains.org/intellij/sdk/docs/basics/virtual_file_system.htmll)

Github

https://github.com/kungyutucheng/my_gradle_plugin

运行环境

macOS 10.14.5
IntelliJ idea 2019.2.4

定义

虚拟文件系统主要为以下几个意图服务:

Providing a universal API for working with files regardless of their actual location (on disk, in archive, on a HTTP server etc.)

Tracking file modifications and providing both old and new versions of the file content when a modification is detected.

Providing a possibility to associate additional persistent data with a file in the VFS.

为了提供后面俩个特性,VFS会保存一份持久化的快照文件内容,这份快照内容是application级别的,因此多个project共用同一份文件快照,并且,当硬盘上的文件内容更新时,快照内容也会异步更新

Virtual file system events

VFS的变更事件可以通过以下俩种方式监听:

上一篇 下一篇

猜你喜欢

热点阅读