Hi,
We are developing a plugin that tries to to register new PsiReferences for certain PsiElements [1]. For these PsiReferences we want to implement a custom multiResolve method that handles the find Usages functionality on these references[2]. In order to do that we utilize ReferenceSearch to search for all usages of this PsiReference in the project[3]. The search takes a considerable amount of time, causing the UI to freeze. We tried to run the search in a backgroundTask[4], but the problem is that the multiResolve method is called so often by the IDE that the accumulating workload freezes the IDE.
IDE target version: 2024.2.4
[1] se.isselab.HAnS.referencing.FeatureReferenceContributor
[2] se.isselab.HAnS.referencing.FeatureReference#multiResolve (specifically the part for FileAnnotations)
[3] se.isselab.HAnS.featureLocation.FeatureLocationManager#getFeatureFileMapping
[4] se.isselab.HAnS.pluginExtensions.ProjectMetricsService#getFeatureFileMappingBackground