How to enable a new FunctionList?
-
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 -
Since DXL is not a builtin language, you will need a couple more steps:
- 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>
… - in the
.../functionList/overrideMap.xml
, in the User Defined Languages section, add a line like:
<association id= "dxl.xml" userDefinedLangName="DXL"/>
- 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 thefunctionList\dxl.xml
file, and just go into Settings > Style Configurator, select C, adddxl
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). - I am going to assume that the snippet you gave from the dxl.xml was not meant to be complete, because the
-
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.
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?
-
@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.