Skip to content
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

Class comments are dropped by Spoon when reading from file system #18

Closed
slarse opened this issue Feb 19, 2020 · 3 comments
Closed

Class comments are dropped by Spoon when reading from file system #18

slarse opened this issue Feb 19, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@slarse
Copy link
Collaborator

slarse commented Feb 19, 2020

I'm not sure if this is something I'm doing wrong, or if Spoon is doing it wrong (I think the latter), but adding an input resource from the file system results in the class comment being dropped. Not always, but often. For example, with this file:

/**
 * This is a comment!
 */
public class Test {}

Then this drops the class comment:

launcher.addInputResource(new FileSystemFile(pathToFile));

but this captures the class comment:

launcher.addInputResource(new VirtualFile(readFile(pathToFile)));

TODO: Work around for now, report on Spoon issue tracker if the latest build doesn't resolve it.

@slarse slarse added the bug Something isn't working label Feb 19, 2020
@slarse
Copy link
Collaborator Author

slarse commented Mar 15, 2020

This is related to INRIA/spoon#3300

@slarse slarse added the wontfix This will not be worked on label Apr 18, 2020
@slarse
Copy link
Collaborator Author

slarse commented May 12, 2020

The problem is that the comments are attached to the compilation unit if they are at the very start of the file. A workaround could be to simply attach them to the package statement instead (if there is a package statement), and simply not care about that odd case where there is no package statement.

@slarse slarse removed the wontfix This will not be worked on label May 24, 2020
@slarse
Copy link
Collaborator Author

slarse commented May 24, 2020

Fixed by 3ceee85

@slarse slarse closed this as completed May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant