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 brings a few important improvements when handling errors/warnings.
1. Format error message
Currently, the message is shown without any treatment. Example:
The most import part of the whole message is
unexpected token: }
. However, it's hard to spot it because there's too much pollution. To make it worse, if the path of the file is long enough, the message might be clipped or even completely hidden.After this PR, it will look like this:
2. Properly handle errors in phoenix templates (
eex
andleex
)Currently, if an error occurs in a phoenix template, the editor points to the view file instead of the template. Example:
The following syntax error is not shown in the template:
But in the view, pointing to a line where there's no code:
After this PR, the editor points to the right file/line:
Additionally, this PR adds
.eex
and.leex
files to the list of watched files by the server so that any changes in those files trigger recompilation.3. Find the line in the stacktrace if the diagnostic does not provide it
When using macros, is common the see errors reported without the line. Example:
After this PR, the editor points to the write file/line if the line is available in the stacktrace: