mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
Add undefined check for tokenPrecedingSpanStart
This commit is contained in:
parent
bfde7ece13
commit
945eb7ce81
@ -448,6 +448,10 @@ module ts.SignatureHelp {
|
||||
|
||||
export function getSignatureHelpCurrentArgumentState(sourceFile: SourceFile, position: number, applicableSpanStart: number): SignatureHelpState {
|
||||
var tokenPrecedingSpanStart = ServicesSyntaxUtilities.findPrecedingToken(applicableSpanStart, sourceFile);
|
||||
if (!tokenPrecedingSpanStart) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (tokenPrecedingSpanStart.kind !== SyntaxKind.OpenParenToken && tokenPrecedingSpanStart.kind !== SyntaxKind.LessThanToken) {
|
||||
// The span start must have moved backward in the file (for example if the open paren was backspaced)
|
||||
return undefined;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user