Navigation Menu

Skip to content

Commit

Permalink
add meta data to complete function.
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Oct 20, 2010
1 parent acddc3d commit 4a22040
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 36 deletions.
3 changes: 2 additions & 1 deletion ftplugin/perl/perlomni.vim
Expand Up @@ -453,7 +453,8 @@ endf

" perl builtin functions
fun! s:CompFunction(base,context)
return s:StringFilter(g:p5bfunctions,a:base)
return filter(copy(g:p5bfunctions),'v:val.word =~ "^".a:base')
" return s:StringFilter(g:p5bfunctions,a:base)
endf

fun! s:CompCurrentBaseFunction(base,context)
Expand Down
45 changes: 10 additions & 35 deletions plugin/perlomni-data.vim
Expand Up @@ -5,42 +5,17 @@ if exists('perlomni_data_loaded')
endif
let perlomni_data_loaded = 1

let g:p5bfunctions = ["abs", "accept", "alarm", "atan2", "bind", "binmode", "bless", "break",
\ "caller", "chdir", "chmod", "chomp", "chop", "chown", "chr", "chroot",
\ "close", "closedir", "connect", "continue", "cos", "crypt", "dbmclose",
\ "dbmopen", "defined", "delete", "die", "do", "dump", "each", "endgrent",
\ "endhostent", "endnetent", "endprotoent", "endpwent", "endservent", "eof",
\ "eval", "exec", "exists", "exit", "exp", "fcntl", "fileno", "flock", "fork",
\ "format", "formline", "getc", "getgrent", "getgrgid", "getgrnam",
\ "gethostbyaddr", "gethostbyname", "gethostent", "getlogin", "getnetbyaddr",
\ "getnetbyname", "getnetent", "getpeername", "getpgrp", "getppid",
\ "getpriority", "getprotobyname", "getprotobynumber", "getprotoent",
\ "getpwent", "getpwnam", "getpwuid", "getservbyname", "getservbyport",
\ "getservent", "getsockname", "getsockopt", "glob", "gmtime", "goto", "grep",
\ "hex", "import", "index", "int", "ioctl", "join", "keys", "kill", "last",
\ "lc", "lcfirst", "length", "link", "listen", "local", "localtime", "lock",
\ "log", "lstat", "m", "map", "mkdir", "msgctl", "msgget", "msgrcv", "msgsnd",
\ "my", "next", "no", "oct", "open", "opendir", "ord", "our", "pack", "package",
\ "pipe", "pop", "pos", "print", "printf", "prototype", "push", "q", "qq", "qr",
\ "quotemeta", "qw", "qx", "rand", "read", "readdir", "readline", "readlink",
\ "readpipe", "recv", "redo", "ref", "rename", "require", "reset", "return",
\ "reverse", "rewinddir", "rindex", "rmdir", "s", "say", "scalar", "seek",
\ "seekdir", "select", "semctl", "semget", "semop", "send", "setgrent",
\ "sethostent", "setnetent", "setpgrp", "setpriority", "setprotoent",
\ "setpwent", "setservent", "setsockopt", "shift", "shmctl", "shmget",
\ "shmread", "shmwrite", "shutdown", "sin", "sleep", "socket", "socketpair",
\ "sort", "splice", "split", "sprintf", "sqrt", "srand", "stat", "state",
\ "study", "sub", "substr", "symlink", "syscall", "sysopen", "sysread",
\ "sysseek", "system", "syswrite", "tell", "telldir", "tie", "tied", "time",
\ "times", "tr", "truncate", "uc", "ucfirst", "umask", "undef", "unlink",
\ "unpack", "unshift", "untie", "use", "utime", "values", "vec", "wait",
\ "waitpid", "wantarray", "warn", "write", "y"]

" XXX: should be automatically build by script ( utils/build_mi_args.pl )
let g:p5_mi_export =
\ map( split(
\ 'admin is_admin new resources install_as_vendor keywords bundles write_mymeta_json recommends sign no_index perl_version_from name install_requires provides add_metadata author module_name repository version author_from test_requires_from configure_requires perl_version install_as_cpan all_from version_from feature read write_mymeta_yaml write install_as_site authors requires_from bugtracker_from auto_provides homepage abstract abstract_from test_requires distribution_type installdirs bugtracker dynamic_config license_from requires install_as_core features name_from license import build_requires tests'
\ ) , '{ "word": v:val ,"menu": "Module::Install::Metadata"}' )
fun! s:build_hash(list,menu)
return map( a:list , '{ "word": v:val , "menu": "'. a:menu .'" }' )
endf

let g:p5bfunctions =
\ s:build_hash( split('abs accept alarm atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime goto grep hex import index int ioctl join keys kill last lc lcfirst length link listen local localtime lock log lstat m map mkdir msgctl msgget msgrcv msgsnd my next no oct open opendir ord our pack package pipe pop pos print printf prototype push q qq qr quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir s say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unlink unpack unshift untie use utime values vec wait waitpid wantarray warn write y'),
\ 'built-in' )

" XXX: should be automatically build by script ( utils/build_mi_args.pl )
let g:p5_mi_export =
\ s:build_hash( split( 'resources install_as_vendor keywords bundles write_mymeta_json recommends sign no_index perl_version_from name install_requires provides add_metadata author module_name repository version author_from test_requires_from configure_requires perl_version install_as_cpan all_from version_from feature read write_mymeta_yaml write install_as_site authors requires_from bugtracker_from auto_provides homepage abstract abstract_from test_requires distribution_type installdirs bugtracker dynamic_config license_from requires install_as_core features name_from license import build_requires tests' ) ,
\ 'Module::Install::Metadata' )

1 change: 1 addition & 0 deletions test-case/Makefile.PL
Expand Up @@ -10,6 +10,7 @@ license 'perl';
# Test1
build_requires 'Test::More';


# Test2
requires 'File::Temp';
requires 'App::CLI';
Expand Down

0 comments on commit 4a22040

Please sign in to comment.