Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix signature help crash on parenthesized call expressions#1418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-1415

Conversation

Copilot
Copy link
Contributor

@CopilotCopilotAI commentedJul 18, 2025
edited
Loading

Fixed a nil pointer dereference crash that occurred when requesting signature help on parenthesized call expressions with specific trigger parameters.

Problem

The language server would crash with a nil pointer dereference when:

  1. A user had a call expression likesomeCall()
  2. They wrapped it in parentheses:(someCall())
  3. Signature help was triggered at specific positions withtriggerCharacter: "(" andtriggerKind: 2

The crash occurred inGetSignatureHelpItems at line 103 when trying to accesscandidateInfo.candidateInfo without first checking ifcandidateInfo was nil.

Root Cause

ThegetCandidateOrTypeInfo function can returnnil when it doesn't match any of the three invocation types (callInvocation, typeArgsInvocation, contextualInvocation). However, the calling code assumedcandidateInfo would never be nil and attempted to access its fields directly, causing a panic.

Solution

Added a simple nil check forcandidateInfo before accessing its fields:

ifcandidateInfo==nil {// We didn't have any sig help items produced by the TS compiler.returnnil}

This defensive programming approach prevents the crash while maintaining existing behavior for valid cases. WhencandidateInfo is nil, the function now returns nil (no signature help) instead of crashing.

Testing

  • Added a test casesignatureHelpParenthesizedCall that reproduces the crash scenario
  • Verified the test fails with a panic before the fix and passes after
  • Confirmed all existing signature help tests continue to pass
  • Build and formatting checks pass

Fixes#1415.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
@CopilotCopilotAI changed the title[WIP] Signature help crash on parenthesized callFix signature help crash on parenthesized call expressionsJul 18, 2025
@CopilotCopilotAI requested a review fromRyanCavanaughJuly 18, 2025 19:57
Copilot finished work on behalf ofRyanCavanaughJuly 18, 2025 19:57
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@RyanCavanaughRyanCavanaughAwaiting requested review from RyanCavanaugh

At least 1 approving review is required to merge this pull request.

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Signature help crash on parenthesized call
2 participants
@Copilot@RyanCavanaugh

[8]ページ先頭

©2009-2025 Movatter.jp