Source filename in PMD 7 #4865
-
Hi all. New to PMD customization so pardon if this seems like a dumb question, but in PMD <7 you could get the source filename from the rule context. My context: I have XML files with a different extension and I have to bypass the rule if the source file being inspected does not have that extension. How do I grab the source filename from the rule in 7? For the record, I'm working on a language module for the file types I'm working with but I need a quick fix for right now. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
It's not in the context, but you can get it from any node in the AST through |
Beta Was this translation helpful? Give feedback.
It's not in the context, but you can get it from any node in the AST through
Node.getTextDocument().getFileId().getFileName()
.