(file)
| 120 | } |
| 121 | |
| 122 | async function resolvePrettierConfig(file) { |
| 123 | const overrides = appSettings?.value?.prettier || {}; |
| 124 | const projectConfig = await loadProjectConfig(file); |
| 125 | const result = { ...overrides, ...(projectConfig || {}) }; |
| 126 | if (file?.eol && result.endOfLine == null) { |
| 127 | result.endOfLine = file.eol === "windows" ? "crlf" : "lf"; |
| 128 | } |
| 129 | if (result.useTabs == null) { |
| 130 | result.useTabs = !appSettings?.value?.softTab; |
| 131 | } |
| 132 | if ( |
| 133 | result.tabWidth == null && |
| 134 | typeof appSettings?.value?.tabSize === "number" |
| 135 | ) { |
| 136 | result.tabWidth = appSettings.value.tabSize; |
| 137 | } |
| 138 | return result; |
| 139 | } |
| 140 | |
| 141 | async function loadProjectConfig(file) { |
| 142 | const uri = file?.uri; |
no test coverage detected