| Age | Commit message (Collapse) | Author | Lines |
|
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.
|
|
|
|
|
|
|
|
start range
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fix: lifetime hint panic in non generic defs
|
|
|
|
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
|
|
|
|
|
|
Signed-off-by: cuishuang <imcusg@gmail.com>
|
|
|
|
|
|
|
|
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.
|
|
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`.
|
|
|
|
Add explicit enum discriminant assist
Add assist for adding explicit discriminants to all variants of an enum.
Closes #17798.
|
|
|
|
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">
|
|
|
|
trait` for `async fn in trait` that's defined in desugar form
|
|
|
|
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.
|
|
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
|
|
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.
|
|
|
|
|
|
Use less confusing name for function, duplicate logic rather than taking flag as argument.
|
|
Update generated doctests, change unit test to be different to doctest.
|
|
Add assist for adding explicit discriminants to all variants of an enum.
|
|
fix: Fix lifetime elision inlay hints breaking for ranged requests
|
|
|
|
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.
|
|
Recategorize config classes
|
|
|
|
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
|
|
|
|
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
|
|
|
|
This reverts commit 7d9e4fcc07e5de94e37b73436147cdbbaa35dbdc.
|