public override void Invoke()
        {
            ParseItem rule = LessExtractVariableCommandTarget.FindParent(_item);
            string    text = _item.Text;
            string    name = Microsoft.VisualBasic.Interaction.InputBox("Name of the variable", "Web Essentials");

            if (!string.IsNullOrEmpty(name))
            {
                EditorExtensionsPackage.DTE.UndoContext.Open(DisplayText);

                foreach (ParseItem item in FindItems())
                {
                    Span span = new Span(item.Start, item.Length);
                    _span.TextBuffer.Replace(span, "@" + name);
                }

                _span.TextBuffer.Insert(rule.Start, "@" + name + ": " + text + ";" + Environment.NewLine + Environment.NewLine);

                EditorExtensionsPackage.DTE.UndoContext.Close();
            }
        }
        protected override bool Execute(uint commandId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (TextView == null)
            {
                return(false);
            }

            CssEditorDocument document = CssEditorDocument.FromTextBuffer(TextView.TextBuffer);

            int       position = TextView.Caret.Position.BufferPosition.Position;
            ParseItem item     = document.Tree.StyleSheet.ItemBeforePosition(position);

            ParseItem rule       = LessExtractVariableCommandTarget.FindParent(item);
            int       mixinStart = rule.Start;
            string    name       = Microsoft.VisualBasic.Interaction.InputBox("Name of the Mixin", "Web Essentials");

            if (!string.IsNullOrEmpty(name))
            {
                EditorExtensionsPackage.DTE.UndoContext.Open("Extract to mixin");

                var    selection = TextView.Selection.SelectedSpans[0];
                string text      = selection.GetText();
                TextView.TextBuffer.Replace(selection.Span, "." + name + "();");
                TextView.TextBuffer.Insert(rule.Start, "." + name + "() {" + Environment.NewLine + text + Environment.NewLine + "}" + Environment.NewLine + Environment.NewLine);

                TextView.Selection.Select(new SnapshotSpan(TextView.TextBuffer.CurrentSnapshot, mixinStart, 1), false);
                EditorExtensionsPackage.ExecuteCommand("Edit.FormatSelection");
                TextView.Selection.Clear();

                EditorExtensionsPackage.DTE.UndoContext.Close();

                return(true);
            }

            return(false);
        }