Lombok IntelliJ IDEA插件:默认情况下禁用var [英] Lombok IntelliJ IDEA Plugin: Use of var is disabled by default

查看:4103
本文介绍了Lombok IntelliJ IDEA插件:默认情况下禁用var的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Lombok插件 IntelliJ IDEA 一>。当尝试使用 var 关键字运行 Java 代码时,出现以下错误:

I'm using the Lombok Plugin for IntelliJ IDEA. When try to run Java code using the var keyword, I get the following error:

默认情况下禁用var的使用。如果你想启用is,请将'lombok.var.flagUsage = ALLOW'添加到'lombok.config'。

你好吗?在 IntelliJ IDEA ?我在项目根目录中创建了 lombok.config 并粘贴了 lombok.var.flagUsage = ALLOW 但它没有修理它。 val 正在运行但不是 var 。我似乎无法找到关于启用 var 的明确说明。

How do you do that in IntelliJ IDEA? I created the lombok.config in the project root and pasted lombok.var.flagUsage = ALLOW but it didn't fix it. val is working but not var. I can't seem to find clear instructions on enabling var.

我的 Lombok maven依赖是:

My Lombok maven dependency is:

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.16.18</version>
    <scope>provided</scope>
</dependency>


推荐答案

您可能需要重新编译所有内容才能观察

You may need to recompile everything in order to observe the effect.

实际上,任何地方的任何 lombok.config 的更改都应该触发子树中所有类的重新编译。事实并非如此,因为这种变化很少见,并且不保证可能是非常重要的工作量。

Actually, any change of any lombok.config anywhere should trigger a recompilation of all classes in the subtree. This is not the case as such changes are rare and don't warrant the probably non-trivial amount of work.

这篇关于Lombok IntelliJ IDEA插件:默认情况下禁用var的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