Skip to content

Conversation

@jonas-schievink
Copy link
Contributor

Fixes #8158
Fixes #10039

This issue was not caused by us not being able to expand the macro (we can do that just fine). Instead, body lowering deliberately aborted lowering of a statement macro expansion when the expansion causes errors, citing some hygiene-related issue with recovery (@edwin0cheng if you remember what exactly the issue was I'd be happy to take a look).

Simply removing that code path doesn't cause any tests to fail, and makes completions in macros work better ("completion after ." is not the only thing that now works better, we also get better highlighting in incomplete macro calls).

Just to be sure, lets merge this after tomorrow's release.

@jonas-schievink
Copy link
Contributor Author

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 6, 2021

@bors bors bot merged commit ca62493 into rust-lang:master Sep 6, 2021
@jonas-schievink jonas-schievink deleted the macro-completion-after-dot branch September 6, 2021 10:35
@lnicola
Copy link
Member

lnicola commented Sep 13, 2021

completion

@lnicola
Copy link
Member

lnicola commented Sep 13, 2021

completion2

@lnicola
Copy link
Member

lnicola commented Sep 13, 2021

Technically this didn't solve #8158, you still need to type one character after the dot.

@jonas-schievink
Copy link
Contributor Author

Hmm, it's working fine for me. Do you have an example?

@jonas-schievink
Copy link
Contributor Author

Ah, nevermind, can reproduce with this

let x = 0i32;
println!("{}", x.$0)

pretty weird though

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.

Inconsistent autocompletion in block macro arguments Inside macros, methods don't show up in completion after a dot

2 participants