Skip to content
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

Add Ranges to Error #254

Closed
gorkem opened this issue Apr 10, 2021 · 1 comment · Fixed by #260
Closed

Add Ranges to Error #254

gorkem opened this issue Apr 10, 2021 · 1 comment · Fixed by #260
Labels
enhancement New feature or request

Comments

@gorkem
Copy link

gorkem commented Apr 10, 2021

Is your feature request related to a problem? Please describe.
YAMLErrors do not have a full range but instead they only report the offset of the error.

Describe the solution you'd like
YAMLError to include range of the Error occurred

Describe alternatives you've considered
a visitor could be done to visit the nodes and determine the end offset.

Additional context
also discussed on redhat-developer/yaml-language-server#421

@gorkem gorkem added the enhancement New feature or request label Apr 10, 2021
@eemeli
Copy link
Owner

eemeli commented Apr 14, 2021

What should the range be, when the error is originally encountered at a specific location?

This is tough to always determine at the point at which the error happens, because the end of the node may well be still unknown at the time.

For your use case, would it be sufficient to provide a way to determine from an error the nearest surrounding sensible range?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants