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

Reconstruct diagnostic range end of ast-gen #630

Merged
merged 2 commits into from
Sep 6, 2022

Conversation

Techatrix
Copy link
Member

ast-gen only reports a line and column. With this PR the end position is reconstructed by finding the given source location and adding the length of the next token.
fixes #627

@llogick
Copy link
Member

llogick commented Sep 5, 2022

The only thing that might bite here is not taking into account the encoding of the document (not sure how likely that is )
I'm only mentioning it because I had the same idea but were gonna utilise offsets.documentPosition for the positionToIndex.

👍 stellar

Copy link
Member

@SuperAuguste SuperAuguste left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof this PR is gonna mess up my #631 I think 😅 LGTM nonetheless

@SuperAuguste SuperAuguste merged commit aa81d83 into zigtools:master Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unused argument produces 0 width diagnostic
3 participants