rust/crates
bors[bot] 0900beeaa2
Merge #8776
8776: fix: fix unnecessary recomputations due to macros r=jonas-schievink a=jonas-schievink

This computes a macro's fragment kind eagerly (when the calling file is still available in parsed form) and stores it in the `MacroCallLoc`. This means that during expansion we no longer have to reparse the file containing the macro call, avoiding the unnecessary salsa dependencies (https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-834776349).

Marking as draft until I manage to find a test for this problem, since for some reason `typing_inside_a_function_should_not_invalidate_expansions` does not catch this (which might indicate that I misunderstand the problem).

I've manually confirmed that this fixes the issue described in https://github.com/rust-analyzer/rust-analyzer/pull/8746#issuecomment-834776349:

```
    7ms - parse_query @ FileId(179)
   12ms - SourceBinder::to_module_def
       12ms - crate_def_map:wait
            5ms - item_tree_query (1 calls)
            7ms - ???
```

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-09 14:40:49 +00:00
..
base_db Add one more profiling span to add_dep 2021-04-22 21:48:17 +03:00
cfg internal: expose cfg attrs from hir::Crate 2021-05-07 23:50:24 +03:00
flycheck Code review feedback. 2021-04-19 12:26:04 -07:00
hir Correctly support SelfType when searching for usages 2021-05-08 22:34:55 +02:00
hir_def Test that none of the macros are reparsed 2021-05-09 16:39:47 +02:00
hir_expand Merge #8776 2021-05-09 14:40:49 +00:00
hir_ty Correctly support SelfType when searching for usages 2021-05-08 22:34:55 +02:00
ide fix: join lines doesn't add space before closing quote 2021-05-09 17:19:18 +03:00
ide_assists Merge #8773 2021-05-08 22:09:03 +00:00
ide_completion Add = to pattern recovery 2021-05-08 23:14:08 +02:00
ide_db Don't handle Self as a usage for TraitDefs 2021-05-08 23:35:18 +02:00
ide_ssr syntax: return owned string instead of leaking string 2021-03-26 18:30:59 +01:00
mbe Merge #8560 2021-04-18 02:14:27 +00:00
parser Add = to pattern recovery 2021-05-08 23:14:08 +02:00
paths Clearer naming 2021-04-06 16:22:26 +03:00
proc_macro_api Replace memmap to memmap2 in proc_macro_api 2021-05-03 20:20:47 -04:00
proc_macro_srv Fix parse u128 bug in proc-macro 2021-03-31 19:50:36 +08:00
proc_macro_test Add description for crates that will be published 2020-08-24 13:07:22 +02:00
profile Use package renaming so source doesn't say tikv 2021-05-07 12:41:07 -07:00
project_model Use RUSTC_BOOTSTRAP=1 instead of +nightly when discovering rust_cfgs throughs cargo 2021-05-09 00:07:04 +02:00
rust-analyzer internal: add rust-analyzer version to panic context 2021-05-08 14:14:06 +03:00
stdx internal: use API stabilized in 1.52 2021-05-06 20:12:15 +03:00
syntax minor: remove dead code 2021-05-08 23:28:36 +03:00
test_utils internal: use API stabilized in 1.52 2021-05-06 20:12:15 +03:00
text_edit Avoid turning completion objects into builders 2020-11-16 23:16:41 +02:00
toolchain Add description for crates that will be published 2020-08-24 13:07:22 +02:00
tt a lot of clippy::style fixes 2021-03-21 16:15:41 +01:00
vfs Avoid duplicating VfsPath in vfs::path_interner::PathInterner by using an IndexSet 2021-04-06 16:03:57 +03:00
vfs-notify Fix slow tests sometimes failing 2021-02-12 16:31:16 +01:00