Exemplo n.º 1
0
        //(MonoDevelop.Projects.Dom.Error info, LineSegment line)
        public ErrorMarker(LineSegment line)
        {
            //this.Info = info;
            this.Line = line; // may be null if no line is assigned to the error.
            string underlineColor;
            //if (info.ErrorType == ErrorType.Warning)
            //	underlineColor = Mono.TextEditor.Highlighting.Style.WarningUnderlineString;
            //else
            underlineColor = Mono.TextEditor.Highlighting.Style.ErrorUnderlineString;

            marker = new UnderlineMarker (underlineColor, - 1, line.Length-1);

            //if (Info.Region.Start.Line == info.Region.End.Line)
            //	marker = new UnderlineMarker (underlineColor, Info.Region.Start.Column - 1, info.Region.End.Column - 1);
            //else
            //	marker = new UnderlineMarker (underlineColor, - 1, - 1);
        }
Exemplo n.º 2
0
		public ErrorMarker (MonoDevelop.Projects.Dom.Error info, LineSegment line)
		{
			this.Info = info;
			this.Line = line; // may be null if no line is assigned to the error.
			string underlineColor;
			if (info.ErrorType == ErrorType.Warning)
				underlineColor = Mono.TextEditor.Highlighting.Style.WarningUnderlineString;
			else
				underlineColor = Mono.TextEditor.Highlighting.Style.ErrorUnderlineString;
			
			if (Info.Region.Start.Line == info.Region.End.Line)
				marker = new UnderlineMarker (underlineColor, Info.Region.Start.Column, info.Region.End.Column);
			else
				marker = new UnderlineMarker (underlineColor, 0, 0);
		}
Exemplo n.º 3
0
		public void SetReferencedSegments (List<ReferenceSegment> refs)
		{
			ReferencedSegments = refs;
			if (ReferencedSegments == null)
				return;
			foreach (var seg in refs) {
				DocumentLine line = inspectEditor.GetLineByOffset (seg.Offset);
				if (line == null)
					continue;
				// FIXME: ILSpy sometimes gives reference segments for punctuation. See http://bugzilla.xamarin.com/show_bug.cgi?id=2918
				string text = inspectEditor.GetTextAt (seg);
				if (text != null && text.Length == 1 && !(char.IsLetter (text [0]) || text [0] == '…'))
					continue;
				var marker = new UnderlineMarker (new Cairo.Color (0, 0, 1.0), 1 + seg.Offset - line.Offset, 1 + seg.EndOffset - line.Offset);
				marker.Wave = false;
				underlineMarkers.Add (marker);
				inspectEditor.Document.AddMarker (line, marker);
			}
		}
Exemplo n.º 4
0
		public void SetReferencedSegments (List<ReferenceSegment> refs)
		{
			ReferencedSegments = refs;
			if (ReferencedSegments == null)
				return;
			foreach (var seg in refs) {
				LineSegment line = inspectEditor.GetLineByOffset (seg.Offset);
				if (line == null)
					continue;
				var marker = new UnderlineMarker ("blue", 1 + seg.Offset - line.Offset, 1 + seg.EndOffset - line.Offset);
				marker.Wave = false;
				underlineMarkers.Add (marker);
				inspectEditor.Document.AddMarker (line, marker);
			}
		}