Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDEA hangs for minutes when working with frameworks like Laravel #33

Closed
klesun opened this issue Mar 10, 2018 · 2 comments
Closed

IDEA hangs for minutes when working with frameworks like Laravel #33

klesun opened this issue Mar 10, 2018 · 2 comments
Assignees
Labels
BG Type Provider This issue is related to the broken feature of supplying type info from plugin to IDEA status: released The said change is now in jetbrains repo main channel and anyone will get it after updating the plug type: bug

Comments

@klesun
Copy link
Owner

klesun commented Mar 10, 2018

Reported by a reliable source.

Should checkout some big projects and reproduce. Then fix. Maybe put a 1 second timeout in resolver.

@bazzik
Copy link

bazzik commented Mar 13, 2018

Yeah -- had to disable this plugin as it's not usable in Laravel project. E.g. I have to wait like 15-20 seconds when typing each letter when typing view name in return view('...'); .. which should not be affected as it's not array completion. CPU is hight then. With plugin disabled it all works just fine and I barely see CPU usage during code completion.

  • Laravel 5.6;
  • PHP 7.1;
  • PhpStorm 2017.3.4 using JRE x64;
  • Windows 10 x64;
  • Laravel plugin installed;
  • Laravel IDE-Helper package in used

Project is pretty much empty. I mean -- just under 40 new classes: around 15 is some "support library" and the rest is basically an control panel logic (AdminLTE based) with login/reset pwd/logout and manage admin users functionality only (.php & .blade.php files -- together under 70 new files of PHP-related code -- not counting CSS/JS and stuff).

Maybe it's related to composer packages installed (e.g. "barryvdh/laravel-ide-helper" and the way how ide-helper/metadata files work)? Just in case: here is appropriate section of it:

    "require": {
        "php": ">=7.1.3",
        "fideloper/proxy": "~4.0",
        "intervention/imagecache": "^2.3",
        "laravel/framework": "5.6.*",
        "laravel/tinker": "~1.0",
        "mccool/laravel-auto-presenter": "^7.0"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.1",
        "barryvdh/laravel-ide-helper": "^2.4",
        "filp/whoops": "~2.0",
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "~1.0",
        "nunomaduro/collision": "~1.1",
        "phpunit/phpunit": "~7.0",
        "symfony/thanks": "^1.0"
    },

klesun added a commit that referenced this issue Mar 23, 2018
Only use it on a particular expression (instead of whole file) on explicit user action like Ctrl+Space, Ctrl+Click, etc... This should fix the problem of validation lagging for several seconds each time you change code
@klesun
Copy link
Owner Author

klesun commented Mar 28, 2018

@bazzik, thanks for your detailed description. I managed to reproduce and fix the problem (I hope for the good).
https://plugins.jetbrains.com/plugin/9927-deep-assoc-completion/update/44358

The problem was that each time a file got changed the Type Provider from my plugin was triggered to resolve each expression in the file. Deep resolution of one expression takes 100+ milliseconds when some tricky abstractions (like Laravel's models) are concerned, and there are usually hundreds of expressions in a file...

I disabled the Type Provider by default, so plugin will not cause reindexing hang for seconds anymore. Option to enable it back, just in case, is located at Settings -> Languages & Frameworks -> PHP -> deep-assoc-completion -> Enable Background Deep Type Provider.

@klesun klesun closed this as completed Mar 28, 2018
@klesun klesun added BG Type Provider This issue is related to the broken feature of supplying type info from plugin to IDEA status: released The said change is now in jetbrains repo main channel and anyone will get it after updating the plug and removed status: in progress labels Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BG Type Provider This issue is related to the broken feature of supplying type info from plugin to IDEA status: released The said change is now in jetbrains repo main channel and anyone will get it after updating the plug type: bug
Projects
None yet
Development

No branches or pull requests

2 participants