bashIde.globPattern has no effect
Code editor
VSCode
Platform
Windows
Version
1.43.0
What steps will reproduce the bug?
You need shellcheck and shfmt working.
- Open a new file with the following content:
function fish_example
set_color green
prompt_pwd
end
- Save the file as
example.fish
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
The formatting should be preserved as written and shellcheck warnings should not be active for this type of file.
What do you see instead?
Additional information
I intentionally set bashIde.globPattern to banana to check if the setting was working correctly, and it does not. Bash IDE process all shellscript files in the workspace no matter the value of this setting. The only thing it seems to affect is the log. Files not matching the pattern are not reported when the Code or the extension starts, but they are processed anyways.
No response
Hi @pcastellazzi . The globPattern config option only controls background analysis of shell files in a project. If the extension is activated for a particular file that is being edited then it will run shellcheck and shfmt according to its configuration.
The issue here is that VSCode is detecting example.fish as a shell script (which it is, of course) and activating the extension. This extension is configured to be activated onLanguage:shellscript.
You may be able to configure VSCode to change when the extension is activated or change how your .fish files are identified.
The problem with changing the association, is that you loose syntax highlighting and the rest of VS Code features. It basically becomes a plain text file.
The list of affected file types can be found at https://github.com/microsoft/vscode/blob/main/extensions/shellscript/package.json. It also considers shell script anything with a shebang ending in a known shell (including fish, tcl, and others)
Can BLS have its own language id?