Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix convert_iter_for_each_to_for doctest | Lukas Wirth | 2021-03-12 | 2 | -15/+56 |
| | |||||
* | fix: generated test fixture | Luiz Carlos Mourão Paes de Carvalho | 2021-03-12 | 2 | -2/+25 |
| | |||||
* | fix: replace doc-comments with normal comments | Luiz Carlos | 2021-03-12 | 1 | -20/+20 |
| | | | Co-authored-by: Lukas Wirth <[email protected]> | ||||
* | refactor: refactored and reduced assist code | Luiz Carlos Mourão Paes de Carvalho | 2021-03-12 | 1 | -36/+21 |
| | |||||
* | fix: remove semicolon | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 1 | -29/+56 |
| | |||||
* | fix: code formatting | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 1 | -10/+20 |
| | |||||
* | fix: tests should work for convert_iter_for_each_to_for | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 1 | -11/+44 |
| | |||||
* | refactor: create block expressions and for loops using make | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 1 | -29/+50 |
| | |||||
* | feat: add expr_for_loop to make in syntax | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 1 | -0/+3 |
| | |||||
* | feat: add assist to conver for_each into for loops | Luiz Carlos Mourão Paes de Carvalho | 2021-03-10 | 2 | -0/+140 |
| | |||||
*-. | Merge #7873 #7933 | bors[bot] | 2021-03-09 | 18 | -380/+847 |
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7873: Consider unresolved qualifiers during flyimport r=matklad a=SomeoneToIgnore Closes https://github.com/rust-analyzer/rust-analyzer/issues/7679 Takes unresolved qualifiers into account, providing better completions (or none, if the path is resolved or do not match). Does not handle cases when both path qualifier and some trait has to be imported: there are many extra issues with those (such as overlapping imports, for instance) that will require large diffs to address. Also does not do a fuzzy search on qualifier, that requires some adjustments in `import_map` for better queries and changes to the default replace range which also seems relatively big to include here. ![qualifier_completion](https://user-images.githubusercontent.com/2690773/110040808-0af8dc00-7d4c-11eb-83db-65af94e843bb.gif) 7933: Improve compilation speed r=matklad a=matklad bors r+ 🤖 Co-authored-by: Kirill Bulatov <[email protected]> Co-authored-by: Aleksey Kladov <[email protected]> | ||||
| | * | Improve compilation speed | Aleksey Kladov | 2021-03-09 | 1 | -1/+1 |
| | | | |||||
| * | | Better strip turbofishes | Kirill Bulatov | 2021-03-08 | 5 | -8/+52 |
| | | | |||||
| * | | Add rustdocs and use better names | Kirill Bulatov | 2021-03-08 | 3 | -40/+64 |
| | | | |||||
| * | | Less lifetines: derive SemanticsScope in place | Kirill Bulatov | 2021-03-08 | 7 | -50/+49 |
| | | | |||||
| * | | Rebase leftovers | Kirill Bulatov | 2021-03-08 | 1 | -5/+2 |
| | | | |||||
| * | | Cleanup | Kirill Bulatov | 2021-03-08 | 1 | -6/+0 |
| | | | |||||
| * | | Restrict fuzzy qualifiers for now | Kirill Bulatov | 2021-03-08 | 3 | -47/+26 |
| | | | |||||
| * | | Test for fuzzy unresolved path maatch | Kirill Bulatov | 2021-03-08 | 1 | -0/+22 |
| | | | |||||
| * | | Enforce the located imports' order | Kirill Bulatov | 2021-03-08 | 3 | -8/+7 |
| | | | |||||
| * | | Fix the completion labels and tests | Kirill Bulatov | 2021-03-08 | 4 | -65/+116 |
| | | | |||||
| * | | Work towards better import labels | Kirill Bulatov | 2021-03-08 | 13 | -239/+243 |
| | | | |||||
| * | | Profile import_assets better | Kirill Bulatov | 2021-03-08 | 1 | -0/+5 |
| | | | |||||
| * | | Update the docs | Kirill Bulatov | 2021-03-08 | 1 | -0/+39 |
| | | | |||||
| * | | Simplify | Kirill Bulatov | 2021-03-08 | 2 | -38/+23 |
| | | | |||||
| * | | Refactor the import location | Kirill Bulatov | 2021-03-08 | 3 | -162/+126 |
| | | | |||||
| * | | Do not propose already imported imports | Kirill Bulatov | 2021-03-08 | 4 | -27/+45 |
| | | | |||||
| * | | Properly handle turbofishes in qualifiers | Kirill Bulatov | 2021-03-08 | 5 | -8/+14 |
| | | | |||||
| * | | Fix some tests | Kirill Bulatov | 2021-03-08 | 4 | -49/+143 |
| | | | |||||
| * | | Return more data about located imports | Kirill Bulatov | 2021-03-08 | 9 | -125/+172 |
| | | | |||||
| * | | Draft the qualifier import resolution | Kirill Bulatov | 2021-03-08 | 4 | -43/+224 |
| | | | |||||
| * | | Filter out path items by the qualifier | Kirill Bulatov | 2021-03-08 | 1 | -24/+15 |
| | | | |||||
| * | | Simplify | Kirill Bulatov | 2021-03-08 | 1 | -64/+37 |
| | | | |||||
| * | | Find the code to change | Kirill Bulatov | 2021-03-08 | 1 | -55/+130 |
| | | | |||||
| * | | Test and initial refactoring | Kirill Bulatov | 2021-03-08 | 4 | -125/+101 |
| | | | |||||
* | | | Make code less surprising | Aleksey Kladov | 2021-03-09 | 1 | -17/+21 |
| |/ |/| | | | | | Theres no reason to have literal `\n\n` in the source code | ||||
* | | Merge #7931 | bors[bot] | 2021-03-09 | 1 | -26/+14 |
|\ \ | | | | | | | | | | | | | | | | | | | | | | 7931: Use `Type::new_with_resolver_inner` more r=jonas-schievink a=jonas-schievink bors r+ Co-authored-by: Jonas Schievink <[email protected]> | ||||
| * | | Use `Type::new_with_resolver_inner` more | Jonas Schievink | 2021-03-09 | 1 | -26/+14 |
| | | | |||||
* | | | Merge #7927 | bors[bot] | 2021-03-09 | 1 | -3/+7 |
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | 7927: Add more documentation for rustc_private r=matklad a=jyn514 Co-authored-by: Joshua Nelson <[email protected]> | ||||
| * | | Add more documentation for rustc_private | Joshua Nelson | 2021-03-08 | 1 | -3/+7 |
| |/ | |||||
* | | Fix format | Duong Do Minh Chau | 2021-03-09 | 1 | -9/+2 |
| | | |||||
* | | Add trailing commas | Duong Do Minh Chau | 2021-03-09 | 1 | -2/+2 |
| | | |||||
* | | Update the test to match the change | Duong Do Minh Chau | 2021-03-09 | 1 | -0/+4 |
| | | |||||
* | | Add completion to turn x.err into Err(x) | Duong Do Minh Chau | 2021-03-09 | 1 | -2/+19 |
| | | |||||
* | | Merge #7898 | bors[bot] | 2021-03-08 | 1 | -6/+67 |
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7898: generate_function assist: infer return type r=JoshMcguigan a=JoshMcguigan This PR makes two changes to the generate function assist: 1. Attempt to infer an appropriate return type for the generated function 2. If a return type is inferred, and that return type is not unit, don't render the snippet ```rust fn main() { let x: u32 = foo$0(); // ^^^ trigger the assist to generate this function } // BEFORE fn foo() ${0:-> ()} { todo!() } // AFTER (only change 1) fn foo() ${0:-> u32} { todo!() } // AFTER (change 1 and 2, note the lack of snippet around the return type) fn foo() -> u32 { todo!() } ``` These changes are made as two commits, in case we want to omit change 2. I personally feel like it is a nice change, but I could understand there being some opposition. #### Pros of change 2 If we are able to infer a return type, and especially if that return type is not the unit type, the return type is almost as likely to be correct as the argument names/types. I think this becomes even more true as people learn how this feature works. #### Cons of change 2 We could never be as confident about the return type as we are about the function argument types, so it is more likely a user will want to change that. Plus it is a confusing UX to sometimes have the cursor highlight the return type after triggering this assist and sometimes not have that happen. #### Why omit unit type? The assumption is that if we infer the return type as unit, it is likely just because of the current structure of the code rather than that actually being the desired return type. However, this is obviously just a heuristic and will sometimes be wrong. But being wrong here just means falling back to the exact behavior that existed before this PR. Co-authored-by: Josh Mcguigan <[email protected]> | ||||
| * | generate_function assist don't render snippet if ret type inferred | Josh Mcguigan | 2021-03-08 | 1 | -26/+47 |
| | | |||||
| * | generate_function assist infer return type | Josh Mcguigan | 2021-03-06 | 1 | -3/+43 |
| | | |||||
* | | Use upstream cov-mark | Laurențiu Nicola | 2021-03-08 | 99 | -513/+338 |
| | | |||||
* | | Hygiene is an internal implementation detail of the compiler | Aleksey Kladov | 2021-03-08 | 3 | -6/+11 |
| | | |||||
* | | Remove useless code_model indirection | Aleksey Kladov | 2021-03-08 | 5 | -2132/+2120 |
| | |