fix(@angular-devkit/schematics): fix generate mangling files contai…#11978
Merged
alexeagle merged 1 commit intoangular:masterfrom Sep 6, 2018
sebastianhaeni:fix-generate-file-mangling
Merged
fix(@angular-devkit/schematics): fix generate mangling files contai…#11978alexeagle merged 1 commit intoangular:masterfrom sebastianhaeni:fix-generate-file-mangling
generate mangling files contai…#11978alexeagle merged 1 commit intoangular:masterfrom
sebastianhaeni:fix-generate-file-mangling
Conversation
…ning wide characters Executing a command like `ng generate component my-component` can sometimes lead to mangled Angular module files when inserting the component into `declaration` and adding the import. This happens if the file contains characters that are wider than one byte e.g. a copyright sign or an umlaut. Today it is expected to be able to use two byte long characters in code. The `UpdateBuffer` class operates using Buffer objects which use byte arrays internally. Using text node positions provided by the TypeScript library, these will not match up. This change looks up the textual position inside the Buffer and uses the correct index. Closes #7851, #7950
Contributor
Author
|
Is there any feedback to this PR? |
clydin
approved these changes
Sep 6, 2018
|
Wonderful! |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ning wide characters
Executing a command like
ng generate component my-componentcan sometimes lead to mangled Angular module files when inserting the component intodeclarationand adding the import.This happens if the file contains characters that are wider than one byte e.g. a copyright sign or an umlaut. Today it is expected to be able to use two byte long characters in code.
The
UpdateBufferclass operates using Buffer objects which use byte arrays internally. Using text node positions provided by the TypeScript library, these will not match up.This change looks up the textual position inside the Buffer and uses the correct index.
Closes #7732
Closes #7851
Closes #7950
Closes #9560
Closes #10030
Closes #10095