C Sharp (C#) Function list not working in npp 7.3.1 32bit although CPP and C work just fine.

  • I have been trying to list the methods of a c# source file in npp to no luck. I get a hyphen and the filename and a icon at the top of the list but no + symbol and double-clicking on the filename does not work either. I do not know that this makes any difference but the file is part of a VS 2013 C# project.
    Any help would be greatly appreciated. I’ve searched up and down the intertubes and all over the netscrape and have only found mentions of getting function list plugin working in older version of npp like 6.5.

    Thanks much!

  • @Gary-Anson
    The C# parser for the (build-in) Function List is far from functional. It’s on the To-Do list but won’t be available anytime soon.

    You could try a plugin like Source Cookifier, NppGTags, TagLEET, TagsJump or TagsView but I am not sure which supports C#.

  • There is a missing function node just above the end </parser> tag:
    <function mainExpr="">
    Adding the missing function node to %APPDATA%\Notepad++\functionList.xml fixes the issue. Looks like someone made some edits and (accidentally ?) deleted the above node.

  • @MAPJe71 : it’s been a year from your comment, is there any update about C# funtion list? It’s still not working now (2018-06-14)
    Regards, LongNX.

  • Well, it’s still unfixed, but the workaround still applies.

  • @Pritvinath-Obla The parser code block for C# ends like this-


    Can You tell me which to change?


  • @Pritvinath-Obla Adding the missing tag worked for me

  • Using the workaround provided by @Pritvinath-Obla, here is a complete working parser configuration for C# in the functionList.xml file:

    <!-- ========================================================== [ C# ] -->
    |   Based on:
    |       http://sourceforge.net/p/notepad-plus/patches/613/
    	id         ="csharp_class"
    		mainExpr    ="^[\t\x20]*((public|protected|private|internal)\s+)?(\w+\s*)?(class|struct|interface)[\t\x20]+[^\{]+\{"
    		openSymbole ="\{"
    			<nameExpr expr="(class|struct|interface)[\t\x20]+\w+" />
    			<nameExpr expr="[\t\x20]+\w+" />
    			<nameExpr expr="\w+" />
    				<funcNameExpr expr="(\w+(&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)\(" />
    				<funcNameExpr expr="(\w+(&lt;[\w,\s&lt;&gt;]+&gt;)?\s?)" />
    	<!-- The following tag was missing from the distributed file. -->
    	<function mainExpr="">

  • @Ed-Eaglehouse I am not sure what it fixes, but I see that cs file cannot be parsed if it contains interpolation string like

    var s_command = "some";
    var s_target= "some 2";
    var s_command_info= "some 3";
    jsSupportLines.Add($"    echo('not implemented: {s_command} ({s_target})'); // {s_command_info}");

Log in to reply