1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-25 11:12:22 +08:00

fix(javalsp): disable omni source when lsp enabled

This commit is contained in:
wsdjeg 2023-03-29 13:17:26 +08:00
parent 423e83e479
commit 5f519c99c9
2 changed files with 31 additions and 27 deletions

View File

@ -166,6 +166,7 @@ function! SpaceVim#layers#lang#java#config() abort
augroup SpaceVim_lang_java augroup SpaceVim_lang_java
au! au!
if !SpaceVim#layers#lsp#check_filetype('java') if !SpaceVim#layers#lsp#check_filetype('java')
\ && !SpaceVim#layers#lsp#check_server('jdtls')
" omnifunc will be used only when no java lsp support " omnifunc will be used only when no java lsp support
autocmd FileType java setlocal omnifunc=javacomplete#Complete autocmd FileType java setlocal omnifunc=javacomplete#Complete
endif endif

View File

@ -18,6 +18,8 @@ call deoplete#custom#option({
\ 'nofile_complete_filetypes' : ['denite-filter'], \ 'nofile_complete_filetypes' : ['denite-filter'],
\ }) \ })
if !SpaceVim#layers#lsp#check_filetype('java')
\ && !SpaceVim#layers#lsp#check_server('jdtls')
" java && jsp " java && jsp
call deoplete#custom#var('omni', 'input_patterns', { call deoplete#custom#var('omni', 'input_patterns', {
\ 'java': [ \ 'java': [
@ -35,6 +37,7 @@ else
call deoplete#custom#source('omni', 'mark', '') call deoplete#custom#source('omni', 'mark', '')
call deoplete#custom#source('omni', 'rank', 9999) call deoplete#custom#source('omni', 'rank', 9999)
endif endif
endif
" sh " sh
call deoplete#custom#option('ignore_sources', {'sh': ['around', 'member', 'tag', 'syntax']}) call deoplete#custom#option('ignore_sources', {'sh': ['around', 'member', 'tag', 'syntax']})