about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/ide-completion
AgeCommit message (Collapse)AuthorLines
2024-07-19Avoid ref when using format! in compilerYuri Astrakhan-2/+2
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-18Encode edition within FileId in the hir layerLukas Wirth-21/+20
2024-07-16Remove Name::to_smol_strLukas Wirth-50/+83
2024-07-16More symbol usageLukas Wirth-7/+7
2024-07-16Use symbol in cfgLukas Wirth-0/+2
2024-07-15Fix stable iteration ordering for `Map<Name, ...>` usagesLukas Wirth-3/+3
2024-07-14Use statics + clone instead of const until const can access staticsLukas Wirth-7/+8
2024-07-12Use Symbol in NameLukas Wirth-28/+29
2024-07-07Auto merge of #17555 - Veykril:grammar-inline, r=Veykrilbors-1/+4
internal: Inline generated syntax methods
2024-07-07HasGenericArgs syntax traitLukas Wirth-1/+4
2024-07-07Auto merge of #17523 - wada314:master, r=Veykrilbors-0/+44
Add an option to use "::" for the external crate prefix. Fixes #11823 . Hi I'm very new to rust-analyzer and not sure how the review process are. Can somebody take a look at this PR? thanks!
2024-07-07fix: Fix parameter completions using macro expanded source rangesLukas Wirth-1/+2
2024-07-02squash.Shohei Wada-0/+44
2024-06-30Auto merge of #17520 - Veykril:slim-proc-macro-api, r=Veykrilbors-2/+0
internal: Cleanup proc-macro-srv some more
2024-06-30Remove inline `rust_2018_idioms, unused_lifetimes` lint warn, Cargo.toml ↵Lukas Wirth-2/+0
already enforces this
2024-06-30Auto merge of #17516 - kilpkonn:master, r=kilpkonnbors-1/+1
Quality of life improvements to term search Basically two things: - Allow optionally disabling "borrow checking" restrictions on term search code assists. Sometimes it is better to get invalid suggestions and fix borrow checking issues later... - Remove explicit generics in generated expressions. I find it quite rare that one writes `None::<T>` instead of `None`.
2024-06-30Do not explicit generics to generated expressionsTavo Annus-1/+1
2024-06-29fix: completions after async kwroife-8/+48
2024-06-24Fix term_search filtering enum variant generics incorrectlyLukas Wirth-1/+1
2024-06-24Auto merge of #17481 - roife:fix-issue-17480, r=Veykrilbors-2/+2
fix: pattern completions in let-stmt fix #17480. We can write `let S { a, b } = s;` or `let Some(x) = a else {}`, so it is reasonable to allow pattern completions in `LetStmt`.
2024-06-23fix: pattern completions in let-stmtroife-2/+2
2024-06-21Run `data_constructor` tactic only backwardsTavo Annus-4/+3
2024-06-19fix(completion): complete async keywordMaria José Solano-0/+21
2024-06-19Auto merge of #17449 - kilpkonn:assoc_const, r=Veykrilbors-0/+1
Term search: new tactic for associated item constants New tactic to cover some more exotic cases that started bothering me. Associated constants seem to be common in [axum](https://github.com/tokio-rs/axum/blob/806bc26e62afc2e0c83240a9e85c14c96bc2ceb3/examples/readme/src/main.rs#L53).
2024-06-18Add tactic for associated item constantsTavo Annus-0/+1
2024-06-16feat: add space after specific keywords in completionroife-24/+193
2024-06-13internal: Fix rustdoc warningsWilfred Hughes-1/+2
`cargo doc` generates a bunch of warnings on rust-analyzer. Fix all the bare URL and empty code block warnings.
2024-06-09Register virtual workspace Cargo.toml files in the VFSLukas Wirth-0/+1
2024-06-06chore: Prefer tracing span shorthand macrosWilfred Hughes-42/+31
2024-06-03Auto merge of #17315 - hamirmahal:style/simplify-string-interpolation, r=Veykrilbors-2/+2
style: simplify string interpolation
2024-06-02feat: Enable completions within derive helper attributesLukas Wirth-10/+76
2024-05-30style: simplify string interpolationHamir Mahal-2/+2
2024-05-22fix: ensure implied bounds from associated types are considered in autocompleteDavid Barsky-0/+41
2024-05-22SimplifyLukas Wirth-6/+1
2024-05-22internal: refactor `prefer_no_std`/`prefer_prelude` bools into a structDavid Barsky-66/+69
2024-05-22fix: Fix general find-path inconsistenciesLukas Wirth-7/+7
2024-05-13Auto merge of #17203 - kilpkonn:collapse_terms, r=Veykrilbors-5/+6
Fix OOM caused by term search The issue came from multi Cartesian product for exprs with many (25+) arguments, each having multiple options. The solution is two fold: ### Avoid blowing up in Cartesian product **Before the logic was:** 1. Find expressions for each argument/param - there may be many 2. Take the Cartesian product (which blows up in some cases) 4. If there are more than 2 options throw them away by squashing them to `Many` **Now the logic is:** 1. Find expressions for each argument/param and squash them to `Many` if there are more than 2 as otherwise we are guaranteed to also have more than 2 after taking the product which means squashing them anyway. 2. Take the Cartesian product on iterator 3. Start consuming it one by one 4. If there are more than 2 options throw them away by squashing them to `Many` (same as before) This is also why I had to update some tests as the expressions get squashed to many more eagerly. ### Use fuel to avoid long search times and high memory usage Now all the tactics use `should_continue: Fn() -> bool` to chech if they should keep iterating _(Similarly to chalk)_. This reduces the search times by a magnitude, for example from ~139ms/hole to ~14ms/hole for `ripgrep` crate. There are slightly less expressions found, but I think speed gain worth it for usability. Also note that syntactic hits decreases more because of squashing so you simple need to run search multiple times to get full terms. Also the worst case time (For example `nalgebra` crate cus it has tons of generics) has search times mostly under 200ms. Benchmarks on `ripgrep` crate Before: ``` Tail Expr syntactic hits: 291/1692 (17%) Tail Exprs found: 1253/1692 (74%) Term search avg time: 139ms ```` After: ``` Tail Expr syntactic hits: 239/1692 (14%) Tail Exprs found: 1226/1692 (72%) Term search avg time: 14ms ```
2024-05-08Make term search fuel configurableTavo Annus-1/+2
2024-05-07Use unit of work as fuel instead of timeTavo Annus-1/+1
2024-05-06Add time based fuel to term searchTavo Annus-1/+2
2024-05-06Collapse term search exprs before Cartesian product to avoid OOMTavo Annus-4/+3
2024-05-06Fix source_range for INT_NUMBER in completionroife-1/+46
2024-04-30fix: Tracing span names should match function namesWilfred Hughes-6/+6
When viewing traces, it's slightly confusing when the span name doesn't match the function name. Ensure the names are consistent. (It might be worth moving most of these to use #[tracing::instrument] so the name can never go stale. @davidbarsky suggested that is marginally slower, so I've just done the simple change here.)
2024-04-25Add inlay hints lifetime arg testsLukas Wirth-6/+6
2024-04-21Allow rust files to be used linkedProjectsLukas Wirth-0/+27778