diff --git a/autoload/SpaceVim/layers/lang/c.vim b/autoload/SpaceVim/layers/lang/c.vim index c589c30b4..ea8605d32 100644 --- a/autoload/SpaceVim/layers/lang/c.vim +++ b/autoload/SpaceVim/layers/lang/c.vim @@ -45,19 +45,21 @@ let s:clang_executable = 'clang' let s:SYSTEM = SpaceVim#api#import('system') function! SpaceVim#layers#lang#c#plugins() abort let plugins = [] - if g:spacevim_autocomplete_method ==# 'deoplete' - if s:use_libclang - call add(plugins, ['zchee/deoplete-clang']) + if !SpaceVim#layers#lsp#check_filetype('c') && !SpaceVim#layers#lsp#check_filetype('cpp') + if g:spacevim_autocomplete_method ==# 'deoplete' + if s:use_libclang + call add(plugins, ['zchee/deoplete-clang']) + else + call add(plugins, ['SpaceVim/deoplete-clang2']) + endif + elseif g:spacevim_autocomplete_method ==# 'ycm' + " no need extra plugins + elseif g:spacevim_autocomplete_method ==# 'completor' + " no need extra plugins + elseif g:spacevim_autocomplete_method ==# 'asyncomplete' else - call add(plugins, ['SpaceVim/deoplete-clang2']) + call add(plugins, ['Rip-Rip/clang_complete']) endif - elseif g:spacevim_autocomplete_method ==# 'ycm' - " no need extra plugins - elseif g:spacevim_autocomplete_method ==# 'completor' - " no need extra plugins - elseif g:spacevim_autocomplete_method ==# 'asyncomplete' - else - call add(plugins, ['Rip-Rip/clang_complete']) endif if has('nvim') if has('python3') diff --git a/autoload/SpaceVim/layers/lang/dart.vim b/autoload/SpaceVim/layers/lang/dart.vim index edfde544a..112b799f7 100644 --- a/autoload/SpaceVim/layers/lang/dart.vim +++ b/autoload/SpaceVim/layers/lang/dart.vim @@ -1,7 +1,9 @@ function! SpaceVim#layers#lang#dart#plugins() abort let plugins = [] call add(plugins, ['dart-lang/dart-vim-plugin', {'merged' : 0}]) - call add(plugins, ['SpaceVim/deoplete-dart', {'merged' : 0}]) + if !SpaceVim#layers#lsp#check_filetype('dart') + call add(plugins, ['SpaceVim/deoplete-dart', {'merged' : 0}]) + endif return plugins endfunction @@ -29,4 +31,12 @@ function! s:language_specified_mappings() abort call SpaceVim#mapping#space#langSPC('nmap', ['l','s', 's'], \ 'call SpaceVim#plugins#repl#send("selection")', \ 'send selection and keep code buffer focused', 1) + if SpaceVim#layers#lsp#check_filetype('dart') + nnoremap K :call SpaceVim#lsp#show_doc() + + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'd'], + \ 'call SpaceVim#lsp#show_doc()', 'show_document', 1) + call SpaceVim#mapping#space#langSPC('nnoremap', ['l', 'e'], + \ 'call SpaceVim#lsp#rename()', 'rename symbol', 1) + endif endfunction diff --git a/autoload/SpaceVim/layers/lsp.vim b/autoload/SpaceVim/layers/lsp.vim index 963687e34..e36c948b4 100644 --- a/autoload/SpaceVim/layers/lsp.vim +++ b/autoload/SpaceVim/layers/lsp.vim @@ -78,6 +78,7 @@ let s:lsp_servers = { \ 'cpp' : ['clangd'], \ 'objc' : ['clangd'], \ 'objcpp' : ['clangd'], + \ 'dart' : ['dart_language_server'], \ 'go' : ['go-langserver', '-mode', 'stdio'], \ 'rust' : ['rustup', 'run', 'nightly', 'rls'], \ 'python' : ['pyls'],