Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

Fixes #2294.

Copilot AI review requested due to automatic review settings December 9, 2025 08:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a crash in signature help when type arguments are provided for an unresolved call target. The fix adds proper nil checking before returning symbol information, preventing a nil pointer dereference in downstream code.

Key changes:

  • Added nil check for GetSymbolAtLocation result in the type arguments invocation path
  • Return nil when the symbol cannot be resolved instead of returning a struct with a nil typeInfo field
  • Added two test cases to verify the crash is fixed and behavior is correct

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
internal/ls/signaturehelp.go Added nil check for unresolved symbols in type arguments invocation path and improved code readability with blank lines
internal/fourslash/tests/signatureHelpTypeArgumentsWithUntypedTarget_test.go Added test to verify no signature help is shown for unresolved identifiers with type arguments
internal/fourslash/tests/signatureHelpBetweenTypeArgsAndArgs_test.go Added test to verify no crash when signature help is requested between type arguments and regular arguments

@DanielRosenwasser DanielRosenwasser added this pull request to the merge queue Dec 9, 2025
Merged via the queue into main with commit 9a0b323 Dec 9, 2025
28 checks passed
@DanielRosenwasser DanielRosenwasser deleted the signatureHelpTypeArgsUnresolvedTarget branch December 9, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash for signature help in type arguments with any/unknown call target

3 participants