public static IVsHierarchy GetHierarchy(Project project)
        {
            IVsHierarchy ppHierarchy;

            ErrorHandler.ThrowOnFailure(VisualStudioServices.GetService <SVsSolution, IVsSolution>().GetProjectOfUniqueName(project.UniqueName, out ppHierarchy));
            return(ppHierarchy);
        }
        /// <summary>
        /// This function is the callback used to execute a command when the a menu item is clicked.
        /// See the Initialize method to see how the menu item is associated to this function using
        /// the OleMenuCommandService service and the MenuCommand class.
        /// </summary>
        private void MenuItemCallback(object sender, EventArgs e)
        {
            IVsUIShell uiShell = (IVsUIShell)GetService(typeof(SVsUIShell));
            Guid       clsid   = Guid.Empty;

            IVsTextManager txtMgr        = VisualStudioServices.GetService <SVsTextManager, IVsTextManager>();
            int            mustHaveFocus = 1;
            IVsTextView    vTextView     = null;

            txtMgr.GetActiveView(mustHaveFocus, null, out vTextView);

            string textUnderCursor = CodeUnderCursor.GetExpression(vTextView);

            ShowToolWindow(textUnderCursor);
        }