about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/ide-completion
AgeCommit message (Collapse)AuthorLines
2025-03-10Merge pull request #19330 from ChayimFriedman2/normalize-projectionLukas Wirth-41/+47
fix: Normalize projections in evaluated const display and layout calculation
2025-03-10Merge pull request #19079 from ChayimFriedman2/rename-conflictLukas Wirth-0/+2
feat: Warn the user when a rename will change the meaning of the program
2025-03-09Rank ADT constructors as constructors for completion scoringLukas Wirth-12/+102
2025-03-07Refactor relevance scoring to use a named constant BASE_SCORETongjun Gao-3/+5
Replace magic number with a named constant for improved readability and maintainability of the scoring logic
2025-03-07Fix logical error in relevance scoring implementationTongjun Gao-3/+3
2025-03-06Warn the user when a rename will change the meaning of the programChayim Refael Friedman-0/+2
Specifically, when a rename of a local will change some code that refers it to refer another local, or some code that refer another local to refer to it. We do it by introducing a dummy edit with an annotation. I'm not a fond of this approach, but I don't think LSP has a better way.
2025-03-06Pass the target crate in `HirFormatter`Chayim Refael Friedman-41/+47
This is required to format evaluated consts, because we need trait env, and it needs the crate (currently it uses the last crate in topological order, which is wrong, the next commit will fix that).
2025-03-06Adjust relevance scoring threshold to consistent with existing implementationsTongjun Gao-1/+1
2025-03-05Merge pull request #19279 from Natural-selection1/masterLukas Wirth-1/+51
Improve keyword completion for 'let' and 'let mut'
2025-03-05add test cases for 'letm' keyword completionTongjun Gao-0/+19
2025-03-05minicore: Add size_of to prelude and add rust_2024 preludeThalia Archibald-0/+1
2025-03-04change 'let mut' keyword completion into 'ietm' snippetTongjun Gao-2/+2
2025-03-04Improve keyword completion for 'let' and 'let mut'Tongjun Gao-1/+32
2025-03-03Merge pull request #19226 from Shourya742/2025-02-25-fix-completion-ref-matchingChayim Refael Friedman-3/+25
completion-ref-matching
2025-02-28add testbit-aloo-0/+24
2025-02-28Avoid suggesting redundant borrowing in completion resultsbit-aloo-3/+1
2025-02-27fix doc testsBenjaminBrienen-12/+13
2025-02-27enable doctestBenjaminBrienen-1/+0
2025-02-23Include private items in completions for local cratesTim Hutt-1/+4
Don't filter out private items when completing paths in the same crate. Instead respect the `privateEditable` setting. Fixes #9850
2025-02-10Fix postfix completions inside macrosChayim Refael Friedman-27/+64
Previously the receiver text was taken directly from the AST, which in macros is missing trivia, leading to corruption (or just unintended replacement of user code). Now we upmap the range, and extract the original file text in it.
2025-01-28Merge pull request #19015 from Wilfred/mdbookLukas Wirth-14/+16
manual: Convert to mdbook
2025-01-28Disable `Receiver` based autoderef temporarilyLukas Wirth-3/+1
2025-01-27Merge pull request #19050 from ChayimFriedman2/iter-selfLukas Wirth-1/+25
fix: Don't suggest `into_iter().method()` on iterators
2025-01-27Don't suggest `into_iter().method()` on iteratorsChayim Refael Friedman-1/+25
2025-01-27Fix #[rustc_deprecated_safe_2024]Chayim Refael Friedman-1/+1
It should be considered by the edition of the caller, not the callee. Technically we still don't do it correctly - we need the span of the method name (if it comes from a macro), but we don't keep it and this is good enough for now.
2025-01-27Merge pull request #19037 from ChayimFriedman2/fix-other-testLukas Wirth-8/+83
fix: In completion's expand, consider recursion stop condition (when we're not inside a macro call anymore) *after* the recursive call instead of before it
2025-01-26Support RFC 2396Chayim Refael Friedman-9/+13
AKA. target_feature 1.1, or non unsafe target_feature.
2025-01-26In completion's expand, consider recursion stop condition (when we're not ↵Chayim Refael Friedman-8/+83
inside a macro call anymore) *after* the recursive call instead of before it This is because our detection is imperfect, and miss some cases such as an impersonating `test` macro, so we hope we'll expand successfully in this case.
2025-01-26Don't complete doc(hidden) enum variants and use treesChayim Refael Friedman-55/+102
Also refactor the check a bit.
2025-01-25Skip redundant path search in `resolve_completion_edits`Lukas Wirth-36/+11
2025-01-25Fix flyimport not filtering via stability of import pathLukas Wirth-12/+50
2025-01-24manual: Convert to mdbookWilfred Hughes-14/+16
Split manual.adoc into markdown files, one for each chapter. For the parts of the manual that are generated from source code doc comments, update the comments to use markdown syntax and update the code generators to write to `generated.md` files. For the weekly release, stop copying the .adoc files to the `rust-analyzer/rust-analyzer.github.io` at release time. Instead, we'll sync the manual hourly from this repository. See https://github.com/rust-analyzer/rust-analyzer.github.io/pull/226 for the sync. This PR should be merged first, and that PR needs to be merged before the next weekly release. This change is based on #15795, but rebased and updated. I've also manually checked each page for markdown syntax issues and fixed any I encountered. Co-authored-by: Lukas Wirth <lukastw97@gmail.com> Co-authored-by: Josh Rotenberg <joshrotenberg@gmail.com>
2025-01-24Merge pull request #19012 from ShoyuVanilla/arbitrary-selfLukas Wirth-0/+30
feat: Implement `arbitrary-self-types`
2025-01-24feat: Implement `arbitrary-self-types`Shoyu Vanilla-0/+30
2025-01-24Merge pull request #18993 from ChayimFriedman2/iter-configLukas Wirth-56/+69
feat: Provide a config to control auto-insertion of `await` and `iter()`
2025-01-21Provide a config to control auto-insertion of `await` and `iter()`Chayim Refael Friedman-56/+69
2025-01-21Sort completion items that skip `await` and `iter()` behind those that don'tChayim Refael Friedman-0/+26
I don't think my ranking is perfect, because it places them even behind snippet completions, but this is something.
2025-01-21Cleanup `Name` string renderingLukas Wirth-52/+36
2025-01-21Merge pull request #18977 from ChayimFriedman2/fix-upmappingLukas Wirth-13/+68
fix: Fix missing upmapping in trait impls completion
2025-01-20Fix another bug with completion of trait items inside macrosChayim Refael Friedman-11/+36
This time, when completing the keyword (e.g. `fn` + whitespace). The bug was actually a double-bug: First, we did not resolve the impl in the macro-expanded file but in the real file, which of course cannot work. Second, in analysis the whitespace was correlated with the `impl` and not the incomplete `fn`, which caused fake (where we insert an identifier after the whitespace) and real expansions to go out of sync, which failed analysis. The fix is to skip whitespaces in analysis.
2025-01-20Fix import search not discarding rawnessLukas Wirth-5/+6
2025-01-20Properly record meaningful imports as re-exports in symbol indexLukas Wirth-2/+4
2025-01-19Fix missing upmapping in trait impls completionChayim Refael Friedman-3/+33
2025-01-16Merge pull request #18952 from lh123/add-raw-keyword-completeLukas Wirth-2/+138
feat: complete raw, const keyword
2025-01-16don't complete `raw` in `&mut $0`lh123-7/+31
2025-01-16feat: complete raw, const keywordlh123-2/+114
2025-01-16Minor docs improvementLukas Wirth-16/+16
2025-01-16Add edit test for await skipping completionsLukas Wirth-0/+28
2025-01-16Add missing `#[rust_analyzer::rust_fixture]` annotationsLukas Wirth-1/+5
2025-01-16Merge pull request #18927 from ChayimFriedman2/skip-iter-awaitLukas Wirth-59/+165
feat: Add smart completions that skip `await` or `iter()` and `into_iter()`