about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-10-14chore: rename salsa to ra_salsaDavid Barsky-538/+540
2024-10-14Auto merge of #18291 - roife:fix-issue-18212, r=Veykrilbors-20/+141
feat: respect references.exclude_tests in call-hierarchy close #18212 ### Changes 1. feat: respect `references.exclude_tests` in call-hierarchy 2. Modified the description of `references.exclude_tests`
2024-10-14Auto merge of #18275 - darichey:fix-test-case-hang, r=Veykrilbors-2/+5
Skip #[test_case] expansion Fixes #18274, although I don't fully understand if this is the best fix (it's not clear to me why this didn't cause issues before https://github.com/rust-lang/rust-analyzer/pull/18085).
2024-10-14Auto merge of #18265 - kouhe3:master, r=Veykrilbors-0/+30
Add support for LLDB-DAP
2024-10-14Auto merge of #18252 - ShoyuVanilla:issue-15799, r=Veykrilbors-1/+37
fix: Do not consider mutable usage of deref to `*mut T` as deref_mut Fixes #15799 We are doing some heuristics for deciding whether the given deref is deref or deref_mut here; https://github.com/rust-lang/rust-analyzer/blob/5982d9c420d0dc90739171829f0d2e9c80d98979/crates/hir-ty/src/infer/mutability.rs#L182-L200 But this heuristic is erroneous if we are dereferencing to a mut ptr and normally those cases are filtered out here as builtin; https://github.com/rust-lang/rust-analyzer/blob/5982d9c420d0dc90739171829f0d2e9c80d98979/crates/hir-ty/src/mir/lower/as_place.rs#L165-L177 Howerver, this works not so well if the given dereferencing is double dereferencings like the case in the #15799. ```rust struct WrapPtr(*mut u32); impl core::ops::Deref for WrapPtr { type Target = *mut u32; fn deref(&self) -> &Self::Target { &self.0 } } fn main() { let mut x = 0u32; let wrap = WrapPtr(&mut x); unsafe { **wrap = 6; } } ``` Here are two - outer and inner - dereferences here, and the outer dereference is marked as deref_mut because there is an assignment operation. And this deref_mut marking is propagated into the inner dereferencing. In the later MIR lowering, the outer dereference is filtered out as it's expr type is `*mut u32`, but the expr type in the inner dereference is an ADT, so this false-mutablility is not filtered out. This PR cuts propagation of this false mutablilty chain if the expr type is mut ptr. Since this happens before the resolve_all, it may have some limitations when the expr type is determined as mut ptr at the very end of inferencing, but I couldn't find simple fix for it 🤔
2024-10-14Auto merge of #18242 - Veykril:veykril/push-tnynzqsmtnqw, r=Veykrilbors-185/+174
internal: Don't resolve extern crates in import fix point resolution The fix point loop won't progress them given the potential extern crate candidates are set up at build time.
2024-10-14Auto merge of #18229 - mrkajetanp:rustfmt-path, r=Veykrilbors-3/+3
fix: Join rustfmt overrideCommand with project root When providing a custom rustfmt command, join it with the project root instead of the workspace root. This fixes rust-analyzer getting the wrong invocation path in projects containing subprojects. This makes the behaviour consistent with how a custom path provided in rust-analyzer.procMacro.server behaves already. Resolves issue #18222
2024-10-14Auto merge of #18217 - ChayimFriedman2:cast-unknown-ptr, r=Veykrilbors-25/+48
fix: Comment out cast checks for unknown ptr kind Just like we don't check for types containing unknown. Fixes #18214. See also https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/Another.20case.20of.20.2318064.3F.
2024-10-14Auto merge of #18152 - CryZe:highlight-async-block-exit-points, r=Veykrilbors-73/+101
feat: Highlight exit points of async blocks Async blocks act similar to async functions in that the await keywords are related, but also act like functions where the exit points are related. Fixes #18147
2024-10-14Auto merge of #18226 - SabrinaJewson:fix-impl-use, r=Veykrilbors-1/+29
Correctly parse `use` in generic parameters Fixes: #18225
2024-10-13feat: respect references.exclude_tests in call-hierarchyroife-20/+141
2024-10-12Auto merge of #18281 - darichey:async-subprocess, r=lnicolabors-32/+83
Run subprocesses async in vscode extension Extensions should not block the vscode extension host. Replace uses of `spawnSync` with `spawnAsync`, a convenience wrapper around `spawn`. These `spawnSync`s are unlikely to cause a real issue in practice, because they spawn very short-lived processes, so we aren't blocking for very long. That said, blocking the extension host is poor practice, and if they _do_ block for too long for whatever reason, vscode becomes useless.
2024-10-12Fix panic when json project has relative buildfile pathsDavid Richey-1/+1
2024-10-10Run subprocesses async in vscode extensionDavid Richey-32/+83
2024-10-09Skip #[test_case] expansionDavid Richey-2/+5
2024-10-09Auto merge of #18245 - boattime:master, r=davidbarskybors-2/+2
fix: include description in label details when detail field is marked for … Fixes https://github.com/rust-lang/rust-analyzer/issues/18231. When omitting the autocomplete detail field, the autocomplete label details can still be returned. Currently the label details are missing the description field if the detail field is included in resolveSupport since it is being overwritten as None and opted to be sent with `completionItem/resolve`. Example completion capabilities. ``` completion = { completionItem = { commitCharactersSupport = true, deprecatedSupport = true, documentationFormat = { "markdown", "plaintext" }, insertReplaceSupport = true, insertTextModeSupport = { valueSet = { 1, 2 } }, labelDetailsSupport = true, preselectSupport = true, resolveSupport = { properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" } }, snippetSupport = true, tagSupport = { valueSet = { 1 } } } ```
2024-10-09Auto merge of #18247 - jhgg:lsp/fix-something-to-resolve, r=Veykrilbors-7/+7
lsp: fix completion_item something_to_resolve not being a latch to true while looking at #18245 i noticed that `something_to_resolve` could technically flap between true -> false if some subsequent fields that were requested to be resolved were empty. this fixes that by using `|=` instead of `=` when assigning to `something_to_resolve` which will prevent it from going back to false once set. although some cases it's simply assigning to `true` i opted to continue to use `|=` there for uniformity sake. but happy to change those back to `=`'s. cc `@SomeoneToIgnore`
2024-10-09Auto merge of #18246 - ChayimFriedman2:fix-18238, r=Veykrilbors-1/+34
fix: Fix `prettify_macro_expansion()` when the node isn't the whole file Fixes #18238.
2024-10-08Only Highlight Exit Points on `async` TokenChristopher Serr-7/+13
This ensures that when being on an `await` token, it still only highlights the yield points and not the exit points.
2024-10-08include fn prefix for all callable defsJake-36/+29
2024-10-08hir-ty: change struct constructor formatting.Jake-53/+54
before, when formatting struct constructor for `struct S(usize, usize)` it would format as: extern "rust-call" S(usize, usize) -> S but after this change, we'll format as: fn S(usize, usize) -> S
2024-10-08Merge from rust-lang/rustLaurențiu Nicola-0/+7
2024-10-08Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-10-08Use macos-13 runners and bump MACOSX_DEPLOYMENT_TARGETLaurențiu Nicola-3/+3
2024-10-08prettier formatkouhe3-14/+13
2024-10-08semicolonkouhe3-1/+1
2024-10-08fix array sourceMapkouhe3-9/+19
2024-10-08lldbdap env dict to stringkouhe3-2/+3
2024-10-08add knownEngines lldb-dapkouhe3-0/+20
2024-10-06Use external stack in borrowck DFSChayim Refael Friedman-58/+67
Because damnit, it can crash r-a. Why do people make this stupid DFSes anyway (I get it, it's easier until it blows).
2024-10-07fix: Do not consider mutable usage of deref to `*mut T` as deref_mutShoyu Vanilla-1/+37
2024-10-05lsp: fix completion_item something_to_resolve not being a latch to trueJake-7/+7
2024-10-05Fix `prettify_macro_expansion()` when the node isn't the whole fileChayim Refael Friedman-1/+34
2024-10-05Include description in label details when detail field is marked for resolutionMax-2/+2
2024-10-05Fix IDE layer not correctly resolving opt-in extern cratesLukas Wirth-7/+18
2024-10-05Add excluded extern-prelude IDE resolution testLukas Wirth-3/+9
2024-10-05Turn ImportSource into a structLukas Wirth-46/+54
2024-10-05Remove ImportSource::ExternCrate as the fixed point loop can't affect itLukas Wirth-138/+102
2024-10-04Auto merge of #18227 - davidbarsky:davidbarsky/push-lmntvwvznyyx, r=davidbarskybors-62/+190
internal: add json `tracing` Layer for profiling startup On `buck2/integrations/rust-project`, this results in the following being printed: ```json {"name":"discover_command","elapsed_ms":18703} {"name":"parallel_prime_caches","elapsed_ms":0} {"name":"vfs_load","elapsed_ms":5895} {"name":"vfs_load","elapsed_ms":547} {"name":"parallel_prime_caches","elapsed_ms":23} {"name":"parallel_prime_caches","elapsed_ms":84} {"name":"parallel_prime_caches","elapsed_ms":5819} ```
2024-10-04internal: add JSON formatting for hprofDavid Barsky-62/+190
2024-10-04Auto merge of #18234 - Veykril:veykril/push-vzynqtlxmrnl, r=Veykrilbors-70/+114
internal: Filter out opaque tokens in some IDE feature macro descensions
2024-10-04internal: Filter out opaque tokens in some of IDE feature macro descensionsLukas Wirth-70/+114
2024-10-02fix: Join rustfmt overrideCommand with project rootKajetan Puchalski-3/+3
When providing a custom rustfmt command, join it with the project root instead of the workspace root. This fixes rust-analyzer getting the wrong invocation path in projects containing subprojects. This makes the behaviour consistent with how a custom path provided in rust-analyzer.procMacro.server behaves already. Resolves issue #18222
2024-10-01fix: correctly parse `use` in generic parametersSabrinaJewson-1/+29
2024-10-01Auto merge of #18219 - Veykril:veykril/push-ytnzuvtoswqz, r=Veykrilbors-3/+4
fix: Fix bootstrap error message being incorrect precedence ...
2024-10-01fix: Fix bootstrap error message being incorrectLukas Wirth-3/+4
2024-10-01Fix: Handle block exprs as modules when finding their parentsShoyu Vanilla-7/+46
2024-09-30Comment out cast checks for unknown ptr kindChayim Refael Friedman-25/+48
Just like we don't check for types containing unknown.
2024-09-30internal: remove `Default` from OpQueueDavid Barsky-24/+40
2024-09-30Auto merge of #18210 - ChayimFriedman2:label-macro, r=Veykrilbors-27/+71
fix: Fix resolution of label inside macro When working on Something Else (TM) (I left a hint in the commits :P), I noticed to my surprise that labels inside macros are not resolved. This led to a discovery of *two* unrelated bugs, which are hereby fixed in two commits.