vs-shell-format
vs-shell-format copied to clipboard
"shellformat.flag" does not work at the project level in a multi-root workspace
In my project's folder, I have a .vscode/settings.json
containing
{
"shellformat.flag": "-sr",
"editor.tabSize": 4,
"editor.detectIndentation": true,
"editor.renderWhitespace": "all",
"editor.formatOnSave": true,
}
When I add my folder in a newly created workspace everything goes well. When I had more folders into the workspace, properties shellformat.*
at the project level are not taken into account anymore.
I get a message saying
This setting cannot be applied in this workspace. It will be applied when you open the containing workspace folder directly.
Thank you for reporting!
you should put settings on workspace config file for workspace .
// xxx.code-workspace
{
"folders": [
{
"path": "f1"
},
{
"path": "f2"
}
],
"settings": {
"shellformat.flag": "-sr",
"editor.tabSize": 4
}
}
code test.code-workspace
for test
Yes, I forgot to tell it, I managed to make it work using the workspace settings.
Does the wrong usage
label mean you don't consider this behavior as a bug? If yes, there's probably something I did not understand. Is there a reason to not handle settings at the folder level but only at the workspace level?
i also did not understand the vscode workspace setting mechanism. i want know other plugin behavior. if there is a different behavior, it's maybe a bug.
I Can't confirm if it's a bug now.
I believe other plugins like shellcheck let you apply individual project settings even within a workspace. The shfmt.flag
setting is greyed out within my project folder; however the shellcheck
options appear to remain active.
If possible, it would be nice to have the choice to choose whether or not we want shfmt applied to a single project or the entire workspace and not have to choose every project in the workspace or nothing at all.