clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
235 stars 86 forks source link

Added basic CleanImports command #170

Closed lucas-jones closed 9 years ago

lucas-jones commented 9 years ago

Simple clean imports command. Maybe too simple?

daboross commented 9 years ago

Just trying this out, it seems that import lines are being replaced with blank lines, rather than being removed completely (so there are no extra blank lines). Is this intentional?

clemos commented 9 years ago

Yeah I've reviewed it a bit (not tested), It seems you just look for the module (for exemple: Expr in haxe.macro.Expr), and if you don't find it in the source, it's just removed. The problem is, when you import a module, you don't just import the class named after the module, but also all the classes in the module (for Expr, you get a huge number of enums, etc). Also, I presume your regexp won't work with 'import js.Browser.window', or 'import js.html.*'... That's why I won't merge this as is, but feel free to reopen in case you addressed these issues.