简体   繁体   English

VS 代码 PHP 格式化程序 Intelephense

[英]VS Code PHP Formatter Intelephense

I use Visual Studio Code as my editor and Intelephense as my PHP formatter.我使用 Visual Studio Code 作为我的编辑器,使用 Intelephense 作为我的 PHP 格式化程序。 It works well for the most part, but Intelephense changes my format in several ways that makes it harder for me to read.它在大多数情况下运行良好,但 Intelephense 以多种方式改变了我的格式,这让我更难阅读。 For example, I like to format my code as follows:例如,我喜欢将我的代码格式化如下:

    if( $var ) {
        // Do something.
    }
    elseif( $var ) {
        // Do something.
    }

But, When I save: Intelephense changes the above to:但是,当我保存时: Intelephene 将上述内容更改为:

    if ($var) {
        // Do something.
    } elseif ($var) {
        // Do something.
    }

To me, that's harder to read, especially when dealing with long expressions.对我来说,这更难阅读,尤其是在处理长表达式时。 How can I configure Intelephense to format my code as in the first example?如何配置 Intelephense 以像第一个示例中那样格式化我的代码?

Extensions > PHP Intelephense > Manage(click the gear) > Find Intelephense › Format: Braces and change or Find Intelephense › Format: Enable and remove tick.扩展 > PHP Intelephense > 管理(单击齿轮)> 查找 Intelephense › 格式:大括号并更改或查找 Intelephense › 格式:启用并删除勾选。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VS Code PHP 数组中的 Intelephense 对象未向 -> 运算符显示属性和函数 - VS Code PHP Intelephense objects in array not showing properties and functions to -> operator PHP:VS 代码 + >Intelephense 检测到在 foreach(和函数)中传递的引用错误 - PHP : VS code + >Intelephense detect an error on references passed in foreach (and in functions) VS Code PHP Intelephense 扩展是否有配置标志来关闭参数提示? - Is there a configuration flag for VS Code PHP Intelephense extension to turn off the parameter hinting? 为什么通过 VS 代码 php intelephense 扩展在 laravel 应用程序中使用别名定义的值时显示错误未定义? - Why showing error undefined when using alias defined values in laravel application through VS code php intelephense extension? VS Code 上的 intelephense 错误:预期类型为“字符串”。 找到'字符串 []' - intelephense error on VS Code: Expected type 'string'. Found 'string[]' Visual Studio Code PHP Intelephense 收到错误 - Visual Studio Code PHP Intelephense gets errors which aren't Visual Studio Code PHP Intelephense 自动格式化 Null 合并运算符 - Visual Studio Code PHP Intelephense auto formats Null Coalescing Operator Visual Studio Code PHP Intelephense 继续显示不必要的错误 - Visual Studio Code PHP Intelephense Keep Showing Not Necessary Error 我们可以按照 WordPress 编码标准在 VS Code 中设置 Intelephense 吗? - Can we set up Intelephense in VS Code as per WordPress coding Standard? VSCODE PHP IntelliSense / Intelephense 问题 - VSCODE PHP IntelliSense / Intelephense issues
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM