Custom Language Plugin Tutorial, Step 6: virtualFiles collection is empty

Answered

In the Custom Language Plugin tutorial, step 6: PSI Helpers and Utilities, I defined method findProperties, but when I run my plugin, the definition

Collection<VirtualFile> virtualFiles =
            FileTypeIndex.getFiles(MyFileType.INSTANCE, GlobalSearchScope.allScope(project));

always yields an empty Collection (using IDEA 2021.2.3), returned by getContainingFiles in FileBasedIndexEx.

Is that definition correct? Do I need to define something else first? I do have a MyFileType, but no FileTypeIndex.

 

3 comments
Comment actions Permalink

Please double-check your filetype is correctly registered and detected by the IDE.

0
Comment actions Permalink

Thanks for your suggestion.  While I cannot vouch for the accuracy of my observation, it seems that References started to work as soon as my Icon path was fixed.

0
Comment actions Permalink

There might have been some exception that prevented fully loading your plugin possibly

0

Please sign in to leave a comment.