Component commits:33829fa4a4
Fix and updated tests2249d6c83e
Added teste1a2b9ed19
Revert "Fix and updated tests" This reverts commit33829fa4a4
.51881c4ea2
Filter out empty access expression2253da6ae9
PR feedback Co-authored-by: Armando Aguirre <armanio123@outlook.com>
This commit is contained in:
parent
9eb689e066
commit
782c09d783
|
@ -1338,13 +1338,16 @@ namespace ts.Completions {
|
|||
case SyntaxKind.PropertyAccessExpression:
|
||||
propertyAccessToConvert = parent as PropertyAccessExpression;
|
||||
node = propertyAccessToConvert.expression;
|
||||
if ((isCallExpression(node) || isFunctionLike(node)) &&
|
||||
node.end === contextToken.pos &&
|
||||
node.getChildCount(sourceFile) &&
|
||||
last(node.getChildren(sourceFile)).kind !== SyntaxKind.CloseParenToken) {
|
||||
const leftmostAccessExpression = getLeftmostAccessExpression(propertyAccessToConvert);
|
||||
if (nodeIsMissing(leftmostAccessExpression) ||
|
||||
((isCallExpression(node) || isFunctionLike(node)) &&
|
||||
node.end === contextToken.pos &&
|
||||
node.getChildCount(sourceFile) &&
|
||||
last(node.getChildren(sourceFile)).kind !== SyntaxKind.CloseParenToken)) {
|
||||
// This is likely dot from incorrectly parsed expression and user is starting to write spread
|
||||
// eg: Math.min(./**/)
|
||||
// const x = function (./**/) {}
|
||||
// ({./**/})
|
||||
return undefined;
|
||||
}
|
||||
break;
|
||||
|
|
12
tests/cases/fourslash/getJavaScriptCompletions22.ts
Normal file
12
tests/cases/fourslash/getJavaScriptCompletions22.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// Regresion test for GH#45436
|
||||
|
||||
// @allowNonTsExtensions: true
|
||||
// @Filename: file.js
|
||||
//// const abc = {};
|
||||
//// ({./*1*/});
|
||||
|
||||
goTo.marker('1');
|
||||
edit.insert('.');
|
||||
verify.completions({ exact: undefined });
|
Loading…
Reference in a new issue