Locate the folder including a file Follow
mySubViewFolder // <= right-click here
framework-project.json // <= check
@framework-folder // <= check
Let's say someone right-clicks on the mySubViewFolder. I would have to check if there is a @framework-folder and a framework-project.json as well as if I am inside the view folder.
Currently I am iterrating up the path to see if inside any folder there are any of these files.
But I had hoped that by indexing there is a faster way.
If not, is there any way to keep the results of the paths?
Please sign in to leave a comment.
com.intellij.psi.search.FilenameIndexfor the items that can be located in unknown places.
For determining if the clicked file is in the “view” directory, I suggest checking its parents.
I would very much enjoy an example, because I am a total newbie to Plugin Development and to Java.
It's getting better, but for now a part of a single line of code, is not really helpful right now.
Thanks a lot for taking the time.
In this case, I suggest investing some time in learning Java (or Kotlin) as it is a requirement for developing plugins.
I think it should be easy to find the method you need in the
getVirtualFilesByName()seems like the one you need):
I also recommend getting familiar with the Explore the API topic, which teaches how to find example implementations.