@@ -2314,7 +2314,7 @@ namespace ts {
23142314
23152315 return true ;
23162316 }
2317-
2317+
23182318 return false ;
23192319 }
23202320
@@ -2333,7 +2333,7 @@ namespace ts {
23332333 }
23342334 return false ;
23352335 }
2336-
2336+
23372337 function tryConsumeDefine ( ) : boolean {
23382338 let token = scanner . getToken ( ) ;
23392339 if ( token === SyntaxKind . Identifier && scanner . getTokenValue ( ) === "define" ) {
@@ -2359,7 +2359,7 @@ namespace ts {
23592359 if ( token !== SyntaxKind . OpenBracketToken ) {
23602360 return true ;
23612361 }
2362-
2362+
23632363 // skip open bracket
23642364 token = scanner . scan ( ) ;
23652365 let i = 0 ;
@@ -2374,7 +2374,7 @@ namespace ts {
23742374 token = scanner . scan ( ) ;
23752375 }
23762376 return true ;
2377-
2377+
23782378 }
23792379 return false ;
23802380 }
@@ -3976,7 +3976,7 @@ namespace ts {
39763976 let sourceFile = getValidSourceFile ( fileName ) ;
39773977
39783978 let entries : CompletionEntry [ ] = [ ] ;
3979-
3979+
39803980 if ( isRightOfDot && isSourceFileJavaScript ( sourceFile ) ) {
39813981 const uniqueNames = getCompletionEntriesFromSymbols ( symbols , entries ) ;
39823982 addRange ( entries , getJavaScriptCompletionEntries ( sourceFile , uniqueNames ) ) ;
@@ -4595,6 +4595,7 @@ namespace ts {
45954595 case SyntaxKind . PropertyAccessExpression :
45964596 case SyntaxKind . QualifiedName :
45974597 case SyntaxKind . ThisKeyword :
4598+ case SyntaxKind . ThisType :
45984599 case SyntaxKind . SuperKeyword :
45994600 // For the identifiers/this/super etc get the type at position
46004601 let type = typeChecker . getTypeAtLocation ( node ) ;
@@ -4866,6 +4867,7 @@ namespace ts {
48664867 function getSemanticDocumentHighlights ( node : Node ) : DocumentHighlights [ ] {
48674868 if ( node . kind === SyntaxKind . Identifier ||
48684869 node . kind === SyntaxKind . ThisKeyword ||
4870+ node . kind === SyntaxKind . ThisType ||
48694871 node . kind === SyntaxKind . SuperKeyword ||
48704872 isLiteralNameOfPropertyDeclarationOrIndexAccess ( node ) ||
48714873 isNameOfExternalModuleImportOrDeclaration ( node ) ) {
@@ -5561,7 +5563,7 @@ namespace ts {
55615563 }
55625564 }
55635565
5564- if ( node . kind === SyntaxKind . ThisKeyword ) {
5566+ if ( node . kind === SyntaxKind . ThisKeyword || node . kind === SyntaxKind . ThisType ) {
55655567 return getReferencesForThisKeyword ( node , sourceFiles ) ;
55665568 }
55675569
@@ -6043,7 +6045,7 @@ namespace ts {
60436045 cancellationToken . throwIfCancellationRequested ( ) ;
60446046
60456047 let node = getTouchingWord ( sourceFile , position ) ;
6046- if ( ! node || node . kind !== SyntaxKind . ThisKeyword ) {
6048+ if ( ! node || ( node . kind !== SyntaxKind . ThisKeyword && node . kind !== SyntaxKind . ThisType ) ) {
60476049 return ;
60486050 }
60496051
@@ -6405,7 +6407,8 @@ namespace ts {
64056407
64066408 return node . parent . kind === SyntaxKind . TypeReference ||
64076409 ( node . parent . kind === SyntaxKind . ExpressionWithTypeArguments && ! isExpressionWithTypeArgumentsInClassExtendsClause ( < ExpressionWithTypeArguments > node . parent ) ) ||
6408- node . kind === SyntaxKind . ThisKeyword && ! isExpression ( node ) ;
6410+ ( node . kind === SyntaxKind . ThisKeyword && ! isExpression ( node ) ) ||
6411+ node . kind === SyntaxKind . ThisType ;
64096412 }
64106413
64116414 function isNamespaceReference ( node : Node ) : boolean {
@@ -6525,6 +6528,7 @@ namespace ts {
65256528 case SyntaxKind . NullKeyword :
65266529 case SyntaxKind . SuperKeyword :
65276530 case SyntaxKind . ThisKeyword :
6531+ case SyntaxKind . ThisType :
65286532 case SyntaxKind . Identifier :
65296533 break ;
65306534
0 commit comments