Notepad++ function list PHP not working if I didn't close the PHP tag

[Solved]

We just need to add enter/add new line after close the class or function tag

So maybe this is a bug

Thanks


For me the problem was that there was no closing PHP tag.

May be that helps someone.

Add a "?>" closing PHP tag if it is already not there.


There are several reasons why function list can't render function tree.

  1. In older versions of Notepad++ PHP section closing tab is required. Just simple add ?> at the end of file. Sometimes after closing tab new line is required.
  2. functionList.xml incorrect parse PHP file. For example this function description broke function list rendering:
    /**
     * Unset an instance of this class.
     *
     * @param Spreadsheet $spreadsheet Injected spreadsheet identifying the instance to unset
     */
    public function __destruct()
    {
        $this->workbook = null;
    }

In this case you must change (or add) commentExpr In functionList.xml in %APPDATA% (There are two functionList.xml locations. Program Files directory and %APPDATA% directory)

<parser
    id         ="php_syntax"
    displayName="PHP"
    commentExpr="(?'MLC'(?s-m)/\*.*?\*/)|(?'SLC'(?m-s)(?:#|/{2}).*$)|(?'STRLIT'(?s-m)&quot;[^&quot;\\]*(?:\\.[^&quot;\\]*)*&quot;|&apos;[^&apos;\\]*(?:\\.[^&apos;\\]*)*&apos;)"
>