Merge pull request #20 from bleshik/feature/support-for-groovy
Support for Groovy
This commit is contained in:
commit
8289c7c1d2
@ -114,7 +114,8 @@ endfunction
|
||||
function! s:getClassNameFromFile(filename)
|
||||
let l:className=fnamemodify(a:filename,':t:r') " Get only the name of the file, without path or extension
|
||||
for l:line in readfile(a:filename)
|
||||
let l:matches=matchlist(l:line,'\vpackage\s+(%(\w|\.)+)\s*;')
|
||||
" trailing ; is optional to make it work for groovy as well
|
||||
let l:matches=matchlist(l:line,'\vpackage\s+(%(\w|\.)+)\s*;?')
|
||||
if 1<len(l:matches)
|
||||
return l:matches[1].'.'.l:className
|
||||
endif
|
||||
|
Loading…
Reference in New Issue
Block a user