Skip to content

Commit 7abe8a1

Browse files
Add builder in computed properties and index signatures.
1 parent e8a1f16 commit 7abe8a1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/services/services.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3062,7 +3062,7 @@ namespace ts {
30623062
}
30633063
return true;
30643064
}
3065-
else if(jsxContainer) {
3065+
else if (jsxContainer) {
30663066
let attrsType: Type;
30673067
if ((jsxContainer.kind === SyntaxKind.JsxSelfClosingElement) || (jsxContainer.kind === SyntaxKind.JsxOpeningElement)) {
30683068
// Cursor is inside a JSX self-closing element or opening element
@@ -3162,7 +3162,7 @@ namespace ts {
31623162
switch (previousToken.kind) {
31633163
case SyntaxKind.CommaToken:
31643164
return containingNodeKind === SyntaxKind.CallExpression // func( a, |
3165-
|| containingNodeKind === SyntaxKind.Constructor // constructor( a, | public, protected, private keywords are allowed here, so show completion
3165+
|| containingNodeKind === SyntaxKind.Constructor // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */
31663166
|| containingNodeKind === SyntaxKind.NewExpression // new C(a, |
31673167
|| containingNodeKind === SyntaxKind.ArrayLiteralExpression // [a, |
31683168
|| containingNodeKind === SyntaxKind.BinaryExpression // let x = (a, |
@@ -3173,10 +3173,12 @@ namespace ts {
31733173
|| containingNodeKind === SyntaxKind.Constructor // constructor( |
31743174
|| containingNodeKind === SyntaxKind.NewExpression // new C(a|
31753175
|| containingNodeKind === SyntaxKind.ParenthesizedExpression // let x = (a|
3176-
|| containingNodeKind === SyntaxKind.ParenthesizedType; // function F(pred: (a| this can become an arrow function, where 'a' is the argument
3176+
|| containingNodeKind === SyntaxKind.ParenthesizedType; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */
31773177

31783178
case SyntaxKind.OpenBracketToken:
3179-
return containingNodeKind === SyntaxKind.ArrayLiteralExpression; // [ |
3179+
return containingNodeKind === SyntaxKind.ArrayLiteralExpression // [ |
3180+
|| containingNodeKind === SyntaxKind.IndexSignature // [ | : string ]
3181+
|| containingNodeKind === SyntaxKind.ComputedPropertyName // [ | /* this can become an index signature */
31803182

31813183
case SyntaxKind.ModuleKeyword: // module |
31823184
case SyntaxKind.NamespaceKeyword: // namespace |

0 commit comments

Comments
 (0)