The steep language server started when Steepfile not exists
My Vim has these settings to enable the ruby-lsp, steep, and rubocop language server
let g:lsp_settings_filetype_ruby = ['ruby-lsp', 'rubocop', 'steep']
However, when I installed steep with gem install steep another project didn't have Steepfile still load the steep language server.
I think this line will check for it but seems not to work: https://github.com/mattn/vim-lsp-settings/blob/2cad696eb76755ff00415d97ce4bd5c82d6e2fb3/settings/steep.vim#L8
If I removed the g:lsp_settings_filetype_ruby then the steep not work on the project has Steepfile
P.S. The
rubocoporrubocop-lsp-modeboth do not run the rubocop language server for now
make sense. I'll look this into it in later.
Thanks.
I test another use case for it.
gem uninstall steepto ensure no steep installed- Run
:LspInstallServer steepto install into~/.local - Run
vimwith theSteepfileproject but the:LspStatusshowssteep: exited
The similar issues occurred with Rubocop:
If :LspInstallServer rubocop-lsp-mode is not configured (not exists in ~/.local) the rubocop-lsp-mode never loaded even the Gemfile included the rubocop gem.
@mattn
I use "= with <CR> to call lsp_settings#root_path(['Steepfile']) to check the value, but it returns the project path instead of an empty value. I think it causes this unexpected behavior.
Test Environment
- Rails Project
Gemfilein project rootSteepfilenot exists
Test Case
"=lsp_settings#root_path(['Steepfile'])<CR>p/Users/elct9620/Workspace/vim-lsp-no-steep
"=lsp_settings#root_path(['Gemfile'])<CR>p/Users/elct9620/Workspace/vim-lsp-no-steep
"=lsp#utils#find_nearest_parent_file(lsp#utils#get_buffer_path(), 'Steepfile')<CR>p"=lsp#utils#find_nearest_parent_file(lsp#utils#get_buffer_path(), 'Gemfile')<CR>p/Users/elct9620/Workspace/vim-lsp-no-steep/Gemfile
I find the root_path call the find_nearest_parent_file_directory with some extra pattern (e.g. .git)
https://github.com/mattn/vim-lsp-settings/blob/ac7a1dc60b300f4bc49c95fec923741a4ef1b7c4/autoload/lsp_settings.vim#L257-L260
Should we use find_nearest_parent_file instead of root_path?
I think the angular has the same issue because this is another place that uses root_path
https://github.com/mattn/vim-lsp-settings/blob/ac7a1dc60b300f4bc49c95fec923741a4ef1b7c4/settings/angular-language-server.vim#L8
@mattn Any update here?