Showing posts with label Function List. Show all posts
Showing posts with label Function List. Show all posts

Notepad++ and function list feature

Starting from version 6.4.1 Notepad++ doesn't use plugging FunctionList any more, because it's now built-in feature. I have copied short description from origin.




Function List Panel is a zone to display all the function (or method) find in current file. User can use Function List Panel to access to a function definition quickly by double clicking function item on the list. Function List can be customized to list the functions for whichever language. For customizing Function List to recognize your favorite language, please check below.
Function list contains a search engine (by using regular expression) and a panel to display the search result (function list). It is designed to be as generic as possible, and allows user to modify the way to search, or to add new parser for any programming language.
In order to make function list work for your language (if not supported), you should modify functionList.xml. It can be found in %APPDATA%\notepad++\ or in Notepad++ installed directory if you use zip package.

Define your parser and add it by adding node parser in parsers node:
function list parsers

In parser node it contains:
id: unique ID for this parser
displayName: reserved for future use.
comment: Optional. you can make a RE in this attribute in order to identify comment zones. The identified zones will be ignored by search.


There are 3 kinds of parsers: function parserclass parser and mix parser.
Define a function parser if the language has only functions to parse (for example C).
Define a class parser if the language has functions "defined" in a class, but no function defined outside of a class (for example Java).
Define a mix parser if you have function "defined" both inside and outside of a class in a file (for example C++).

A function parser contains only a function node.
A class parser contains only a classRange node.
A mix parser contains both function and classRange nodes.

Function parser


In function node it contains:
mainExpr: it's the regex to get the whole string which contains all the information you need.
displayMode: reserved for future use.
functionName: define a or several RE to get the function name from the result of "mainExpr" attribute of "function" node.
    - nameExpr: 1..N
        - expr: here you define the RE to find the function name.

className: define a or several RE to get the class name from the result of "mainExpr".
    - nameExpr: 1..N
      - expr: here you define the RE to find the function name.
  
Both functionName and className nodes are optional.
If functionName and className are absent, then the found string by mainExpr RE will be processed as function name, and the class name won't be used.


The nodes functionName and className have the same structure, and they have the same parsing behaviour. For example, in the functionName node, we got 2 nameExpr nodes:
If the function parser find the first result by mainExpr attribute, then it will use the first nameExpr to search in the first result, if found (the 2nd result), then it will use the 2nd nameExpr to search in the 2nd result. If found, then the function name is solved.

Class parser


In classRange node it contains:
mainExr: the main whole string to search
displayMode: reserved for future use.
openSymbole & closeSymbole: they are optional. if defined, then the parser will determinate the zone of this class. It find first openSymbole from the first character of found string by mainExpr attribute. then it determinates the end of class by closeSymbole found. The algorithm deals with the several levels of imbrication. for example: {{{}{}}{}}
className: 1 (or more) nameExpr node for determination of class name (from the result of mainExprsearching).
function: search in the class zone by using mainExpr attribute and the functionName nodes.

Mix parser


Mix Parser contains Class parser (classRange node) and Function parser (function node).
Class parser will be applied firstly to find class zones, then function parser will be applied on non-class zones.

Link to Language


<associationMap>
<!-- langID:
L_TEXT: 0     L_PHP: 1        L_C: 2        L_CPP: 3       L_CS: 4         L_OBJC: 5
L_JAVA: 6     L_RC: 7         L_HTML: 8     L_XML: 9       L_MAKEFILE: 10  L_PASCAL: 11
L_BATCH:12    L_INI: 13       L_ASCII: 14   L_USER: 15     L_ASP: 16       L_SQL: 17
L_VB: 18      L_JS: 19        L_CSS: 20     L_PERL: 21     L_PYTHON: 22    L_LUA: 23
L_TEX: 24     L_FORTRAN: 25   L_BASH: 26    L_FLASH: 27    L_NSIS: 28      L_TCL: 29
L_LISP: 30    L_SCHEME: 31    L_ASM: 32     L_DIFF: 33     L_PROPS: 34     L_PS: 35
L_RUBY: 36    L_SMALLTALK:37  L_VHDL: 38    L_KIX: 39      L_AU3: 40       L_CAML: 41
L_ADA: 42     L_VERILOG: 43   L_MATLAB: 44  L_HASKELL: 45  L_INNO: 46      L_SEARCHRESULT: 47
L_CMAKE: 48   L_YAML: 49      L_COBOL 50    L_GUI4CLI: 51  L_D: 52         L_POWERSHELL: 53
L_R: 54       L_JSP: 55
-->
<association langID="1" id="php_function"/>
<association langID="2" id="c_function"/>
<association langID="3" id="c_cpp_function"/>
<association langID="6" id="java"/>
<association langID="9" id="xml_node"/>
<association langID="12" id="batch_label"/>
<association langID="13" id="ini_section"/>
<association langID="19" id="js_function"/>
<association langID="21" id="perl_function"/>
<association langID="28" id="nsis_syntax"/>
<!--
if langID cannot be found above, you can still set the file extensions
<association ext=".my_passer_ext1" id="my_passer_id"/>
<association ext=".my_passer_ext2" id="my_passer_id"/>

