Speculatively expand attributes in completions

This commit is contained in:
Lukas Wirth 2021-09-02 18:54:09 +02:00
parent c3eb646487
commit 2b907652ee
7 changed files with 238 additions and 66 deletions

View file

@ -370,6 +370,7 @@ impl ExpansionInfo {
) -> Option<impl Iterator<Item = InFile<SyntaxToken>> + '_> {
assert_eq!(token.file_id, self.arg.file_id);
let token_id = if let Some(item) = item {
// check if we are mapping down in an attribute input
let call_id = match self.expanded.file_id.0 {
HirFileIdRepr::FileId(_) => return None,
HirFileIdRepr::MacroFile(macro_file) => macro_file.macro_call_id,