rust-analyzer/crates
bors[bot] daffdd8674
Merge #3179
3179: Introduce AsMacroCall trait r=matklad a=edwin0cheng

This PR introduce `AsMacroCall` trait to help convert `ast::MacroCall` to `MacroCallId`. The main goal here is to centralize various conversions to single place and make implementing eager macro calls without further ado.

```rust
pub trait AsMacroCall {
    fn as_call_id(
        &self,
        db: &(impl db::DefDatabase + AstDatabase),
        resolver: impl Fn(path::ModPath) -> Option<MacroDefId>,
    ) -> Option<MacroCallId>;
}
```

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-02-17 08:38:09 +00:00
..
ra_arena Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_assists Do not collect all traits 2020-02-12 23:27:19 +02:00
ra_batch Support setting cargo features 2019-12-13 18:16:34 +08:00
ra_cargo_watch Update snapshot tests due to removed SuggestedFix 2020-02-03 12:24:57 +01:00
ra_cfg Disable doctests 2019-11-17 18:35:05 +03:00
ra_cli 1-based columns 2020-02-16 18:30:48 +01:00
ra_db Apply the reviews suggestions 2020-02-05 12:47:28 +02:00
ra_fmt Refactor if-let -> match assist to use ast::make 2020-02-05 14:08:16 +01:00
ra_hir Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
ra_hir_def Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
ra_hir_expand Add couple of utility methods 2020-02-12 18:19:55 +01:00
ra_hir_ty Fix coercion of &T to itself 2020-02-16 12:58:20 +01:00
ra_ide Add module colors to css 2020-02-16 17:06:01 +01:00
ra_ide_db Remove extra dep 2020-02-15 23:23:44 +01:00
ra_lsp_server Enable profiling for bench 2020-02-16 18:04:08 +01:00
ra_mbe ra_syntax: refactored the lexer design as per @matklad and @kiljacken PR review 2020-02-04 00:00:55 +02:00
ra_parser Add test for unnamed argument in function pointer 2020-02-12 22:55:37 +01:00
ra_prof Enable profiling for bench 2020-02-16 18:04:08 +01:00
ra_project_model Make AtomicX type resolve again 2020-02-14 19:33:39 +01:00
ra_syntax Run cargo test 2020-02-12 23:15:48 +01:00
ra_text_edit move to to_usize() 2020-02-10 01:57:43 +02:00
ra_tt Refactoring 2019-12-18 13:10:37 +08:00
ra_vfs_glob Disable doctests 2019-11-17 18:35:05 +03:00
test_utils Simplify fixture parsing 2020-01-30 13:17:56 +01:00