-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor compilation diagnostics, add them to compilation status page #1762
Conversation
8960070
to
ba1e8dc
Compare
I have also added logging of compilation of error, in addition to the warnings added in #1659 |
9cab783
to
1f548e9
Compare
This is a large commit of various interdependent changes with the simple goal of adding warnings to the compilation status page. * Non-critical errors from tokens are now reported as warnings. Before, they were ignored completely. * Added IDiagnosticsCompilationTracer interface - it allows watching the compilation process, for example observing changes made by various visitors or in this case getting the warnings when the compilation otherwise succeeds * Added DotvvmCompilationDiagnostic and DotvvmCompilationSourceLocation records - it designed to be a generic class for warnings and errors from the DotHTML compilation. It contains references to the syntax and resolved trees, so it should not be stored long-term, but provides all the possible detail about each reported error/warning. * BindingCompilationException is refactored to use the DotvvmCompilationDiagnostics and support any number of them. - plus, IDotvvmException compatibility is added - the exception will present as the "first" / primary error for better compatibility * ErrorCheckingVisitor is now smarter about binding errors, the BindingToken ranges are mapped into the DothtmlToken so we can underline only the affected part of the binding. This is somewhat important for displaying diagnostics of multiline bindings in the compilation page. Multiple errors can be collected from the error. * ViewCompilationService now collects the warnings and errors from the tracer and DotvvmCompilationException * And finally, the compilation displays up to 8 errors and warnings encountered during the page compilation under each row. Warnings tab was also added which shows only the views with at least one warning/error
1f548e9
to
bccb5e6
Compare
ex.FileName = Path.Combine( | ||
file.FullPath.Remove(file.FullPath.Length - file.FileName.Length), | ||
ex.FileName); | ||
fileName = Path.Combine(file.FullPath.Remove(file.FullPath.Length - file.FileName.Length), fileName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will break if the FullPath
does not end with FileName
src/Framework/Framework/Compilation/DotvvmCompilationDiagnostic.cs
Outdated
Show resolved
Hide resolved
src/Framework/Framework/Compilation/ViewCompiler/DefaultViewCompiler.cs
Outdated
Show resolved
Hide resolved
src/Framework/Framework/Configuration/DotvvmCompilationPageConfiguration.cs
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,14 @@ | |||
<%-- @property DotVVM.Framework.Compilation.DotHtmlFileInfo.CompilationDiagnosticViewModel Diagnostic --%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove commented-out code
5f93303
to
f056894
Compare
This is a large commit of various interdependent changes with the simple goal of adding warnings to the compilation status page.