Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhpStorm extremely slow while editing vue.js files

I'm using PhpStorm 2017.1.4 with the vue.js plugin. The problem I have is: this plugin is extremely slow and makes coding impossible as you type and you don't see what you type only with 1 to 2 seconds lag. It takes 95% of allocated memory. It takes 50% of the CPU usage.

The project I'm working on is new and I have only one file open of less than 70 lines.

Settings offers to install for vue.js plugin v171.4424.63 I tried to install an earlier version of the plugin v171.3780.63 from https://plugins.jetbrains.com/plugin/9442-vue-js but the result is the same.

Installing more recent versions wasn't supported by PhpStorm and showed it in red with the message "plugin is not compatible with current PhpStorm installation".

I already opened an issue on https://youtrack.jetbrains.com/issue/WI-36715. But what do I do until they fix the issue? code on notepad?

Is there anything I can do to speed things up?

like image 205
Warrio Avatar asked Jun 03 '17 12:06

Warrio


People also ask

Is PHPStorm slow?

PHPStorm 2021.2 stupidly slow and constantly indexing files (actually, incrementally worse ever since 2020.2^ onwards) – IDEs Support (IntelliJ Platform) | JetBrains.

Is WebStorm good for Vue?

WebStorm provides support for the Vue. js building blocks of HTML, CSS, and JavaScript with Vue. js-aware code completion for components, including components defined in separate files, attributes, properties, methods, slot names, and more. With the built-in debugger, you can debug your Vue.


3 Answers

Did this and solved my problem

Tell php storm to ignore the /public dir for indexing.

  1. Right-click a dir (like public, or public/js),
  2. Choose mark directory as and select excluded.
  3. PHPStorm will no longer index it when changes are made.
like image 115
Huynh Thien Phuoc Avatar answered Oct 23 '22 01:10

Huynh Thien Phuoc


I had similar issue and for me the problem was with multiple copies of generated javascript files by Encore / Webpack in public folder. Therefore, PhpStorm indexed all duplicates and was using all the duplicates for code completion / code navigation.

Excluding the folder with generated javascript files (mark directory as excluded in PhpStorm) helped!

(well, I should have excluded such folder long time ago)...

like image 22
betatester07 Avatar answered Oct 23 '22 01:10

betatester07


I have just found what was making my specific project so slow and not other ones: I am using Laravel mix tool for versioning my js and sass files. I had more than 200 generated copies of each stored in the public directory. Edit Even if I have added public\js and public\css to the .gitignore, phpStorm VCS (version control) PhpStorm was taking almost all ressource to index these files. Now I deleted the unused files, the plugin is fast as it should be.

The question that remains now is why laravel mix is not deleting the previous versions of built css and js files?

like image 44
Warrio Avatar answered Oct 23 '22 02:10

Warrio