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.
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
fix: improve source code location metadata accuracy #8362
fix: improve source code location metadata accuracy #8362
Changes from 2 commits
11fc31e
f42aa9c
d89022f
22eaaf2
2dea46b
765023d
75aec41
c729829
61312c8
7d3b368
4547d3f
e8c1db9
eedacc9
abd760d
1e2cfa4
42e0f7d
c9ccd6e
8c9198d
16ab649
1533c9f
7410321
56146d0
eab99a4
2c92c2f
9aca05b
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
is this really just zero based vs one based or another cause?
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.
I'm wondering why this all still works the same, since you're always adding +1 to the line, regardless of a source map existing or not.
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.
you're already adding 1 above: https://github.com/sveltejs/svelte/pull/8362/files#r1135771594
so I think this is really adding 2 which seems wrong to me
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.
in a locally linked vite project with sveltekit-ts it produces correct positions in __svelte_meta.
I agree that this looks off and so far havn't been able to understand why it produces the correct result.
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.
looking at main.svelte, the h1 sits at line 5, not line 4
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.
I've reverted these changes since it seems like there's some other bug that was present previously. Perhaps something like Rich-Harris/magic-string#248 which was causing some of our other source map tests to assert unexpected behavior
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.
same for the p, the previous combination of line 1, col 1 and char 7 would require cramming 6 chars at col 0.