about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-10-21feat: better completions for extern blcoksroife-18/+104
2024-10-21refactor add_keywords in ide-completions for clarityroife-47/+56
2024-10-21Auto merge of #18359 - Daanoz:support-initializeStopped, r=Veykrilbors-1/+17
feat: support initializeStopped setting See #18356 Add option to start rust-analyzer in "stopped" state when the extension activates.
2024-10-21Auto merge of #18294 - Giga-Bowser:master, r=Veykrilbors-2387/+4718
Add wrap/unwrap return type in Option I pretty much just copied over the code and tests for wrapping/unwrapping return types in `Result` and then did a bunch of find and replace changes. I handled unwrapping statements returning `None` by just replacing `None` with the unit type, but I'm open to suggestions for more intuitive behavior here.
2024-10-21Auto merge of #18337 - dqkqd:issue-18287, r=Veykrilbors-4/+20
fix: private items are shown in completions for modules in fn body Close: #18287
2024-10-21fix: private items are shown in completions for modules in fn bodyKhanh Duong Quoc-4/+20
2024-10-21fix: FIx mbe bench tests being iteration order dependentLukas Wirth-5/+8
2024-10-21Update ide testsLukas Wirth-178/+179
2024-10-21Fix recursive_adt fixtureLukas Wirth-6/+8
2024-10-21Update rustc-hash to version 2Noratrieb-31/+34
This brings in the new optimized algorithm that was shown to have small performance benefits for rustc.
2024-10-21feat: support initializeStopped settingDaan Sieben-1/+17
2024-10-20Auto merge of #18354 - roife:safe-kw-2, r=lnicolabors-11/+11
fix: classify `safe` as a contextual kw fix #18352
2024-10-21fix: classify `safe` as a contextual kwroife-11/+11
2024-10-20Store patterns desugared from destructuring assignments in source mapChayim Refael Friedman-174/+280
And few more fixups. I was worried this will lead to more memory usage since `ExprOrPatId` is double the size of `ExprId`, but this does not regress `analysis-stats .`. If this turns out to be a problem, we can easily use the high bit to encode this information.
2024-10-20Handle destructuring assignments uniformlyChayim Refael Friedman-707/+886
Instead of lowering them to `<expr> = <expr>`, then hacking on-demand to resolve them, we lower them to `<pat> = <expr>`, and use the pattern infrastructure to handle them. It turns out, destructuring assignments are surprisingly similar to pattern bindings, and so only minor modifications are needed. This fixes few bugs that arose because of the non-uniform handling (for example, MIR lowering not handling slice and record patterns, and closure capture calculation not handling destructuring assignments at all), and furthermore, guarantees we won't have such bugs in the future, since the programmer will always have to explicitly handle `Expr::Assignment`. Tests don't pass yet; that's because the generated patterns do not exist in the source map. The next commit will fix that.
2024-10-20Remove now-incorrect codeChayim Refael Friedman-8/+0
Because our lint infra *can* handle allows from within macro expansions! (Also, what did this reason have to do with something that is a hard error and not a lint? I'm puzzled). I wonder how many such diagnostics we have... Maybe that also mean we can change `unused_mut` to no-longer-experimental? But this is a change I'm afraid to do without checking.
2024-10-20Update Cargo.lockChayim Refael Friedman-5/+5
2024-10-20fix: do not emit unsafe diagnositcs for safe statics in extern blocksroife-3/+62
2024-10-20feat: initial support for safe_kw in extern blocksroife-9/+264
2024-10-20Rollup merge of #131942 - workingjubilee:reduce-haruspicy, r=lukas-code,lnicolaStuart Cook-5/+4
compiler: Adopt rust-analyzer impls for `LayoutCalculatorError` We're about to massively churn the internals of `rustc_abi`. To minimize the immediate and future impact on rust-analyzer, as a subtree that depends on this crate, grow some API on `LayoutCalculatorError` that reflects their uses of it. This way we can nest the type in theirs, and they can just call functions on it without having to inspect and flatten-out its innards.
2024-10-19rust-analyzer: Nest `LayoutCalculatorError` in `hir_ty::LayoutError`Jubilee Young-5/+4
2024-10-19Combine entry points for wrapping/unwrapping return typesGiga Bowser-426/+592
2024-10-19Auto merge of #18336 - xuwaters:patch-1, r=lnicolabors-1/+1
Fix: Increase TOKEN_LIMIT in hir-expand Due to the `TOKEN_LIMIT`, rust-analyzer failed to expand macro for `web-sys::WebGl2RenderingContext` https://github.com/rustwasm/wasm-bindgen/blob/main/crates/web-sys/src/features/gen_WebGl2RenderingContext.rs <img width="780" alt="image" src="https://github.com/user-attachments/assets/3a39f18e-656e-43df-9994-0a0179fa42ac"> <img width="403" alt="image" src="https://github.com/user-attachments/assets/7ae8dcf9-a40a-4070-8623-dd3a953bbf45"> After increasing the `TOKEN_LIMIT`, the `web-sys::WebGl2RenderingContext` can be expanded successfully: <img width="459" alt="image" src="https://github.com/user-attachments/assets/76a71763-05a5-4f14-a5c9-61fc190c668f">
2024-10-19Auto merge of #18335 - SomeoneToIgnore:editorconfig-glob, r=lnicolabors-1/+1
internal: Fix editorconfig glob Had been testing Zed's editorconfig branch on r-a and noticed that something was odd with yaml files. https://spec.editorconfig.org/#glob-expressions > {s1,s2,s3} > any of the strings given (separated by commas, can be nested) (But {s1} only matches {s1} literally.)
2024-10-18Increase TOKEN_LIMIT for hir-expandWei Xu-1/+1
2024-10-19Fix editorconfig globKirill Bulatov-1/+1
2024-10-18style: fix typosDavid Kurilla-3/+3
2024-10-18docs: create setup documentationDavid Kurilla-0/+63
2024-10-18Clamp Position::character to line lengthJohannes Altmanninger-3/+11
LSP says about Position::character > If the character value is greater than the line length it defaults back to the line length. but from_proto::offset() doesn't implement this. A client might for example request code actions for a whole line by sending Position::character=99999. I don't think there is ever a reason (besides laziness) why the client can't specify the line length instead but I guess we should not crash but follow protocol. Technically it should be a warning, not an error but warning is not shown by default so keep it at error I guess. Fixes #18240
2024-10-18vscode: update some dependenciesDavid Barsky-138/+1401
2024-10-18Auto merge of #18320 - davidbarsky:davidbarsky/fix-lldb-dap-calling-rustc, ↵bors-16/+27
r=Veykril internal: fix lldb-dap unconditionally calling rustc Fixes https://github.com/rust-lang/rust-analyzer/issues/18318. I also took the opportunity to refactor how `discoverSourceFileMap` worked—it now returns a type instead of mutating a map in place. I tested this change using the LLDB DAP extension. I needed to set `"lldb-dap.executable-path": "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap"` for everything to work, however, but once I did, was able to successfully debug a test.
2024-10-18Auto merge of #18243 - krobelus:clamp-position-character, r=Veykrilbors-1/+32
Clamp Position::character to line length LSP says about Position::character > If the character value is greater than the line length it defaults back to the line length. but from_proto::offset() doesn't implement this. A client might for example request code actions for a whole line by sending Position::character=99999. I don't think there is ever a reason (besides laziness) why the client can't specify the line length instead but I guess we should not crash but follow protocol. Not sure how to update Cargo.lock (lib/README.md doesn't say how). Fixes #18240
2024-10-18Auto merge of #18331 - Veykril:veykril/push-tsolukqqyllz, r=Veykrilbors-1/+11
internal: Add more trivially `Sized` types to `is_sized` check
2024-10-18internal: Add more trivially `Sized` types to `is_sized` checkLukas Wirth-1/+11
2024-10-18fix: Fix CI running analysis-stats incorrectly against the standard librariesLukas Wirth-8/+13
2024-10-17internal: fix lldb-dap unconditionally calling rustcDavid Barsky-16/+27
2024-10-17Re-use code for wrapping/unwrapping return typesGiga Bowser-3488/+3305
2024-10-17Bump rustc cratesLaurențiu Nicola-19/+20
2024-10-17Merge from rust-lang/rustLaurențiu Nicola-0/+6
2024-10-17Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-10-17Bump version of scip crateVarun Gandhi-7/+7
2024-10-16internal: Use local time when formatting logsWilfred Hughes-1/+32
When debugging rust-analyzer and looking at logs, it's much easier to read when the timestamp is in the local timezone. Before: 2024-08-28T20:55:38.792321Z INFO ParseQuery: invoked at R18460 After: 2024-08-28T13:55:38.792321-07:00 INFO ParseQuery: invoked at R18460
2024-10-15line-index method to allow clamping column to line lengthJohannes Altmanninger-1/+32
Part of #18240
2024-10-15Auto merge of #18278 - ShoyuVanilla:never-place, r=Veykrilbors-102/+637
Do not consider match/let/ref of place that evaluates to ! to diverge, disallow coercions from them too Resolves #18237
2024-10-15fix: autofix for missing wrapped unit in return exprroife-0/+38
2024-10-15minor: `ra-salsa` in `profile.dev.package`Shoyu Vanilla-1/+1
2024-10-15Do not consider match/let/ref of place that evaluates to ! to diverge, ↵Shoyu Vanilla-102/+637
disallow coercions from them too
2024-10-14Auto merge of #18292 - roife:fix-issue-17427, r=Veykrilbors-12/+41
feat: handle self-param outside of methods when renaming close #17427
2024-10-14feat: handle self-param outside of methods when renamingroife-12/+41
2024-10-14Auto merge of #18239 - davidbarsky:davidbarsky/push-lswkwuyrpuqv, r=davidbarskybors-538/+540
chore: rename `salsa` to `ra_salsa` Laying some groundwork to start before I import the new Salsa crate. Here's why: 1. As part of the migration, `@darichey,` `@Wilfred,` and I will create new Salsa equivalents of the existing databases/query groups. We'll get them to compile crate-by-crate. 2. Once we wrote all equivalents of all queries, we'd start to refactor usage sites of the vendored Salsa to use the new Salsa databases. 3. Starting porting usage sites of old Salsa to the new Salsa. 4. Remove the vendored `ra_salsa`; declare victory.