Support exporting string literals for some languages#259
Open
mr-briggs wants to merge 1 commit into1Password:mainfrom
Open
Support exporting string literals for some languages#259mr-briggs wants to merge 1 commit into1Password:mainfrom
mr-briggs wants to merge 1 commit into1Password:mainfrom
Conversation
This builds upon PR 1Password#218 and partially resolves issue 1Password#228. Adds support for exporting string literals to Typescript, Python, and Go.
Author
|
Just a heads up to reviewers that I'm not as familiar with Go as the other languages! I've tried to be thorough with the testing but it's definitely possible that some edge cases aren't covered. |
mr-briggs
commented
Jul 31, 2025
| const ContainsDollarCurly string = "${not_interpolation}" | ||
| const EndsWithOddBackslash string = `Odd number of backslashes: \\\` | ||
| const NullByte string = "Null:\x00End" | ||
| const Combining string = "é vs é" |
Author
There was a problem hiding this comment.
In the original Rust string, these two accented characters are encoded differently (one as a combining accent). That's still the case here, but we've output the raw characters instead of escaped unicode, which makes them look the same here.
I think ideally, we'd export escaped unicode as-is (e.g. have const Combining string = "e\u0301 vs é"), but I wasn't sure how to achieve that.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This builds upon PR #218 and partially resolves issue #228 by adding support for exporting string literals to Typescript, Python, and Go.