diff --git a/settings/sorbet.vim b/settings/sorbet.vim index 64f19321..5fd0f1c0 100644 --- a/settings/sorbet.vim +++ b/settings/sorbet.vim @@ -1,8 +1,18 @@ +function! Vim_lsp_get_watchman_flag() + if executable('watchman') + return '' + endif + + " cf. https://sorbet.org/docs/vscode#installing-and-enabling-the-sorbet-extension + echo "To watch file changes, watchman is required for sorbet-lsp" + return '--disable-watchman' +endfunction + augroup vim_lsp_settings_sorbet au! LspRegisterServer { \ 'name': 'sorbet', - \ 'cmd': {server_info->lsp_settings#get('sorbet', 'cmd', [lsp_settings#exec_path('sorbet'), lsp#utils#uri_to_path(lsp_settings#root_uri('sorbet')), '--lsp'])+lsp_settings#get('sorbet', 'args', [])}, + \ 'cmd': {server_info->lsp_settings#get('sorbet', 'cmd', [lsp_settings#exec_path('sorbet'), lsp#utils#uri_to_path(lsp_settings#root_uri('sorbet')), '--lsp', Vim_lsp_get_watchman_flag()])+lsp_settings#get('sorbet', 'args', [])}, \ 'root_uri':{server_info->lsp_settings#get('sorbet', 'root_uri', lsp_settings#root_uri('sorbet'))}, \ 'initialization_options': lsp_settings#get('sorbet', 'initialization_options', v:null), \ 'allowlist': lsp_settings#get('sorbet', 'allowlist', ['ruby']),