@@ -67,6 +67,9 @@ export function isInsideStringLiteral(
6767 * `@Component` or `{styleUrls: [someFunction('stringL¦iteral')]}`, the @angular/language-service
6868 * will always give us the correct answer. This helper gives us a quick win for optimizing the
6969 * 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
7073 */
7174function isPropertyAssignmentToStringOrStringInArray (
7275 documentText : string , offset : number , propertyAssignmentNames : string [ ] ) : boolean {
@@ -78,23 +81,8 @@ function isPropertyAssignmentToStringOrStringInArray(
7881 let lastTokenText : string | undefined ;
7982 let unclosedBraces = 0 ;
8083 let unclosedBrackets = 0 ;
81- let unclosedTaggedTemplates = 0 ;
8284 let propertyAssignmentContext = false ;
83-
84- function isTemplateStartOfTaggedTemplate ( ) {
85- return token === ts . SyntaxKind . NoSubstitutionTemplateLiteral ||
86- token === ts . SyntaxKind . TemplateHead ;
87- }
88-
8985 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- }
9886 if ( lastToken === ts . SyntaxKind . Identifier && lastTokenText !== undefined &&
9987 propertyAssignmentNames . includes ( lastTokenText ) && token === ts . SyntaxKind . ColonToken ) {
10088 propertyAssignmentContext = true ;
0 commit comments