Fix C# function list not working with comments

Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/3643#issuecomment-1455254475

Close #16386
This commit is contained in:
Christian Grasser 2025-04-05 16:20:41 +02:00 committed by Don Ho
parent 03d1268b44
commit 884f8cdc06
2 changed files with 29 additions and 1 deletions

View File

@ -11,8 +11,16 @@ using Microsoft.Owin.Security.OpenIdConnect;
namespace $OwinNamespace$
{
// check if comments are causing parsing problems
/* check if comments are causing parsing problems
check if comments are causing parsing problems
*/
public partial class $OwinClass$
{
// check if comments are causing parsing problems
/* check if comments are causing parsing problems
check if comments are causing parsing problems
*/
private static string clientId = ConfigurationManager.AppSettings["ida:ClientId"];
private static string aadInstance = ConfigurationManager.AppSettings["ida:AADInstance"];
private static string tenantId = ConfigurationManager.AppSettings["ida:TenantId"];
@ -25,6 +33,11 @@ namespace $OwinNamespace$
app.UseCookieAuthentication(new CookieAuthenticationOptions());
// check if comments are causing parsing problems
/* check if comments are causing parsing problems
check if comments are causing parsing problems
*/
app.UseOpenIdConnectAuthentication(
new OpenIdConnectAuthenticationOptions
{
@ -34,4 +47,9 @@ namespace $OwinNamespace$
});
}
}
}
}
// check if comments are causing parsing problems
/* check if comments are causing parsing problems
check if comments are causing parsing problems
*/

View File

@ -38,6 +38,16 @@
</functionName>
</function>
</classRange>
<function
mainExpr="^[\t\x20]*((static|const|virtual)\s+)?\w+(\s+\w+)?(\s+|(\*|\*\*|&amp;)\s+|\s+(\*|\*\*|&amp;)|\s+(\*|\*\*|&amp;)\s+)(\w+\s*::)?(?!(if|while|for))\w+\s*\([^\)\(]*\)(\s*const\s*)?[\n\s]*\{">
<functionName>
<nameExpr expr="(?!(if|while|for))\w+\s*\(" />
<nameExpr expr="(?!(if|while|for))\w+" />
</functionName>
<className>
<nameExpr expr="\w+(?=\s*::)" />
</className>
</function>
</parser>
</functionList>
</NotepadPlus>