Phpstorm 设置注释符缩进位置

版权声明:欢迎任何形式的转载,但请务必注明出处,共创知识服务 https://blog.csdn.net/ASUKA2020/article/details/84527927

在日常PHP项目开发中,使用 Phpstrom 单行注释时,注释符号「//」没有和代码缩进的位置对齐。

注释不对齐情况:

function test() { 
    //这是注释
//    return false; 
}

我们想要的是下面这种:

function test() {
    //这是注释
    //return false;
}

设置方式:

菜单栏:File > Settings > Editor > Code Style > PHP
取消勾选「Code Generation」 选项卡下的「Line comment at first column」
添加勾选 「Code Generation」 选项卡下的「Add a space at comment start」
设置好后,依次点击「Apply」、「OK」按钮,使配置生效。

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/ASUKA2020/article/details/84527927