PHP Intelephense 扩展说明
PHP Intelephense 扩展说明
下载PHP Intelephense这个插件,要求php版本大于7,且设置环境变量。
扩展配置说明
generic syntax. eg ArrayAccessOrTraversable[ElementType => `ArrayAccessOrTraversable<mixed,ElementType>'.
将与类型化数组联合的' ArrayAccess'和可遍历实现解析为泛型语法
Resolves `BaseClass|staticTunion types to 'statici instead of BaseClass.
解析' BaseClass|staticTunion类型为'statici而不是BaseClass。
Global namespace constants and functions will be fully qualified (prefixed with a backslash),
全局命名空间常量和函数将是完全限定的(以反斜杠作为前缀),
Use declarations will be automatically inserted for namespaced classes, traits, interfaces, functions, and constants.
使用声明将自动插入命名空间类、特征、接口、函数和常量。
The maximum number of completion items returned per request.
每个请求返回的完成项的最大数量。
Method and function completions will include parentheses and trigger parameter hints.
方法和函数补全将包括圆括号和触发参数提示。
Enables argument count diagnostics.
● 启用参数计数诊断。
Enables deprecated diagnostics.
● 启用已弃用的诊断。
Enables duplicate symbol diagnostics.
● 启用重复符号诊断。
Enables diagnostics in embedded languages.
● 启用内嵌语言的诊断。
Enables reporting of problems associated with method and class implementations. For example, unimplemented methods or methodsignature incompatibilities.
支持报告与方法和类实现相关的问题。例如,未实现的方法或方法签名不兼容。
Enables reporting of various language constraint errors.
支持报告各种语言约束错误。
Enables diagnostics on type compatibility of arguments, property assignments, and return statements where types have been declared.
启用对已声明类型的实参、属性赋值和返回语句的类型兼容性的诊断。
Enables undefined class constant diagnostics.
● 启用未定义的类常量诊断。
Enables undefined class, interface and trait diagnostics.
启用未定义的类、接口和特征诊断。
The include paths (as individual path items) as defined in the include path ini setting or paths to external libraries. Can be absolute or relative tothe workspace folder. Used for resolving script inclusion and/or adding external symbols to folder.
在include path ini设置中定义的包含路径(作为单独的路径项)或到外部库的路径。可以是绝对的,也可以是相对于工作空间文件夹的。用于解析脚本包含和/或向文件夹添加外部符号。
Anonymous usage and crash data will be sent to Azure Application Insights. Inherits from telemetry.enableTelemetry.
匿名使用和崩溃数据将被发送到Azure Application Insights。继承自telemetry.enableTelemetry。
跟踪VSCode和智能语言服务器之间的通信。
配合laravel框架使用
采用 laravel-ide-helper 插件解决问题
一安装
- 使用 composer 安装 laravel-ide-helper
composer require --dev barryvdh/laravel-ide-helper
二配置
方法一
在安装完成后,需要到config/app.php中配置providers在后面加上以下代码
Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class,
方法二
在 app/Providers/AppServiceProvider.php 的 register 方法中添加如下代码
if ($this->app->environment() !== 'production')
{
$this->app->register(\Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class);
}
运行生效
然后运行
php artisan ide-helper:generate
● 生成帮 IDE 理解引用的代码
● 重启 vscode
● 错误提示消失啦,撒花~