digitalmars.D.learn - How to get warnings about unused imports ?
Hi, How to find unused imports ? It seems the compiler doesn't do it, but is there any other tool for that? This seems like small issue, but those unused imports pile up pretty quickly Regards, Gabi
Jul 02 2013
On Tuesday, 2 July 2013 at 21:49:37 UTC, Gabi wrote:Hi, How to find unused imports ? It seems the compiler doesn't do it, but is there any other tool for that? This seems like small issue, but those unused imports pile up pretty quickly Regards, GabiI'm working on something like that for a few days. It is still not completely finished, but it works so far. But currently only for named imports. Everything else was far too much work for me. https://github.com/Dgame/SimpleDAT
Jul 02 2013
On Wednesday, 3 July 2013 at 06:12:46 UTC, Namespace wrote:On Tuesday, 2 July 2013 at 21:49:37 UTC, Gabi wrote:This is great. Maybe point me to the right direction how to implement finding unnamed imports too ? It could be great exercise for me to learn D :)Hi, How to find unused imports ? It seems the compiler doesn't do it, but is there any other tool for that? This seems like small issue, but those unused imports pile up pretty quickly Regards, GabiI'm working on something like that for a few days. It is still not completely finished, but it works so far. But currently only for named imports. Everything else was far too much work for me. https://github.com/Dgame/SimpleDAT
Jul 03 2013
You have to parse the unnamed import files, list all their identifiers (global variables, public functions etc.) and search for them. ;) That could be a bit complicated. ;) Therefore I don't want to do it. Even with named imports you can get false positives. But if you like it, you could improve it. The Lexer is my own and not that good, that would be start. On the wiki you can find other Lexer / Parsers, which are really good, but I haven't the time to replace my own and adapt the source or to work much on the project.
Jul 03 2013