Scripts and startup files (no `.sh` suffix) are not supported.
dseynhae opened this issue · 3 comments
I'm using the formatter in VS Code to manage my Bash startup files.
The Bash IDE
language server recognizes that they are written in a supported language.
For my scripts, they require a shebang, and the Bash IDE
extension kicks in again...
But the vs-shell-format extension seems to insist on the sh
suffix to make the formatter available...
Can we provide an option to explicitly list file names where the formatter should be available? The typical startup file names should just be recognized by default...
Or is there another way to force access to this formatter in VS Code?
I'm using a bit of a hack to resolve the situation: I just create a symbolic link to my prefix-less files:
ln -s <file> <file.sh>
Now I can edit the file with the prefix, but the changes (and formatting) happen to my original file:
core -r <file>.sh
...
It's just a bit messy keeping those links around....
A lot of my scripts are sourced (and hence don't have a shebang line).
The shebang line of course is ignored as a comment when sourcing a file, but I don't like to use a shebang line, because it implies that the script can be executed...
Another problem with the shebang, is that the extension now has to consider every file that gets opened, checking for a shebang line...
So as a first compromise, I would like to see support for files like:
.profile
.bash_profile
.bashrc
Or, any file in particular directories:
.bashrc.d
bin