You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

JetBrains PhpStorm注释存在大量多余空格问题求助

解决PhpStorm Blade文件注释自动生成多余空格的问题
  • 打开PhpStorm设置(Mac快捷键:Cmd + ,)
  • 进入Editor > Code Style > Blade设置项
  • 切换到Tabs and Indents标签页:
    • 取消勾选Align comments with code
    • 将Indent comments设置为Same as code
  • 接着检查通用注释设置:进入Editor > Code Style > General > Comments,取消Align line comments的勾选

如果是用快捷键(比如Cmd + /)加注释时的对齐问题,再调整这一步:

  • 回到Blade设置的Code Generation标签页
  • 在Line comment区域,取消Add at first column的勾选,确保注释缩进和当前行输入位置一致

调整完这些设置后,再在Blade文件里添加注释,就会和VSCode默认效果一样,注释位置和输入位置匹配,不会自动生成多余空格。

内容的提问来源于stack exchange,提问作者Wally

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 23:27:08