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

Typing inside proc-macro only changing trivia tokens re-expands proc-macro #17213

Open
Veykril opened this issue May 10, 2024 · 0 comments
Open
Labels
A-perf performance issues A-proc-macro proc macro C-Architecture Big architectural things which we need to figure up-front (or suggestions for rewrites :0) ) C-enhancement Category: enhancement E-hard

Comments

@Veykril
Copy link
Member

Veykril commented May 10, 2024

#[foo]
fn f() {
    // comment
}

Changing the comment content here currently invalidates relative spans in the macro input, invalidating the macro argument subtree as the contained spans change, and as such we re-expand the proc-macro even though logically the macro can't really observe this change unless it actually uses the proc-macro API to introspect spans. We should fix this by having the proc-macro server record whether an expansion did introspection or not and somehow instruct salsa that it shouldnt need to re-expand these queries in those cases.

@Veykril Veykril added E-hard C-Architecture Big architectural things which we need to figure up-front (or suggestions for rewrites :0) ) A-perf performance issues A-proc-macro proc macro C-enhancement Category: enhancement labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-perf performance issues A-proc-macro proc macro C-Architecture Big architectural things which we need to figure up-front (or suggestions for rewrites :0) ) C-enhancement Category: enhancement E-hard
Projects
None yet
Development

No branches or pull requests

1 participant