Skip to content

Commit

Permalink
handle watchman dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukkee committed Dec 8, 2023
1 parent 6bea656 commit 77c9940
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion settings/sorbet.vim
Original file line number Diff line number Diff line change
@@ -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"

Check failure on line 7 in settings/sorbet.vim

View workflow job for this annotation

GitHub Actions / runner / vint

[vint] reported by reviewdog 🐶 Prefer single quoted strings (see Google VimScript Style Guide (Strings)) Raw Output: settings/sorbet.vim:7:8: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
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']),
Expand Down

0 comments on commit 77c9940

Please sign in to comment.