INRIA / spoon

Spoon is a metaprogramming library to analyze and transform Java source code. :spoon: is made with :heart:, :beers: and :sparkles:. It parses source files to build a well-designed AST with powerful analysis and transformation API.
http://spoon.gforge.inria.fr/
Other
1.75k stars 351 forks source link

bug: sniper mode does not work when one removes a type #3183

Open monperrus opened 4 years ago

monperrus commented 4 years ago

When one removes a top-level type in Sniper mode and that the type is the only one in the file, the file should be removed when pretty-printing.

Use case: automated removal of deprecated classes, see removeDeprecatedMethods.

monperrus commented 4 years ago

To do it really nicely, we can do a rm or even git rm from Spoon if the source folder is the same as the target folder.