parent
0d95d0405c
commit
88bffac07f
2 changed files with 32 additions and 1 deletions
|
@ -3311,11 +3311,24 @@ namespace ts {
|
|||
let start = new Date().getTime();
|
||||
let result = isInStringOrRegularExpressionOrTemplateLiteral(contextToken) ||
|
||||
isSolelyIdentifierDefinitionLocation(contextToken) ||
|
||||
isDotOfNumericLiteral(contextToken);
|
||||
isDotOfNumericLiteral(contextToken) ||
|
||||
isInJsxText(contextToken);
|
||||
log("getCompletionsAtPosition: isCompletionListBlocker: " + (new Date().getTime() - start));
|
||||
return result;
|
||||
}
|
||||
|
||||
function isInJsxText(contextToken: Node): boolean {
|
||||
if (contextToken.kind === SyntaxKind.JsxText) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return contextToken.kind === SyntaxKind.GreaterThanToken &&
|
||||
contextToken.parent &&
|
||||
(contextToken.parent.kind === SyntaxKind.JsxOpeningElement ||
|
||||
contextToken.parent.kind === SyntaxKind.JsxSelfClosingElement ||
|
||||
contextToken.parent.kind === SyntaxKind.JsxClosingElement);
|
||||
}
|
||||
|
||||
function isNewIdentifierDefinitionLocation(previousToken: Node): boolean {
|
||||
if (previousToken) {
|
||||
let containingNodeKind = previousToken.parent.kind;
|
||||
|
|
18
tests/cases/fourslash/tsxCompletion9.ts
Normal file
18
tests/cases/fourslash/tsxCompletion9.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
//@Filename: file.tsx
|
||||
//// declare module JSX {
|
||||
//// interface Element { }
|
||||
//// interface IntrinsicElements {
|
||||
//// div: { ONE: string; TWO: number; }
|
||||
//// }
|
||||
//// }
|
||||
//// var x1 = <div> /*1*/ hello /*2*/ world /*3*/</div>;
|
||||
//// var x2 = <div> /*4*/ <div></div> /*5*/ world /*6*/</div>;
|
||||
//// var x3 = <div>/*7*/<div/>/*8*/world/*9*/</div>;
|
||||
//// var x4 = <div>/*10*/</div>;
|
||||
|
||||
for (var i = 1; i <= 10; i++) {
|
||||
goTo.marker(i + '');
|
||||
verify.completionListIsEmpty();
|
||||
}
|
Loading…
Reference in a new issue