about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-04-30braces around {self} in UseTree are not unnecessaryHarry Sarson-2/+53
Before this commit `UseTree::remove_unnecessary_braces` removed the braces around `{self}` in `use x::y::{self};` but `use x::y::self;` is not valid rust.
2024-04-30Auto merge of #17160 - dfireBird:fix_impl_trait, r=Veykrilbors-17/+102
Implement creating generics for impl traits in associated types Hopefully fix #17017
2024-04-30Use `RefCell::take`Lukas Wirth-1/+1
2024-04-30Auto merge of #17138 - Kohei316:generate-function-assist-for-new, r=Veykrilbors-26/+270
feature: Make generate function assist generate a function as a constructor if the generated function has the name "new" and is an asscociated function. close #17050 This PR makes `generate function assist` generate a function as a constructor if the generated function has the name "new" and is an asscociated function. If the asscociate type is a record struct, it generates the constructor like this. ```rust impl Foo { fn new() -> Self { Self { field_1: todo!(), field_2: todo!() } } } ``` If the asscociate type is a tuple struct, it generates the constructor like this. ```rust impl Foo { fn new() -> Self { Self(todo!(), todo!()) } } ``` If the asscociate type is a unit struct, it generates the constructor like this. ```rust impl Foo { fn new() -> Self { Self } } ``` If the asscociate type is another adt, it generates the constructor like this. ```rust impl Foo { fn new() -> Self { todo!() } } ```
2024-04-30Fix coercion of async blockmorine0122-1/+42
2024-04-30Make generate function assist generate a function as a constructor if the ↵morine0122-0/+492346
name of function is new
2024-04-30discard when the path is invalid utf8 symbol.Yu Zeng-1/+1
2024-04-29implement creating generics for impl traits in associated typesdfireBird-17/+102
2024-04-29Auto merge of #17144 - cbiffle:patch-1, r=Veykrilbors-2/+0
manual: remove suggestion of rust-project.json example The manual has been linking to the repo https://github.com/rust-analyzer/rust-project.json-example/tree/master This repo does not contain a rust-project.json, does not appear to have _ever_ contained a rust-project.json, and my bug report about this has gone untouched: https://github.com/rust-analyzer/rust-project.json-example/issues/4 Since I can't figure out an example, this commit removes the link pending better documentation.
2024-04-29Auto merge of #17157 - Veykril:retry, r=Veykrilbors-139/+131
fix: Don't retry position relient requests and version resolve data Fixes https://github.com/rust-lang/rust-analyzer/issues/15907 Fixes https://github.com/rust-lang/rust-analyzer/issues/14839 Fixes https://github.com/rust-lang/rust-analyzer/issues/16536
2024-04-29Retry inlay hint requestsLukas Wirth-2/+6
2024-04-28Work around completion retrying not fixing up offsetsLukas Wirth-10/+11
2024-04-28Don't retry position relient requests and version resolve dataLukas Wirth-129/+116
2024-04-27Auto merge of #17153 - Veykril:doc-comment-desugaring, r=Veykrilbors-52/+228
fix: Fix doc comment desugaring for proc-macros Fixes https://github.com/rust-lang/rust-analyzer/issues/16259
2024-04-27fix: Fix doc comment desugaring for proc-macrosLukas Wirth-52/+228
2024-04-27Auto merge of #17151 - Veykril:fix-cfg-trait-params, r=Veykrilbors-212/+250
fix: Fix attributes on generic parameters colliding in item tree Fixes https://github.com/rust-lang/rust-analyzer/issues/16141
2024-04-27fix: Fix attributes on generic parameters colliding in item treeLukas Wirth-212/+250
2024-04-27Auto merge of #17150 - RalfJung:josh-pull, r=lnicolabors-1/+13
internal: add no-new-root check to josh pull We probably don't want a second root to show up... Also clear the rust-version file while we are at it.
2024-04-27empty rust-version file, since no pull has happened yetRalf Jung-1/+0
2024-04-27add no-new-root check to josh pullRalf Jung-0/+13
2024-04-26fix: Fix source roots not always being created when necessaryLukas Wirth-28/+13
2024-04-26manual: remove suggestion of rust-project.json exampleCliff L. Biffle-2/+0
The manual has been linking to the repo https://github.com/rust-analyzer/rust-project.json-example/tree/master This repo does not contain a rust-project.json, does not appear to have _ever_ contained a rust-project.json, and my bug report about this has gone untouched: https://github.com/rust-analyzer/rust-project.json-example/issues/4 Since I can't figure out an example, this commit removes the link pending better documentation.
2024-04-26Show workspace info in the status barLukas Wirth-81/+168
2024-04-25Auto merge of #17135 - Veykril:inline-const-scope, r=Veykrilbors-34/+69
fix: Fix expression scopes not being calculated for inline consts
2024-04-25fix: Fix expression scopes not being calculated for inline constsLukas Wirth-34/+69
2024-04-25Auto merge of #17134 - Veykril:lt-err-display, r=Veykrilbors-586/+631
internal: Don't render unknown lifetimes when rendering generic args cc https://github.com/rust-lang/rust-analyzer/issues/17098
2024-04-25Auto merge of #17021 - roife:add-hover-limits-for-adts, r=Veykrilbors-97/+563
Support hovering limits for adts Fix #17009 1. Currently, r-a supports limiting the number of struct fields displayed when hovering. This PR extends it to support enum variants and union fields. Since the display of these three (ADTs) is similar, this PR extends 'hover_show_structFields' to 'hover_show_adtFieldsOrVariants'. 2. This PR also resolved the problem that the layout of ADT was not restricted by display limitations when hovering on the Self type. 3. Additionally, this PR changes the default value of display limitations to `10` (instead of the original `null`), which helps users discover this feature.
2024-04-25Add inlay hints lifetime arg testsLukas Wirth-8/+27
2024-04-25Auto merge of #16972 - joshka:cargo-run-runnable, r=Veykrilbors-2/+6
Make `cargo run` always available for binaries Previously, items for `cargo test` and `cargo check` would appear as in the `Select Runnable` quick pick that appears when running `rust-analyzer: Run`, but `run` would only appear as a runnable if a `main`` function was selected in the editor. This change adds `cargo run` as an always available runnable command for binary packages. This makes it easier to develop cli / tui applications, as now users can run application from anywhere in their codebase.
2024-04-24Drop unknown lifetimes when rendering generic argsLukas Wirth-578/+604
2024-04-24fix: move no_std check out of loopJosh McKinney-1/+2
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-3/+3
And suggest adding the `#[coroutine]` to the closure
2024-04-23different error code based on variantBao Zhiyuan-4/+14
2024-04-22Auto merge of #17102 - ↵bors-5/+33
davidbarsky:david/add-some-tracing-to-project-loading, r=lnicola chore: add some `tracing` to project loading I wanted to see what's happening during project loading and if it could be parallelized. I'm thinking maybe, but it's not this PR :)
2024-04-22chore: add some `tracing` to project loadingDavid Barsky-0/+493726
2024-04-21Auto merge of #17025 - lnicola:josh, r=lnicolabors-30/+248
internal: Use josh for subtree syncs
2024-04-21Auto merge of #16938 - Nilstrieb:dont-panic-tests, r=Veykrilbors-85/+235
Implement `BeginPanic` handling in const eval for #16935, needs some figuring out of how to write these tests correctly
2024-04-21Auto merge of #17115 - leviska:json_is_not_rust_better_names, r=Veykrilbors-18/+66
Try to generate more meaningful names in json converter I just found out about rust-analyzer json converter, but I think it would be more convenient, if names were more useful, like using the names of the keys. Let's look at some realistic arbitrary json: ```json { "user": { "address": { "street": "Main St", "house": 3 }, "email": "example@example.com" } } ``` I think, new generated code is much easier to read and to edit, than the old: ```rust // Old struct Struct1{ house: i64, street: String } struct Struct2{ address: Struct1, email: String } struct Struct3{ user: Struct2 } // New struct Address1{ house: i64, street: String } struct User1{ address: Address1, email: String } struct Root1{ user: User1 } ``` Ideally, if we drop the numbers, I can see it being usable just as is (may be rename root) ```rust struct Address{ house: i64, street: String } struct User{ address: Address, email: String } struct Root{ user: User } ``` Sadly, we can't just drop them, because there can be multiple fields (recursive) with the same name, and we can't just easily retroactively add numbers if the name has 2 instances due to parsing being single pass. We could ignore the `1` and add number only if it's > 1, but I will leave this open to discussion and right now made it the simpler way In sum, even with numbers, I think this PR still helps in readability
2024-04-21Support flychecking for cargo scriptsLukas Wirth-44/+61
2024-04-21Extract common fields out of ProjectWorkspace variantsLukas Wirth-332/+247
2024-04-21Allow rust files to be used linkedProjectsLukas Wirth-0/+494483
2024-04-21Use josh for subtree syncsLaurențiu Nicola-0/+494678
2024-04-21Peek for panic message in test outputLukas Wirth-12/+36
2024-04-20add test with multiple namesLev Iskandarov-1/+37
2024-04-20try to generate more meaningful namesLev Iskandarov-0/+494472
2024-04-20Merge commit '55d9a533b309119c8acd13061581b43ae8840823' into sync-from-raLaurențiu Nicola-3270/+6206
2024-04-20fix: remove space within `{}` when no fields in structroife-11/+35
2024-04-20Add hovering limitations support for variantsroife-48/+138
2024-04-19fix: add a separate setting for enum variantsroife-52/+183
2024-04-19Implement BeginPanic for mir evalLukas Wirth-7/+44