문제

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?

도움이 되었습니까?

해결책 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

다른 팁

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top