-
Notifications
You must be signed in to change notification settings - Fork 433
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
Changes towards a language server friendly compiler #673
Conversation
Co-authored-by: Nicolas Abril <[email protected]>
The latest commit includes the last suggested change - all diagnostic range and file information has been unified into the |
d061f5a
to
9862533
Compare
The new diagnostics printing should be much better. |
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.
Update the changelog
for diag in diags { | ||
// We need to allow this Clippy warning due to `Name` in `DiagnosticOrigin::Function`. | ||
// We know how it works, so it shouldn't be a problem. | ||
#[allow(clippy::mutable_key_type)] |
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.
We can allow it at the crate level, since we're just sprinkling this macro in different places, always for the same reason.
This PR:
TSPL::ParseError
, new in the latest TSPL version, as to report error range information,FileSpan
to eachDiagnostic
,Function
diagnostic origin,I'm still not sure about the
TextSpan
construct - the new TSPL version only reports byte range information, while the LSP requires line and column range information, so that's how I implemented that struct. I think it could be better to changeTextSpan
to only report byte range information, and provide a function to convert between the two given the source code. I could also change TSPL again to include both types of range information, but I think it's not something the team would want since many changes to it would stop it from being the simplest parser library.I'll wait until after the review to add a changelog because of the aforementioned issues.
Related to #650.