rust-analyzer/crates
Michael Sloan 17c90f71bf Improve SCIP symbols
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
    27e2eea54f, 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 73d9c77f2a 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-25 21:51:58 -07:00
..
base-db Remove patch sysroot cfg-if hack 2024-12-09 11:42:51 +01:00
cfg Support cfg(true) and cfg(false) 2024-10-27 10:46:49 +02:00
edition Properly handle different defaults for severity of lints 2024-12-11 20:48:41 +02:00
hir Improve SCIP symbols 2024-12-25 21:51:58 -07:00
hir-def Unify handling of path diagnostics in hir-ty 2024-12-24 18:58:52 +02:00
hir-expand Merge from rust-lang/rust 2024-12-23 11:27:07 +02:00
hir-ty Improve SCIP symbols 2024-12-25 21:51:58 -07:00
ide Improve SCIP symbols 2024-12-25 21:51:58 -07:00
ide-assists Merge pull request #18707 from ChayimFriedman2/subst 2024-12-24 14:16:16 +00:00
ide-completion Fix a case where completion was unable to expand a macro 2024-12-20 13:14:59 +02:00
ide-db Improve SCIP symbols 2024-12-25 21:51:58 -07:00
ide-diagnostics Unify handling of path diagnostics in hir-ty 2024-12-24 18:58:52 +02:00
ide-ssr Show expansion errors in expand_macro feature 2024-12-13 09:36:03 +01:00
intern internal: Implement naked_asm! builtin 2024-12-12 17:43:27 +01:00
limit
load-cargo Remove salsa from proc-macro server dep tree 2024-12-18 10:24:26 +01:00
mbe Remove dangling outdated test module 2024-12-24 10:37:24 +01:00
parser Fix a case where completion was unable to expand a macro 2024-12-20 13:14:59 +02:00
paths internal: Split serde derive feature into serde_derive usage 2024-12-20 11:55:02 +01:00
proc-macro-api Revert "internal: Drop proc-macro server support for ~1.66.0 and older toolchains" 2024-12-20 20:51:09 +01:00
proc-macro-srv Remove salsa from proc-macro server dep tree 2024-12-18 10:24:26 +01:00
proc-macro-srv-cli Do not require a special env var to be set for the proc-macro-srv 2024-12-13 09:29:16 +01:00
profile Use c"lit" for CStrings without unwrap 2024-12-02 18:16:36 +00:00
project-model Cleanup target fetching for cargo metadata 2024-12-24 17:49:07 +01:00
ra-salsa internal: Split serde derive feature into serde_derive usage 2024-12-20 11:55:02 +01:00
rust-analyzer Improve SCIP symbols 2024-12-25 21:51:58 -07:00
span internal: Split serde derive feature into serde_derive usage 2024-12-20 11:55:02 +01:00
stdx Merge pull request #18074 from ChayimFriedman2/typeref-source-map 2024-10-28 11:01:12 +00:00
syntax internal: Standardize how we take iterator parameters in SyntaxFactory 2024-12-20 12:06:27 -05:00
syntax-bridge Remove salsa from proc-macro server dep tree 2024-12-18 10:24:26 +01:00
test-fixture Rename test fixture crates to ra_test_fixture 2024-12-09 11:40:21 +01:00
test-utils Remove unstable attributes in minicore 2024-12-09 11:17:17 +02:00
toolchain
tt Fix new nightly lints 2024-10-22 11:48:41 +02:00
vfs Rename object_safety to dyn_compatibility 2024-09-29 07:26:45 -04:00
vfs-notify