-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #286 from sharwell/improved-locations
Improved DiagnosticResult location support
- Loading branch information
Showing
8 changed files
with
263 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...rosoft.CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticLocation.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.CodeAnalysis.Testing | ||
{ | ||
public readonly struct DiagnosticLocation | ||
{ | ||
public DiagnosticLocation(FileLinePositionSpan span, DiagnosticLocationOptions options) | ||
{ | ||
Span = span; | ||
Options = options; | ||
} | ||
|
||
public FileLinePositionSpan Span { get; } | ||
|
||
public DiagnosticLocationOptions Options { get; } | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...CodeAnalysis.Testing/Microsoft.CodeAnalysis.Analyzer.Testing/DiagnosticLocationOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
namespace Microsoft.CodeAnalysis.Testing | ||
{ | ||
/// <summary> | ||
/// Defines options for interpreting <see cref="DiagnosticLocation"/>. | ||
/// </summary> | ||
public enum DiagnosticLocationOptions | ||
{ | ||
/// <summary> | ||
/// The diagnostic location is a simple <see cref="FileLinePositionSpan"/>. | ||
/// </summary> | ||
None = 0, | ||
|
||
/// <summary> | ||
/// The diagnostic location is defined as a position instead of a span. The length of the actual diagnostic span | ||
/// should be ignored when comparing results. | ||
/// </summary> | ||
IgnoreLength = 1, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.