@@ -67,6 +67,9 @@ export function isInsideStringLiteral(
67
67
* `@Component` or `{styleUrls: [someFunction('stringL¦iteral')]}`, the @angular/language-service
68
68
* will always give us the correct answer. This helper gives us a quick win for optimizing the
69
69
* number of requests we send to the server.
70
+ *
71
+ * TODO(atscott): tagged templates don't work: #1872 /
72
+ * https://github.com/Microsoft/TypeScript/issues/20055
70
73
*/
71
74
function isPropertyAssignmentToStringOrStringInArray (
72
75
documentText : string , offset : number , propertyAssignmentNames : string [ ] ) : boolean {
@@ -78,23 +81,8 @@ function isPropertyAssignmentToStringOrStringInArray(
78
81
let lastTokenText : string | undefined ;
79
82
let unclosedBraces = 0 ;
80
83
let unclosedBrackets = 0 ;
81
- let unclosedTaggedTemplates = 0 ;
82
84
let propertyAssignmentContext = false ;
83
-
84
- function isTemplateStartOfTaggedTemplate ( ) {
85
- return token === ts . SyntaxKind . NoSubstitutionTemplateLiteral ||
86
- token === ts . SyntaxKind . TemplateHead ;
87
- }
88
-
89
85
while ( token !== ts . SyntaxKind . EndOfFileToken && scanner . getStartPos ( ) < offset ) {
90
- if ( isTemplateStartOfTaggedTemplate ( ) ) {
91
- unclosedTaggedTemplates ++ ;
92
- }
93
- if ( token === ts . SyntaxKind . CloseBraceToken && unclosedTaggedTemplates > 0 ) {
94
- // https://github.com/Microsoft/TypeScript/issues/20055
95
- token = scanner . reScanTemplateToken ( /*isTaggedTemplate*/ true ) ;
96
- unclosedTaggedTemplates -- ;
97
- }
98
86
if ( lastToken === ts . SyntaxKind . Identifier && lastTokenText !== undefined &&
99
87
propertyAssignmentNames . includes ( lastTokenText ) && token === ts . SyntaxKind . ColonToken ) {
100
88
propertyAssignmentContext = true ;
0 commit comments