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
Open the repository through the repo.code-workspace
This will open the repo with workspaces
Open the Prettier output pane
Open repo.code-workspace and comment out folders 1, 2 and 3
This is to ensure the files open through the 'Root' folder
Then open any of the JSON documents and format the file
Should format successfully
Uncomment the folders in the repo.code-workspace
Now re-open the document and try to format
Expected result
The Prettier output should have logged a successful reformat
Actual result
The prettier output errors out:
["INFO" - 17:04:20] Formatting file:///Users/me/Developer/prettier-vscode-multi-workspace-config/group-1/workspace-2/doc.json
["ERROR" - 17:04:20] Invalid prettier configuration file detected.
["ERROR" - 17:04:20] ENOENT: no such file or directory, open '/Users/me/Developer/prettier-vscode-multi-workspace-config/group-1/workspace-2/.prettierrc'
Error: ENOENT: no such file or directory, open '/Users/me/Developer/prettier-vscode-multi-workspace-config/group-1/workspace-2/.prettierrc'
Now this would be fine if you could write ${workspaceFolder:Root}/.prettier, however this does not resolve:
Error: ENOENT: no such file or directory, open '/Users/me/Developer/prettier-vscode-multi-workspace-config/group-1/workspace-2/${workspaceFolder:Root}/.prettierrc'
It would be ideal if the Prettier extension could resolve the workspaceFolder or bubble up a search to look at parent, grandparent or great-grandparent directories.
Additional information
VS Code Version: 1.84.2
Prettier Extension Version: 10.1.0
OS and version: MacOS Sonoma 14.1
Prettier Log Output
Relevant logs logged above
The text was updated successfully, but these errors were encountered:
Summary
Prettier does not format in multi-folder repositories whilst using the
.code-workspace
config.Github Repository to Reproduce Issue
https://github.com/aidanm1999/prettier-vscode-multi-workspace-config
This repository is set up like so:
workspace-1
- a folder containing a dummy JSON document to simulate formattable filesgroup-1
- a folder containing 2 workspacesworkspace-2
- a folder containing a dummy JSON document to simulate formattable filesworkspace-3
- a folder containing a dummy JSON document to simulate formattable files.prettierrc
- default prettier config.prettierignore
- default prettier ignore configrepo.code-workspace
- file containing workspace configSteps To Reproduce:
repo.code-workspace
repo.code-workspace
and comment out folders 1, 2 and 3repo.code-workspace
Expected result
The Prettier output should have logged a successful reformat
Actual result
The prettier output errors out:
Now this would be fine if you could write
${workspaceFolder:Root}/.prettier
, however this does not resolve:It would be ideal if the Prettier extension could resolve the
workspaceFolder
or bubble up a search to look at parent, grandparent or great-grandparent directories.Additional information
VS Code Version:
1.84.2
Prettier Extension Version:
10.1.0
OS and version:
MacOS Sonoma 14.1
Prettier Log Output
Relevant logs logged above
The text was updated successfully, but these errors were encountered: