Object (@NotNull FileEditor fileEditor, TreeBasedStructureViewBuilder builder) { Editor editor = fileEditor instanceof TextEditor ? ((TextEditor)fileEditor).getEditor() : null; StructureViewModel model = builder.createStructureViewModel(editor); Object selectorInFile = model.getCurrentEditorElement(); Disposer.dispose(model); return selectorInFile; }