aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattn <mattn.jp@gmail.com>2020-03-05 17:54:58 +0900
committerGitHub <noreply@github.com>2020-03-05 17:54:58 +0900
commit9fac100cae4dee8679c03fc94ec4f6b2b876c99d (patch)
treefc5f971771ffba06b1c9d4878b722866314b78d2
parent509f92da05019e682dadc4b9e77947471f39f66d (diff)
parentfed93a0175169d87d06816814c0cde26192b0ad5 (diff)
downloadvim-lsp-settings-9fac100cae4dee8679c03fc94ec4f6b2b876c99d.tar.gz
vim-lsp-settings-9fac100cae4dee8679c03fc94ec4f6b2b876c99d.tar.bz2
vim-lsp-settings-9fac100cae4dee8679c03fc94ec4f6b2b876c99d.zip
Merge pull request #187 from mattn/vls
Rename vue-language-server to vls
-rw-r--r--installer/install-vls.cmd2
-rwxr-xr-xinstaller/install-vls.sh2
-rw-r--r--settings/sqls.vim29
3 files changed, 31 insertions, 2 deletions
diff --git a/installer/install-vls.cmd b/installer/install-vls.cmd
index fdb0828..0440a03 100644
--- a/installer/install-vls.cmd
+++ b/installer/install-vls.cmd
@@ -1,3 +1,3 @@
@echo off
-call "%~dp0\npm_install.cmd" vls vue-language-server
+call "%~dp0\npm_install.cmd" vls vls
diff --git a/installer/install-vls.sh b/installer/install-vls.sh
index d524c41..ed799b4 100755
--- a/installer/install-vls.sh
+++ b/installer/install-vls.sh
@@ -2,4 +2,4 @@
set -e
-"$(dirname "$0")/npm_install.sh" vls vue-language-server
+"$(dirname "$0")/npm_install.sh" vls vls
diff --git a/settings/sqls.vim b/settings/sqls.vim
index a8477dc..6f746c1 100644
--- a/settings/sqls.vim
+++ b/settings/sqls.vim
@@ -12,3 +12,32 @@ augroup vimlsp_settings_sqls
\ 'semantic_highlight': lsp_settings#get('sqls', 'semantic_highlight', {}),
\ }
augroup END
+
+function! s:sqls_query() abort
+ call lsp#send_request('sqls', {
+ \ 'method': 'workspace/executeCommand',
+ \ 'params': {
+ \ 'command': 'sqls.executeQuery',
+ \ 'arguments': [lsp#utils#get_buffer_uri()],
+ \ },
+ \ 'on_notification': function('s:handle_execute_command'),
+ \ })
+endfunction
+
+function! s:handle_execute_command(data) abort
+ let l:lines = a:data['response']['result']
+ vnew
+ call setline(1, split(l:lines, "\n"))
+endfunction
+
+function! s:on_lsp_buffer_enabled() abort
+ if &ft !=# 'sql'
+ return
+ endif
+ command! -buffer LspSQLQuery call <SID>sqls_query()
+endfunction
+
+augroup lsp_install_sqls
+ au!
+ autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
+augroup END