Thanks for the example file.
Functions outside a class are indeed a problem for a tree view list of all classes and functions. For that reason I concentrated first on getting a function list as CodeWright displays.
With option
Sort unchecked in context menu of the function list those regular expressions below show the same list.
Code: Select all
/TGBegin "Requires"
/TGFindStr = "^[\t ]*require(?:_once)*[\t "']+([0-9a-z$&*\-./:=?\\^_]+)["']*;"
/TGEnd
/TGBegin "Includes"
/TGFindStr = "^[\t ]*include(?:_once)*[\t "']+([0-9a-z$&*\-./:=?\\^_]+)["']*;"
/TGEnd
/TGBegin "Classes & Functions"
/TGFindStr = "^[\t ]*(?:(?:abstract|final|private|protected|public|static)[\t ]+)*(?:class|function)[\t ]+([a-z_\x7f-\xff][0-9a-z_\x7f-\xff]*)"
/TGEnd
It looks like all your classes start with
c_ and therefore no additional indicator would be necessary. But that would be possible with modifying the regular expressions for classes and functions to:
Code: Select all
/TGFindStr = "^[\t ]*(?:(?:abstract|final|private|protected|public|static)[\t ]+)*([cf])(?:lass|unction)[\t ]+([a-z_\x7f-\xff][0-9a-z_\x7f-\xff]*)"
Of course that expression would interpret also
flass and
cunction as keyword for a class or function definition, but I suppose that this does not matter in real world as those two strings are not found in any PHP file with a positive match.
The parameters of a function and the local variables of a function are not listed anymore in function list with these two variants of regular expression sets because an additional condition like "search for parameters and variables only if a
function definition is found" is not possible with a regular expression.
But the parameters of a function could be displayed in same line as the function name in function list by using the following regular expression for classes and functions:
Code: Select all
/TGFindStr = "^[\t ]*(?:(?:abstract|final|private|protected|public|static)[\t ]+)*(?:class|function)[\t ]+([a-z_\x7f-\xff][0-9a-z_\x7f-\xff]*)(?:[\t ]*(\([^)]*\)))?"
But getting the functions with their parameters listed is perhaps not needed as on referencing a function UEStudio automatically shows the parameters while typing except this IntelliTip feature is disabled in configuration. So the function list could be also without parameters to make them easier to find and read in function list.
I have never understood why local variables of a function should be displayed in function list. I don't have them in my function lists. The symbol database contains the local variables and therefore I can easily jump to definition of a local variable using
Find Symbol command executed by key and auto-completion also offers the variables in the displayed list. So I do not really understand why having local variables in function list. Too much information displayed in function list is counterproductive in my estimation. It takes more time to find all the data to display in function list and it takes more time for the user's brain to find something in function list with too much data displayed.
Please let me know if you are happy with one of the provided solutions or if you would prefer a different function list.