paraphrase icon indicating copy to clipboard operation
paraphrase copied to clipboard

Parser able to read comments/documentation

Open danielkutik opened this issue 11 years ago • 1 comments

Known issues:

  • Android Build process eats comments.
  • Simple implementation without any validation, WIP

This PR is to discuss the issues. Do not merge until resolved.

Problem: If we use the ValueResourceParser and parse the processed values.xml file, which is generated by the build process, then there are no comments, the get eaten. Possible solution: we need to parse the untouched xml files (strings.xml, ...) to get the comments/documentation...

Original strings.xml:

<resources>
  <!-- This is a comment. Hopefully it makes it to the Javadoc someday! -->
  <string name="simple_test">The {quick} brown {fox} jumps over the {lazy} {dog}.</string>
  <string name="non_matching">A man, a plan, a canal. Panama.</string>
</resources>

Processed/generated values.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>

  <!-- From: file:/Users/d/Projects/github/paraphrase/src/test/fixtures/simple/src/main/res/values/strings.xml -->
  <eat-comment />

  <string name="non_matching">A man, a plan, a canal. Panama.</string>
  <string name="simple_test">The {quick} brown {fox} jumps over the {lazy} {dog}.</string>

</resources>

Additional todos: <!-- <string name="disabled_string">...</string> --> should be ignored and not seen as documentation

danielkutik avatar Jan 30 '14 14:01 danielkutik

I discussed this with Xavier on the mailing list. Future versions of the Android plugin will correctly merge comments.

JakeWharton avatar Jan 30 '14 17:01 JakeWharton