Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    AutoComplete Problem

    Help wanted · · · – – – · · ·
    2
    2
    1554
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ghotihead
      Ghotihead last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • Jim Dailey
        Jim Dailey last edited by

        @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?).

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright © 2014 NodeBB Forums | Contributors