1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 12:50:04 +08:00

fix(typescript): fix lsp key binding for typescript

This commit is contained in:
dqnk 2023-08-05 15:32:12 +02:00 committed by GitHub
parent 3e96e1325f
commit b785aaa8ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,8 +115,8 @@ endfunction
function! s:on_typescript_ft() abort
if SpaceVim#layers#lsp#check_filetype('typescript')
\ || SpaceVim#layers#lsp#check_server('tsserver')
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'],
\ 'call SpaceVim#lsp#show_doc()', 'show-document', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'],
@ -129,6 +129,16 @@ function! s:on_typescript_ft() abort
nnoremap <silent><buffer> K :<C-u>TSDoc<Cr>
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TSRename',
\ 'rename-symbol', 1)
else
nnoremap <silent><buffer> gD :<C-u>TsuTypeDefinition<Cr>
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], 'TsuquyomiSignatureHelp',
\ 'show document', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TsuquyomiRenameSymbol',
\ 'rename symbol', 1)
endif
endif
if has('nvim')
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'f'], 'TSGetCodeFix',
\ 'code fix', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TSImport',
@ -144,17 +154,11 @@ function! s:on_typescript_ft() abort
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'o'], 'TSOrganizeImports',
\ 'organizes imports', 1)
else
nnoremap <silent><buffer> gD :<C-u>TsuTypeDefinition<Cr>
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], 'TsuquyomiSignatureHelp',
\ 'show document', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TsuquyomiRenameSymbol',
\ 'rename symbol', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TsuImport',
\ 'import', 1)
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'm'], 'TsuImplementation',
\ 'interface implementations', 1)
endif
endif
" code runner
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'r'],