To make sure it doesn't panic.
Also fix a bunch of errors that were causing panic bacause missing elements in the tree
The goal it to be able to generate a best effort node required for the LSP
This also makes the focus() method available as a member function on any
item, but the resolve_element_reference_in_set_focus_calls() pass will
check if the elements are valid.
The check for `has-focus` to determine a focusable item was replaced
with an annotation on the built-in elements, so that `has-focus` can
later be implemented as a built-in function through the run-time,
without the need for a boolean property.
Avoid empty lines in stderr from the compiler, and make sure
the description from the compile line mention the output target
instead of not the source tomake it consistant with other outputs
This actually cause a different compilation error and hides the real compilation error.
It was anyway not working because rustc does not show warning that comes from a macro
Since some lines may produce multiple warnings/errors, the regex
supports now multiple carets, which indicates the number of lines to
walk back. This is a bit hacky, but it works :-)
We decided that their type mapping is not ready for public API yet. For
example for duration we'd like to replace the opaque i64 with another
opaque type that however has convenient conversions to
std::time::Duration or std::chrono::milliseconds. We can't use either
directly because we need ffi compatibility, in order to create an
instance in C++ and pass it to the Rust run-time.
So this hides such properties and instead produces a warning.
When going from the plain rowan::SyntaxNode tree to the syntax_nodes::*
elements, attach the source file and keep track of it from that point
on. That'll pave the way for proper multi-file diagnostics generated
later on from the passes, where we store syntax_nodes::* types.
Let the bulk of the push_error() calls take a Spanned trait impl, so
that we can pass node on the call sites. Then when later change the
underyling trait to pass something that can also provide the source file
and we don't have to change all call sites again.
Remove the need for PartialEq for the Diagnostics. The objective is to
introduce an enum here in the future
that may hold types that do not support
PartialEq. It turns out that we don't really need it though.