InternalCompilerRefServiceView (PsiElement element) { Project project = element.getProject(); final ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project); ToolWindow toolWindow = toolWindowManager.getToolWindow(TOOL_WINDOW_ID); if (toolWindow == null) { toolWindow = toolWindowManager.registerToolWindow(TOOL_WINDOW_ID, true, ToolWindowAnchor.TOP); } final InternalCompilerRefServiceView view = new InternalCompilerRefServiceView(project); ToolWindow finalToolWindow = toolWindow; toolWindow.activate(() -> { final String text = SymbolPresentationUtil.getSymbolPresentableText(element); final ContentImpl content = new ContentImpl(view, text, true); finalToolWindow.getContentManager().addContent(content); finalToolWindow.getContentManager().setSelectedContent(content, true); }); return view; }