public override IInsightWindow ShowInsightWindow(IEnumerable <IInsightItem> items) { if (items == null) { return(null); } var insightWindow = textEditor.ActiveInsightWindow; bool isNewWindow = false; if (insightWindow == null) { insightWindow = new SharpDevelopInsightWindow(this.TextEditor.TextArea); isNewWindow = true; } var adapter = new SharpDevelopInsightWindowAdapter(insightWindow); adapter.Items.AddRange(items); if (adapter.Items.Count > 0) { adapter.SelectedItem = adapter.Items[0]; } else { // don't open insight window when there are no items return(null); } insightWindow.SetActiveAdapter(adapter, isNewWindow); if (isNewWindow) { textEditor.ShowInsightWindow(insightWindow); } return(adapter); }