示例#1
0
        public void SetUp()
        {
            var path = "foo.js";

            issue = new Issue()
            {
                FilePath = path,
                Message  = "This is dangerous",
                RuleKey  = "javascript:123",
                Severity = Issue.Types.Severity.Blocker,
            };

            var mockTextSnap = new Mock <ITextSnapshot>();

            mockTextSnap.Setup(t => t.Length).Returns(50);

            var mockTextSnapLine = new Mock <ITextSnapshotLine>();

            mockTextSnapLine.Setup(l => l.LineNumber).Returns(12);
            mockTextSnapLine.Setup(l => l.Start).Returns(new SnapshotPoint(mockTextSnap.Object, 10));

            mockTextSnap.Setup(t => t.GetLineFromPosition(25)).Returns(mockTextSnapLine.Object);
            var textSnap = mockTextSnap.Object;

            var marker = new IssueMarker(issue, new SnapshotSpan(new SnapshotPoint(textSnap, 25), new SnapshotPoint(textSnap, 27)));

            snapshot = new IssuesSnapshot("MyProject", path, 1, new List <IssueMarker>()
            {
                marker
            });
        }
示例#2
0
		public Result (TextSpan region, string message, DiagnosticSeverity level, IssueMarker inspectionMark, bool underline = true)
		{
			this.Region = region;
			this.Message = message;
			this.Level = level;
			this.InspectionMark = inspectionMark;
			this.Underline = underline;
		}
