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:
parent
3e96e1325f
commit
b785aaa8ed
@ -115,8 +115,8 @@ endfunction
|
|||||||
|
|
||||||
function! s:on_typescript_ft() abort
|
function! s:on_typescript_ft() abort
|
||||||
if SpaceVim#layers#lsp#check_filetype('typescript')
|
if SpaceVim#layers#lsp#check_filetype('typescript')
|
||||||
|
\ || SpaceVim#layers#lsp#check_server('tsserver')
|
||||||
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
nnoremap <silent><buffer> K :call SpaceVim#lsp#show_doc()<CR>
|
||||||
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'],
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'],
|
||||||
\ 'call SpaceVim#lsp#show_doc()', 'show-document', 1)
|
\ 'call SpaceVim#lsp#show_doc()', 'show-document', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'],
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'],
|
||||||
@ -129,33 +129,37 @@ function! s:on_typescript_ft() abort
|
|||||||
nnoremap <silent><buffer> K :<C-u>TSDoc<Cr>
|
nnoremap <silent><buffer> K :<C-u>TSDoc<Cr>
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TSRename',
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TSRename',
|
||||||
\ 'rename-symbol', 1)
|
\ 'rename-symbol', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'f'], 'TSGetCodeFix',
|
|
||||||
\ 'code fix', 1)
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TSImport',
|
|
||||||
\ 'import', 1)
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'p'], 'TSDefPreview',
|
|
||||||
\ 'preview definition', 1)
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 't'], 'TSType',
|
|
||||||
\ 'view type', 1)
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'R'], 'TSRefs',
|
|
||||||
\ 'show reference', 1)
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'D'], 'TSGetDiagnostics',
|
|
||||||
\ 'show errors', 1)
|
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'o'], 'TSOrganizeImports',
|
|
||||||
\ 'organizes imports', 1)
|
|
||||||
else
|
else
|
||||||
nnoremap <silent><buffer> gD :<C-u>TsuTypeDefinition<Cr>
|
nnoremap <silent><buffer> gD :<C-u>TsuTypeDefinition<Cr>
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], 'TsuquyomiSignatureHelp',
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], 'TsuquyomiSignatureHelp',
|
||||||
\ 'show document', 1)
|
\ 'show document', 1)
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TsuquyomiRenameSymbol',
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], 'TsuquyomiRenameSymbol',
|
||||||
\ 'rename symbol', 1)
|
\ '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
|
||||||
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',
|
||||||
|
\ 'import', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'p'], 'TSDefPreview',
|
||||||
|
\ 'preview definition', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 't'], 'TSType',
|
||||||
|
\ 'view type', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'R'], 'TSRefs',
|
||||||
|
\ 'show reference', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'D'], 'TSGetDiagnostics',
|
||||||
|
\ 'show errors', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'o'], 'TSOrganizeImports',
|
||||||
|
\ 'organizes imports', 1)
|
||||||
|
else
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'i'], 'TsuImport',
|
||||||
|
\ 'import', 1)
|
||||||
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'm'], 'TsuImplementation',
|
||||||
|
\ 'interface implementations', 1)
|
||||||
|
endif
|
||||||
|
|
||||||
" code runner
|
" code runner
|
||||||
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'r'],
|
call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'r'],
|
||||||
\ 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)
|
\ 'call SpaceVim#plugins#runner#open()', 'execute current file', 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user