What is the problem this feature will solve?
Currently: shellcheck is run automatically on document changes, while shfmt is exposed through formatting.
That makes it difficult to control when they are run, and one cannot control their order.
What is the feature you are proposing to solve the problem?
Bash IDE should expose both as vscode "Code Actions".
Using array syntax, which preserves ordering:
"[shellscript]": {
"editor.codeActionsOnSave": [
"source.fixAll.bashide-format",
"source.fixAll.bashide-lint"
]
}
Or using object syntax, which exposes fine-grained policies:
"[shellscript]": {
"editor.codeActionsOnSave": {
"source.fixAll.bashide-format": "explicit",
"source.fixAll.bashide-lint": "explicit"
}
}
Code actions are the modern approach for this behaviour. Other formatting/linting extensions already work this way, and could be used for guidance (e.g. ESLint extension, Prettier extension, ShellCheck extension).
Implications:
- Control lint/format-on-save behaviour from vscode settings
- Control each operation independently, enforce ordering
- Follow modern approach of letting the editor control save-time behaviour rather than hard-coding triggers in extension logic
I've noticed there are many issues related to settings and overlap between various extensions and tools. This approach would probably address many of them, as it's the recommended modern on-save behaviour in vscode.
References:
What alternatives have you considered?
Multiple extensions, multiple tools, using prettier for formatting, complex vscode settings... a mess.
Thank you!
What is the problem this feature will solve?
Currently:
shellcheckis run automatically on document changes, whileshfmtis exposed through formatting.That makes it difficult to control when they are run, and one cannot control their order.
What is the feature you are proposing to solve the problem?
Bash IDE should expose both as vscode "Code Actions".
Using array syntax, which preserves ordering:
Or using object syntax, which exposes fine-grained policies:
Code actions are the modern approach for this behaviour. Other formatting/linting extensions already work this way, and could be used for guidance (e.g. ESLint extension, Prettier extension, ShellCheck extension).
Implications:
I've noticed there are many issues related to settings and overlap between various extensions and tools. This approach would probably address many of them, as it's the recommended modern on-save behaviour in vscode.
References:
What alternatives have you considered?
Multiple extensions, multiple tools, using prettier for formatting, complex vscode settings... a mess.
Thank you!