Skip to content

Pass a call site per derive to the proc macro server - #3275

Open
hakiers wants to merge 3 commits into
mainfrom
hakiers/1414-ls
Open

hakiers wants to merge 3 commits into
mainfrom
hakiers/1414-ls

Conversation

@hakiers

@hakiers hakiers commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Part of software-mansion/cairols#1414

Summary

ExpandDeriveParams now carries a call site per derive (derives: Vec<Derive { name, call_site }>) instead of one call_site for the whole batch, and the PMS expands each derive with its own call site — as the compile path already does.

Why

With a single call site, everything produced by the 2nd, 3rd, … derive of #[derive(A, B, C)] — token spans from TextSpan::call_site(), CallSite code mappings, diagnostics — was attributed to the first derive. E.g. Fuzzable's Debug error was underlined on the first derive in the attribute. The field was added in #2120 for V2 support without accounting for batched derives.

Breaking change

scarb-proc-macro-server-types 0.6.0: ExpandDeriveParams shape changed. Only the PMS and cairols use it, and the LS ships with Scarb.

The bundled cairo-language-server rev must be bumped to a commit using 0.6.0 before release — cairols side: software-mansion/cairols#1415.

@hakiers
hakiers marked this pull request as ready for review September 23, 2026 13:32
@hakiers
hakiers requested a review from a team as a code owner September 23, 2026 13:32
@hakiers
hakiers requested review from Arcticae, piotmag769 and wawel37 and removed request for a team September 23, 2026 13:32

@piotmag769 piotmag769 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

.

Comment thread utils/scarb-proc-macro-server-types/src/methods/expand.rs Outdated

@Arcticae Arcticae left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please implement the regression test we talked about f2f

This branch has not been deployed

No deployments
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.

3 participants