forked from unoplatform/uno
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve error reporting with Roslyn-hosted generators
- Loading branch information
1 parent
a04bed2
commit 8c3a0d7
Showing
4 changed files
with
151 additions
and
3 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
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
37 changes: 37 additions & 0 deletions
37
src/SourceGenerators/Uno.UI.SourceGenerators/XamlGenerator/XamlParsingException.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,37 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace Uno.UI.SourceGenerators.XamlGenerator | ||
{ | ||
/// <summary> | ||
/// Defines a XAML parsing exception to be raised from the generator | ||
/// </summary> | ||
[Serializable] | ||
internal class XamlParsingException : Exception | ||
{ | ||
public XamlParsingException() | ||
{ | ||
} | ||
|
||
public XamlParsingException(string message) : base(message) | ||
{ | ||
} | ||
|
||
public XamlParsingException(string message, Exception? innerException, int lineNumber, int linePosition, string filePath) : base(message, innerException) | ||
{ | ||
LineNumber = lineNumber; | ||
LinePosition = linePosition; | ||
FilePath = filePath; | ||
} | ||
|
||
protected XamlParsingException(SerializationInfo info, StreamingContext context) : base(info, context) | ||
{ | ||
} | ||
|
||
public int? LineNumber { get; } | ||
public int? LinePosition { get; } | ||
public string? FilePath { get; } | ||
} | ||
} |