about summary refs log tree commit diff
path: root/crates
AgeCommit message (Collapse)AuthorLines
2021-12-13Merge #10998bors[bot]-26/+221
10998: Add number representation assists r=Veykril a=errx Reimplemented assists from this PR https://github.com/rust-analyzer/rust-analyzer/pull/3683 with current APIs. ![image](https://user-images.githubusercontent.com/462486/145726792-47700215-26f2-4fdc-9520-63d1487901e5.png) ![image](https://user-images.githubusercontent.com/462486/145726802-f528a2f7-9159-41d3-b459-fc3fae033e60.png) I've decided not to add options about size of the groups so behaviour is similar to clippy's. Minimal number length is also taken from clippy. Co-authored-by: Oleg Matrokhin <matrokhin@gmail.com>
2021-12-13Reuse results from split_into_parts()Oleg Matrokhin-21/+9
2021-12-13Add number representation assistsOleg Matrokhin-26/+233
2021-12-13Merge #11002bors[bot]-7/+17
11002: fix: Add support for v6 macro metadata format r=lnicola a=lnicola CC https://github.com/rust-analyzer/rust-analyzer/issues/10894#issuecomment-991993824 bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-13Add support for v6 macro metadata formatLaurențiu Nicola-7/+17
2021-12-13Merge #11001bors[bot]-7/+6
11001: minor: fixup generate assist priorities r=Veykril a=Veykril Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10996 bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-13Merge #11000bors[bot]-103/+205
11000: fix: insert whitespaces into assoc items for assist when macro generated r=Veykril a=Veykril This is obviously only a temporary hack which still produces ugly looking items, but as long as the syntax is valid one can at least have rustfmt fix the formatting again. Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6588 bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-13minor: fixup generate assist prioritiesLukas Wirth-7/+6
2021-12-13fix: insert whitespaces into assoc items for assist when macro generatedLukas Wirth-26/+84
2021-12-13Move ws insert rendering for macro expansion into ide_dbLukas Wirth-95/+139
2021-12-12prettyfyAleksey Kladov-19/+20
2021-12-12consistencyAleksey Kladov-6/+6
2021-12-12simplifyAleksey Kladov-47/+23
2021-12-12tighten up invariantsAleksey Kladov-14/+17
2021-12-12add cross-crate inlinesAleksey Kladov-1/+5
2021-12-12port mbe to soa tokensAleksey Kladov-183/+130
2021-12-12more orthogonal interfaceAleksey Kladov-8/+12
2021-12-12parser tests workAleksey Kladov-140/+92
2021-12-12Switch parser to use tokensAleksey Kladov-53/+47
2021-12-12use eof token pattenrAleksey Kladov-4/+12
2021-12-12start SOA parser interfaceAleksey Kladov-0/+59
2021-12-12Merge #10993bors[bot]-1/+1
10993: minor: Bump deps r=lnicola a=lnicola Gets `coutme 2.0`. Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-12Bump depsLaurențiu Nicola-1/+1
2021-12-11Merge #10951bors[bot]-0/+1123
10951: feat: assist to generate documentation templates r=Veykril a=numero-744 Closes #10878, #1915 and #4767 Full description is in #10878, better read [the tests](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R424) to understand what this feature does. - [x] There is one remaining thing about non-`pub` functions, what do you think about it? - [x] In this PR [empty examples are generated](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R99) for `trait` functions, but maybe no examples should be provided at all. - [x] If there is already a documentation, add another one with a separator ([currently done](https://github.com/rust-analyzer/rust-analyzer/pull/10951/files#diff-7a64e2efb66b2625443340fcbc96d531baff12c17cc0aaf51885ea94f67de254R74)) or simply disable this assist? - [x] I will check once more that the generated examples are correct (ie. they are easy to fill before that they are built and tested) Comments appreciated :smile: Co-authored-by: Côme ALLART <come.allart@etu.emse.fr>
2021-12-11feat: remove should_panic example generationCôme ALLART-97/+24
2021-12-11refactor: use hir to test if a value is returnedCôme ALLART-7/+8
2021-12-11refactor: use Itertools::intersperseCôme ALLART-14/+2
2021-12-11refactor: use hir to compare returned and self typesCôme ALLART-11/+17
2021-12-11Fix expected type calculation in struct literal if followed by commaFlorian Diebold-5/+29
2021-12-11Merge #10987bors[bot]-2/+15
10987: fix: respect inner attributes for Structs and Enums r=lnicola a=rainy-me fix: #10980 (the allow/deny issue is not fully resolved though.) Co-authored-by: rainy-me <github@yue.coffee>
2021-12-12fix: lookup upwards for struct and enumrainy-me-2/+15
2021-12-11Merge #10965bors[bot]-18/+0
10965: minor: Remove dead assists-related function r=Veykril a=lnicola Unless I'm missing something, `assists_with_fixes` seems to be always used and ends up in the same code path. Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-11Merge #10956 #10986bors[bot]-28/+41
10956: minor: Bump deps r=Veykril a=lnicola bors r+ 10986: fix: Fix lint completions not working for unclosed attributes r=Veykril a=Veykril Fixes #10682 Uses keywords and nested `TokenTree`s as a heuristic to figure out when to stop parsing in case the attribute is unclosed which should work pretty well as attributes are usually followed by either of those. bors r+ Co-authored-by: Laurențiu Nicola <lnicola@dend.ro> Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-11fix: Fix lint completions not working for unclosed attributesLukas Wirth-25/+39
2021-12-11Merge #10877bors[bot]-4/+39
10877: feat: make hightlighting linear r=matklad a=matklad In https://youtu.be/qvIZZf5dmTE, we've noticed that AstIdMap does a linear lookup when going from SyntaxNode to Id. This leads to accidentally quadratic overall performance. Replace linear lookup with a O(1) hashmap lookup. Future work: don't duplicate `SyntaxNodePtr` in `AstIdMap` and switch to "call site dependency injection" style storage (eg, store a `HashSet<ErasedFileAstId>`). See the explanation of the work here on YouTube :-) As you can see from then benchmark results, this doesn't actually make analysis stats fastre. I am a bit mystified as to why this is happening to be honest. Baseline ``` Database loaded: 598.40ms, 304minstr, 118mb (metadata 390.57ms, 21minstr, 841kb; build 111.31ms, 8764kinstr, -214kb) crates: 39, mods: 824, decls: 18647, fns: 13910 Item Collection: 9.70s, 75ginstr, 377mb exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145 Inference: 43.16s, 342ginstr, 641mb Total: 52.86s, 417ginstr, 1018mb ``` This PR: ``` Database loaded: 626.34ms, 304minstr, 118mb (metadata 416.26ms, 21minstr, 841kb; build 113.67ms, 8750kinstr, -209kb) crates: 39, mods: 824, decls: 18647, fns: 13910 Item Collection: 10.16s, 75ginstr, 389mb exprs: 382426, ??ty: 387 (0%), ?ty: 285 (0%), !ty: 145 Inference: 44.51s, 342ginstr, 644mb Total: 54.67s, 417ginstr, 1034mb ``` I think we probably should merge the first commit here, but not the second. Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-12-11more frugal mapAleksey Kladov-15/+28
2021-12-11Merge #10985bors[bot]-3/+3
10985: minor: Remove unnecessary clones r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-11minor: Remove unnecessary clonesLukas Wirth-3/+3
2021-12-11Merge #10976bors[bot]-33/+55
10976: fix: Show case-insensitive exact matches instead of fuzzy flyimport for short paths r=Veykril a=Veykril And raise the fuzzy trigger from 2 to 3 chars. This way we keep the ability of flyimporting short names like `Rc`. Fixes https://github.com/rust-analyzer/rust-analyzer/issues/6917 bors r+ Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-11Show case-insensitive exact matches instead of fuzzy flyimport for short pathsLukas Wirth-33/+55
2021-12-10Merge #10978bors[bot]-21/+10
10978: internal: Only prime direct dependencies of the workspace crates r=jonas-schievink a=lnicola This reduces the number of primed crates on `self` from 177 to 105. ```text # baseline 86521 me 20 0 2939M 562M 14320 S 0.0 0.9 0:07.10 37 rust-analyzer # pr 99947 me 20 0 2935M 549M 14424 S 0.0 0.9 0:07.10 37 rust-analyzer ``` The RAM usage seems to vary a lot, so I'm not sure the improvement shown above is real. We also drop the topological sorting, although it might still make sense to do the dependencies before the workspace crates. But since it's only used to make the progress reporting a bit more fine, it probably doesn't matter too much. Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-12-10Remove some allocationsLukas Wirth-58/+78
2021-12-10Don't show trait flyimports for impl trait and placeholdersLukas Wirth-30/+78
2021-12-10Show enum completions for single variant enums in irrefutable patternsLukas Wirth-15/+24
2021-12-10feat: trait fn: add panicking example only if default panicksCôme ALLART-1/+121
2021-12-10Only prime direct dependencies of the workspace cratesLaurențiu Nicola-21/+10
2021-12-10Merge #10977bors[bot]-1/+46
10977: fix: fix `concat!` with captured expression r=jonas-schievink a=jonas-schievink Adds another hack on top of https://github.com/rust-analyzer/rust-analyzer/pull/10623 to fix `concat!`. Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10721 bors r+ Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2021-12-10Fix `concat!` with captured expressionJonas Schievink-1/+46
2021-12-10refactor: use hir to check if fn in trait/implCôme ALLART-11/+14
2021-12-10fix: check correctly if function is exportedCôme ALLART-20/+30