File index initialization when project is imported from Gradle

IJ 2024.1

We have a custom language plugin that normally compiles using JPS. We are trying to make it also work with Gradle. The problem is that we have custom file type indexes and added source roots (for these file types) and the indexes are not being populated. It looks like the Module indexing scans the added roots but just ignores the content.

I’m wondering if I am expected to add something to the Gradle file (besides marking the source dirs) in order to get these files indexed.

The files *are* being examined later by UnindexedFilesScanner, so I’m wondering if I should try to add an extension point there which indexes these files. Obviously I would prefer to change the Gradle file if I can.

I’d suggest sharing some example, it is unclear what the files are those and why they are not included to Gradle source roots

This is a rather distant past and the version we do not even support with fixes

I understand it’s too old to ask for a fix; I’m not convinced there is a bug here. But since I can’t find documentation on how file indexing works in a gradle imported project, I am trying to get information from someone who knows how it is supposed to behave and whether there’s a configuration pattern that I am expected to follow.

But it might be that something in the index does not work correctly for additional roots. For example, the module index has a membership predicate

  @Override
  protected boolean isInContent(@NotNull WorkspaceFileSetWithCustomData<?> fileSet) {
    return fileSet.getData() instanceof ModuleRelatedRootData data && myModule.equals(data.getModule());
  }

and it fails on things that are in submodules, e.g.

alpn-cc-all.app-cc.alpn-cc-alpha-content COMPARED TO alpn-cc-all.app-cc.alpn-cc-alpha-content.main