Thursday, July 29, 2010

Re: Omni completion for mysql dialect


On 7/28/2010 8:18 PM, GAS wrote:
When I set sql dialect as :h sql.txt recommends: let g:sql_type_default = 'mysql' Omni completion fails to do any sql completion. Removing this settings fix problem and omni properly functioning. 

Since the SQL completion contains many different maps, can I assume you use <CTRL-C>a (for all syntax items).

When setting the dialog to mysql as you did above it found no items to complete.
Where as if you had done:
	let g:sql_type_default = 'sqloracle' 
It does show the syntax items in the OMNI list.


The difference between the two seems to be how the syntax writers format their syntax files.
The 2 I predominant formats I see are:
    syn keyword {filetype}Keyword         values ...
and
    syn keyword {syntax_filename}Keyword  values ...

The syntax items are pulled from the autoload/syntaxcomplete.vim and only looks for format #1.
I have extended it to also look for format #2, if format #1 fails to find any matches.

I have sent an updated autoload/syntaxcomplete.vim to Bram for inclusion in Vim.

I have also created this as a script on www.vim.org if you wish to try it out now:
SyntaxComplete : OMNI Completion based on the current syntax highlights
http://www.vim.org/scripts/script.php?script_id=3172

If you could test this out we may be able to get it released with Vim 7.3.

Thanks,
Dave



No comments:

Post a Comment