[英]How to auto format PHP code curly braces to new lines in VS Code
[英]How to configure VS code when coding PHP so braces are keep on new line
假設我有這段代碼,其中每個大括號都在單獨的一行上。 一旦我保存此代碼,代碼就會被 VS 代碼更改,因此每個大括號不再位於單獨的行上。
function mainEngine(string &$errmessage): void
{
if (isFormSent())
{
if ((new User())->loginUser($_POST['username'],
$_POST['password']))
{
header("Location:admin.php");
}
else
{
$errmessage = "Felaktig användare/password";
}
}
}
//托尼
正如M. Volf所說:這是您的用戶設置 (JSON) 上的特定智能大括號配置(k&r 類型大括號),添加此行:“intelephense.format.braces”:“k&r”,
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.