Community

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

    How to enable a new FunctionList?

    Help wanted · · · – – – · · ·
    3
    4
    423
    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.
    • chamisso chen
      chamisso chen last edited by

      Hello there.

      I am Newbie in Notepad++.
      I am writing IBM DXL code. The language is very similar to the C.
      Therefore I copy the /functionList/c.xml to /functionList/dxl.xml.

      Then I substitute the string “C” with “DXL” as follows :

      <NotepadPlus>
      <functionList>
      <!-- =========================================================== [ DXL ] -->
      <parser
      displayName=“DXL”
      id =“dxl_function”

      When I open a abc.dxl file, the function cannot be displayed in the function window.
      But when I rename the file to abc.c, the function can be displayed.

      Can someone help me to fix the problem?

      Thank you.

      Best regards,
      Chamisso

      PeterJones 1 Reply Last reply Reply Quote 0
      • PeterJones
        PeterJones @chamisso chen last edited by

        @chamisso-chen ,

        Since DXL is not a builtin language, you will need a couple more steps:

        1. I am going to assume that the snippet you gave from the dxl.xml was not meant to be complete, because the <parser... tag didn’t show its closing >, let alone its contents or </parser>…
        2. in the .../functionList/overrideMap.xml, in the User Defined Languages section, add a line like:
        			<association id= "dxl.xml"				userDefinedLangName="DXL"/>
        
        1. Create a User Defined Language (UDL) for DXL.

        References:

        • UDL Docs = https://npp-user-manual.org/docs/user-defined-language-system/
        • Function List overview = https://npp-user-manual.org/docs/function-list/
        • Function List config file format = https://npp-user-manual.org/docs/config-files/#function-list

        ----
        Alternately, if DXL is close enough to C (ie, C with a few extra keywords) that you don’t need to customize anything about its function list capability, then you can skip creating the functionList\dxl.xml file, and just go into Settings > Style Configurator, select C, add dxl to the User ext. box (no dot in the box), and if there are extra keywords, put them in the user defined keywords section of INSTRUCTION WORD and/or TYPE WORD, as appropritate; then Notepad++ will treat .dxl files just like c source code for everything (syntax highlighting and function list included).

        1 Reply Last reply Reply Quote 0
        • chamisso chen
          chamisso chen last edited by

          @PeterJones

          Thank you very much for the quick response.

          Yes, it does work after adding the line in the overrideMap.xml.

          Before I tried to add this line : <association id= “dxl.xml” langID= “85”/>, which didn’t help.

          By the way, the functionList for C seems to have bugs, see below.

          question.png image url)

          Not only the function definition will be shown, but also the invoking position is shown as well.

          I try to study the REGEXP grammar and get lost. :-)

          Do you have any idea to improve the template?

          Alan Kilborn 1 Reply Last reply Reply Quote 1
          • Alan Kilborn
            Alan Kilborn @chamisso chen last edited by

            @chamisso-chen said in How to enable a new FunctionList?:

            Not only the function definition will be shown, but also the invoking position is shown as well.

            IIRC, that is a known issue with no current resolution.

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