diff --git a/content/docs/config-files.md b/content/docs/config-files.md index cc09ef9f..5a4c6f87 100644 --- a/content/docs/config-files.md +++ b/content/docs/config-files.md @@ -303,23 +303,22 @@ Defines what counts as a "function" for **View > Function List**. There are some ### Function List Definitions -The `functionList` folder contains a separate XML file (function list parse rule) for each language's function list capability. -Each function list parse rule links to a language with the language default name. For example the file name of php language parse rule is `php.xml`, the file name of Java language parse rule is `java.xml`, Check [overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) for the naming list of all supported programming languages. +The `functionList` folder contains a separate XML file (function list parser definition) for each language's function list capability. Each function list parser definition links to a language with the language default name. For example the file name of php language parse rule is `php.xml`, the file name of Java language parse rule is `java.xml`, Check [overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) for the naming list of all supported programming languages. -[overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) is optional. When you need to override a default parser rule or to define a function list parser for your User Defined Language (UDL), you modify this file. +For built-in languages that already have Function List behavior, editing [overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) is optional: if you edit the existing `functionList\XYZ.xml` for that language, you don't need to edit `overrideMap.xml`; however, if you create a new `functionList\my_XYZ.xml` that you want to use instead of the default function list definition for XYZ, then you need to copy the an `` for language XYZ from inside the `` comment block, paste it outside that block, and point the to the new file using `id="my_XYZ.xml`. If you need to link to a function list parser name "udl_ABC.xml" for your User Defined Language (UDL) named "ABC", you need to modify this file to add an `` : the `id` must match the filename exactly, and the `userDefinedLangName` must match the name of your UDL, as seen in the **Language** menu and UDL dialog. -- Override a default parser rule examples -``` - - -``` -If 2 above lines are in *overrideMap.xml*, function list will load your parsers `anotherPhpParser.xml` and `myPerlRule.xml` instead of loaoding `php.xml` and `perl.xml` while showing PHP and Perl function list respectively. +- Example: Override default parser definition files for two languages: + ``` + + + ``` + If those two are in `overrideMap.xml` (and not commented out), then function list will load your parsers `anotherPhpParser.xml` and `myPerlRule.xml` instead of loaoding `php.xml` and `perl.xml` while showing PHP and Perl function lists, respectively. -- Define your UDL example -``` - -``` -Here you define a parser rule file name for your KRL UDL. When you open a file which is recognized as a KRL file, then the function list engine will load `functionList\krl.xml` to show the KRL function list. If you have no KRL UDL defined in your Notepad++, you have to define a dummy one (with the name "KRL") to make it work. +- Example: Set the parser definition file for your UDL called "KRL": + ``` + + ``` + Here you define a parser rule file name for your KRL UDL. When you open a file which is recognized as a KRL file, then the function list engine will load `functionList\krl.xml` to show the KRL function list. If you have no KRL UDL defined in your Notepad++, you have to define a dummy one (with the name "KRL") to make it work. The `functionList\`_languagename_`.xml` parser file itself, whether it's for a builtin language or a UDL-based language, requires the structure `...`, where the attributes and contents of the `` are described in the documents section about [How to Customize Function List](../function-list/#how-to-customize-function-list). You can look at any of the [default parser files](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/) for examples of working Function List configurations. diff --git a/content/docs/function-list.md b/content/docs/function-list.md index a2fba9fd..5564dbd7 100644 --- a/content/docs/function-list.md +++ b/content/docs/function-list.md @@ -77,8 +77,8 @@ A mixed parser contains a Class parser (`classRange` node) and a Function parser ## Manually verify that your parser works for you Once you finish defining your parser, save and name the file as the language name with `xml` as file extension to the `functionList` folder in order to make it work with the language you want. (Check [overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) for the naming list of all supported programming languages.) Then load a file that uses that parser, and make sure it finds all the functions that you expect, in the appropriate classes. -## Use your own personal function list definition for a built-in language -If you do not like the results of the default Function List parser that ships with Notepad++ for a particular language, feel free to write your parser rule then save with a unique filename (like `my_languagename.xml`). (_Note_: if you edit the existing `languagename.xml`, the next update may erase your changes.) Use your [overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) in the functionList directory to override the default mapping of functionList parser rule files, or to add a mapping to new UDL parser rule files, as described in the [function list config files](../config-files/#function-list) section of the manual. +## Use your own personal function list definition for a built-in language or UDL +If you do not like the results of the default Function List parser that ships with Notepad++ for a particular language, feel free to write your parser rule then save with a unique filename (like `my_languagename.xml`). (_Note_: if you edit the existing `languagename.xml`, the next update may erase your changes.) Use your [overrideMap.xml](https://github.com/notepad-plus-plus/notepad-plus-plus/blob/master/PowerEditor/installer/functionList/overrideMap.xml) in the functionList directory to override the default mapping of functionList parser rule files and point to your new definition file, or to add a mapping to new UDL parser rule files, as described in the [function list config files](../config-files/#function-list) section of the manual. ## Validating Function List definition files