1 "------------------------------------------------------------------------------
2 " Description: Vim Ada omnicompletion file
4 " $Id: adacomplete.vim,v 1.4 2007/05/12 13:48:35 vimboss Exp $
5 " Maintainer: Martin Krischik
7 " $Date: 2007/05/12 13:48:35 $
10 " $HeadURL: https://svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/adacomplete.vim $
11 " History: 24.05.2006 MK Unified Headers
12 " 26.05.2006 MK improved search for begin of word.
13 " 16.07.2006 MK Ada-Mode as vim-ball
14 " 15.10.2006 MK Bram's suggestion for runtime integration
15 " 05.11.2006 MK Bram suggested not to use include protection for
17 " 05.11.2006 MK Bram suggested agaist using setlocal omnifunc
18 " 05.11.2006 MK Bram suggested to save on spaces
19 " Help Page: ft-ada-omni
20 "------------------------------------------------------------------------------
26 " Section: adacomplete#Complete () {{{1
28 " This function is used for the 'omnifunc' option.
30 function! adacomplete#Complete (findstart, base)
32 return ada#User_Complete (a:findstart, a:base)
37 if exists ("g:ada_omni_with_keywords")
38 call ada#User_Complete (a:findstart, a:base)
41 " search tag file for matches
43 let l:Pattern = '^' . a:base . '.*$'
44 let l:Tag_List = taglist (l:Pattern)
48 for Tag_Item in l:Tag_List
49 if l:Tag_Item['kind'] == ''
51 " Tag created by gnat xref
54 \ 'word': l:Tag_Item['name'],
55 \ 'menu': l:Tag_Item['filename'],
56 \ 'info': "Symbol from file " . l:Tag_Item['filename'] . " line " . l:Tag_Item['cmd'],
61 " Tag created by ctags
63 let l:Info = 'Symbol : ' . l:Tag_Item['name'] . "\n"
64 let l:Info .= 'Of type : ' . g:ada#Ctags_Kinds[l:Tag_Item['kind']][1] . "\n"
65 let l:Info .= 'Defined in File : ' . l:Tag_Item['filename'] . "\n"
67 if has_key( l:Tag_Item, 'package')
68 let l:Info .= 'Package : ' . l:Tag_Item['package'] . "\n"
69 let l:Menu = l:Tag_Item['package']
70 elseif has_key( l:Tag_Item, 'separate')
71 let l:Info .= 'Separate from Package : ' . l:Tag_Item['separate'] . "\n"
72 let l:Menu = l:Tag_Item['separate']
73 elseif has_key( l:Tag_Item, 'packspec')
74 let l:Info .= 'Package Specification : ' . l:Tag_Item['packspec'] . "\n"
75 let l:Menu = l:Tag_Item['packspec']
76 elseif has_key( l:Tag_Item, 'type')
77 let l:Info .= 'Datetype : ' . l:Tag_Item['type'] . "\n"
78 let l:Menu = l:Tag_Item['type']
80 let l:Menu = l:Tag_Item['filename']
84 \ 'word': l:Tag_Item['name'],
87 \ 'kind': l:Tag_Item['kind'],
90 if complete_add (l:Match_Item) == 0
99 endfunction adacomplete#Complete
103 "------------------------------------------------------------------------------
104 " Copyright (C) 2006 Martin Krischik
106 " Vim is Charityware - see ":help license" or uganda.txt for licence details.
107 "------------------------------------------------------------------------------
108 " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
109 " vim: foldmethod=marker