Commit Graph

4 Commits

Author SHA1 Message Date
Dylan Sturgeon
5e38e1ebe8 Fix missing refs to accesor when shadowing with if-let shorthand.
After ce55a854b9 the references to accessors for the shadowed accessor were discarded when indexing without locals.
2025-04-01 11:43:30 -07:00
Dylan Sturgeon
ce55a854b9 Emit references to shadowed variables in if-let shorthands as variables when indexing locals is enabled.
Track the original-decl/captured decl as part of the symbol passed to the IndexConsumer. This allows the Rename consumer to check if the symbol is a shadowed reference to a decl being renamed, without the index skipping the other relevant output when visiting shadowing variables.

https://github.com/swiftlang/swift/issues/76805
2024-10-22 16:43:24 -07:00
Ben Barham
21f997c01a [IDE] Remove invalid assertions
The declaration and reference aren't necessarily the same type (eg. they
could be a function and a local). Thus they don't have to have the same
names, making the assertion invalid.

Resolves #63262.
2023-01-27 21:24:25 -08:00
Ben Barham
7b4ab8d0e6 [Index] Resolve any shadowed references to the decl they shadow
Skip the shadowing decl and instead reference the top-most shadowed decl
(ie. follow any shadowed decls up the chain).

Also fix `getShorthandShadows` missing references in `MemberDeclRefExpr`
by using `getReferencedDecl` instead of assuming it is a `DeclRefExpr`.

Resolves rdar://99730146, rdar://100006415, and rdar://103449038.
2023-01-20 14:34:10 -08:00