Repository navigation
Conversation
… cron aliases unraw - macro_storage: the IDE single-declaration and moved-away checks count module-level fn items (inline modules included, plus macro_rules! bodies) instead of every textual `fn <name>`, so an impl method sharing a handler's name no longer keeps a stale unknown-scope entry beside the saved one (duplicate route in rust-analyzer). Unparsable text falls back to the textual count. - cron_discovery/imports: the `as cron` rename guards compare `rename.unraw()`, so `use other::cron as r#cron;` is an explicit foreign import and `use super::cron as r#cron;` inherits the parent's cron. syn's Ident == &str is false for a raw spelling. - Tests: impl-method IDE cases, direct count cases, raw-spelled cron import cases (the foreign and child ones fail before the fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Round-63 macro/rest fixes (pending findings R63-MR2-L1 and R63-MR5-L1).
Fixed
single_declaration_in_ideandmoved_away(crates/vespera_macro/src/macro_storage.rs) counted every textualfn <name>, including impl methods, trait items and nested fns. Animpl Repo { fn list(&self) }beside#[route(get)] pub async fn list()made the count 2, so rust-analyzer kept the stale entry andvespera!emittedlisttwice. The count is nowcount_free_fn_declarations: module-level fn items (inline modules included) plus thefn <name>text ofmacro_rules!bodies, which may expand to a second declaration. Unparsable text falls back to the textual count.declares_fninretain_declaredstays textual.cronrename. Invespera_impl/cron_discovery/imports.rs, the tworename.rename == "cron"guards (explicit-import and inherited-rename arms) compared a raw identifier against&str, which is false forr#cron(synIdent == &strcompares the raw spelling). They now comparerename.unraw(). Effects:use other::cron as r#cron;is an explicit foreign import again (a bare#[cron]is no longer scheduled), anduse super::cron as r#cron;in a child module inherits the parent's cron.Refuted
component_schemas.rs:548(f.sig.ident == namewith rawfunction_name). Not a bug.function_nameissig.ident.to_string()and stays raw (r#match), and proc-macro2'sIdent: PartialEq<str>matches a raw ident against itsr#-prefixed spelling (checked in proc-macro2 1.0.99fallback.rs:if self.raw { other.starts_with("r#") && sym == other[2..] }). The route name passed there is the raw one, so the comparison holds. The unraw-trimmed names at lines 437/441/478 are compared against unraw names and are unaffected.Tests
macro_storage/tests.rs:ide_stale_entry_is_dropped_beside_an_impl_method_of_the_same_name,ide_moved_entry_is_dropped_when_an_impl_method_shares_the_name. Mutation check: with the old textual count both fail; with the fix both pass.macro_storage/tests_count.rs:count_free_fn_declarations_counts_module_level_fns(impl/trait/nested fns, two modules,macro_rules!bodies at top level and in an inline module, comments, unparsable fallback).cron_discovery/tests_alias.rs:raw_spelled_cron_imports_match_the_plain_spelling(8 cases). Before the fix, the foreign root raw rename, the raw rename beside a vespera glob, and the childsuper::cron as r#cronof a foreign cron fail; the rest are guards.Checks
cargo test -p vespera_macro --lib: 7445 passed.cargo clippy -p vespera_macro --all-targets --all-features -D warnings: clean.cargo fmt --check: clean.bun scripts/check-version-alignment.ts: all 7 packages at 0.8.0..changepacks/changepack_log_macrorest_round63.json(Patch, all 7 packages, ASCII note).macro_storage.rs632,tests_alias.rs607).🤖 Generated with Claude Code