about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2024-06-30Move proc-macro-srv RUSTC_VERSION fetching from include to env varLukas Wirth-16/+3
2024-06-30Remove inline `rust_2018_idioms, unused_lifetimes` lint warn, Cargo.toml ↵Lukas Wirth-58/+3
already enforces this
2024-06-30Move interior mutability into ProcMacroSrvProcessLukas Wirth-43/+31
2024-06-30Auto merge of #17519 - Veykril:slim-proc-macro-api, r=Veykrilbors-33/+36
internal: Move dylib version stuff to proc-macro-srv The client no longer reads the proc-macro versions, so this has no need to be in the api crate
2024-06-30Move dylib version stuff to proc-macro-srvLukas Wirth-33/+36
2024-06-30Auto merge of #17516 - kilpkonn:master, r=kilpkonnbors-77/+51
Quality of life improvements to term search Basically two things: - Allow optionally disabling "borrow checking" restrictions on term search code assists. Sometimes it is better to get invalid suggestions and fix borrow checking issues later... - Remove explicit generics in generated expressions. I find it quite rare that one writes `None::<T>` instead of `None`.
2024-06-30Auto merge of #17467 - winstxnhdw:bool-to-enum, r=Veykrilbors-17/+112
feat: add bool_to_enum assist for parameters ## Summary This PR adds parameter support for `bool_to_enum` assists. Essentially, the assist can now transform this: ```rs fn function($0foo: bool) { if foo { println!("foo"); } } ``` To this, ```rs #[derive(PartialEq, Eq)] enum Bool { True, False } fn function(foo: Bool) { if foo == Bool::True { println!("foo"); } } ``` Thanks to `@/davidbarsky` for the test skeleton (: Closes #17400
2024-06-30Do not explicit generics to generated expressionsTavo Annus-75/+13
2024-06-30Auto merge of #17518 - Veykril:expr-scopes-mac, r=Veykrilbors-108/+198
fix: Fix expression scope calculation when within macro expansions
2024-06-30SimplifyLukas Wirth-53/+62
2024-06-30Fix expression scope calculation when within macro expansionsLukas Wirth-33/+99
2024-06-30Simplify unresolved proc-macro handlingLukas Wirth-29/+44
2024-06-30Auto merge of #17513 - roife:fix-issue-17500, r=Veykrilbors-8/+48
fix: completions after async kw fix #17500 ### Changes 1. fix completions after async kw 2. fix completions for `async` kw in trait
2024-06-29fix: completions after async kwroife-8/+48
2024-06-29Make borrow checking configurable for term searchTavo Annus-2/+38
2024-06-28Add landing/faq walkthroughs and commands for quick accessJoel Daniel Rico-0/+128
2024-06-27Use proper `ImplTraits` in `insert_inference_vars_for_impl_trait`Shoyu Vanilla-31/+19
2024-06-27Add a regression test for issue 17199 that causes stack overflowShoyu Vanilla-0/+19
2024-06-27Update triagebot.tomlLukas Wirth-0/+1
2024-06-27Remove the `box_pointers` lint.Nicholas Nethercote-1/+0
As the comment says, this lint "is mostly historical, and not particularly useful". It's not worth keeping it around.
2024-06-26do not normalize `use foo::{self}` to `use foo`Harry Sarson-4/+79
It changes behaviour and can cause collisions. E.g. for the following snippet ```rs mod foo { pub mod bar {} pub const bar: i32 = 8; } // tranforming the below to `use foo::bar;` causes the error: // // the name `bar` is defined multiple times use foo::bar::{self}; const bar: u32 = 99; fn main() { let local_bar = bar; } ``` we still normalize ```rs use foo::bar; use foo::bar::{self}; ``` to `use foo::bar;` because this cannot cause collisions. See: https://github.com/rust-lang/rust-analyzer/pull/17140#issuecomment-2079189725
2024-06-25Bump actions/download-artifact and upload-artifactLaurențiu Nicola-11/+11
2024-06-25pass cargo extra args when debugAndrei Listochkin-2/+3
fixes #17128
2024-06-25RFC 2383: Stabilize `lint_reasons` :tada:xFrednet-3/+3
2024-06-25feat: add bool_to_enum assist for parameterswinstxnhdw-16/+20
2024-06-25tests: add test for param transformationwinstxnhdw-1/+92
2024-06-24Auto merge of #17489 - Veykril:tt-iter, r=Veykrilbors-319/+332
minro: move tt-iter into tt crate
2024-06-24move tt-iter into tt crateLukas Wirth-319/+332
2024-06-24Auto merge of #17488 - alibektas:17485/duplicate_snippets, r=alibektasbors-0/+3
minor : Fix duplicate snippets showing up on hover. With each `config::apply_change` duplicate configs were being added. Now we first drain the vec that holds these and then start adding. This fixes #17485
2024-06-24Apply minor changesAli Bektas-1/+1
2024-06-24minor : Fix duplicate snippets showing up on hover.Ali Bektas-0/+3
With each `config::apply_change` duplicate configs were being added. Now we first drain the vec that holds these and then start adding.
2024-06-24Auto merge of #17487 - Veykril:ty-perf-stuff, r=Veykrilbors-260/+340
internal: Some more small memory optimizations Not a big impact on metrics, though there are some more savings in queries mainly used by the IDE layer from this
2024-06-24Fix term_search filtering enum variant generics incorrectlyLukas Wirth-5/+5
2024-06-24Auto merge of #17471 - davidsemakula:fix-remove-parenthesis, r=Veykrilbors-0/+37
fix: don't remove parentheses for calls of function-like pointers that are members of a struct or union Fixes #17111
2024-06-24Auto merge of #17411 - Wilfred:clearer_unlinked_file, r=Veykrilbors-3/+6
fix: Improve hover text in unlinked file diagnostics Use full sentences, and mention how to disable the diagnostic if users are intentionally working on unowned files. ![Screenshot 2024-06-12 at 5 55 48 PM](https://github.com/rust-lang/rust-analyzer/assets/70800/c91ee1ed-1c72-495a-9ee3-9e360a5c6977) (Full disclosure: I've tested a rust-analyzer build in VS Code, but the pop-up logic is currently disabled due to #17062, so I haven't tested that.)
2024-06-24Shrink mbe's OpLukas Wirth-29/+55
2024-06-24Intern ModPath within RawVisibilityLukas Wirth-20/+31
2024-06-24Save a bit on empty item trees by deduplicating themLukas Wirth-43/+76
2024-06-24Enum variants are not generic def idsLukas Wirth-178/+188
2024-06-24Auto merge of #17466 - chenyukang:patch-1, r=Veykrilbors-1/+1
chore: Fix diagnostic name in macro_error.rs
2024-06-24Auto merge of #17481 - roife:fix-issue-17480, r=Veykrilbors-2/+2
fix: pattern completions in let-stmt fix #17480. We can write `let S { a, b } = s;` or `let Some(x) = a else {}`, so it is reasonable to allow pattern completions in `LetStmt`.
2024-06-24Auto merge of #17478 - kilpkonn:master, r=Veykrilbors-456/+163
Simplify some term search tactics Working on the paper `@phijor` found that "Data constructor" tactic could be simplified quite a bit by running it only in the backwards direction. With n+1 rounds it has same coverage as previous implementation in n rounds, however the tactic it self is more simple and also potentially faster as there is less to do. In a nutshell the idea is to only work with types in the wish-list rather than with any types. Turns out it is quite a bit faster: Before: ``` ripgrep: Tail Expr syntactic hits: 238/1692 (14%) Tail Exprs found: 1223/1692 (72%) Term search avg time: 15ms nalgebra: Tail Expr syntactic hits: 125/3001 (4%) Tail Exprs found: 2143/3001 (71%) Term search avg time: 849ms ``` After ```` ripgrep: Tail Expr syntactic hits: 246/1692 (14%) Tail Exprs found: 1209/1692 (71%) Term search avg time: 8ms nalgebra: Tail Expr syntactic hits: 125/3001 (4%) Tail Exprs found: 2028/3001 (67%) Term search avg time: 305ms ```` _Also removed niche optimization of removing scope defs from the search space as this wasn't helping much anyway and made code a bit more complex._
2024-06-23fix: pattern completions in let-stmtroife-2/+2
2024-06-22Fix suggestions of unstable constantsTavo Annus-12/+16
2024-06-22Increase search depth to account for more granual stepsTavo Annus-5/+7
2024-06-22Remove Changelog: XXX title from Github release notesLaurențiu Nicola-0/+9
2024-06-22Simplify `impl_method` tacticTavo Annus-104/+41
2024-06-22Simplify `impl_static_method` tacticTavo Annus-102/+28
2024-06-22Remove remove not-very-helpful optimizationsTavo Annus-47/+0
2024-06-21Run `data_constructor` tactic only backwardsTavo Annus-190/+75