| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
6105: Fix path comparison not comparing paths correctly with unequal lengths r=matklad a=Veykril
~~This PR includes the commit from #6102 there as I found a bug while writing that(so either merging this or both in order works) so I included a test there already which was just ignored.~~ This PR fixes that, basically inserting imports didn't consider path length for equality, so depending on the order it might insert the path before or after another import if they only differ in segment length.
~~Diff without the commit of #6102 https://github.com/rust-analyzer/rust-analyzer/commit/2d90d3937d71f9a00f3d44c15b20679215311637~~
Co-authored-by: Lukas Wirth <[email protected]>
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | |
| | |
| | | |
6104: Minor clippy performance suggestions r=matklad a=kjeremy
Co-authored-by: kjeremy <[email protected]>
|
| |/ |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| | |
6019: Remove make::path_from_text r=matklad a=Veykril
This removes the `make::path_from_text` function, which according to a note should've been private. I removed it since it didn't really serve a purpose as it was simply wrapping `make::ast_from_text`.
Co-authored-by: Lukas Wirth <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
member assist (if braces are missing from an impl def then there is no associated item list in the AST)
|
|\ \
| |/
|/|
| |
| |
| |
| |
| |
| |
| | |
5989: Rewrite import merging r=jonas-schievink a=Veykril
Rewrites how import merging is being handled. It is now a recursive function to properly handle merging of intermediate levels in the import trees. With this ordering the imports is also now possible tho it doesn't quite order it the same way as `rustfmt` does yet, namely it orders lowercase identifiers after uppercase identifiers as that is the standard character order that rust uses. This also fixes a few weird behaviors that were visible in some of the `replace_qualified_name_with_use.rs` tests.
This really took longer than I was hoping for, fighting with import trees is quite the exhausting task 😅
Co-authored-by: Lukas Wirth <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
5955: Remove merge import code duplication r=jonas-schievink a=Veykril
This removes the code duplication caused by #5935, this also allows the assist to merge imports that have equal visibility and prevents merges of unequal visibility. This PR also fixes an iteration mistake in the mentioned PR:
Turns out I made a mistake when writing the `segment_iter` function, I was assuming that the `children` of a path will just be the segments, which is obviously not the case. This also brings insertion order of shorter paths in line with how `rustfmt` orders them.
Co-authored-by: Lukas Wirth <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| |
| | |
5940: Implement "Replace `impl Trait` function argument with the named generic" assist. r=matklad a=alekseysidorov
Fixes #5085
Co-authored-by: Aleksei Sidorov <[email protected]>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
* stick to trivial factory functions in make
* compress the logic for inverting Option/Result
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
5733: Fix expand glob import bugs r=matklad a=unexge
fixes https://github.com/rust-analyzer/rust-analyzer/issues/5709
TODOs:
- [x] Incorrect node replacing
<details>
<summary>Details</summary>
```rust
use crate::{
body::scope::{ExprScopes, ScopeId},
body::Body,
builtin_type::BuiltinType,
db::DefDatabase,
expr::{ExprId, PatId},
generics::GenericParams,
item_scope::{BuiltinShadowMode, BUILTIN_SCOPE},
nameres::CrateDefMap,
path::*<|>,
per_ns::PerNs,
visibility::{RawVisibility, Visibility},
AdtId, AssocContainerId, ConstId, ContainerId, DefWithBodyId, EnumId, EnumVariantId,
FunctionId, GenericDefId, HasModule, ImplId, LocalModuleId, Lookup, ModuleDefId, ModuleId,
StaticId, StructId, TraitId, TypeAliasId, TypeParamId, VariantId,
};
```
becames
```rust
use crate::{PathKind, name, name, ModPath};
```
</details>
- [x] Ignoring visibility
<details>
<summary>Details</summary>
```rust
mod foo {
mod bar {
pub struct Bar;
}
}
use foo::bar::*;
fn baz(bar: Bar) {}
```
becames
```rust
mod foo {
mod bar {
pub struct Bar;
}
}
use foo::bar::Bar;
fn baz(bar: Bar) {}
```
although mod `bar` is private
</details>
- [x] Eating attributes
Co-authored-by: unexge <[email protected]>
|