clemos / haxe-sublime-bundle

Sublime Text bundle for Haxe programming language
Apache License 2.0
237 stars 85 forks source link

'organize imports' feature #192

Closed ghost closed 9 years ago

ghost commented 9 years ago

Sorts imports. Removes unused and unnecessary imports.

out

fponticelli commented 9 years ago

+1 !

clemos commented 9 years ago

Thanks a lot for your contribution :D

nadako commented 9 years ago

Unfortunately, this feature doesn't quite work, if you include a whole module which has a lot of types but don't have a main type (or you don't mention it in your code), it removes the import.

Example:

MyModule.hx

class SomeOtherName {}
typedef OneMore = {}

Main.hx

import MyModule; // this import will be removed despite SomeOtherName being used.

class Main {
    static function main() {
        var s = new SomeOtherName();
    }
}
ghost commented 9 years ago

Thanks. I'll try to fix that.