Changes towards a language server friendly compiler#673
Merged
Conversation
nicolas-abril
requested changes
Aug 14, 2024
Co-authored-by: Nicolas Abril <nicolas@higherorderco.com>
nicolas-abril
approved these changes
Aug 14, 2024
Contributor
Author
|
The latest commit includes the last suggested change - all diagnostic range and file information has been unified into the |
nicolas-abril
requested changes
Aug 16, 2024
d061f5a to
9862533
Compare
Contributor
Author
|
The new diagnostics printing should be much better. |
nicolas-abril
approved these changes
Aug 19, 2024
| 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)] |
Member
There was a problem hiding this comment.
We can allow it at the crate level, since we're just sprinkling this macro in different places, always for the same reason.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR:
TSPL::ParseError, new in the latest TSPL version, as to report error range information,FileSpanto eachDiagnostic,Functiondiagnostic origin,I'm still not sure about the
TextSpanconstruct - 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 changeTextSpanto 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.