我在 VSCode 中使用 php 格式化程序,我的问题是在一些也有 html 的视图文件上代码变得混乱,所以我试图从 formatOnSave 中排除文件夹
这是我目前的配置。
"editor.formatOnSave": true,
"[php]": {
"editor.formatOnSave": false
}
我怎样才能在除视图之一之外的所有文件夹上保存 php 格式?
我在 VSCode 中使用 php 格式化程序,我的问题是在一些也有 html 的视图文件上代码变得混乱,所以我试图从 formatOnSave 中排除文件夹
这是我目前的配置。
"editor.formatOnSave": true,
"[php]": {
"editor.formatOnSave": false
}
我怎样才能在除视图之一之外的所有文件夹上保存 php 格式?
如果您使用Prettier,那么您可以创建一个.prettierignore文件并包含要从格式化中排除的目录。您可能需要进入 Prettier 的扩展设置并设置 .prettierignore 的文件路径才能使其生效。
如果您使用的是Beautify,则可以使用以下beautify.ignore选项:
例子:
/* ignore all files named 'test.js' not in the root folder, all files directly in any 'spec' directory, and all files in any 'test' directory at any depth */ "beautify.ignore": ["*/test.js", "**/spec/*", "**/test/**/*"] /* ignore all files ending in '_test.js' anywhere */ "beautify.ignore": "**/*_test.js"