You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow formatting untitled files when requireConfig is enabled
When `prettier.requireConfig` is enabled, untitled files couldn't be
formatted because the extension tried to find a config file starting
from the file's path, but untitled files don't have a real path.
This fix modifies `getResolvedConfig` to detect untitled documents
(scheme === "untitled") and use the first workspace folder's path
as the starting point for config file search instead.
Fixes#3885
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ All notable changes to the "prettier-vscode" extension will be documented in thi
6
6
7
7
## [Unreleased]
8
8
9
+
- Fixed formatting of untitled files when `requireConfig` is enabled. The extension now uses the workspace folder to search for Prettier config files when formatting untitled documents (#3885).
10
+
9
11
## [12.2.0]
10
12
11
13
- Fixed `source.fixAll.prettier` code action running even when `editor.defaultFormatter` was set to a different extension (#3908). The code action now respects the user's formatter choice and only runs when Prettier is the default formatter or when `source.fixAll.prettier` is explicitly enabled.
0 commit comments