PhpStorm 2020.2 - 无法识别 PHP 内置函数 [英] PhpStorm 2020.2 - PHP Built-in functions are not recognized

查看:81
本文介绍了PhpStorm 2020.2 - 无法识别 PHP 内置函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 PhpStorm 2020.2,注意到所有 php 基类,如 Closure 或 mysqli 都没有被 IDE 识别.

查看左侧 PHP 基本文件所在的位置,它只显示文件夹,就像您在第一张图片中看到的那样,另一方面,我的旧版 PhpStorm 2017 包含其中包含文件的文件夹,无法识别所有文件php基类

PhpStorm 2020.2

PhpStorm 2017

解决方案

这是一个已知问题.AFAIK 仍然不清楚为什么会发生这种情况以及为什么只有一些用户会受到影响.

如果问题仍然存在(即第二天/重启后再次出现),则是其他原因,您将不得不等待 2021.1.1 版本.

I just installed PhpStorm 2020.2, and notice that all php base classes like Closure or mysqli are not been identified by the IDE.

Looking at the left where the PHP base files are, it just show the folders, like you can see in the first image, on the other hand, my older PhpStorm 2017 has the folders with the files inside it and cant identify all php base classes

PhpStorm 2020.2

PhpStorm 2017

解决方案

It's a known issue. AFAIK there is still no solid idea on why it happens and why only some users are affected.

https://youtrack.jetbrains.com/issue/WI-54626 -- watch this ticket (star/vote/comment) to get notified on any progress. Fixed in PhpStorm 2021.1.1 version.


Current workaround:

  1. Close IDE
  2. Locate folder where PhpStorm 2020.2 stores indexes/caches on your computer (see below)
  3. Delete that folder (as standard "Invalidate caches" does not help here)
  4. Launch IDE

Typical locations for caches folder for different OS:

  • Windows: %USERPROFILE%\AppData\Local\JetBrains\PhpStorm2020.2\caches
  • Linux: ~/.cache/JetBrains/PhpStorm2020.2/caches
  • macOS: ~/Library/Caches/JetBrains/PhpStorm2020.2/caches

For 2021.1 version: use File | Invalidate Caches... -- it now better clears them so no need to delete such folders manually.

  1. File | Invalidate Caches...
  2. Select top 2 options (maybe only 1st will be enough, but better use both)
  3. Use Invalidate and Restart button there
  4. After the IDE will restart, open the project and let re-indexing to complete.

If the issue persists (i.e. comes back the next day / after restart) then it's a different cause and you will have to wait for 2021.1.1 build.

这篇关于PhpStorm 2020.2 - 无法识别 PHP 内置函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