void (@NotNull Consumer<? super StructureViewComponent> consumer) { assertNotNull("configure first", myFile); FileEditor fileEditor = FileEditorManager.getInstance(getProject()).getSelectedEditor(myFile); assertNotNull("editor not opened for " + myFile, myFile); StructureViewBuilder builder = LanguageStructureViewBuilder.INSTANCE.getStructureViewBuilder(getFile()); assertNotNull("no builder for " + myFile, builder); StructureViewComponent component = null; try { component = (StructureViewComponent)builder.createStructureView(fileEditor, getProject()); PlatformTestUtil.waitForPromise(component.rebuildAndUpdate()); consumer.consume(component); } finally { if (component != null) Disposer.dispose(component); } }