开发者

How do I add a warning with Groovy AST transformations?

开发者 https://www.devze.com 2023-02-01 00:43 出处:网络
I see on the SourceUnit object that I can addError(SyntaxException)开发者_如何学Go, but how do I add a warning?

I see on the SourceUnit object that I can addError(SyntaxException)开发者_如何学Go, but how do I add a warning?

EDIT: Anyone know how I can either get a CSTNode in the CompilePhase.SEMANTIC_ANALYSIS, or how I can simply add a warning with only having to know the line number and column number (just like the addError function works)?

EDIT 2: I tried just creating a CSTNode myself, but it didn't seem to work as eclipse didn't show the warning.


Can you call getErrorCollector() on SourceUnit then add the warnings to that with one of the addWarning(...) methods?

0

精彩评论

暂无评论...
验证码 换一张
取 消