如何修复或更正“默认文件模板”? IntelliJ Idea中的警告

编程入门 行业动态 更新时间:2024-10-24 04:52:17
本文介绍了如何修复或更正“默认文件模板”? IntelliJ Idea中的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

IntelliJ Idea:2016.1 Windows 10 Pro

IntelliJ Idea: 2016.1 Windows 10 Pro

当我在新项目中创建新项目或新类时,IntelliJ有用地包含一个默认标题包含我的姓名和日期。但是,它还会突出显示代码并使用默认文件模板显示有关文件的警告。它提出了两种纠正代码的方法。通过编辑模板或将其替换为实际的文件模板。但是,两种选择都不满足警告;也不会手动替换标题的内容。我无法找到摆脱它的方法。

When I create a new project or a new class in a new project, IntelliJ helpfully includes a default header containing my name and the date. However, it also highlights the code and displays a warning about the file using a "Default File Template". It suggests two ways to correct the code. Either by editing the template or by replacing it with an actual file template. However, neither option satisfies the warning; nor does manually replacing the contents of the header. I can't figure out a way to get rid of it.

我知道我可以取消警告,但我更愿意更正或修正它。

I know that I can suppress the warning, but I would prefer to actually correct or fix it.

任何想法?

推荐答案

只需在具有名称和日期的默认模板语句后添加一个新行。 Intellij将新行视为文档的一部分,然后停止投诉。 更新

Just add a new line after Default Template statement which has name and date. Intellij considers that new line as part of documentation, and then stops complaining. Update

赞这个:

/** * Created by YourName on 2017/06/11. * THIS LINE */

更多推荐

如何修复或更正“默认文件模板”? IntelliJ Idea中的警告

本文发布于:2023-11-16 09:50:49,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1603199.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:模板   文件   Idea   IntelliJ

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!