Нow to update the project tree when creating a file/directory?

Answered

Using

File(pathSelect).renameTo(newPath)
File(pathSelect).copyRecursively(newPath)
File(path).mkdir()

Tree in project tools not refresh.

I tried to call

VirtualFileManager.getInstance().asyncRefresh

this does not work

I started sending messageBus VFileEvent but it has @ApiStatus.Internal and I won't be able to publish the plugin.

How can I trigger an update?

1
5 comments
ProjectView.getInstance(it)
    .getProjectViewPaneById(ProjectViewPane.ID)
    .updateFromRoot(true)

    Not work!

  

0

Hi Mikhail,

Why do you use Java IO API instead of Virtual File System API?
https://plugins.jetbrains.com/docs/intellij/virtual-file-system.html

Also, what is the full context? Where do you call it?

0

Do I understand correctly, in order for changes to arrive quickly, you need to create/make changes through VirtualFile? and everything will be updated without additional updates after creation?

0

The documentation says that I can create a Java API, but nothing is said about how it will work with the tools project.

https://plugins.jetbrains.com/docs/intellij/virtual-file.html#how-do-i-create-a-virtual-file

 

 

0

In general, yes, but it depends on the implementation of specific subsystems. In your case, it should work out of the box.

0

Please sign in to leave a comment.