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 }); }
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; }
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; }
/// <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); }
/// <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; }
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(); }
/// <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 }); }
public void SetSeverity(DiagnosticSeverity level, IssueMarker inspectionMark) { this.Level = level; this.InspectionMark = inspectionMark; }
/// <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; }
public FixableResult (DomRegion region, string message, Severity level, IssueMarker mark, params IAnalysisFix[] fixes) : base (region, message, level, mark) { this.Fixes = fixes; }
public GenericResults (DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes) : base (region, message, level, mark) { this.Fixes = fixes; }
public InspectorResults (CodeIssueProvider inspector, DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes) : base (region, message, level, mark, fixes) { this.Inspector = inspector; }
/// <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; }
public FixableResult(DomRegion region, string message, Severity level, IssueMarker mark, params IAnalysisFix[] fixes) : base(region, message, level, mark) { this.Fixes = fixes; }
/// <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) { }
public IssueDescriptionAttribute(string title) { Title = title; Severity = Severity.Suggestion; IssueMarker = IssueMarker.Underline; }
public void SetSeverity (DiagnosticSeverity level, IssueMarker inspectionMark) { this.Level = level; this.InspectionMark = inspectionMark; }
/// <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) { }
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(); }
public InspectorResults(CodeIssueProvider inspector, DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes) : base(region, message, level, mark, fixes) { this.Inspector = inspector; }
public GenericResults(DomRegion region, string message, Severity level, IssueMarker mark, params GenericFix[] fixes) : base(region, message, level, mark) { this.Fixes = fixes; }
public IssueDescriptionAttribute (string title) { Title = title; Severity = Severity.Suggestion; IssueMarker = IssueMarker.Underline; }
/// <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; }