示例#3
0
 public Result(TextSpan region, string message, DiagnosticSeverity level, IssueMarker inspectionMark, bool underline = true)
 {
     this.Region         = region;
     this.Message        = message;
     this.Level          = level;
     this.InspectionMark = inspectionMark;
     this.Underline      = underline;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoDevelop.CodeIssues.CodeIssue"/> class.
 /// </summary>
 public CodeIssue(IssueMarker issueMarker, string description, DomRegion region, string inspectorIdString, IEnumerable <MonoDevelop.CodeActions.CodeAction> actions = null)
 {
     IssueMarker       = issueMarker;
     Description       = description;
     Region            = region;
     Actions           = actions;
     InspectorIdString = inspectorIdString;
 }
 static TextSegmentMarkerEffect GetSegmentMarkerEffect(IssueMarker marker)
 {
     if (marker == IssueMarker.GrayOut)
     {
         return(TextSegmentMarkerEffect.GrayOut);
     }
     if (marker == IssueMarker.DottedLine)
     {
         return(TextSegmentMarkerEffect.DottedLine);
     }
     return(TextSegmentMarkerEffect.WavedLine);
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue"/> class.
 /// </summary>
 public CodeIssue(TextLocation start, TextLocation end, string issueDescription)
 {
     if (issueDescription == null)
     {
         throw new ArgumentNullException("issueDescription");
     }
     Description = issueDescription;
     Start       = start;
     End         = end;
     Actions     = EmptyList <CodeAction> .Instance;
     IssueMarker = IssueMarker.WavedLine;
 }
示例#7
0
            public InspectionTag(IssueManager manager, IssueProvider provider, ITextSourceVersion inspectedVersion, string description, int startOffset, int endOffset, IssueMarker markerType, IEnumerable <CodeAction> actions)
            {
                this.manager          = manager;
                this.Provider         = provider;
                this.InspectedVersion = inspectedVersion;
                this.Description      = description;
                this.StartOffset      = startOffset;
                this.EndOffset        = endOffset;
                this.Severity         = provider.CurrentSeverity;
                this.MarkerType       = markerType;

                this.Actions = actions.Select(Wrap).ToList();
            }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue"/> class.
 /// </summary>
 public CodeIssue(AstNode node, string issueDescription)
 {
     if (node == null)
     {
         throw new ArgumentNullException("node");
     }
     if (issueDescription == null)
     {
         throw new ArgumentNullException("issueDescription");
     }
     Description = issueDescription;
     Start       = node.StartLocation;
     End         = node.EndLocation;
     Actions     = EmptyList <CodeAction> .Instance;
     IssueMarker = IssueMarker.WavedLine;
 }
        public void SetUp()
        {
            var path = "foo.js";

            issue = new Issue()
            {
                FilePath = path,
                Message  = "This is dangerous",
                RuleKey  = "javascript:123",
                Severity = Issue.Types.Severity.Blocker,
            };

            var marker = new IssueMarker(issue, new SnapshotSpan());

            snapshot = new IssuesSnapshot(path, 1, new List <IssueMarker>()
            {
                marker
            });
        }
示例#10
0
 public void SetSeverity(DiagnosticSeverity level, IssueMarker inspectionMark)
 {
     this.Level          = level;
     this.InspectionMark = inspectionMark;
 }
示例#11
0
		/// <summary>
		/// Initializes a new instance of the <see cref="MonoDevelop.CodeIssues.CodeIssue"/> class.
		/// </summary>
		public CodeIssue (IssueMarker issueMarker, string description, DomRegion region, string inspectorIdString, IEnumerable<MonoDevelop.CodeActions.CodeAction>  actions = null)
		{
			IssueMarker = issueMarker;
			Description = description;
			Region = region;
			Actions = actions;
			InspectorIdString = inspectorIdString;
		}
示例#12
0
		public FixableResult (DomRegion region, string message, Severity level,
			IssueMarker mark, params IAnalysisFix[] fixes)
			: base (region, message, level, mark)
		{
			this.Fixes = fixes;
		}
示例#13
0
		public GenericResults (DomRegion region, string message, Severity level,
			IssueMarker mark, params GenericFix[] fixes)
			: base (region, message, level, mark)
		{
			this.Fixes = fixes;
		}
示例#14
0
		public InspectorResults (CodeIssueProvider inspector, DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes)
			: base (region, message, level, mark, fixes)
		{
			this.Inspector = inspector;
		}
示例#15
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue"/> class.
		/// </summary>
		public CodeIssue(TextLocation start, TextLocation end, string issueDescription)
		{
			if (issueDescription == null)
				throw new ArgumentNullException("issueDescription");
			Description = issueDescription;
			Start = start;
			End = end;
			Actions = EmptyList<CodeAction>.Instance;
			IssueMarker = IssueMarker.WavedLine;
		}
示例#16
0
 public FixableResult(DomRegion region, string message, Severity level,
                      IssueMarker mark, params IAnalysisFix[] fixes)
     : base(region, message, level, mark)
 {
     this.Fixes = fixes;
 }
示例#17
0
		/// <summary>
		/// Initializes a new instance of the <see cref="MonoDevelop.CodeIssues.CodeIssue"/> class.
		/// </summary>
		public CodeIssue (IssueMarker issueMarker, string description, string fileName, DocumentLocation start, DocumentLocation end, string inspectorIdString, IEnumerable<MonoDevelop.CodeActions.CodeAction>  actions = null) : this (issueMarker, description, new DomRegion (fileName, start, end), inspectorIdString, actions)
		{
		}
示例#18
0
 public IssueDescriptionAttribute(string title)
 {
     Title       = title;
     Severity    = Severity.Suggestion;
     IssueMarker = IssueMarker.Underline;
 }
示例#19
0
		public void SetSeverity (DiagnosticSeverity level, IssueMarker inspectionMark)
		{
			this.Level = level;
			this.InspectionMark = inspectionMark;
		}
示例#20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MonoDevelop.CodeIssues.CodeIssue"/> class.
 /// </summary>
 public CodeIssue(IssueMarker issueMarker, string description, string fileName, DocumentLocation start, DocumentLocation end, string inspectorIdString, IEnumerable <MonoDevelop.CodeActions.CodeAction> actions = null) : this(issueMarker, description, new DomRegion(fileName, start, end), inspectorIdString, actions)
 {
 }
示例#21
0
			public InspectionTag(IssueManager manager, IssueProvider provider, ITextSourceVersion inspectedVersion, string description, int startOffset, int endOffset, IssueMarker markerType, IEnumerable<CodeAction> actions)
			{
				this.manager = manager;
				this.Provider = provider;
				this.InspectedVersion = inspectedVersion;
				this.Description = description;
				this.StartOffset = startOffset;
				this.EndOffset = endOffset;
				this.Severity = provider.CurrentSeverity;
				this.MarkerType = markerType;
				
				this.Actions = actions.Select(Wrap).ToList();
			}
示例#22
0
 public InspectorResults(CodeIssueProvider inspector, DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes)
     : base(region, message, level, mark, fixes)
 {
     this.Inspector = inspector;
 }
示例#23
0
 public GenericResults(DomRegion region, string message, Severity level,
                       IssueMarker mark, params GenericFix[] fixes)
     : base(region, message, level, mark)
 {
     this.Fixes = fixes;
 }
示例#24
0
		public IssueDescriptionAttribute (string title)
		{
			Title = title;
			Severity = Severity.Suggestion;
			IssueMarker = IssueMarker.Underline;
		}
示例#25
0
		/// <summary>
		/// Initializes a new instance of the <see cref="ICSharpCode.NRefactory.CSharp.Refactoring.CodeIssue"/> class.
		/// </summary>
		public CodeIssue(AstNode node, string issueDescription)
		{
			if (node == null)
				throw new ArgumentNullException("node");
			if (issueDescription == null)
				throw new ArgumentNullException("issueDescription");
			Description = issueDescription;
			Start = node.StartLocation;
			End = node.EndLocation;
			Actions = EmptyList<CodeAction>.Instance;
			IssueMarker = IssueMarker.WavedLine;
		}