spectacles / CodeComplice

CodeIntel for Sublime Text 2 / 3
Other
167 stars 18 forks source link

I never see manual autocompletion #17

Closed Kcko closed 9 years ago

Kcko commented 9 years ago

I never see manual autocompletion (ctrl + shift + space). I remove .codeintel/ + sublime code intel plugin ... and install your plugin ...

Can you help me?

EDIT: after updating index (10 min indexing / medium project is working).... My mistake.

Advantage: is fast against last update CodeIntel ;).

Improve to future - better PHP code intelisense ... it´s little tragedy in comparing with PHP IDE (ie: PHP Storm , PHP Designer etc.)

See screenshot: http://files.rjwebdesign.cz/i/20150213-142547---532x190---%25t---%25pn.png

Im looking for some CONSTANTS from Form object .. nothing given.

wizza-smile commented 9 years ago

class constants are working in principle. The plugin has a weak spot on namespaces though. I searching do a way to improve that. http://i58.tinypic.com/11kl4za.png

meigallodixital commented 9 years ago

On a big project (symfony 2.x based for example) never autocompletes. it gives timeout always. On sublimecodeintel happens the same problem.

wizza-smile commented 9 years ago

You will probably have to configure your "codeintel_scan_exclude_dir". But seriously, you have to provide as much info as possible (os, ST version, console output), to make it possible to analyze your problem!

meigallodixital commented 9 years ago

Sublime text: Build 3082 dev channel CodeComplice: 1.1.2 Codeintel: 2.0.24 OS: Windows 7 64bits Problem: Update indexes for PHP fail with a timeout. Plugin host uses an entire core, a lot of ram and never ends.

done eval: timed out
+ Info: Timeout while resolving completions!
Done 'PHP' CodeIntel! Full CodeIntel took ~21s

But this fail from years on sublicodeintel, it's like a feature ;)

I do not want to exclude directories, is just the sense of autocompletion. Show the definitions of code from other people is what I need . :)

wizza-smile commented 9 years ago

You really need to take care of what directories you are indexing. When working with symfony you should REALLY exclude AT LEAST the /cache/ directory. Nothing valid in there, but huge amount of subdirectories.

Please go to Sublime Command Palette, type "Dump" and select "CodeComplice: Dump import Directories".

It will raise a message dialog with the current database directory. In this directory (or one directory level "up" from there) you will find a new directory "import_dir_stats". The Command has written all scanned directories per language into text files.

The way to go is to only include directories you are sure you will use/need.

Feel free to post the content of the php file here to get further advice!

Good luck!

meigallodixital commented 9 years ago

Obviously i not have indexed the cache and logs directories . ;)

{   
    "codeintel_enabled_languages":
    [
       "JavaScript", "HTML", "XML", "HTML5", "CSS", "Twig", "Less", "PHP"
    ],
    "codeintel_live": false,
    "codeintel_scan_exclude_dir":[],
    "codeintel_language_settings": {
        "JavaScript": {
            "codeintel_scan_extra_dir": [],
            "codeintel_scan_exclude_dir":["/build/", "/min/"],
            "codeintel_scan_files_in_project": false,
            "codeintel_selected_catalogs": ["jQuery"]
        },
        "PHP": {
            "php": "D:\\php\\php.exe",
            "codeintel_scan_extra_dir": [],
            "codeintel_scan_files_in_project": true,
            "codeintel_max_recursive_dir_depth": 25,
            "codeintel_scan_exclude_dir":["D:\\test.com\\app\\cache", "D:\\test.com\\app\\logs"]
        }
    }
}
wizza-smile commented 9 years ago

what about the "import_dir_stats"?

meigallodixital commented 9 years ago

1.400 dirs ...

I'll try disabling a couple of vendors and see what happens.

wizza-smile commented 9 years ago

don't forget to delete your database to force re-indexing with "exclude dirs" settings!

meigallodixital commented 9 years ago

I disabled the entire directory vendors , .codeintel deleted and re-indexed .

