-
Notifications
You must be signed in to change notification settings - Fork 107
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
missing comments on patches #231
Comments
Here, we disable before creating the model:
|
Actually, if we enable the inclusion of comments
we have:
|
Solution: diff context = 0 |
default value is 0 (instead of 3)
In the generated result file, I don't have comments either. Has this been fixed? Could you explain a bit how to keep the comments? |
Hi @qiujiangkun To include comments, we should include them in the generated model.
I'd say that would be simple to modify astor to include them: add an option that indicates whether comments should be included or not, then use the value (e.g., read it using the ConfigurationProperties) when Astor creates the model here |
PRs are welcome @qiujiangkun , you are welcome if you 'd try to implement this feature. We can help you :) |
Thanks for the solution. I've implemented a very primitive algorithm based on Intellij IDEA's great PSI model, to match patch against original code structure as much as possible. |
That code could be very useful for future research. Do you have a pointer? |
Yes, I have modified my previous comment to include link to that code |
The modified version of the patched file does not include comments, even it keeps the original line number of elements. (it leaves empty lines).
Reported by @tdurieux.
The text was updated successfully, but these errors were encountered: