SlickEdit Product Discussion > Slick-C® Macro Programming

Adding php support for jrefactor.e/refactor_add_import() ?


I was wondering how difficult it would be to extend the jrefactor.e/refactor_add_import() function to support PHP.
Java and C# are supported already and it seems that SlickEdit has everything to make it possible for PHP (see screenshot with example for Queueable class).
Thanks for your attention.

Possible.  That code is pretty easy to trace.  There are few functions I can point you to that will get you started.

* _OnUpdate_refactor_add_import -- you'll want to add "phpscript" to the list of supported language modes
* _OnUpdate_refactor_goto_import -- same deal
* add_import -- trace it, look for how "using" is added for C++, add the appropriate code checking _LanguageInheritsFrom("phpscript")
* getAutoImportOptions -- here's where things get a bit trickier
That being said, PHP isn't a statically typed language, so you might encounter some heartaches along the way.

Thanks Dennis, that will help. I'd love to make it happen.


[0] Message Index

Go to full version