? ? 如題所示,我們?nèi)绻麄€人使用免費社區(qū)版的IDEA,它缺失了很多功能,使用起來沒有專業(yè)版那么強大,比如無法直接創(chuàng)建springbootinit項目,spring配置yml文件沒有提示。但是可以通過安裝一些插件,比如spring boot helper 、spring boot assistant插件來分別解決這兩個問題。
? ? 下面是安裝了spring boot assistant插件的idea。
? ? 插件的特點說明里面,第一條就提到了yml配置文件的自動提示,下面看一下動態(tài)效果截圖:? ? ? ? ?==========================
? ? ? IDEA中,我們經(jīng)常會用到注釋,當一個類,一個接口的注釋,可能會長這樣:
? ? 這個注釋,如果手動去寫,其實也很簡單,但是開發(fā)中每一個文件都這么來手動填寫,有點麻煩,可以將這個注釋做成一個模板,在File->Settings->Editor-> File And Code Templates :
? ? 我們先切換到Includes標簽,設(shè)置類注釋信息:
? ? 再切換到Files標簽,設(shè)置整個類Class的模板, 這里我們把版權(quán)信息加入到最頂部,然后空一行。
? ? 設(shè)置成功之后,新建類效果動態(tài)截屏:
? ? 這個類的注釋,最后需要我們手動修改的地方就是描述信息這里,根據(jù)每個類功能書寫。
? ? 我們在定義模板的時候,有些變量定義,在面板中都有:
? ??${PACKAGE_NAME} ? ? Name of the package in which a new class is created
? ? ${NAME} ? ? ? ? ? ? Name of the new class specified by you in the Create New Class dialog
? ? ${USER}? ? ? ? ? ? ? ? ? ? ? System login name of the current user
? ? ${DATE}? ? ? ? ? ? ? ? ? ? ? ?Current system date
? ? ${TIME}? ? ? ? ? ? ? ? ? ? ? ? Current system time
? ? ${YEAR}? ? ? ? ? ? ? ? ? ? ? ?Current year
? ? ${MONTH}? ? ? ? ? ? ? ? ? ? Current month
? ? ${MONTH_NAME_SHORT} First 3 letters of the current month name (Jan, Feb, and so on)
? ? ${MONTH_NAME_FULL} ?Full name of the current month (January, February, and so on)
? ? ${DAY}? ? ? ? ? ? ? ? ? ? ? ? ? Current day of the month
? ? ${HOUR}? ? ? ? ? ? ? ? ? ? ? Current hour
? ? ${MINUTE}? ? ? ? ? ? ? ? ? ?Current minute
? ? ${PROJECT_NAME} ? ?Name of the current project
? ? ====================
? ? idea幾個快捷鍵:
? ? ctrl+alt+b 跳轉(zhuǎn)到接口實現(xiàn)文章來源:http://www.zghlxwxcb.cn/news/detail-417380.html
? ? ctrl+alt+v? 自動生成變量文章來源地址http://www.zghlxwxcb.cn/news/detail-417380.html
到了這里,關(guān)于社區(qū)版Intellij IDEA安裝Spring Boot Assistant插件解決yml無提示問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!