Skip to content

Commit d89fd14

Browse files
committed
Bean Registrar validation preference setting
1 parent 98a5992 commit d89fd14

File tree

3 files changed

+69
-15
lines changed

3 files changed

+69
-15
lines changed

headless-services/spring-boot-language-server/src/main/resources/problem-types.json

+30-7
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,29 @@
123123
}
124124
]
125125
},
126+
{
127+
"id": "boot4",
128+
"label": "Boot 4.x Best Practices & Optimizations",
129+
"toggle": {
130+
"label": "Enablement",
131+
"values": [
132+
"AUTO",
133+
"OFF",
134+
"ON"
135+
],
136+
"preferenceKey": "boot-java.validation.java.boot4",
137+
"defaultValue": "AUTO"
138+
},
139+
"order": 3,
140+
"problemTypes": [
141+
{
142+
"code": "REGISTRAR_BEAN_DECLARATION",
143+
"label": "Not registered via `@Import` in a configuration bean",
144+
"description": "Bean derived from BeanRegistrar should be registered via `@Import` over configuration bean",
145+
"defaultSeverity": "WARNING"
146+
}
147+
]
148+
},
126149
{
127150
"id": "spring-aot",
128151
"label": "AOT Optimizations",
@@ -135,7 +158,7 @@
135158
"preferenceKey": "boot-java.validation.java.spring-aot",
136159
"defaultValue": "OFF"
137160
},
138-
"order": 3,
161+
"order": 4,
139162
"problemTypes": [
140163
{
141164
"code": "JAVA_CONCRETE_BEAN_TYPE",
@@ -160,7 +183,7 @@
160183
{
161184
"id": "application-properties",
162185
"label": "Property Config Files",
163-
"order": 4,
186+
"order": 5,
164187
"problemTypes": [
165188
{
166189
"code": "PROP_INVALID_BEAN_NAVIGATION",
@@ -233,7 +256,7 @@
233256
{
234257
"id": "application-yaml",
235258
"label": "YAML Config Files",
236-
"order": 5,
259+
"order": 6,
237260
"problemTypes": [
238261
{
239262
"code": "YAML_SYNTAX_ERROR",
@@ -327,7 +350,7 @@
327350
"preferenceKey": "boot-java.validation.spel.on",
328351
"defaultValue": "ON"
329352
},
330-
"order": 6,
353+
"order": 7,
331354
"problemTypes": [
332355
{
333356
"code": "JAVA_SPEL_EXPRESSION_SYNTAX",
@@ -355,7 +378,7 @@
355378
"preferenceKey": "boot-java.validation.java.version-validation",
356379
"defaultValue": "ON"
357380
},
358-
"order": 7,
381+
"order": 8,
359382
"problemTypes": [
360383
{
361384
"code": "SUPPORTED_OSS_VERSION",
@@ -413,7 +436,7 @@
413436
"preferenceKey": "boot-java.validation.data-query",
414437
"defaultValue": "ON"
415438
},
416-
"order": 8,
439+
"order": 9,
417440
"problemTypes": [
418441
{
419442
"code": "JPQL_SYNTAX",
@@ -447,7 +470,7 @@
447470
"preferenceKey": "boot-java.validation.cron",
448471
"defaultValue": "ON"
449472
},
450-
"order": 9,
473+
"order": 10,
451474
"problemTypes": [
452475
{
453476
"code": "SYNTAX",

headless-services/spring-boot-language-server/src/test/java/org/springframework/ide/vscode/boot/test/ProblemTypesToJson.java

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.commons.io.FileUtils;
2929
import org.springframework.ide.vscode.boot.java.Boot2JavaProblemType;
3030
import org.springframework.ide.vscode.boot.java.Boot3JavaProblemType;
31+
import org.springframework.ide.vscode.boot.java.Boot4JavaProblemType;
3132
import org.springframework.ide.vscode.boot.java.SpelProblemType;
3233
import org.springframework.ide.vscode.boot.java.SpringAotJavaProblemType;
3334
import org.springframework.ide.vscode.boot.java.cron.CronProblemType;
@@ -177,6 +178,7 @@ public static void main(String[] args) throws Exception {
177178
writer.collectProblemTypeData(Boot2JavaProblemType.values());
178179
writer.collectProblemTypeData(ApplicationPropertiesProblemType.values());
179180
writer.collectProblemTypeData(Boot3JavaProblemType.values());
181+
writer.collectProblemTypeData(Boot4JavaProblemType.values());
180182
writer.collectProblemTypeData(SpringAotJavaProblemType.values());
181183
writer.collectProblemTypeData(VersionValidationProblemType.values());
182184
writer.collectProblemTypeData(QueryProblemType.values());

vscode-extensions/vscode-spring-boot/package.json

+37-8
Original file line numberDiff line numberDiff line change
@@ -724,10 +724,39 @@
724724
}
725725
}
726726
},
727+
{
728+
"id": "boot4",
729+
"title": "Boot 4.x Best Practices & Optimizations",
730+
"order": 403,
731+
"properties": {
732+
"boot-java.validation.java.boot4": {
733+
"type": "string",
734+
"default": "AUTO",
735+
"description": "Enablement",
736+
"enum": [
737+
"AUTO",
738+
"OFF",
739+
"ON"
740+
]
741+
},
742+
"spring-boot.ls.problem.boot4.REGISTRAR_BEAN_DECLARATION": {
743+
"type": "string",
744+
"default": "WARNING",
745+
"description": "Bean derived from BeanRegistrar should be registered via `@Import` over configuration bean",
746+
"enum": [
747+
"IGNORE",
748+
"INFO",
749+
"WARNING",
750+
"HINT",
751+
"ERROR"
752+
]
753+
}
754+
}
755+
},
727756
{
728757
"id": "spring-aot",
729758
"title": "AOT Optimizations",
730-
"order": 403,
759+
"order": 404,
731760
"properties": {
732761
"boot-java.validation.java.spring-aot": {
733762
"type": "string",
@@ -779,7 +808,7 @@
779808
{
780809
"id": "application-properties",
781810
"title": "Property Config Files",
782-
"order": 404,
811+
"order": 405,
783812
"properties": {
784813
"spring-boot.ls.problem.application-properties.PROP_INVALID_BEAN_NAVIGATION": {
785814
"type": "string",
@@ -918,7 +947,7 @@
918947
{
919948
"id": "application-yaml",
920949
"title": "YAML Config Files",
921-
"order": 405,
950+
"order": 406,
922951
"properties": {
923952
"spring-boot.ls.problem.application-yaml.YAML_SYNTAX_ERROR": {
924953
"type": "string",
@@ -1081,7 +1110,7 @@
10811110
{
10821111
"id": "spel",
10831112
"title": "SpEL Expressions",
1084-
"order": 406,
1113+
"order": 407,
10851114
"properties": {
10861115
"boot-java.validation.spel.on": {
10871116
"type": "string",
@@ -1121,7 +1150,7 @@
11211150
{
11221151
"id": "version-validation",
11231152
"title": "Versions and Support Ranges",
1124-
"order": 407,
1153+
"order": 408,
11251154
"properties": {
11261155
"boot-java.validation.java.version-validation": {
11271156
"type": "string",
@@ -1221,7 +1250,7 @@
12211250
{
12221251
"id": "data-query",
12231252
"title": "Data Queries",
1224-
"order": 408,
1253+
"order": 409,
12251254
"properties": {
12261255
"boot-java.validation.data-query": {
12271256
"type": "string",
@@ -1273,7 +1302,7 @@
12731302
{
12741303
"id": "cron",
12751304
"title": "CRON Expressions",
1276-
"order": 409,
1305+
"order": 410,
12771306
"properties": {
12781307
"boot-java.validation.cron": {
12791308
"type": "string",
@@ -1382,4 +1411,4 @@
13821411
"extensionDependencies": [
13831412
"redhat.java"
13841413
]
1385-
}
1414+
}

0 commit comments

Comments
 (0)