Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[使用疑问]排除函数功能的正则表达式 #13

Open
feng99 opened this issue Jan 13, 2025 · 2 comments
Open

[使用疑问]排除函数功能的正则表达式 #13

feng99 opened this issue Jan 13, 2025 · 2 comments

Comments

@feng99
Copy link

feng99 commented Jan 13, 2025

插件版本 1.22.2025.01.11_00.25

期望: 排除指定名称的函数

原因:
某个没有实际业务的公共函数,在生成的图中,出现很多次, 我想排除这个函数
image

在设置界面看到
image

然后我把^(java). 更换为 ^(get_result_model). 再次生成, 这个函数 依然存在

请指导下 函数排除功能的正确使用示例

@LinWanCen
Copy link
Owner

这个正则是匹配完整签名(sign)的,你可以点击源码,看看这个函数的sign是啥,我目前写的是类名#方法名,不知道是不是还要命名空间啥的,或者直接正则不带开始标志^,默认表示 java 开始 的函数,用来屏蔽 Java 自带函数的。

override fun toSign(func: PyFunction): String? {
val clazz = func.containingClass ?: return "#${func.name}"
return "${clazz.qualifiedName ?: return null}#${func.name}"
}

@LinWanCen
Copy link
Owner

应该用 func.qualifiedName

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants