fix(compiler-cli): compute source-mappings for localized strings (#38747)

Previously, localized strings had very limited or incorrect source-mapping
information available.

Now the i18n AST nodes and related output AST nodes include source-span
information about message-parts and placeholders - including closing tag
placeholders.

This information is then used when generating the final localized string
ASTs to ensure that the correct source-mapping is rendered.

See #38588 (comment)

PR Close #38747
This commit is contained in:
Pete Bacon Darwin
2020-08-31 16:27:44 +01:00
committed by atscott
parent 6b0dba48b1
commit b4eb016e56
7 changed files with 217 additions and 113 deletions

View File

@ -41,7 +41,7 @@ import {_extractMessages} from '../i18n_parser_spec';
new i18n.IcuPlaceholder(null!, '', null!),
],
null!);
const tag = new i18n.TagPlaceholder('', {}, '', '', [container], false, null!, null);
const tag = new i18n.TagPlaceholder('', {}, '', '', [container], false, null!, null, null);
const icu = new i18n.Icu('', '', {tag}, null!);
icu.visit(visitor);