1182: Add HIR for where clauses & ignore impls with where clauses in trait resolution r=matklad a=flodiebold
This prevents any `impl<T> Trait for T where ...` from being treated as a
blanket impl while we don't handle where clauses yet.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
1175: Fix bugs and add error log about macro expansion r=matklad a=edwin0cheng
This PR fixed / add following things:
* Add a fused count which stop recursion of macro expansion in name resolution.
* Add some logs when macro expansion fails
* Add `$crate` meta variable support in mbe, which create a `$crate` ident token in token tree.
* Fixed matching a `$REPEAT` pattern inside a subtree, e.g. `(fn $name:ident {$($i:ident)*} ) => {...}`
* Remove composite-able punct token in syntax node to token conversion.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1176: Add a simple test for str method completion r=flodiebold a=flodiebold
Somehow I forgot that we should add a test for this in #1154 until after it was already merging. So I'll just add one now :)
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
1154: Initial support for lang items (and str completion) r=flodiebold a=marcogroppo
This PR adds partial support for lang items.
For now, the only supported lang items are the ones that target an impl block.
Lang items are now resolved during type inference - this means that `str` completion now works.
Fixes#1139.
(thanks Florian Diebold for the help!)
Co-authored-by: Marco Groppo <marco.groppo@gmail.com>
1174: improve cargo watch r=matklad a=vemoo
- Add start and stop commands
- Cleanup trypescript code to avoid definite assignment assertions (`!` after possibly undefined value)
- Recover `rustc-watch` problem matcher because it's still useful, can be used with any command, for example `cargo test`
Co-authored-by: Bernardo <berublan@gmail.com>
1172: Temporarily disable tt matcher r=edwin0cheng a=edwin0cheng
Temporarily fix for #1170 by disable the `tt` matcher. The reason for that is normally a `$($tt:tt))* wildcard matcher will be added for recurisve macro. If we have any bugs in macro expansion, the macro will infinite expanding recursively.
Let me add a fused system and add more test in later PR and then re-enable this one
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1167: Added instructions for Sublime Text 3 setup r=matklad a=OtaK
Hey all!
I'm a Sublime Text 3 user and I wrote instructions to make `rust-analyzer` work with it.
So far works flawlessly, barring the missing features, which is fine (and not the point of this PR).
Great work <3
Thanks,
Mathieu
Co-authored-by: Mathieu Amiot <amiot.mathieu@gmail.com>
1148: Add token_tree_to_xxx functions r=matklad a=edwin0cheng
<del>As discus in PR #1147 , this PR added a `mbe::MacroKind` .
Currently only 2 kind of macro are supported, `SourceFile` and `Block`.</del>
Added following functions for `tt::TokenTree` and `ast::Node` conversion:
* token_tree_to_expr
* token_tree_to_pat
* token_tree_to_ty
* token_tree_to_macro_stmts
* token_tree_to_macro_items
And added two new syntax kind:
* MACRO_ITEMS
* MACRO_STMTS
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1164: Fix missing last token in mbe $repeat parsing r=matklad a=edwin0cheng
The `mbe parser` incorrectly eat one more token in $repeat parsing, described in #1141.
Remove incorrect token eating, and add related test.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
1161: Add mbe 'item' matcher r=matklad a=edwin0cheng
Add `item` matcher in `ra_mbe` , and added corresponding `item()` parser in `ra_syntax`.
This PR also help PR #1148 for `Items` parsing.
And hopefully fix#1149 ?!
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>