AutoComplete Problem
-
I need the help of someone here. I am trying to put together an autocomplete for XQuery with function descriptions and parameters defined. To start with, I just went with something simple and tried to define for fn:contains(). Here’s what I have in my XQuery.xml file:
<?xml version=“1.0” encoding=“Windows-1252” ?>
<NotepadPlus>
<AutoComplete language=“XQuery”>
<Environment ignoreCase=“no” startFunc=“(” stopFunc=“)” paramSeparator=“,” terminal=“” />
<KeyWord name=“fn:contains” func=“yes”>
<Overload retVal=“boolean” descr=“Returns true if the first parameter contains the string from the second parameter, otherwise returns false.”>
<Param name=“xs:string $parameter1” />
<Param name=“xs:string $parameter2” />
<Param name=“[xs:string $collation]” />
</Overload>
</KeyWord>
</AutoComplete>
</NotepadPlus>I also have a UDL that I imported that includes this for the highlighting.
If I enter “fn:contains”, as I’m typing it, the suggestion comes up okay, but when I type the open paren, I don’t get the information for the function. However, if I change the above to be just “contains”, then repeat the steps by typing “contains(”, it works like it should, which is nice, but that would preclude having a different function with a different namespace, like “xyz:contains”, as both would put up the same parameters and return value information.
Am I doing something wrong, or perhaps is the “fn:” causing problems with the auto-complete in recognizing it as a function name?
Thanks for any help you can provide!
-
@Ghotihead
I don’t think you are doing anything wrong. I think the “:” is the problem. I don’t think it affects auto-complete, but I do think it affects the function help tool tip.I have a lot of keywords that contain some special characters (e.g. gBS->AllocatePool), but I have to use only the function name (e.g. AllocatePool) and overload it with multiple definitions when there are more than one function of that name.
So, I think you might have to define all your namespace:functions as keywords, and then overload the functions with multiple definitions (and maybe some text that identifies the namespace of each?).