summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/ide-db
AgeCommit message (Collapse)AuthorLines
2025-02-04Expose symbol of `CrateName`Lukas Wirth-5/+8
2025-02-03Split cache priming into distinct phasesLukas Wirth-31/+83
2025-01-28Merge pull request #19063 from ↵David Barsky-7/+0
davidbarsky/davidbarsky/backout-struct-default-fields internal: backout `hir-*` changes from #19001
2025-01-28Merge pull request #19015 from Wilfred/mdbookLukas Wirth-10/+7
manual: Convert to mdbook
2025-01-27Back out "feat: Implement `default-field-values`"David Barsky-7/+0
This backs out commit 7de0b2e75a541b98f735ee6fcd12d326be38d23f.
2025-01-27feat: Implement `default-field-values`Shoyu Vanilla-0/+7
2025-01-26Add GenericDefId::StaticIdLukas Wirth-0/+2
2025-01-25Merge pull request #19028 from Veykril/push-vuytpkvqzwzsLukas Wirth-0/+3
fix: Fix flyimport not filtering via stability of import path
2025-01-25Fix flyimport not filtering via stability of import pathLukas Wirth-0/+3
2025-01-25Merge pull request #19026 from Veykril/push-wrxrutptywzxLukas Wirth-0/+33
Only collect implicit visibile use symbols if they have renames
2025-01-25Only collect implicit visibile use symbols if they have renamesLukas Wirth-0/+33
Otherwise this will pollute the index too much with unnecessary symbols
2025-01-24manual: Convert to mdbookWilfred Hughes-10/+7
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-24minor: Suggest better names when a type is a sequenceWilfred Hughes-0/+83
Previously, we'd suggest a type of `vec` for a value of type `Vec<T>`, which is rarely what the user wants. We also had no suggestions for values of type `&[T]`. Instead, try to pluralise the inner type name, and fall back to `items`.
2025-01-24Merge pull request #19016 from Veykril/push-moqnsytyrupuLukas Wirth-10/+12
fix: Fix `ItemScope` not recording glob imports
2025-01-24Fix `ItemScope` not recording glob importsLukas Wirth-10/+12
This caused us other code to incorrectly assume in dealing with a declaration when in fact it was dealing with a glob imported definition
2025-01-21Merge pull request #18986 from Veykril/push-zlwvwlowpzqmLukas Wirth-0/+7
Goto `Display::fmt` when invoked on `to_string`
2025-01-21Cleanup `Name` string renderingLukas Wirth-16/+12
2025-01-20Goto `Display::fmt` when invoked on `to_string`Lukas Wirth-0/+7
2025-01-20Move dual blanket impl logic from source analyzer to goto_defLukas Wirth-0/+12
2025-01-20Fix import search not discarding rawnessLukas Wirth-9/+21
2025-01-20Less allocsLukas Wirth-19/+30
2025-01-20Preserve impl assoc names in ImplDataLukas Wirth-6/+7
2025-01-20Vec -> Box<[_]>Lukas Wirth-7/+4
2025-01-20Properly record meaningful imports as re-exports in symbol indexLukas Wirth-68/+41
2025-01-16Merge pull request #18951 from Veykril/push-zpvunsvlpuxtLukas Wirth-8/+24
Add missing `#[rust_analyzer::rust_fixture]` annotations
2025-01-16Generalize some type walking in hover type actionsLukas Wirth-0/+16
2025-01-16Add missing `#[rust_analyzer::rust_fixture]` annotationsLukas Wirth-8/+24
2025-01-15Early exit in search properlyLukas Wirth-3/+8
2025-01-10Re-implement rust string highlighting via tool attributeLukas Wirth-6/+12
2025-01-10Merge pull request #18904 from Veykril/push-yztnorquuyzwLukas Wirth-1/+1
Improve hover module path rendering
2025-01-10Implement implicit sized bound inlay hintsLukas Wirth-0/+4
2025-01-10Improve hover module path renderingLukas Wirth-1/+1
2025-01-10Merge pull request #18902 from Veykril/push-znlsxykqrkooLukas Wirth-5/+19
internal: Add Definition::Crate
2025-01-10internal: Add Definition::CrateLukas Wirth-5/+19
This is its own thing so it should be handled specifically where possible
2025-01-10Remove two hir reexportsChayim Refael Friedman-16/+16
2025-01-06minor: New clippy lintsLukas Wirth-22/+17
2024-12-31Merge pull request #18758 from mgsloan/scip-unique-symbolsLukas Wirth-5/+49
Improve SCIP symbols
2024-12-30Move `container_to_definition` function into `enclosing_definition`Michael Sloan-19/+15
2024-12-30fix: avoid generating colliding names in extract_variableroife-68/+79
2024-12-25Improve SCIP symbolsMichael Sloan-5/+53
In particular, the symbol generation before this change creates a lot of symbols with the same name for different definitions. This change makes progress on symbol uniqueness, but does not fix a couple cases where it was unclear to me how to fix (see TODOs in `scip.rs`) Behavior changes: * `scip` command now reports symbol information omitted due to symbol collisions. Iterating with this on a large codebase (Zed!) resulted in the other improvements in this change. * Generally fixes providing the path to nested definitions in symbols. Instead of having special cases for a couple limited cases of nesting, implements `Definition::enclosing_definition` and uses this to walk definitions. * Parameter variables are now treated like locals. - This fixes a bug where closure captures also received symbols scoped to the containing function. To bring back parameter symbols I would want a way to filter these out, since they can cause symbol collisions. - Having symbols for them seems to be intentional in 27e2eea54fbd1edeefa2b47ddd4f552a04b86582, but no particular use is specified there. For the typical indexing purposes of SCIP I don't see why parameter symbols are useful or sensible, as function parameters are not referencable by anything but position. I can imagine they might be useful in representing diagnostics or something. * Inherent impls are now represented as `impl#[SelfType]` - a type named `impl` which takes a single type parameter. * Trait impls are now represented as `impl#[SelfType][TraitType]` - a type named `impl` which takes two type parameters. * Associated types in traits and impls are now treated like types instead of type parameters, and so are now suffixed with `#` instead of wrapped with `[]`. Treating them as type parameters seems to have been intentional in 73d9c77f2aeed394cf131dce55807be2d3f54064 but it doesn't make sense to me, so changing it. * Static variables are now treated as terms instead of `Meta`, and so receive `.` suffix instead of `:`. * Attributes are now treated as `Meta` instead of `Macro`, and so receive `:` suffix instead of `!`. * `enclosing_symbol` is now provided for labels and generic params, which are local symbols. * Fixes a bug where presence of `'` causes a descriptor name to get double wrapped in backticks, since both `fn new_descriptor` and `scip::symbol::format_symbol` have logic for wrapping in backticks. Solution is to simply delete the redundant logic. * Deletes a couple tests in moniker.rs because the cases are adequeately covered in scip.rs and the format for identifiers used in moniker.rs is clunky with the new representation for trait impls
2024-12-24Merge pull request #18707 from ChayimFriedman2/substLukas Wirth-64/+99
feat: Show substitution where hovering over generic things
2024-12-20Show substitution where hovering over generic thingsChayim Refael Friedman-64/+99
There are few things to note in the implementation: First, this is a best-effort implementation. Mainly, type aliases may not be shown (due to their eager nature it's harder) and partial pathes (aka. hovering over `Struct` in `Struct::method`) are not supported at all. Second, we only need to show substitutions in expression and pattern position, because in type position all generic arguments always have to be written explicitly.
2024-12-16fix: Fix path qualified auto-importing completions not working with re-exportsLukas Wirth-120/+152
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-13feat: improve name generation in destructure_tuple_bindingroife-0/+2
2024-12-13Bump typosLaurențiu Nicola-1/+1
2024-12-11Properly handle different defaults for severity of lintsChayim Refael Friedman-1267/+6155
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-11Merge from rust-lang/rustLaurențiu Nicola-11/+2
2024-12-10minor: enhance name suggestion for `Arc<T>` and `Rc<T>`roife-1/+27
2024-12-05fix: Resolve generic parameters within use capturesLukas Wirth-0/+7
2024-12-05Parse lifetime bounds in lifetime param into TypeBoundListLukas Wirth-10/+0
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.