答案 0 :(得分:0)
如果您使用此插件/扩展程序。 https://github.com/kokororin/vscode-phpfmt
有一个选项“RestoreComments”不修改/触摸注释块。
文件|偏好|设置
{
"phpfmt.psr2": true,
"phpfmt.visibility_order": true,
"phpfmt.passes": [
"PSR2KeywordsLowerCase",
"PSR2LnAfterNamespace",
"PSR2CurlyOpenNextLine",
"PSR2ModifierVisibilityStaticOrder",
"PSR2SingleEmptyLineAndStripClosingTag",
"ReindentSwitchBlocks",
"SpaceAfterExclamationMark",
"ReplaceBooleanAndOr",
"RestoreComments",
"GeneratePHPDoc"
],
"phpfmt.exclude": [
"ReindentComments",
"StripNewlineWithinClassBody"
],
"[php]": {
"editor.insertSpaces": true,
"editor.tabSize": 4,
"editor.autoIndent": true,
"editor.formatOnSave": true
}
}