• Login
Community
  • Login

How to enable a new FunctionList?

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 1.3k Views
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.
  • C
    chamisso chen
    last edited by Nov 22, 2020, 8:44 PM

    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

    P 1 Reply Last reply Nov 22, 2020, 8:56 PM Reply Quote 0
    • P
      PeterJones @chamisso chen
      last edited by Nov 22, 2020, 8:56 PM

      @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
      • C
        chamisso chen
        last edited by Nov 22, 2020, 9:29 PM

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

        A 1 Reply Last reply Nov 22, 2020, 9:31 PM Reply Quote 1
        • A
          Alan Kilborn @chamisso chen
          last edited by Nov 22, 2020, 9:31 PM

          @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
          2 out of 4
          • First post
            2/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors