about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-09-03Auto merge of #18031 - roife:suggest-name-in-completion, r=Veykrilbors-15/+142
feat: Suggest name in completion for let_stmt and fn_param fix #17780 1. Refactor: move `ide_assist::utils::suggest_name` to `ide-db::syntax_helpers::suggest_name` for reuse. 2. When completing `IdentPat`, detecte if the current node is a `let_stmt` or `fn_param`, and suggesting a new name based on the context.
2024-09-02misc fixesDropDemBits-26/+20
2024-09-02handle replace_with_many and replace_allDropDemBits-16/+97
2024-09-02support replacing root nodeDropDemBits-14/+200
2024-09-02properly sort changes by depth to sort between nodes that have the same ↵DropDemBits-4/+19
start range
2024-09-02fix insert ranges not being excluded from disjointnessDropDemBits-7/+12
2024-09-02support insert{_all}DropDemBits-11/+88
2024-09-02propagate annotations to mapped elementsDropDemBits-52/+168
2024-09-03tests: suggesting names in completions for let_stmt and fn_paramroife-0/+73
2024-09-03feat: suggest name in let_stmt and fn_paramroife-2/+53
2024-09-03refactor: move ide_assist::utils::suggest_name to ide-dbroife-13/+16
2024-09-03feat: Implement cast typechecksShoyu Vanilla-93/+1614
2024-09-02Merge some stringsLaurențiu Nicola-6/+3
2024-09-02Avoid Option::is_none_or for a whileLaurențiu Nicola-1/+1
2024-09-02Auto merge of #18028 - Veykril:lifetime-hints-panic, r=Veykrilbors-1/+19
fix: lifetime hint panic in non generic defs
2024-09-02fix: lifetime hint panic in non generic defsLukas Wirth-1/+19
2024-09-02Auto merge of #18016 - IvarWithoutBones:wrap-return-ty-local-result, r=Veykrilbors-16/+294
fix: use Result type aliases in "Wrap return type in Result" assist This commit makes the "Wrap return type in Result" assist prefer type aliases of standard library type when the are in scope, use at least one generic parameter, and have the name `Result`. The last restriction was made in an attempt to avoid false assumptions about which type the user is referring to, but that might be overly strict. We could also do something like this, in order of priority: * Use the alias named "Result". * Use any alias if only a single one is in scope, otherwise: * Use the standard library type. This is easy to add if others feel differently that is appropriate, just let me know. Fixes #17796
2024-09-02Adjust completions scoringLukas Wirth-50/+46
2024-09-02Simplify CompletionRelevanceLukas Wirth-90/+85
2024-09-02chore: fix some commentscuishuang-4/+4
Signed-off-by: cuishuang <imcusg@gmail.com>
2024-09-02handle merging two syntax editors togetherDropDemBits-14/+39
2024-09-02elaborate SyntaxEdit commentsDropDemBits-6/+17
2024-09-02wip: new syntax tree editorDropDemBits-0/+723
2024-09-02fix: use Result type aliases in "Wrap return type in Result" assistIvar Scholten-16/+294
This commit makes the "Wrap return type in Result" assist prefer type aliases of standard library type when the are in scope, use at least one generic parameter, and have the name "Result". The last restriction was made in an attempt to avoid false assumptions about which type the user is referring to, but that might be overly strict. We could also do something like this, in order of priority: * Use the alias named "Result". * Use any alias if only a single one is in scope, otherwise: * Use the standard library type. This is easy to add if others feel differently that is appropriate, just let me know.
2024-09-01Auto merge of #17967 - Veykril:mbe-tests, r=Veykrilbors-76/+288
internal: Lay basic ground work for standalone mbe tests Most of our mbe hir-def tests don't actually do anything name res relevant, we can (and should) move those down the stack into `mbe/hir-expand`.
2024-09-01internal: Lay basic ground work for standalone mbe testsLukas Wirth-52/+233
2024-09-01Auto merge of #17985 - riverbl:explicit-enum-discriminant, r=Veykrilbors-3/+258
Add explicit enum discriminant assist Add assist for adding explicit discriminants to all variants of an enum. Closes #17798.
2024-09-01minor: Reduce friction for updating minicoreLukas Wirth-27/+58
2024-09-01Auto merge of #17737 - hyf0:hyf_32089420384, r=Veykrilbors-21/+284
feat(ide-completion): extra sugar auto-completion `async fn ...` in `impl trait` for `async fn in trait` that's defined in desugar form Solves #17719. --- Preview <img width="670" alt="image" src="https://github.com/user-attachments/assets/64ccef84-4062-4702-8760-89220585f422"> <img width="540" alt="image" src="https://github.com/user-attachments/assets/d22637f9-d531-43b2-a9f1-cd40a002903a"> <img width="631" alt="image" src="https://github.com/user-attachments/assets/21cd2142-bb8e-4493-9ac7-e6a9e7076904">
2024-09-01Complete desugared and resugared async fn in trait implsLukas Wirth-87/+267
2024-09-01feat(ide-completion): extra sugar auto-completion `async fn ...` in `impl ↵Yunfei-1/+84
trait` for `async fn in trait` that's defined in desugar form
2024-09-01minor: Downgrade cyclic deps error to warningLukas Wirth-48/+8
2024-09-01Auto merge of #18015 - ChayimFriedman2:flip-comma-attribute, r=Veykrilbors-3/+61
Handle attributes correctly in "Flip comma" Attributes often contain path followed by a token tree (e.g. `align(2)`), and the previous code handled them as two separate items, which led to results such as `#[repr(alignC, (2))]`. An alternative is to just make the assist unavailable in attributes, like we do in macros. But contrary to macros, attributes often have a fixed form, so this seems useful. Fixes #18013.
2024-09-01Rollup merge of #129207 - GrigorenkoPV:elided-is-named, r=cjgillotMatthias Krüger-3/+3
Lint that warns when an elided lifetime ends up being a named lifetime As suggested in https://github.com/rust-lang/rust/issues/48686#issuecomment-1817334575 Fixes #48686
2024-09-01Handle attributes correctly in "Flip comma"Chayim Refael Friedman-3/+61
Attributes often contain path followed by a token tree (e.g. `align(2)`, and the previous code handled them as two separate items, which led to results such as `#[repr(alignC, (2))]`. An alternative is to just make the assist unavailable in attributes, like we do in macros. But contrary to macros, attributes often have a fixed form, so this seems useful.
2024-09-01Provide an option to hide deprecated items from completionChayim Refael Friedman-1/+26
2024-08-31Fix `elided_named_lifetimes` in codePavel Grigorenko-3/+3
2024-08-31Rename function and remove flag argumentriverbl-9/+21
Use less confusing name for function, duplicate logic rather than taking flag as argument.
2024-08-31Update generated doctestsriverbl-0/+27
Update generated doctests, change unit test to be different to doctest.
2024-08-31Add explicit enum discriminant assistriverbl-5/+221
Add assist for adding explicit discriminants to all variants of an enum.
2024-08-31Auto merge of #18012 - Veykril:inlay-hints-lt, r=Veykrilbors-57/+59
fix: Fix lifetime elision inlay hints breaking for ranged requests
2024-08-31fix: Fix lifetime elision inlay hints breaking for ranged requestsLukas Wirth-57/+59
2024-08-31Auto merge of #18011 - Wilfred:op_queue_doc_comments, r=Veykrilbors-0/+11
internal: Add doc comments to OpQueue I spent a while debugging some OpQueue behaviours and found the API slightly confusing, so I've added doc comments to clarify what each OpQueue method does.
2024-08-31Auto merge of #17945 - alibektas:ratoml_categorization, r=alibektasbors-644/+607
Recategorize config classes
2024-08-31Apply changes, fix path information in a comment in config.rsAli Bektas-19/+4
2024-08-30Auto merge of #18010 - Veykril:inlay-hints-lt, r=Veykrilbors-358/+597
feat: Support fn-ptr and fn-path types for lifetime elision hints All still syntax based unfortunately but that won't change for quite a while
2024-08-30Support fn-ptr and fn-path types for lifetime elision hintsLukas Wirth-358/+597
2024-08-30Auto merge of #18009 - Veykril:reformat-no-rustup, r=Veykrilbors-22/+26
fix: do not assume rustup is installed in xtask codegen take 2 7d9e4fcc07e5de94e37b73436147cdbbaa35dbdc broke this on rustup toolchains, the `cmd` command is trying to be too smart here
2024-08-30Allow xtask::reformat to work without rustupLukas Wirth-18/+26
2024-08-30Revert "fix: do not assume rustup is installed in xtask codegen"Lukas Wirth-19/+15
This reverts commit 7d9e4fcc07e5de94e37b73436147cdbbaa35dbdc.