@@ -2320,7 +2320,7 @@ namespace ts {
23202320
23212321 return true ;
23222322 }
2323-
2323+
23242324 return false ;
23252325 }
23262326
@@ -2339,7 +2339,7 @@ namespace ts {
23392339 }
23402340 return false ;
23412341 }
2342-
2342+
23432343 function tryConsumeDefine ( ) : boolean {
23442344 let token = scanner . getToken ( ) ;
23452345 if ( token === SyntaxKind . Identifier && scanner . getTokenValue ( ) === "define" ) {
@@ -2365,7 +2365,7 @@ namespace ts {
23652365 if ( token !== SyntaxKind . OpenBracketToken ) {
23662366 return true ;
23672367 }
2368-
2368+
23692369 // skip open bracket
23702370 token = scanner . scan ( ) ;
23712371 let i = 0 ;
@@ -2380,7 +2380,7 @@ namespace ts {
23802380 token = scanner . scan ( ) ;
23812381 }
23822382 return true ;
2383-
2383+
23842384 }
23852385 return false ;
23862386 }
@@ -3985,7 +3985,7 @@ namespace ts {
39853985 let sourceFile = getValidSourceFile ( fileName ) ;
39863986
39873987 let entries : CompletionEntry [ ] = [ ] ;
3988-
3988+
39893989 if ( isRightOfDot && isSourceFileJavaScript ( sourceFile ) ) {
39903990 const uniqueNames = getCompletionEntriesFromSymbols ( symbols , entries ) ;
39913991 addRange ( entries , getJavaScriptCompletionEntries ( sourceFile , uniqueNames ) ) ;
@@ -4604,6 +4604,7 @@ namespace ts {
46044604 case SyntaxKind . PropertyAccessExpression :
46054605 case SyntaxKind . QualifiedName :
46064606 case SyntaxKind . ThisKeyword :
4607+ case SyntaxKind . ThisType :
46074608 case SyntaxKind . SuperKeyword :
46084609 // For the identifiers/this/super etc get the type at position
46094610 let type = typeChecker . getTypeAtLocation ( node ) ;
@@ -4875,6 +4876,7 @@ namespace ts {
48754876 function getSemanticDocumentHighlights ( node : Node ) : DocumentHighlights [ ] {
48764877 if ( node . kind === SyntaxKind . Identifier ||
48774878 node . kind === SyntaxKind . ThisKeyword ||
4879+ node . kind === SyntaxKind . ThisType ||
48784880 node . kind === SyntaxKind . SuperKeyword ||
48794881 isLiteralNameOfPropertyDeclarationOrIndexAccess ( node ) ||
48804882 isNameOfExternalModuleImportOrDeclaration ( node ) ) {
@@ -5570,7 +5572,7 @@ namespace ts {
55705572 }
55715573 }
55725574
5573- if ( node . kind === SyntaxKind . ThisKeyword ) {
5575+ if ( node . kind === SyntaxKind . ThisKeyword || node . kind === SyntaxKind . ThisType ) {
55745576 return getReferencesForThisKeyword ( node , sourceFiles ) ;
55755577 }
55765578
@@ -6052,7 +6054,7 @@ namespace ts {
60526054 cancellationToken . throwIfCancellationRequested ( ) ;
60536055
60546056 let node = getTouchingWord ( sourceFile , position ) ;
6055- if ( ! node || node . kind !== SyntaxKind . ThisKeyword ) {
6057+ if ( ! node || ( node . kind !== SyntaxKind . ThisKeyword && node . kind !== SyntaxKind . ThisType ) ) {
60566058 return ;
60576059 }
60586060
@@ -6414,7 +6416,8 @@ namespace ts {
64146416
64156417 return node . parent . kind === SyntaxKind . TypeReference ||
64166418 ( node . parent . kind === SyntaxKind . ExpressionWithTypeArguments && ! isExpressionWithTypeArgumentsInClassExtendsClause ( < ExpressionWithTypeArguments > node . parent ) ) ||
6417- node . kind === SyntaxKind . ThisKeyword && ! isExpression ( node ) ;
6419+ ( node . kind === SyntaxKind . ThisKeyword && ! isExpression ( node ) ) ||
6420+ node . kind === SyntaxKind . ThisType ;
64186421 }
64196422
64206423 function isNamespaceReference ( node : Node ) : boolean {
@@ -6534,6 +6537,7 @@ namespace ts {
65346537 case SyntaxKind . NullKeyword :
65356538 case SyntaxKind . SuperKeyword :
65366539 case SyntaxKind . ThisKeyword :
6540+ case SyntaxKind . ThisType :
65376541 case SyntaxKind . Identifier :
65386542 break ;
65396543
0 commit comments