about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2025-08-26Merge pull request #20534 from A4-Tacks/tog-macro-delim-semicolonShoyu Vanilla (Flint)-3/+33
Fix ExprStmt delete semicolon for toggle_macro_delimiter
2025-08-26Merge pull request #20509 from A4-Tacks/fix-move-guard-to-arm-indentShoyu Vanilla (Flint)-13/+57
Fix indent for move_guard_to_arm_body
2025-08-26Merge pull request #20520 from ChayimFriedman2/reborrowShoyu Vanilla (Flint)-5/+88
feat: Add an option to remove reborrows from adjustment inlay hints
2025-08-26Merge pull request #20537 from ChayimFriedman2/new-solver-normalizeShoyu Vanilla (Flint)-6/+45
fix: Normalize all types when finishing inference
2025-08-25Merge pull request #20423 from ShoyuVanilla/import-2024Chayim Refael Friedman-50/+219
Make import sorting order follow 2024 edition style
2025-08-25Merge pull request #20528 from ShoyuVanilla/nightly-zscriptChayim Refael Friedman-0/+1
fix: Masquerade as nightly cargo when invoking flycheck with `-Zscript`
2025-08-25Don't map Chalk's `Normalize` to next solver's `NormalizesTo`Chayim Refael Friedman-6/+16
`NormalizesTo` is a private predicate that should not be used outside the solver. For normalization, rustc uses `AliasRelate`, so replace with that.
2025-08-25Normalize all types when finishing inferenceChayim Refael Friedman-0/+29
The new solver does not eagerly normalize, but things after inference expect types to be normalized. rustc does the same. Also, I'm afraid other things in r-a don't expect results of the solver to be unnormalized. We'll need to handle that.
2025-08-25Cache trait solving across queries in the same revisionChayim Refael Friedman-66/+140
Caching trait solving can do a lot to speed. Unfortunately it also consume a huge amount of memory. Therefore, as part of the migration to the new solver Jack Huey disabled caching of trait solving (he made the query transparent). The PR proposes a middle ground: do cache trait solving, but only for the same revision. This allows us to be safe because during a revision the inputs cannot change. The result is hopefully much better performance to features that tend to do a bulk of trait solving, and also repeat the same query (e.g. inference then IDE features). There is another limitation: results are only cached in the same thread, to remove the need for synchronization which will be expensive. More measurements are required to check whether it's better to use a synchronized global cache, or maybe stay with a thread-local cache but batch multiple feature requests (highlighting, inlay hints etc.) of the same file to the same thread. Alongside the actual cache we store the revision, because we need to verify it (we can't eagerly clear caches when incrementing the revision), and also the address of the db to prevent multiple dbs from interleaving (this is mostly relevant in tests, although injected highlighting also uses a new db, therefore maybe it's better to move it to a separate thread). This "games" analysis-stats to both be way faster and use way more memory; the former is because analysis-stats doesn't increment revisions, therefore all queries share the cache and hit ratio is way too good, the latter is because analysis-stats doesn't increment revisions and therefore the cache isn't cleared. Both are not representative of a typical IDE scenario.
2025-08-25Fix ExprStmt delete semicolon for toggle_macro_delimiterA4-Tacks-3/+33
2025-08-24Fix rust-analyzer-contributors referenceEmmanuel Ferdman-1/+1
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
2025-08-24fix: Masquerade as nightly cargo when invoking flycheck with `-Zscript`Shoyu Vanilla-0/+1
2025-08-24Merge pull request #20523 from ChayimFriedman2/opaque-genericsShoyu Vanilla (Flint)-43/+54
fix: Fix opaque generics
2025-08-24Fix opaque genericsChayim Refael Friedman-43/+54
The parent generics were incorrectly not considered for TAIT. I'm not convinced we should follow rustc here, also there are items (opaques) with more than 1 parent (opaque -> fn/type alias -> impl/trait) and I'm not sure we properly account for that in all places, but for now I left it as-is. Also fix a bug where lifetimes' indices were incorrect when there is a self param (they started from 0 instead of 1).
2025-08-24Merge pull request #20507 from A4-Tacks/suggest-return-exprChayim Refael Friedman-3/+54
Add ReturnExpr completion suggest
2025-08-24Add ReturnExpr completion suggestA4-Tacks-3/+54
2025-08-24Merge pull request #20512 from A4-Tacks/arith-op-not-on-selectedChayim Refael Friedman-1/+16
replace_arith_op not applicable on selected
2025-08-24replace_arith_op not applicable on selectedA4-Tacks-1/+16
2025-08-24Add an option to remove reborrows from adjustment inlay hintsChayim Refael Friedman-5/+88
Reborrows are consecutive deref then ref. Make it the default because reborrows are mostly useless to the programmer. Also rename `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "reborrow"` to `rust-analyzer.inlayHints.expressionAdjustmentHints.enable: "borrows"`, as it's not about reborrows but about any ref/deref and it's confusing with the new setting.
2025-08-23Merge pull request #20513 from A4-Tacks/let-in-let-chainChayim Refael Friedman-3/+17
Add let in let-chain completion support
2025-08-23Merge pull request #20518 from A4-Tacks/fix-else-in-in-letChayim Refael Friedman-3/+355
Fix `else` completion in `let _ = if x {} $0`
2025-08-23Merge pull request #20511 from A4-Tacks/fix-conv-int-lit-on-selectedChayim Refael Friedman-2/+8
convert_integer_literal not on selected
2025-08-23Fix `else` completion in `let _ = if x {} $0`A4-Tacks-3/+355
2025-08-22Add let in let-chain completion supportA4-Tacks-3/+17
Example --- ```rust fn f() { if true && $0 {} } ``` -> ```rust fn f() { if true && let $1 = $0 {} } ```
2025-08-22fix: convert_integer_literal not on selectedA4-Tacks-2/+8
`convert_integer_literal` can only convert the first literal, it is not reasonable to apply it when selected Example --- ```rust fn main() { $01+1$0; } ``` **Assist old outputs**: ``` Convert 1 to 0b1 Convert 1 to 0o1 Convert 1 to 0x1 Replace arithmetic with call to checked_* Replace arithmetic with call to saturating_* Replace arithmetic with call to wrapping_* Extract into variable Extract into constant Extract into static Extract into function ``` **Assist this PR outputs**: ``` Replace arithmetic with call to checked_* Replace arithmetic with call to saturating_* Replace arithmetic with call to wrapping_* Extract into variable Extract into constant Extract into static Extract into function ```
2025-08-22Fix panic in syntax_highlightingLukas Wirth-27/+29
2025-08-22Fix indent for move_guard_to_arm_bodyA4-Tacks-13/+57
Input: ```rust fn main() { match 92 { x $0if true && true && true => { { false } }, _ => true } } ``` Old output: ```rust fn main() { match 92 { x => if true && true && true { { { false } } }, _ => true }; } ``` This PR fixed: ```rust fn main() { match 92 { x => if true && true && true { { { false } } }, _ => true } } ```
2025-08-21Merge pull request #20504 from ShoyuVanilla/ethereum-madnessChayim Refael Friedman-1/+58
fix: Infinite recursion while lowering assoc type bounds from supertraits
2025-08-22fix: Infinite recursion while lowering assoc type bounds from supertraitsShoyu Vanilla-1/+58
2025-08-21Remove unnecessary `salsa::attach()` callsChayim Refael Friedman-13/+7
2025-08-21Attach the DB when mapping the result of `world_symbols()`Chayim Refael Friedman-6/+9
We call `try_to_nav()` there.
2025-08-21Attach the DB in symbol queriesChayim Refael Friedman-12/+16
2025-08-19Optimize iconlumiscosity-0/+0
Losslessly optimizes the icon with: ``` oxipng -o max -a -s oxipng -o max --zopfli -a -s ```
2025-08-19user facing code should use not use `PostAnalysis`lcnr-2/+2
2025-08-18Auto-attach database in `Analysis` callsLukas Wirth-101/+137
2025-08-18Merge pull request #20442 from ChayimFriedman2/unqualifyShoyu Vanilla (Flint)-1/+122
fix: Only import the item in "Unqualify method call" if needed
2025-08-17Remove fixme commentjackh726-1/+0
2025-08-17Add FIXME in named_associated_type_shorthand_candidatesjackh726-0/+3
2025-08-17Add fixme to associated_ty_item_boundsjackh726-0/+1
2025-08-17Update fixmejackh726-1/+1
2025-08-17Add new_empty_tuplejackh726-2/+7
2025-08-17Remove a bunch of stuff from chalk_dbjackh726-513/+80
2025-08-17Use impl_trait_ns in Impl::trait_refjackh726-4/+1
2025-08-17Switch TraitRef in hir::TraitRef to next solverjackh726-41/+288
2025-08-17Replace layout_of_ty with layout_of_ty_nsjackh726-73/+75
2025-08-17Remove all_super_traits in dyn_compatibilityjackh726-7/+33
2025-08-17Switch generics_require_sized_self to next solverjackh726-25/+17
2025-08-17Convert more of dyn_compatibility to next-solverjackh726-153/+130
2025-08-17Switch associated_type_shorthand_candidates to lower_nextsolverjackh726-159/+197
2025-08-17Cleanup assoc_type_shorthand_candidatesjackh726-14/+13