about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-05-24Add cwd to CargoRunnableroife-0/+14
2024-05-23Auto merge of #17287 - Veykril:sysroot-encode-empty, r=Veykrilbors-361/+277
Allow sysroots to only consist of the source root dir Fixes https://github.com/rust-lang/rust-analyzer/issues/17159 This PR encodes the `None` case of an optional sysroot into `Sysroot` itself. This simplifies a lot of things and allows us to have sysroots that consist of nothing, only standard library sources, everything but the standard library sources or everything. This makes things a lot more flexible. Additionally, this removes the workspace status bar info again, as it turns out that that can be too much information for the status bar to handle (this is better rendered somewhere else, like in the status view).
2024-05-23Allow sysroots to only consist of the source root dirLukas Wirth-361/+277
2024-05-23Auto merge of #17284 - Veykril:doc-links, r=Veykrilbors-3/+7
fix: Use correct toolchain channel when generating builtin type doc links
2024-05-23Use correct toolchain channel when generating builtin type doc linksLukas Wirth-3/+7
2024-05-23Auto merge of #17174 - Kohei316:fix-infer-async-block-with-tail-return-expr, ↵bors-1/+43
r=Veykril Fix: infer type of async block with tail return expr Fixes #17106 The `infer_async_block` method calls the `infer_block` method internally, which returns the never type without coercion when `tail_expr` is `None` and `ctx.diverges` is `Diverges::Always`.This is the reason for the bug in this issue. https://github.com/rust-lang/rust-analyzer/blob/cfce2bb46da62950a8b70ddb0b2a12332da1b1e1/crates/hir-ty/src/infer/expr.rs#L1411-L1413 This PR solves the bug by adding a process to coerce after calling `infer_block` method. This code passes all the tests, including tests I added for this isuue, however, I am not sure if this solution is right. I think that this solution is an ad hoc solution. So, I would appreciate to have your review. I apologize if I'm off the mark, but `infer_async_block` method should be rewritten to share code with the process of infering type of `expr::Closure` instead of the `infer_block` method. That way it will be closer to the infer process of rustc.
2024-05-23Update crates/hir-ty/src/infer/expr.rsLukas Wirth-0/+1
2024-05-23Auto merge of #17140 - harrysarson:harry-unused-self, r=Veykrilbors-2/+53
handle {self} when removing unused imports Fixes #17139 On master ```rs mod inner { pub struct X(); pub struct Y(); } mod z { use super::inner::{self, X}$0; fn f() { let y = inner::Y(); } } ``` becomes ```rs mod inner { pub struct X(); pub struct Y(); } mod z { use super::inner:self; fn f() { let y = inner::Y(); } } ``` with this fix it instead becomes ``` ```rs mod inner { pub struct X(); pub struct Y(); } mod z { use super::inner; fn f() { let y = inner::Y(); } } ```
2024-05-22Fix: clippyJonathan Kelley-1/+1
2024-05-22Allow searching with prefixJonathan Kelley-1/+6
2024-05-22Feat: hide double underscored symbols from symbol searchJonathan Kelley-1/+32
2024-05-22Auto merge of #17270 - ↵bors-2/+53
davidbarsky:david/fix-completions-from-associated-types, r=Veykril fix: ensure implied bounds from associated types are considered in autocomplete closes: #16989 rust-analyzer needs to consider implied bounds from associated types in order to get all methods suggestions people expect. A pretty easy way to do that is to keep the `candidate_trait_id`'s receiver if it matches `TyFingerprint::Unnameable`. When benchmarking this change, I didn't notice a meaningful difference in autocomplete latency. (`TyFingerprint::Unnameable` corresponds to `TyKind::AssociatedType`, `TyKind::OpaqueType`, `TyKind::FnDef`, `TyKind::Closure`, `TyKind::Coroutine`, and `TyKind::CoroutineWitness`.)
2024-05-22fix: ensure implied bounds from associated types are considered in autocompleteDavid Barsky-2/+53
2024-05-22Auto merge of #17251 - roife:fix-issue-17057, r=Veykrilbors-6/+71
fix: resolve extern prelude for local mods in block modules fix https://github.com/rust-lang/rust-analyzer/issues/17057, https://github.com/rust-lang/rust-analyzer/issues/17032. We should use `ModuleOrigin` to check if the current module is a pseudo-module introduced by blocks (where names might be shadowed), rather than checking `block_def_map`.
2024-05-22SimplifyLukas Wirth-16/+11
2024-05-22internal: refactor `prefer_no_std`/`prefer_prelude` bools into a structDavid Barsky-351/+304
2024-05-23fix: check pseudo-block by local_id instead of ModuleOriginroife-5/+3
2024-05-22Auto merge of #17277 - Veykril:find-path-fixes, r=Veykrilbors-346/+647
fix: Various find path fixes Fixes https://github.com/rust-lang/rust-analyzer/issues/17271
2024-05-22Auto merge of #17279 - Veykril:format_args-escape, r=Veykrilbors-6/+18
fix: Fix format_args lowering passing incorrect parameters to `rustc_parse_format`
2024-05-22fix: Fix format_args lowering passing incorrect parameters to rustc_parse_formatLukas Wirth-6/+18
2024-05-22Auto merge of #17248 - mladedav:dm/delay-clear, r=Veykrilbors-1/+10
Clear diagnostics only after new ones were received Closes #15934 This adds a flag inside the global state which controls when old diagnostics are cleared. Now, old diagnostics should be cleared only after at least one new diagnostic is available.
2024-05-22Auto merge of #17268 - Veykril:signatures, r=Veykrilbors-226/+388
feat: More callable info With this PR we retain more info about callables other than functions, allowing for closure parameter type inlay hints to be linkable as well as better signature help around closures and `Fn*` implementors.
2024-05-22Update assists test fixturesLukas Wirth-29/+18
2024-05-22expectify find_path testsLukas Wirth-184/+447
2024-05-22fix: Fix general find-path inconsistenciesLukas Wirth-193/+242
2024-05-21test: add tests for extern preludes resolving in local modsroife-0/+62
2024-05-19Bump rustc cratesLaurențiu Nicola-15/+38
2024-05-19Merge from rust-lang/rustLaurențiu Nicola-11/+10
2024-05-19Preparing for merge from rust-lang/rustLaurențiu Nicola-0/+1
2024-05-18Show fn traits in signature info for trait implementorsLukas Wirth-68/+196
2024-05-18Enable linked locations for closure param inlay hintsLukas Wirth-10/+5
2024-05-18Render closure fn trait kind in siganture helpLukas Wirth-27/+79
2024-05-18Allow hir::Param to refer to other entity params aside from functionsLukas Wirth-118/+114
2024-05-18Update builtin tool listLukas Wirth-25/+16
2024-05-18implement assist to switch between doc and normal commentsLuuk Wester-0/+662
2024-05-17fix: resolve extern prelude for local mods in block modulesroife-7/+12
2024-05-17Correct Neovim 0.10 inlay hints config exampleAdam Szkoda-1/+1
2024-05-17Clear diagnostics only after new ones were receivedDavid Mládek-1/+10
2024-05-16Auto merge of #17243 - Veykril:static-lt-hir, r=Veykrilbors-40/+70
internal: Add StaticLifetime to hir API
2024-05-16internal: Add StaticLifetime to hir APILukas Wirth-40/+70
2024-05-15Fix typosblyxyas-5/+5
2024-05-15Use actions/cache again in metrics CILukas Wirth-11/+15
2024-05-15Auto merge of #17239 - Veykril:metrics-caching, r=Veykrilbors-3/+3
internal: Key ignoring the job-id in metrics cache
2024-05-15Key ignoring the job-id in metrics cacheLukas Wirth-3/+3
2024-05-15Auto merge of #17238 - Veykril:metrics-caching, r=Veykrilbors-17/+13
Fix metrics workflow not actually updating the toolchain The install won't persist across jobs
2024-05-15Fix metrics workflow not actually updating the toolchainLukas Wirth-17/+13
2024-05-15Auto merge of #17235 - Veykril:metrics-caching, r=Veykrilbors-31/+14
internal: Use Swatinem/rust-cache for metrics CI Current metrics caching uses a base cache action, whereas I think the one we use for general ci works here as well. Saw this while noticing that our metrics CI is broken as it for some reason uses an outdated rust stable? (unsure why that is)
2024-05-15Bump Swatinem/rust-cacheLukas Wirth-2/+2
2024-05-15Use Swatinem/rust-cache for metrics CILukas Wirth-29/+12
2024-05-14Auto merge of #17232 - Veykril:build-scripts-keep-going, r=Veykrilbors-9/+16
fix: Don't emit --keep-going for custom build script commands Might be the cause for https://github.com/rust-lang/rust-analyzer/issues/17231