Skip to content

Fix crash in signatureHelp #29534

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 23, 2019
Merged

Fix crash in signatureHelp #29534

merged 2 commits into from
Jan 23, 2019

Conversation

rbuckton
Copy link
Contributor

This fixes a crash in signature help. When we pass true for isManuallyInvoked when calling getContainingArgumentInfo, we were shortcutting the isSourceFile check. Both the rangeContainsRange check and the following call to getImmediatelyContainingArgumentOrContextualParameterInfo require a node with a valid parent, and a SourceFile does not have a parent.

Fixes #29355


if (ts.sys.tryEnableSourceMapsForHost && /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV"))) {
ts.sys.tryEnableSourceMapsForHost();
}
Copy link
Member

Choose a reason for hiding this comment

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

While at it can you please add enabling debug info on nodes/sourcefiles/symbols as well. Thanks for doing this.

if (ts.Debug.isDebugging) {
    ts.Debug.enableDebugInfo();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@rbuckton rbuckton merged commit c2e74ae into master Jan 23, 2019
@rbuckton
Copy link
Contributor Author

This has also been merged into release-3.3.

@rbuckton rbuckton deleted the fix29355 branch January 23, 2019 00:24
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.

Signature HelpCannot read property 'pos' of undefined
3 participants