-
I created a function
there. Import dependencies are available there, so that is easy. However, I get the following error:
Also, it seems Java syntax is applied for parsing the test code. I defined the namespace and function in xpath_funs.yml. How to fix this? Maybe the test class (including the dependencies) should go into pmd-kotlin module? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can see how this is done in Java here: And here: |
Beta Was this translation helpful? Give feedback.
xpath_funs.yml
is just for documentation purposes. To get the function registered you would need to:LanguageProcessor createProcessor(LanguagePropertyBundle bundle)
inKotlinLanguagemodule
to provide your own processor extendingBatchLanguageProcessor
XPathHandler getXPathHandler()
to return anXPathHandler.getHandlerForFunctionDefs(YOUR_FUNCTION)
You can see how this is done in Java here:
pmd/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/JavaLanguageModule.java
Lines 60 to 63 in c472fdf