简体   繁体   English

如何从函数调用Eclipse / Xtext代码格式化程序?

[英]How can I call the Eclipse/Xtext code formatter from a function?

I would like to be able to call my XText code formatter from a function. 我希望能够从一个函数中调用XText代码格式化程序。 I will be calling this as part of my code generator, and possibly from elsewhere. 我将其称为代码生成器,也可能从其他地方调用。 I believe this solution will be generic for any language in Eclipse, not just those implemented with XText. 我相信该解决方案将对Eclipse中的任何语言通用,而不仅仅是使用XText实现的语言。

I have searched for a solution on SO, but have been unsuccessful. 我已经在SO上寻找解决方案,但是没有成功。

Any suggestions/a point in the right direction would be helpful. 任何建议/朝正确方向的观点都会有所帮助。

Thanks, Sean 谢谢,肖恩

Thanks to Christian for this link... 感谢Christian的这个链接...

Trigger Eclipse's code formatter programmatically from a new file wizard 通过新文件向导以编程方式触发Eclipse的代码格式化程序

If anybody needs help with a similar issue, let me know. 如果有人在类似问题上需要帮助,请告诉我。 It was straightforward in the end. 最后很简单。

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

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