Skip to content

Private method translations are not working#33

Open
pablomatiasgomez wants to merge 2 commits intogetsentry:masterfrom
pablomatiasgomez:resolve-private-methods
Open

Private method translations are not working#33
pablomatiasgomez wants to merge 2 commits intogetsentry:masterfrom
pablomatiasgomez:resolve-private-methods

Conversation

@pablomatiasgomez
Copy link
Copy Markdown

@pablomatiasgomez pablomatiasgomez commented Mar 9, 2026

I found in one my apps that some private methods are not correctly being translated
I was able to reproduce a small example in this PR.

I believe the problem is that some source maps place the name mapping on the token immediately after the identifier, rather than on it.. I guess the fix would be to do the look at both the range.start and range.end on this file

let source_position = self.ctx.offset_to_position(range.start)?;
?

If so, I can do the change

Comment thread tests/integration.rs
resolved_scopes,
[
(7..225, Some("new ApiConnector".into()), Some("new ApiConnector".into())),
(56..142, Some("ApiConnector.#t".into()), Some("ApiConnector.#makeRequest".into())),
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This test would currently fail as ApiConnector.#t and ApiConnector.#r won't be translated

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.

1 participant