在编写Eclipse JDT插件时,有没有办法在代码中跟踪某些字符串的appearace?

时间:2023-01-14 12:09:00

I'm writing an Eclipse plugin for the JDT.

我正在为JDT编写一个Eclipse插件。

I need a functionality that tracks certain strings or regular expressions and possibly creates markers.

我需要一种跟踪某些字符串或正则表达式的功能,并可能创建标记。

I know that Eclipse already does that for //TODO comments, for example (creating task markers for them) but I'm not sure if I can use the same mechanism. I can write my own but worried it would be too inefficient and not sensitive enough to code chnanges.

我知道Eclipse已经为// TODO注释执行了此操作(例如,为它们创建任务标记),但我不确定是否可以使用相同的机制。我可以自己编写,但担心它效率太低而且不够灵敏,无法编写代码。

1 个解决方案

#1


3  

It shouldn't be complicated. Register yourself as either resource listener or as a builder and use AST to parse the modified text files.

它应该不复杂。将自己注册为资源侦听器或构建器,并使用AST来解析修改后的文本文件。

#1


3  

It shouldn't be complicated. Register yourself as either resource listener or as a builder and use AST to parse the modified text files.

它应该不复杂。将自己注册为资源侦听器或构建器,并使用AST来解析修改后的文本文件。