Ejemplo n.º 1
0
 public Comment(Nemerle.Compiler.Comment comment, CommentType type, int textPosition)
 {
     Position = comment.Position;
       Length = comment.Length;
       IsDocument = comment.IsDocument;
       IsMultiline = comment.IsMultiline;
       Type = type;
       TextPosition = textPosition;
 }
Ejemplo n.º 2
0
        private void FillUsagesTextBox(Nemerle.Completion2.IIdeEngine engine)
        {
            string currentFileName = null;
            var lastTextLength = 0;
            rtbFoundUsages.Text = "";
            foreach(var usage in from use in _usages
                                     orderby use.Location.File
                                     select use)
            {
                var loc = usage.Location;
                if(loc.File != currentFileName)
                {
                    currentFileName = loc.File;
                    var fileString = string.Format("File: {0}\n", Path.GetFileName(currentFileName));
                    rtbFoundUsages.AppendText(fileString);

                    rtbFoundUsages.SelectionStart = lastTextLength;
                    rtbFoundUsages.SelectionLength = fileString.Length;
                    rtbFoundUsages.SelectionColor = Color.CornflowerBlue;

                    lastTextLength = rtbFoundUsages.Text.Length;
                }
                var strUsageLine = loc.Line.ToString();
                var line = string.Format("{0}: {1}\n", strUsageLine, usage.GetLineOfCode(engine));
                rtbFoundUsages.AppendText(line);

                int lineStart = lastTextLength;
                int selectionLength = loc.EndColumn - loc.Column;
                rtbFoundUsages.SelectionStart = lineStart + strUsageLine.Length + 2 + loc.Column - 1;
                rtbFoundUsages.SelectionLength = selectionLength;

                if (_oldName == null)
                {
                    _oldName = rtbFoundUsages.SelectedText;
                    NewName = _oldName;
                }

                rtbFoundUsages.SelectionBackColor = Color.LightGreen;
                lastTextLength = rtbFoundUsages.Text.Length;
            }
            rtbFoundUsages.SelectionStart = rtbFoundUsages.SelectionLength = 0;
        }
Ejemplo n.º 3
0
 public InlineRefactoringPreview(Nemerle.Completion2.Project project)
 {
     InitializeComponent();
     _project = project;
 }
Ejemplo n.º 4
0
 public RenameRefactoringDlg(Nemerle.Completion2.IIdeEngine engine, GotoInfo[] usages)
 {
     InitializeComponent();
     _usages = usages;
     FillUsagesTextBox(engine);
 }