@@ -1143,15 +1143,15 @@ public Label visit(Property nd, Context c) {
11431143 locationManager .emitNodeLocation (nd , propkey );
11441144 visitAll (nd .getDecorators (), propkey , IdContext .varBind , -1 , -1 );
11451145 visit (nd .getKey (), propkey , 0 , nd .isComputed () ? IdContext .varBind : IdContext .label );
1146- visit (nd .getValue (), propkey , 1 , c .idcontext );
1146+ Label valueLabel = visit (nd .getValue (), propkey , 1 , c .idcontext );
11471147 visit (nd .getDefaultValue (), propkey , 2 , IdContext .varBind );
11481148 if (nd .isComputed ()) trapwriter .addTuple ("is_computed" , propkey );
11491149 if (nd .isMethod ()) trapwriter .addTuple ("is_method" , propkey );
11501150
11511151 // Extract the value of a property named `template` as HTML, in order to support
11521152 // Angular2 components with an inline template.
11531153 if (!nd .isComputed () && "template" .equals (tryGetIdentifierName (nd .getKey ()))) {
1154- extractStringValueAsHtml (nd .getValue ());
1154+ extractStringValueAsHtml (nd .getValue (), valueLabel );
11551155 }
11561156
11571157 return propkey ;
@@ -1160,7 +1160,7 @@ public Label visit(Property nd, Context c) {
11601160 /**
11611161 * Extracts the string value of <code>expr</code> as an HTML snippet.
11621162 */
1163- private void extractStringValueAsHtml (Expression expr ) {
1163+ private void extractStringValueAsHtml (Expression expr , Label exprLabel ) {
11641164 TextualExtractor textualExtractor = lexicalExtractor .getTextualExtractor ();
11651165 if (textualExtractor .isSnippet ()) {
11661166 return ; // do not create nested snippets
@@ -1185,7 +1185,11 @@ private void extractStringValueAsHtml(Expression expr) {
11851185 getMetrics (),
11861186 vfile .toFile ());
11871187 HTMLExtractor html = HTMLExtractor .forEmbeddedHtml (config );
1188- html .extract (innerTextualExtractor );
1188+ List <Label > rootNodes = html .extractEx (innerTextualExtractor ).fst ();
1189+ int rootNodeIndex = 0 ;
1190+ for (Label rootNode : rootNodes ) {
1191+ trapwriter .addTuple ("xml_element_parent_expression" , rootNode , exprLabel , rootNodeIndex ++);
1192+ }
11891193 }
11901194
11911195 private String tryGetIdentifierName (Expression e ) {
0 commit comments