使用问题反馈(Prettier无法格式化)

在Qoder编辑器中,当以Administrator用户身份运行时,Prettier格式化工具无法正常工作。根据初步分析,此问题可能与Administrator用户权限或环境配置相关。目前尚未测试其他插件是否存在类似问题。请协助诊断并解决这一Prettier格式化失效问题,包括检查用户权限设置、Qoder与Prettier的兼容性配置、相关文件系统访问权限以及环境变量设置等方面,确保在Administrator用户环境下Prettier能够正常执行代码格式化功能。

有具体报错图片么?请右上角提交下问题报告,并发下反馈码 我们看下 :grinning_face:

[“INFO” - 16:57:42] Extension Name: esbenp.prettier-vscode.
[“INFO” - 16:57:42] Extension Version: 11.0.2.
[“INFO” - 16:57:47] Using config file at web\vben.prettierrc.mjs
[“INFO” - 16:58:17] Using config file at web\vben.prettierrc.mjs
[“INFO” - 16:58:22] Formatting file:///web/vben/apps/web-antd/src/views/system/permission/modules/form.vue
[“INFO” - 16:58:22] Using config file at web\vben.prettierrc.mjs
[“INFO” - 16:58:22] PrettierInstance:
{
“modulePath”: “web\vben\node_modules\prettier\index.cjs”,
“messageResolvers”: {},
“version”: “3.6.2”
}
[“INFO” - 16:58:22] Using ignore file (if present) at web\vben\apps\web-antd.prettierignore
[“INFO” - 16:58:22] File Info:
{
“ignored”: false,
“inferredParser”: “vue”
}
[“INFO” - 16:58:22] Detected local configuration (i.e. .prettierrc or .editorconfig), VS Code configuration will not be used
[“INFO” - 16:58:22] Prettier Options:
{
“filepath”: “web\vben\apps\web-antd\src\views\system\permission\modules\form.vue”,
“parser”: “vue”,
“useTabs”: false,
“tabWidth”: 4,
“printWidth”: 230,
“singleQuote”: true,
“endOfLine”: “auto”,
“plugins”: [
“web\vben\node_modules\.pnpm\prettier-plugin-tailwindcss@0.7.1_prettier@3.6.2\node_modules\prettier-plugin-tailwindcss\dist\index.mjs”
],
“proseWrap”: “never”,
“semi”: true,
“trailingComma”: “none”,
“vueIndentScriptAndStyle”: true,
“quoteProps”: “as-needed”,
“bracketSpacing”: true,
“bracketSameLine”: false,
“jsxSingleQuote”: false,
“arrowParens”: “always”,
“insertPragma”: false,
“requirePragma”: false,
“htmlWhitespaceSensitivity”: “strict”,
“rangeStart”: 0
}
[“ERROR” - 16:58:22] Error formatting document.
[“ERROR” - 16:58:22] No package.json could be found upwards from directory D:\ProgramData\CodeTools\Qoder
Error: No package.json could be found upwards from directory D:\ProgramData\CodeTools\Qoder
at findRootSync (web/vben/node_modules/.pnpm/@manypkg+find-root@3.1.0/node_modules/@manypkg/find-root/dist/manypkg-find-root.js:120:11)
at getPackagesSync (web/vben/node_modules/.pnpm/@manypkg+get-packages@3.1.0/node_modules/@manypkg/get-packages/dist/manypkg-get-packages.js:38:47)
at web/vben/internal/tailwind-config/src/index.ts:14:55
at eval_evalModule (web\vben\node_modules.pnpm\jiti@2.6.1\node_modules\jiti\dist\jiti.cjs:1:155533)
at jitiRequire (web\vben\node_modules.pnpm\jiti@2.6.1\node_modules\jiti\dist\jiti.cjs:1:150967)
at web\vben\node_modules.pnpm\jiti@2.6.1\node_modules\jiti\dist\jiti.cjs:1:157987
at web/vben/internal/tailwind-config/dist/index.cjs:16:18
at eval_evalModule (web\vben\node_modules.pnpm\jiti@2.6.1\node_modules\jiti\dist\jiti.cjs:1:155533)
at jitiRequire (web\vben\node_modules.pnpm\jiti@2.6.1\node_modules\jiti\dist\jiti.cjs:1:150967)
at web\vben\node_modules.pnpm\jiti@2.6.1\node_modules\jiti\dist\jiti.cjs:1:157987
[“INFO” - 16:58:22] Formatting completed in 395ms.

我个人感觉就是系统支持问题,因为我是administrator用户 ,我记得以前vs code也有两个版本。有个版本就正常 ,有个版本就不正常 。

因为安装的时候报这个了的。

这个不影响的,你右上角上报下问题报告 :saluting_face: 反馈码发到这里我看下日志

afc17b18-c2c7-4df1-a7a8-534d3c087081

而且总提醒不能升级。

我看了下日志:是你的这个Prettier-plugin-tailwindcss插件导致的;

.prettierrc.mjs配置中暂时移除prettier-plugin-tailwindcss插件

并不是,同一个项目,同一个node_modules 包目录,在trae cn 上正常,在qoder就不正常 。

另外我今天还尝试了一下直接从.trae cn中复制插件到.qoder下,还是一样的问题。