Question

I'm just trying to find out how can I auto-import methods of an implemented interface.

Example:

//LoaderInterface.php
interface LoaderInterface
{
    public function load($endpoint);
}

//myLoader.php
class myLoader implements LoaderInterface

and here after writing implements LoaderInterface I would use some command to ends up with

//myLoader.php
class myLoader implements LoaderInterface
{
    public function load($endpoint)
    {
        //do something
    }
}  

I've tried sublimeCodeIntel but it seems to me that is not possible, or am I doing wrong?

Was it helpful?

Solution 2

Because I couldn't find something helpful, I've now decided to try to write my first plugin. At my first experience in Python.

Just in case someone could use it or help me improve this plugin.

https://github.com/ilpaijin/Sublime-Text-2-AutoimportSignature-Plugin

OTHER TIPS

There is a way in sublime_text


  1. go to tool
  2. new snippet

copy and pest these code *save* as whatever name You want


<snippet>
    <content><![CDATA[


interface ${1:LoaderInterface}
{
    public function ${2:load($endpoint);}
}

//myLoader.php
class myLoader implements ${3:LoaderInterface}


]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>loader</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <scope>source.php - variable.other.php</scope>
</snippet>

Note:

  1. You can call Your snippte by typing loader in beet been <?php ?> tag . 1 More thing to remember most save Your file as .php
  2. if you want to call Your snippet by Typing other Key Word You can put that keyword in beet-been <tabTrigger>**keyword**</tabTrigger>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top