Spring Boot应用程序的`application.properties`没有自动完成建议。

huangapple go评论76阅读模式
英文:

Spring Boot Application.properties has no autocomplete suggestions

问题

我是一个Spring Boot初学者
我使用Spring Initializer创建了一个示范项目
在application.properties文件中,我想要修改服务器端口,但是编辑器不识别它
完全一无所知
问题是什么

英文:

I'm a spring boot beginner
I created a sample project using the spring initializer
in the application.properties I want to change the server. port but editor doesn't know that
doesn't know anything at all
what's the problem

答案1

得分: 5

InteliJ IDEA的Community Edition不支持application.properties的自动补全功能。这是Ultimate版的特性。

根据这个支持主题

> Spring Boot框架仅在IntelliJ IDEA的Ultimate版本中可用。它作为捆绑插件提供,并默认情况下已启用。

英文:

Community Edition of InteliJ IDEA doesn't support autocompletion for application.properties. It is ultimate edition feature.

From this support thread

> Spring Boot framework is available in the Ultimate edition of IntelliJ IDEA only. It comes as a bundled plugin and is enabled by default.

答案2

得分: 2

IntelliJ社区版不支持Spring Boot,因此您无法获得自动补全功能,这是一种“企业”功能(仅在IntelliJ企业版中支持)。

总的来说,有一个特殊的JSON文件,IntelliJ可以解析它(同样,只有企业版支持),根据在该文件中找到的信息,它可以为属性/YAML配置文件生成自动补全。

您还可以通过使用注解处理器为自己的配置文件创建这样的JSON:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
</dependency>

参见此教程作为示例,还有许多其他教程。但是再次强调,这一切仅在IntelliJ的企业版中有效。

英文:

IntelliJ community edition doesn't support spring boot hence you don't have autocompletion, its an "enterprise" feature (read supported only in the IntelliJ enterprise edition).

All-in-all, there is a special JSON file that IntelliJ can parse (again, only the enterprise edition) and based on the information found in this file it can produce auto-completion for the properties / YAML configuration files.

You can also create such a JSON for your own configuration files by using an annotation processor:

&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-configuration-processor&lt;/artifactId&gt;
    &lt;optional&gt;true&lt;/optional&gt;
&lt;/dependency&gt;

See this tutorial for example, there are many others. But again, this all works only in the enterprise edition of IntelliJ.

答案3

得分: 0

&lt;h4&gt;你好&lt;/h4&gt;
有一个适用于IntelliJ IDEA Community Edition的插件,可能会在自动完成和其他一些方面非常有帮助,这是它的网站:&lt;a href=&quot;https://plugins.jetbrains.com/plugin/17747-spring-boot-assistant&quot;&gt;Spring Boot Assistant&lt;/a&gt;。&lt;br&gt;
您可以从上面的链接获取插件,或直接从IDE获取:&lt;ul&gt;
&lt;li&gt;转到文件 -&gt; 设置(在Windows上为Ctrl + Alt + S)
&lt;li&gt;搜索“插件”
&lt;li&gt;进入市场
&lt;li&gt;搜索“Spring Boot Assistant”
&lt;li&gt;安装并重新启动您的IDE
&lt;li&gt;享受自动完成&lt;/ul&gt;&lt;p&gt;希望它能帮助您学习,继续加油,伙计 :D
英文:

<h4>Hello</h4>
There is a plugin for IntelliJ IDEA Community Edition which might be very helpful with autocomplete and few more things, here is it's website: <a href="https://plugins.jetbrains.com/plugin/17747-spring-boot-assistant">Spring Boot Assistant</a>.<br>
You can get the plugin from the link above or directly from the IDE:<ul>
<li>go to File -> Settings (Ctrl + Alt + S on Windows)
<li>search for "Plugins"
<li>go to Marketplace
<li>search for "Spring Boot Assistant"
<li>install it and restart your IDE
<li>enjoy autocomplete</ul><p>Hope it will help you learning, keep working, mate Spring Boot应用程序的`application.properties`没有自动完成建议。

答案4

得分: 0

对于那些仍在寻找IntelliJ IDEA社区版上自动补全功能的人,可以在此处找到一个插件。

> 此插件为Spring Boot配置文件(application.yml、application.properties)添加了自动补全支持。

我已经测试过了,它在这里的截图中展示出正常工作。

英文:

For those who are still looking for the autocomplete feature on the IntelliJ IDEA Community Edition, there is a plugin for that found here.

> This plugin adds auto-completion support for Spring Boot configuration files (application.yml, application.properties).

I have tested it and it is working ok as shared in the Spring Boot应用程序的`application.properties`没有自动完成建议。

huangapple
  • 本文由 发表于 2020年10月19日 17:24:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/64424533.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定