Now are 775 directories to index . No longer gives timeout but still does not autocomplete. But works go to the definition now.

wizza-smile commented 9 years ago

well, that's some kind of progress! Komodo's recommendation is using around 100 import dirs for optimal results. I had good results with around 400.

It's a bit hard to say why you don't get autocomplete suggestions. Nothing's showing in the console? Is it working in other projects?

meigallodixital commented 9 years ago

Console log:

Could not import subprocess32 module, falling back to subprocess module
Invalid language: Plain text. Available: Ruby, Smarty, Sass, Django, Twig, XSLT, Mason, Tcl, Perl, RHTML, JavaScript, Node.js, HTML5, SCSS, CSS, XML, PHP, Python, HTML, Go, TemplateToolkit, Python3, Less, XBL, XUL
processing `PHP': please wait...
current triggername: 'php-complete-object-members'
Doing CodeIntel for 'PHP' (hold on)...
Timeout while resolving completions!
spectacles commented 9 years ago

Question: Is the autocompletion working in other projects of yours??

Well, that's not bringing us anywhere! I think at this point, since reducing the import directories gave you "goto_defn", it will take us closer to our goal, if you you would reduce the import dirs even further and see if that's bringin things to life! If yes, then there is possibilities:

  1. The sheer amount of the scanned source code was killing CodeComplice
  2. One of the directories contained code, that made CodeComplice stumble You could (rule out/check for) [2.] by re-adding the directories one by one, and see where things stop working.

Also some more things: You should define a designated database for your project in "codeintel_database_dir". Then please let us know the size (MB) of your database dir once the index finished building. The number of directories is not really saying much about the contained code!

Question: Is the autocompletion working in other projects of yours??

meigallodixital commented 9 years ago

As returns timeout I do not know if really indexes all the code. This is a clean db indexed with only the src directory.

https://www.dropbox.com/s/cymkttk49x6ne8r/db_dir.png

spectacles commented 9 years ago

Have you had the time to rule out possibility number 2 (see my post above!)?

I can remember when working with symfony two there where some files deep down in some susubsubdirectories, that contained some problematic characters.

So "codeintel_max_recursive_dir_depth": 25 this is problematic. You should try and change that to 10 and see if that works.

Let me how you're doing!

Greetings, spectacles!

meigallodixital commented 9 years ago

With 10 on recursive depth and vendor folder omited it gives timeout on sublime's statusbar, but autocompletes ok.

evaluating 'parent' at AppKernel.php#16: could not resolve first part of '\Symfony\Component\HttpKernel\Kernel'
done eval: eval error

Config

{
    "codeintel_settings":
    {
        "codeintel_database_dir": "D:\\codeintel",
        "codeintel_enabled_languages":
        [
           "JavaScript", "HTML", "XML", "HTML5", "CSS", "Twig", "Less", "PHP"
        ],
        "codeintel_live": false,
        "codeintel_scan_exclude_dir":[],
        "codeintel_language_settings": {
            "JavaScript": {
                "codeintel_scan_extra_dir": [],
                "codeintel_scan_exclude_dir":["/build/", "/min/"],
                "codeintel_scan_files_in_project": false,
                "codeintel_selected_catalogs": ["jQuery"]
            },
            "PHP": {
                "php": "D:\\php\\php.exe",
                "codeintel_scan_extra_dir": [],
                "codeintel_scan_exclude_dir":["app", "vendor", "web"],
                "codeintel_scan_files_in_project": true,
                "codeintel_max_recursive_dir_depth": 10
            }
        }
    },
    "folders":
    [
        {
            "path": "D:\\testproject",
            "folder_exclude_patterns": ["app/cache", "app/logs"]
        }
    ]
}

If I add vendor folder gives timeout and autocomplete fail.

spectacles commented 9 years ago

So the culprit is a file in the vendor folder! done eval: eval error is a regular case, not a bug. Autocompletion is a best attempt, not a pledge!! congraztz, it works!