williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

BashLS not getting attached to buffer #573

Closed dnjmn closed 2 years ago

dnjmn commented 2 years ago

Problem description

i installed bash-language-server via nvim-lsp-installer and it is successfully installed as showed by LspInfo ( Configured servers list: bashls ). client attached is 0.

Neovim version (>= 0.6)

NVIM v0.6.1 Build type: Release LuaJIT 2.1.0-beta3 Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.6.1/share/nvim"

Run :checkhealth for more info

Operating system/version

Darwin Dhananjays-MacBook-Air.local 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101 arm64

I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig

Affected language servers

bashls

Steps to reproduce

i am using https://github.com/kabinspace/AstroVim checked health... no issue installed bashls created a .zsh file and opened in nvim

Actual behavior

no client attached

Expected behavior

bashls should be attached as lsp client

LspInfo

Language client log: /Users/metalhead/.cache/nvim/lsp.log
 Detected filetype:   zsh

 0 client(s) attached to this buffer: 

 Configured servers list: sumneko_lua, bashls, gopls

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - WARNING: **julia**: not available
  - OK: **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)`
  - OK: **tar**: `bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
  - OK: **gzip**: `Apple gzip 353.100.22`
  - OK: **curl**: `curl 7.79.1 (x86_64-apple-darwin21.0) libcurl/7.79.1 (SecureTransport) LibreSSL/3.3.5 zlib/1.2.11 nghttp2/1.45.1`
  - OK: **wget**: `GNU Wget 1.21.3 built on darwin21.3.0.`
  - OK: **python3**: `Python 3.9.12`
  - OK: **node**: `v17.8.0`
  - OK: **Ruby**: `ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]`
  - OK: **Go**: `go version go1.18 darwin/arm64`
  - OK: **sh**: `Ok`
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - OK: **RubyGem**: `3.0.3.1`
  - OK: **npm**: `8.5.5`
  - OK: **pip3**: `pip 22.0.4 from /opt/homebrew/lib/python3.9/site-packages/pip (python 3.9)`

Screenshots or recordings

No response

williamboman commented 2 years ago

Hello! The default settings (provided by lspconfig) only sets sh as the associated filetype for the bash language server. Your zsh file seem to be opened with the zsh filetype. I don't know how AstroVim sets servers up, but you can override the associated filetypes, for example like so. More information can also be found in :h lspconfig-root-dir!