Fix references for local variables and parameters#2679
Conversation
|
@ahoppen @hamishknight @rintaro Can you review this pr? |
|
@swift-ci Please test |
|
@swift-ci Please test Windows |
ahoppen
left a comment
There was a problem hiding this comment.
Nice improvement, @somiljain2006.
|
Thanks for the feedback. I've updated the implementation accordingly: switched back to .deletedFiles, filtered out only current-document index results. I also added a test covering references from edited non-current documents are still reported. All tests are passing. |
ahoppen
left a comment
There was a problem hiding this comment.
Sorry for the back-and-forth between Rintaro and myself here. The implementation looks good, just have a few nitpicks on the tests.
|
@swift-ci Please test |
|
@swift-ci Please test Windows |
|
@ahoppen The CI failure turned out to be unrelated to the reference's logic itself. The build was failing in the logging statements because SKLogging couldn't interpolate the error value directly. I've updated the logging code to avoid that interpolation issue and pushed a follow-up fix. |
|
@swift-ci Please test |
|
@swift-ci Please test |
|
@ahoppen The macOS CI failure looks unrelated to this PR. The job timed out while building, and I don't see any build errors or test failures in the log. |
|
@swift-ci Please test |
Fixes #2583
Use relatedIdentifiers as a fallback when indexed references are unavailable, allowing textDocument/references to resolve local variables and parameters. Add regression tests covering local variable references, shadowed locals, parameter references, and includeDeclaration behavior.