Hi,
I have implemented a custom structure view (alt+7) for custom files and it works as expected. But the file structure popup (ctrl+F12) always shows “Structure is empty”.
What I did
- Implemented and registered a
CustomStructureViewFactory implements PsiStructureViewFactory
along with
CustomStructureViewModel extends StructureViewModelBase implements StructureViewModel.ElementInfoProvider
and
CustomStructureViewElement implements StructureViewTreeElement - Open a file that triggers the CustomStructureViewFactory
- Open the structure view (alt+7) and see that it works
- Open the file structure popup (ctrl+F12) and see “Structure is empty”
Expected result:
If the structure view is populated correctly with the desired elements, the file structure popup should be too.
Actual result:
The file structure popup remains empty.
When debugging I can confirm that the methods getPresentation() and getChildren() in my StructureViewTreeElement class are being called when pressing ctrl+F12 and seemingly perform correctly.
What could be the issue? Am I missing a class or method I need to implement for the file structure popup to work?
I do see warnings and SEVERE flags in the log regarding StructureViewComponent.class (InvalidMirrorException) but unfortunately that does not tell me much.
Environment #
OS version: Win 11 10.0.26100
IDE version: IntelliJ IDEA 2024.3.2.1 (Ultimate Edition)
Build #IU-243.23654.153, built on January 23, 2025