Search code examples
phpautocompletesublimetext3sublime-text-plugin

Bad autocompletion in SublimeText3 when pressing tab in PHP array


I'm using SublimeText3.

When i work in an array in PHP, the autocompletion proposed by pressing Tab totally annoys me.

I just want to add some tabulations, but at each time i press Tab, sublimetext propose me :

array(<list>)
Create a PHP Array.

If a just press Tab again, he valid the proposition and write in the file <list>.

I've installed this plugins :

{
    "installed_packages":
    [
        "Alignment",
        "ApacheConf.tmLanguage",
        "BracketHighlighter",
        "Comment-Snippets",
        "Comments Aware Enter",
        "eZ Publish Syntax",
        "HTML5",
        "jQuery",
        "LESS",
        "SublimeCodeIntel",
        "sublimelint",
        "Symfony2 Snippets",
        "Theme - Soda",
        "Twig"
    ]
}

If someone knows how to disable this bad proposition or to correct it ?

Thanks.


Solution

  • Update 01-29-14

    Over on Github someone found a better solution than the one I posted previously. New Solution.

    Open up your_packages_folder/SublimeCodeIntel/codeintel2/tree_php.py and add array to the tooltip ignore array around line 140.

    php_ignored_calltip_expressions = ("if", "elseif",
                                       "for", "foreach",
                                       "while",
                                       "switch",
                                       "array"
                                       )
    

    Old solution

    I found a temporary solution on github.

    Comment out or delete line 100 & 101 in SublimeCodeIntel/codeintel2/tree_php.py

    "array": "array(<list>)\n"
    "Create a PHP array.",
    

    Then delete the ~/.codeintel folder in your user dir on OS X, not sure where this cache lives on windows.