【问题标题】:Is there a way to make IntelliJ autocomplete custom-named property files?有没有办法让 IntelliJ 自动完成自定义命名的属性文件?
【发布时间】:2023-03-17 17:56:01
【问题描述】:

我在库中有一个自定义命名的属性文件,例如foo.properties 然后我将其加载到配置类中,如下所示:

@Configuration
@PropertySource({"/foo.properties"})
public class FooConfiguration {}

IntelliJ 不会将 foo.properties 识别为 Spring 属性文件,并且不会自动完成它。有没有办法提示 IntelliJ 将其视为 Spring 属性文件?

【问题讨论】:

  • 我不确定,但也许 pom.xml 中的 ${basedir}/src/main/resources 可以帮助你
  • 文件夹已被标记为资源 :(

标签: java spring spring-boot intellij-idea spring-properties


【解决方案1】:

我不知道这是否可能。

但是您可以为您的智能手机安装一些替代插件,例如tabnine

【讨论】:

  • 属性文件在 Spring 中定义良好,我只需要让文件表现得像一个:)
猜你喜欢
  • 2016-07-03
  • 1970-01-01
  • 1970-01-01
  • 2022-11-13
  • 2021-09-30
  • 1970-01-01
  • 2011-11-29
  • 2018-09-15
  • 1970-01-01
相关资源
最近更新 更多