private void RemoveComment(VBE vbe)
        {
            var instruction = Node.Instruction;
            var location    = vbe.FindInstruction(instruction);
            int index;

            if (!instruction.Line.Content.HasComment(out index))
            {
                return;
            }

            var line = instruction.Line.Content.Substring(0, index);

            location.CodeModule.ReplaceLine(location.Selection.StartLine, line);

            Handled = true;
        }
        private void ReplaceWithSingleQuote(VBE vbe)
        {
            var instruction = Node.Instruction;
            var location    = vbe.FindInstruction(instruction);
            int index;

            if (!instruction.Line.Content.HasComment(out index))
            {
                return;
            }

            var line = instruction.Line.Content.Substring(0, index) + "'" + instruction.Comment.Substring(ReservedKeywords.Rem.Length);

            location.CodeModule.ReplaceLine(location.Selection.StartLine, line);

            Handled = true;
        }
        private void OnNavigateCodeIssue(object sender, NavigateCodeIssueEventArgs e)
        {
            try
            {
                var location = VBE.FindInstruction(e.Node.Instruction);
                location.CodeModule.CodePane.SetSelection(location.Selection);

                var codePane  = location.CodeModule.CodePane;
                var selection = location.Selection;
                codePane.SetSelection(selection.StartLine, selection.StartColumn, selection.EndLine, selection.EndColumn);
                codePane.ForceFocus();
            }
            catch (Exception exception)
            {
                System.Diagnostics.Debug.Assert(false);
            }
        }
예제 #4
0
        private void OnNavigateCodeIssue(object sender, NavigateCodeEventArgs e)
        {
            try
            {
                var location = _vbe.FindInstruction(e.QualifiedName, e.Selection);
                location.CodeModule.CodePane.SetSelection(location.Selection);

                var codePane  = location.CodeModule.CodePane;
                var selection = location.Selection;
                codePane.SetSelection(selection.StartLine, selection.StartColumn, selection.EndLine, selection.EndColumn);
                codePane.ForceFocus();
                SetQuickFixTooltip();
            }
            catch (Exception exception)
            {
                Debug.Assert(false);
            }
        }