for User Defined Languages:
<association userDefinedLangName="my user defined language" id="my_udl_passer_id"/>
<association userDefinedLangName="Autocad" id="my_autocad_passer_id"/>
-->

</associationMap>

Once you finish to defined your parser, you can associate it with Notepad++ internal language id (or with file extension), in order to make it works with the language you want. All you need to do is add associationnode(s) into associationMap node.

In associationMap, it contains:
association: 1 or several nodes to make associations between defined parsers and languages.
    - langID: Notepad++ internal language ID.
    - userDefinedLangName: User Defined Language Name. It makes association between User Defined Language and the parser. If langID is present, this attribute will be ignored.
    - ext: File name extension (should contain '.'). If langID or userDefinedLangName is present, this attribute will be ignored.
    - id: Parser ID.

Notepad++ Function List


notepad++ has built-in function list starting from version 6.4. At the moment only C++ and JavaScript are supporting.

Follow next releases and enjoy!

HOWTO create php function list

I have tried to use php reflections with no success to examine php class.
After that i found phpdoc which creates full list of methods etc just in a second.
It was really easy against expectation. And now I can see php function list nice formated

$ phpdoc -o HTML:frames:earthli -d -myclasses -t docs

and result looks like



Enjoy!

C# real function list

An assembly (DLL, EXE etc) can contain different classes. And class can contain a lot of methods.
You know already about reflection, but you need quickly look up the function list.

I have written yet another c sharp assembly explorer, please take here.




Enjoy!

C# (c sharp) function list


C# has no functions in the ordinary sense. So you if you are looking for absolute value you can't call abs() any more and should use static method from Math class!

Math.Abs(foo_bar);

So you can forget right now about function and find some useful methods of class which grouped in namespaces.

Namespace overview you will find here. Base classes are collected in System namespace. And useful list and hashes are located in System.Collections namespace.

Enjoy!

PeopleSoft SQR Language and Function List in Notepad 5

First of all I have found funny bug in Notepad++, if you want to use FunctionList plugin with User Defined Language then you should switch off "language menu compact" mode and disable some languages.


Next step to add user defined language SQR
Open User Language Dialog and and create new language SQR.
You can add some keywords, comments and nice formatting. Look here for details.


After that we can define Language Parsing Rule for Function List plugin.
But keep in mind, that SQR script has a lot nameless blocks, so function list could not show any text.
Recommended workaround to add some descriptive comment after begin word, e.g.
begin-program !my first app


Lets add new Group PROGRAMM and RegEx



and of course we need PROCEDURE group with 2 rules!
Rule 1.


Rule 2.



Press OK and enjoy with end result


Keywords for SQR  have been taken here. Many thanks to Iouri Chadour!


Sincerely yours,
R

HOWTO list all my functions in CSharp (C#) using FunctionList

If you could not find your functions in the list from C# class, it is possible that not exists correct language parsing rule. Click on picture to zoom out it and create similar rule in "Language Parsing Rules" dialog. Add new group for C# language and name it METHOD.


Function Begin: \w*[\s\*]*
Function List Name: \w+\s*[\s\*]*
Function End: \(.*\)
Body Begin: \{
Body End: \}
Body Begin to Body End: \{

by the way you can use the same trick for Java language.

If you are looking for method list of class in C# check also here.
It will NOT help to folding and unfolding blocks of code like Eclipse, but you can quickly navigate through code.

Sources of Function List plugin (Unicode+ANSI)

You can use the generic_ stubs from notepad++ source, but you may prefer the "fully portable" _TCHAR macros. These macros are all prefixed with _tcs; they substitute, one for one, for the str family of functions. For more information, see Generic-Text Mappings in TCHAR.H. In any case i have used _tcs functions. Sources you can take here.

Function List is compatible with Notepad 5.1.2

OUT - OF - DATE
Obsolete. Please check new post!



If you have issue with Function List plugin for Notepad++ 5.1.2, please check first whether you have ANSI or UNICODE version of application. Just open About dialog and check at the top version. You can download here UNICODE or ANSI recompiled version of plugin and save it into NPP_HOME \plugins\ folder.









Enjoy!

Function List for Notepad++

If you are fan of Function List plugin for Notepad++, you know that it does not work any more on version 5. I have good news, you can download here recompiled version of plugin and save it into NPP_HOME \plugins\ folder.

Enjoy!

HOWTO: Repair Logitech M325 Mouse

FixIt says that you will find single screw under CE label. It isn't always true.