How would you add a new (ephemeral) file to the project?



How would i add reference navigation to a piece of code? Say i have a button which downloads code from the internet. How can i present this code to the user and the user is able to "navigate" from it?

I already solved the downloading part

My questions here:

* How am i able to "show" this (non existing) file to the user? Do i need to create it somehow?

* How can i add "references" to this file? I basically want that intellij threads this file as "existing" in the project, but i also want to hide this file from the project, so the user doesnt commit it etc.


Use com.intellij.testFramework.LightVirtualFile to represent in-memory file.