You need to call VirtualFileManager.refresh() to refresh the virtual file system. This will cause the project view and all other parts of the IntelliJ IDEA model to refresh as well.
VirtualFileManager.getInstance().asyncRefresh(new Runnable() { @Override public void run() { String newFilePath = "path/to/file"; VirtualFile newFile = LocalFileSystem.getInstance().findFileByPath(newFilePath); if (newFile == null) { throw RuntimeException("Could not find newly created file!"); } else { // Open the file in the editor. new OpenFileDescriptor(project, newFile).navigate(true); } } });
You need to call VirtualFileManager.refresh() to refresh the virtual file system. This will cause the project view and all other parts of the IntelliJ IDEA model to refresh as well.
Works perfectly. Here's how I'm using it.