} // end of function - Dispose

        /*----------------------- ParseCommentType ------------------------------*/
        /// <summary>
        /// Parses the comment type from the current document
        /// </summary>
        protected virtual void ParseCommentType()
        {
            // Get the current selection
            if (Document?.Selection is TextSelection sel)
            {
                // From the text selection we should be able to get the active point
                // for inspection
                TextPoint tp = sel.ActivePoint;
                // Then check for well-known code elements
                var ce = this.CodeElement = tp.GetCodeElement();
                if (ce != null)
                {
                    switch (ce.Kind)
                    {
                    case vsCMElement.vsCMElementClass:
                        CommentType = SupportedCommandTypeFlag.Class;
                        break;

                    case vsCMElement.vsCMElementEnum:
                        CommentType = SupportedCommandTypeFlag.Enum;
                        break;

                    case vsCMElement.vsCMElementFunction:
                        CommentType = SupportedCommandTypeFlag.Function;
                        break;

                    case vsCMElement.vsCMElementInterface:
                        CommentType = SupportedCommandTypeFlag.Interface;
                        break;

                    case vsCMElement.vsCMElementProperty:
                        CommentType = SupportedCommandTypeFlag.Property;
                        break;

                    case vsCMElement.vsCMElementNamespace:
                        CommentType = SupportedCommandTypeFlag.Namespace;
                        break;

                    default:
                        CommentType = SupportedCommandTypeFlag.Unknown;
                        break;
                    } // end switch - code element kind
                }     // end of if - code elemtn of current active point is valid
            }         // end of if - valid insertion point
            return;
        }             // end of function - ParseCommentType