Skip to content

Commit 3e98951

Browse files
Location info added to CodeCompilerError
1 parent 995b8b7 commit 3e98951

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Mono.TextTemplating.Roslyn/RoslynCodeCompiler.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ public override async Task<CodeCompilerResult> CompileFile (
7373
Success = false,
7474
Output = new List<string> (),
7575
Errors = failures.Select (
76-
x => new CodeCompilerError { Message = x.GetMessage () }).ToList (),
76+
x => new CodeCompilerError {
77+
Message = x.GetMessage(),
78+
Column = x.Location.GetMappedLineSpan().StartLinePosition.Character,
79+
Line = x.Location.GetMappedLineSpan().StartLinePosition.Line,
80+
EndLine = x.Location.GetMappedLineSpan().EndLinePosition.Line,
81+
EndColumn = x.Location.GetMappedLineSpan().EndLinePosition.Character,
82+
IsError = x.Severity == DiagnosticSeverity.Error,
83+
Origin = x.Location.GetMappedLineSpan().Path
84+
}).ToList ()
7785
};
7886
}
7987
}

0 commit comments

Comments
 (0)