rust/crates
bors[bot] beb4f49541
Merge #3513
3513: Completion in macros r=matklad a=flodiebold

I experimented a bit with completion in macros. It's kind of working, but there are a lot of rough edges.

 - I'm trying to expand the macro call with the inserted fake token. This requires some hacky additions on the HIR level to be able to do "hypothetical" expansions. There should probably be a nicer API for this, if we want to do it this way. I'm not sure whether it's worth it, because we still can't do a lot if the original macro call didn't expand in nearly the same way. E.g. if we have something like `println!("", x<|>)` the expansions will look the same and everything is fine; but in that case we could maybe have achieved the same result in a simpler way. If we have something like `m!(<|>)` where `m!()` doesn't even expand or expands to something very different, we don't really know what to do anyway.
 - Relatedly, there are a lot of cases where this doesn't work because either the original call or the hypothetical call doesn't expand. E.g. if we have `m!(x.<|>)` the original token tree doesn't parse as an expression; if we have `m!(match x { <|> })` the hypothetical token tree doesn't parse. It would be nice if we could have better error recovery in these cases.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-03-09 08:56:58 +00:00
..
ra_arena Switch to variant-granularity field type inference 2019-11-25 00:12:36 +03:00
ra_assists Rerail split_import API onto AST 2020-03-06 14:08:43 +01:00
ra_cargo_watch lsp-types 0.72 2020-03-02 11:52:46 -05:00
ra_cfg Update versions 2020-02-18 16:12:40 +02:00
ra_db Source map returns a result 2020-03-06 14:44:44 +01:00
ra_fmt When joining lines, unwrap trivial diverging blocks 2020-02-24 17:17:05 +01:00
ra_hir Merge #3513 2020-03-09 08:56:58 +00:00
ra_hir_def Handle visibility for assoc item path completion as well 2020-03-08 15:15:46 +01:00
ra_hir_expand Merge #3513 2020-03-09 08:56:58 +00:00
ra_hir_ty Prevent include! macro include itself 2020-03-07 19:08:42 +08:00
ra_ide Merge #3513 2020-03-09 08:56:58 +00:00
ra_ide_db Normalize waiting queries names 2020-03-07 00:18:04 +01:00
ra_mbe Merge #3513 2020-03-09 08:56:58 +00:00
ra_parser Implement concat macro 2020-03-04 01:21:14 +08:00
ra_prof Allow specifying additional info on call to profile 2020-03-06 17:36:51 +01:00
ra_project_model ra_project_model: migrate to Sysroot::alloc() 2020-03-01 00:16:57 +02:00
ra_syntax Add parse_to_token_tree 2020-03-09 00:13:04 +08:00
ra_text_edit Remove unused dependencies 2020-02-27 14:04:13 +09:00
ra_tt Update versions 2020-02-18 16:12:40 +02:00
rust-analyzer Ignore client-specific notifications 2020-03-09 09:26:41 +01:00
test_utils Support cross-crate marks 2020-03-04 11:55:25 +01:00