简体   繁体   English

NetBeans-如果注册了ProjectFactory(Project API),则TaskFactory(Parsing API)不起作用

[英]NetBeans - TaskFactory (Parsing API) does not work if a ProjectFactory (Project API) was registered

I'm creating a NetBeans module with multiple services (code assist, project, debugger etc.) 我正在创建具有多种服务(代码辅助,项目,调试器等)的NetBeans模块。

I've noticed that after I registered my ProjectFactory via the @ServiceProvider annotation, the TaskFactory which is registered by the @MimeRegistration annotation stops working. 我注意到,在通过@ServiceProvider批注注册我的ProjectFactory之后,由@MimeRegistration批注注册的@MimeRegistration停止工作。 Ie its one and only method create(Snapshot snapshot) for creating parsing tasks, like ParserResultTasks for error annotations, is not being invoked anymore, thus no parsing. 即,不再create(Snapshot snapshot)用于创建解析任务的唯一方法create(Snapshot snapshot) ,例如用于错误注释的ParserResultTasks,因此不再解析。

However, once I invoke the parser explicitly, eg through ParserManager.parse within a CompletionProvider, everything works again. 但是,一旦我显式调用了解析器(例如,通过CompletionProvider中的ParserManager.parse ,一切都会再次起作用。 Also, I should probably note that the project, editor and parser implementations are all in separate modules. 另外,我可能应该注意项目,编辑器和解析器的实现都在单独的模块中。

Is there anything else I have to pay attention to if the ProjectFactory and TaskFactory are being used together? 如果一起使用ProjectFactory和TaskFactory,我还有什么要注意的吗? Perhaps adding the TaskFactory to the lookup of the project? 也许将TaskFactory添加到项目的查找中?

Update 更新资料

All of a sudden everything is working. 突然间一切正常。 I don't know what the problem was, perhaps the META registrations haven't been loaded correctly after changes were made? 我不知道问题出在哪里,也许在进行更改后未正确加载META注册? I don't know. 我不知道。 But now everything seems to do what it supposed do. 但是现在,一切似乎都按预期进行。

I'm still open for possible suggestions where things can go wrong when using both, project and parsing API together (if that at all was the problem). 我仍然愿意寻求建议,在将项目API和解析API一起使用时,如果出现问题,那可能会出错。

Update2 更新2

No, it's not working. 不,它不起作用。 Filed in a bug report, see https://netbeans.org/bugzilla/show_bug.cgi?id=230558 归档在错误报告中,请参阅https://netbeans.org/bugzilla/show_bug.cgi?id=230558

Ok, turns out it was a bug after all, but it has been fixed now. 好的,事实证明这毕竟是一个错误,但现在已修复。

See the full story over here . 这里查看全文。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM