-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Implement literal_from_str
for proc macro server
#16446
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
Conversation
Yes thats fine, the server depends on
What do those look like? I would expect r-a to handle them the same as with integer suffixes |
In regards to the suffixes for strings, the Rust Reference has this to say:
My understanding is we will have to handle literals like let item = "crab"cake; Currently in In regards to the other comments, I will address them and re-request a review. Thanks for the feedback! |
We should go about this the same way we handle it for integers and such. The parser currently intentionally does not acknowledge suffixes separately (as they are technically part of the token). |
32e282b
to
6b59101
Compare
I think I might open a separate PR to deal with parsing the suffix for strings. Is that ok with you? |
6b59101
to
4923b8a
Compare
Thanks! (gonna remove some allocations in that code in a follow up in a bit) |
☀️ Test successful - checks-actions |
fix: Validate literals in proc-macro-srv FreeFunctions::literal_from_str cc #16446 meant to only get rid of some string allocs but then I noticed we can just implement this with the bare lexer.
Closes #16233
Todos and unanswered questions:
rust_analyzer_span
servers depend on thesyntax
crate?rust-analyzer
preservers suffix information after parsing.expect
tests failing? Specificallytest_fn_like_macro_clone_literals