简体   繁体   English

为什么 Xtext 不再生成 Xtend 类?

[英]Why does Xtext no longer generates Xtend classes?

I am refactoring an Xtext project developed on an older version and notice that, by default, the Xtext framework now generates Java classes in place of what used to be Xtend classes.我正在重构在旧版本上开发的 Xtext 项目,并注意到默认情况下,Xtext 框架现在生成 Java 类来代替以前的 Xtend 类。

Is the Xtext project moving towards Java recently? Xtext 项目最近是否向 Java 发展? Is this to harness Java's updates?这是为了利用 Java 的更新吗? What does it mean for Xtend within Xtext? Xtext 中的 Xtend 意味着什么?

I am curious because my project uses a lot of extension methods and string templates, so I need to know if I should update my code at some point.我很好奇,因为我的项目使用了很多扩展方法和字符串模板,所以我需要知道是否应该在某个时候更新我的代码。

https://blogs.itemis.com/en/xtext-2.20-release https://blogs.itemis.com/en/xtext-2.20-release

To be more specific, we still think that Xtend is the most powerful language supporting template expressions.更具体地说,我们仍然认为 Xtend 是最强大的支持模板表达式的语言。 The most common use case for this are code generators.最常见的用例是代码生成器。 Besides that, writing unit tests with Xtend feels much cleaner than with Java.除此之外,使用 Xtend 编写单元测试感觉比使用 Java 更简洁。 However, we decided to encourage to use Xtend only for these areas, and not as the primary general-purpose language.但是,我们决定鼓励仅将 Xtend 用于这些领域,而不是作为主要的通用语言。 And we start doing this with the “New Project” wizard.我们从“新建项目”向导开始执行此操作。 The configuration that this wizard creates for a new Xtext project, will now use Java as the language for generated skeleton classes, so that newly-created projects (and especially new users) are using Java by default.此向导为新 Xtext 项目创建的配置现在将使用 Java 作为生成骨架类的语言,因此新创建的项目(尤其是新用户)默认使用 Java。

The Xtext project started to discourage the usage of Xtend where the latter's language features do not have a significant benefit over Java. Xtext 项目开始不鼓励使用 Xtend,后者的语言功能与 Java 相比没有显着优势。 And internally, the project started to refactor the codebase to follow this recommendation.在内部,该项目开始重构代码库以遵循此建议。

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

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