about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/ide-completion
AgeCommit message (Collapse)AuthorLines
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()`
2025-01-15Add smart completions that skip `await` or `iter()` and `into_iter()`Chayim Refael Friedman-59/+165
E.g. complete `await.foo()`.
2025-01-13feat: Add dereferencing autocompleteboattime-33/+100
2025-01-10Re-implement rust string highlighting via tool attributeLukas Wirth-22/+52
2025-01-09Merge pull request #18889 from ChayimFriedman2/subtle-completionLukas Wirth-1/+2
fix: Fix actual token lookup in completion's `expand()`
2025-01-09Fix actual token lookup in completion's `expand()`Chayim Refael Friedman-1/+2
It should be left biased, not right biased, because when e.g. the use has typed `h` then requested completion, the `h` is what we want to find, not the next token (which might indeed be inside a macro call). I'm not sure why I wrote `right_biased()` to begin with (I remember I had a reason and not just "both should work"), I might've copied the code in `expand_and_analyze()` (which is wrong, because there it lookups on the speculative file, where right biased will always find the correct token and left biased not). This is still not perfect, because there might not be an identifier already typed then we might still end up in a macro call, but this is the best we can do.
2025-01-08refactor test helpers within ide-completionsVishruth-Thimmaiah-448/+322
2025-01-08Merge pull request #18884 from Veykril/push-xwqkorxozzkqLukas Wirth-30/+27
fix: Fix `env`/`option_env` macro check disregarding macro_rules definitions
2025-01-08fix: Fix `env`/`option_env` macro check disregarding macro_rules definitionsLukas Wirth-30/+27
2025-01-08Merge pull request #18855 from Giga-Bowser/migrate-if-letLukas Wirth-1/+1
internal: Migrate `if let` replacement assists to `SyntaxEditor`
2025-01-07fix: do not offer completions within macro stringsVishruth-Thimmaiah-0/+31
2025-01-07Merge pull request #18853 from ChayimFriedman2/no-completionLaurențiu Nicola-0/+72
Fix case where completion inside macro that expands to `#[test]` was unavailable
2025-01-06internal: `make::expr_prefix` should return `ast::PrefixExpr`Giga Bowser-1/+1
2025-01-06Fix case where completion inside macro that expands to `#[test]` was unavailableChayim Refael Friedman-0/+72
We ignore `#[test]` in the def map, so that's why it failed.
2025-01-06minor: New clippy lintsLukas Wirth-24/+19
2025-01-04Hide synthetic locals from completionsLukas Wirth-0/+85
2025-01-01CleanupLukas Wirth-1/+0
2025-01-01Revamp auto-import exclude configLukas Wirth-35/+44
2025-01-01Simplify completion config path resolutionsLukas Wirth-94/+44
2025-01-01Reduce the default autoimport exclusion listLukas Wirth-71/+83
2025-01-01Allow flyimporting excluded trait items if there is an exact match in the nameChayim Refael Friedman-3/+51
I.e. with `fn foo()`, don't complete at `x.fo|`, but complete (with imports) for `x.foo|`, since this is less likely to have false positives. I opted to only do that for flyimport, even though for basic imports there can also be snippet completion (completing the params list for a method), since this is less universally applicable and seems not so useful.
2025-01-01Allow excluding specific traits from completionChayim Refael Friedman-37/+613
To be accurate, only their methods are excluded, the trait themselves are still available. I also excluded a bunch of std traits by default. Some less opinionated, like `AsRef`, which should never be used directly except in generic scenarios (and won't be excluded there), some more opinionated, like the ops traits, which I know some users sometimes want to use directly. Either way it's configurable. It should be pretty easy to extend support to excluding only specific methods, but I didn't do that currently. Traits configured to be excluded are resolved in each completion request from scratch. If this proves too expensive, it is easy enough to cache them in the DB.
2024-12-20Fix a case where completion was unable to expand a macroChayim Refael Friedman-290/+510
Which caused the macros of the popular `tracing` crate to not offer completions. The reason is rather complicated: it boils down to macro ignoring their input and completion always choosing the first expansion.
2024-12-18internal: Cleanup label structure of `CompletionItem`Lukas Wirth-1062/+1190
2024-12-16fix: Fix path qualified auto-importing completions not working with re-exportsLukas Wirth-0/+42
Prior to this commit we used to generate import paths, then zipped them with the existing qualifier to check if they agree on the path to import. This is brittle when re-exports come into play causing items to have multiple applicable paths that refer to them. This commit instead rewrites this logic by generating the import path for the qualifier, verifying that the rest of the qualifier resolves and then doing a final lookup on that resolution result for the final segment instead.
2024-12-13Show expansion errors in expand_macro featureLukas Wirth-4/+7
2024-12-11Properly handle different defaults for severity of lintsChayim Refael Friedman-1/+1
Previously all lints were assumed to be `#[warn]`, and we had a hand-coded list of `#[allow]` exceptions. Now the severity is autogenerated from rustdoc output. Also support lints that change status between editions, and the `warnings` lint group.
2024-12-09Draft completion hashingKirill Bulatov-2/+2
2024-12-05Parse lifetime bounds in lifetime param into TypeBoundListLukas Wirth-33/+25
This mainly aids in error recovery but also makes it a bit easier to handle lifetime resolution. While doing so it also came apparent that we were not actually lowering lifetime outlives relationships within lifetime parameter declaration bounds, so this fixes that.
2024-12-04Merge pull request #18604 from ChayimFriedman2/complete-helpersLukas Wirth-4/+95
feat: Complete derive helper attributes
2024-12-04Complete derive helper attributesChayim Refael Friedman-4/+95
Only their names, anything can go inside.
2024-12-03Remove references to platform-intrinsic ABIMark Murphy-1/+0
2024-12-03Advertise completions and inlay hints resolve server capabilities based on ↵Kirill Bulatov-1/+13
the client capabilities.
2024-10-30Merge pull request #18382 from dqkqd/issue-17042Lukas Wirth-3/+72
fix: auto-complete import for aliased function and module
2024-10-28Merge pull request #18420 from ChayimFriedman2/cfg-true-falseLukas Wirth-0/+2
feat: Support `cfg(true)` and `cfg(false)`
2024-10-28Move text-edit into ide-dbLukas Wirth-14/+15
2024-10-27Support `cfg(true)` and `cfg(false)`Chayim Refael Friedman-0/+2
As per RFC 3695.
2024-10-26Use method syntaxMoskalykA-1/+1
2024-10-26Start using `Option::is_none_or`MoskalykA-2/+1
2024-10-24fix: handle aliased pattern and simplify testcaseKhanh Duong Quoc-23/+32
2024-10-24refactor: separate function for getting import nameKhanh Duong Quoc-7/+19
2024-10-23fix: auto-complete import for aliased function and moduleKhanh Duong Quoc-2/+50
2024-10-21Auto merge of #18360 - roife:safe-kw-3, r=Veykrilbors-54/+146
feat: better completions for extern blcoks This PR refactors `add_keywords` (making it much clearer!) and enhances completion for `extern` blocks. It is recommended to reviewing the changes in order of the commits: - The first commit (f3c4dde0a4917a2bac98605cc045eecfb4d69872) doesn’t change any logic but refactors parts of the `add_keywords` function and adds detailed comments. - The second commit (5dcc1ab649bf8a49cadf006d620871b12f093a2f) improves completion for `extern` kw and extern blocks.
2024-10-22minor: refactor completions in item_listroife-27/+24
2024-10-21feat: better completions for extern blcoksroife-18/+104
2024-10-21refactor add_keywords in ide-completions for clarityroife-47/+56