Skip to content

Commit 12e65e7

Browse files
cheuk-fungautozimu
authored andcommitted
Send messages for jdt files
JDT files are essentially Java source files. By sending messages for jdt files, we are able to use language server functionalities in those files, such as go to definition or type definition which is supper helpful for browsing source code.
1 parent 9d90c49 commit 12e65e7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

autoload/LanguageClient.vim

+10-2
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,16 @@ function! LanguageClient#Write(message) abort
644644
endif
645645
endfunction
646646

647+
function! s:SkipSendingMessage() abort
648+
if expand('%') =~# '^jdt://'
649+
return v:false
650+
endif
651+
652+
return &buftype !=# '' || &filetype ==# '' || expand('%') ==# ''
653+
endfunction
654+
647655
function! LanguageClient#Call(method, params, callback, ...) abort
648-
if &buftype !=# '' || &filetype ==# '' || expand('%') ==# ''
656+
if s:SkipSendingMessage()
649657
" call s:Debug('Skip sending message')
650658
return
651659
endif
@@ -675,7 +683,7 @@ function! LanguageClient#Call(method, params, callback, ...) abort
675683
endfunction
676684

677685
function! LanguageClient#Notify(method, params) abort
678-
if &buftype !=# '' || &filetype ==# '' || expand('%') ==# ''
686+
if s:SkipSendingMessage()
679687
" call s:Debug('Skip sending message')
680688
return
681689
endif

0 commit comments

Comments
 (0)