bash-language-server
bash-language-server copied to clipboard
[question] how to tell bashls to analyze zsh filetype
im using neovim and its configured with lua
i tried:
in my init.lua
require"lspconfig".bashls.setup {
filetypes = {"sh", "bash", "zsh"}
}
but it doesnt work
i also tried this
require"lspconfig".bashls.setup {
settings = {
bash = {
filetypes = {"sh", "zsh", "bash"}
},
}
doesnt work.
is there a way to specifiy for the server to analyze zsh filetypes?
i also tried to set the file type to bash:
autocmd FileType zsh setl filetype=bash
still doesnt work.
You can set the GLOB_PATTERN
env variable to override the default pattern. This worked for me:
export GLOB_PATTERN="**/*@(.sh|.inc|.bash|.command|.zsh|zshrc|zsh_*)"
hello, I modified the config.ts and changed the glob pattern to the given pattern above but still the bashls lsp wont recognise .zshrc file
i have checked the output of :LspInfo in nvim normal more and found that although the bashls lsp is installed, it is not attached to the .zshrc file
I think the following config for nvim-lspconfig works as of now:
lspconfig.bashls.setup {
filetypes = { 'sh', 'zsh', },
}
See https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#bashls
I didn't need to configure bashIde.globPattern
for some reason.. and it also recognizes zshrc (if its filetype is zsh).
BTW I don't think using an environment variable GLOB_PATTERN
is a good idea.