Skip to content

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

Open
@Veykril

Description

#[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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-perfperformance issuesA-proc-macroproc macroC-ArchitectureBig architectural things which we need to figure up-front (or suggestions for rewrites :0) )C-enhancementCategory: enhancementE-hard

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions