Skip to content

fix extracted docs of types include escaped linebreaks in signature #891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

woeps
Copy link
Contributor

@woeps woeps commented Jan 10, 2024

Closes #888

Json.escape was called twice:

  • once explicitly
  • twice in Protocol.wrapInQuotes

I also updated the test, to not contain e.g. \\n

Since this is my first PR in this repo, I hope this is fine?

@aspeddro
Copy link
Contributor

You can update tools/CHANGELOG.md?

@zth
Copy link
Collaborator

zth commented Jan 10, 2024

Awesome! I'm a bit worried about exotic identifiers if we don't escape. @woeps could you add a test case with a value like let \"SomeConstant\" = 12 and just make sure that the output doesn't break?

@woeps
Copy link
Contributor Author

woeps commented Jan 10, 2024

Awesome! I'm a bit worried about exotic identifiers if we don't escape. @woeps could you add a test case with a value like let \"SomeConstant\" = 12 and just make sure that the output doesn't break?

We still escape, because Protocol.wrapInQuotes calls Json.escape.
Before this PR, there were 4 places with someVar |> Json.escape |> Protocol.wrapInQuotes. This caused the strings being escaped twice.

Of cause, I'll add an additional test case and a note to the changelog.

@zth
Copy link
Collaborator

zth commented Jan 10, 2024

@woeps thanks for the explanation. This is ready to merge after that's settled. Could you test the other in progress PR too? I can release a new tools version after both of these are merged then.

let \"SomeConstant\" = 12
@zth
Copy link
Collaborator

zth commented Jan 10, 2024

@woeps looks good, although there's a weird escape of : but maybe that doesn't matter. Ready to go?

@woeps
Copy link
Contributor Author

woeps commented Jan 10, 2024

@zth not sure which escape you mean?

Now (after updating changelog) it's good to go.

@zth zth merged commit d39e28c into rescript-lang:master Jan 10, 2024
@woeps woeps deleted the do-not-escape-twice-in-signature-docextraction branch January 10, 2024 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

extracted docs of types include escaped linebreaks in signature
3 participants