Skip to content

Commit d69d92d

Browse files
Copilotnixel2007
andcommitted
Complete Spring Bean warnings fix by adding ROLE_INFRASTRUCTURE to all CodeLens and Command suppliers
Co-authored-by: nixel2007 <[email protected]>
1 parent 7a4c86d commit d69d92d

8 files changed

+24
-0
lines changed

src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
2626
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
2727
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
28+
import org.springframework.beans.factory.config.BeanDefinition;
29+
import org.springframework.context.annotation.Role;
2830
import org.springframework.stereotype.Component;
2931

3032
import java.util.Map;
@@ -33,6 +35,7 @@
3335
* Сапплаер линз, показывающий когнитивную сложность методов.
3436
*/
3537
@Component
38+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
3639
public class CyclomaticComplexityCodeLensSupplier extends AbstractMethodComplexityCodeLensSupplier {
3740

3841
public CyclomaticComplexityCodeLensSupplier(

src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
import org.eclipse.lsp4j.Command;
3333
import org.springframework.beans.factory.annotation.Autowired;
3434
import org.springframework.context.annotation.Lazy;
35+
import org.springframework.beans.factory.config.BeanDefinition;
36+
import org.springframework.context.annotation.Role;
3537
import org.springframework.stereotype.Component;
3638

3739
import java.nio.file.Paths;
@@ -43,6 +45,7 @@
4345
* Поставщик линзы для запуска всех тестов в текущем файле.
4446
*/
4547
@Component
48+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
4649
@Slf4j
4750
public class RunAllTestsCodeLensSupplier
4851
extends AbstractRunTestsCodeLensSupplier<DefaultCodeLensData> {

src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
import org.eclipse.lsp4j.Command;
3737
import org.springframework.beans.factory.annotation.Autowired;
3838
import org.springframework.context.annotation.Lazy;
39+
import org.springframework.beans.factory.config.BeanDefinition;
40+
import org.springframework.context.annotation.Role;
3941
import org.springframework.stereotype.Component;
4042

4143
import java.beans.ConstructorProperties;
@@ -50,6 +52,7 @@
5052
* Поставщик линз для запуска теста по конкретному тестовому методу.
5153
*/
5254
@Component
55+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
5356
@Slf4j
5457
public class RunTestCodeLensSupplier
5558
extends AbstractRunTestsCodeLensSupplier<RunTestCodeLensSupplier.RunTestCodeLensData> {

src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
import org.springframework.cache.annotation.CacheEvict;
4040
import org.springframework.cache.annotation.Cacheable;
4141
import org.springframework.context.event.EventListener;
42+
import org.springframework.beans.factory.config.BeanDefinition;
43+
import org.springframework.context.annotation.Role;
4244
import org.springframework.stereotype.Component;
4345

4446
import java.io.IOException;
@@ -56,6 +58,7 @@
5658
* Физически выполняет команды по получению идентификаторов тестов на основании конфигурации.
5759
*/
5860
@Component
61+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
5962
@RequiredArgsConstructor
6063
@Slf4j
6164
@CacheConfig(cacheNames = "testIds")

src/main/java/com/github/_1c_syntax/bsl/languageserver/commands/ToggleCognitiveComplexityInlayHintsCommandSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323

2424
import com.github._1c_syntax.bsl.languageserver.commands.complexity.AbstractToggleComplexityInlayHintsCommandSupplier;
2525
import com.github._1c_syntax.bsl.languageserver.inlayhints.CognitiveComplexityInlayHintSupplier;
26+
import org.springframework.beans.factory.config.BeanDefinition;
27+
import org.springframework.context.annotation.Role;
2628
import org.springframework.stereotype.Component;
2729

2830
/**
2931
* Поставщик команды переключения подсказок когнитивной сложности.
3032
*/
3133
@Component
34+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
3235
public class ToggleCognitiveComplexityInlayHintsCommandSupplier
3336
extends AbstractToggleComplexityInlayHintsCommandSupplier {
3437

src/main/java/com/github/_1c_syntax/bsl/languageserver/commands/ToggleCyclomaticComplexityInlayHintsCommandSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323

2424
import com.github._1c_syntax.bsl.languageserver.commands.complexity.AbstractToggleComplexityInlayHintsCommandSupplier;
2525
import com.github._1c_syntax.bsl.languageserver.inlayhints.CyclomaticComplexityInlayHintSupplier;
26+
import org.springframework.beans.factory.config.BeanDefinition;
27+
import org.springframework.context.annotation.Role;
2628
import org.springframework.stereotype.Component;
2729

2830
/**
2931
* Поставщик команды переключения подсказок цикломатической сложности.
3032
*/
3133
@Component
34+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
3235
public class ToggleCyclomaticComplexityInlayHintsCommandSupplier
3336
extends AbstractToggleComplexityInlayHintsCommandSupplier {
3437

src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/CognitiveComplexityInlayHintSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.github._1c_syntax.bsl.languageserver.context.computer.ComplexitySecondaryLocation;
2626
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
2727
import lombok.RequiredArgsConstructor;
28+
import org.springframework.beans.factory.config.BeanDefinition;
29+
import org.springframework.context.annotation.Role;
2830
import org.springframework.stereotype.Component;
2931

3032
import java.util.List;
@@ -34,6 +36,7 @@
3436
* Поставщик подсказок о когнитивной сложности методов.
3537
*/
3638
@Component
39+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
3740
@RequiredArgsConstructor
3841
public class CognitiveComplexityInlayHintSupplier extends AbstractComplexityInlayHintSupplier {
3942

src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/CyclomaticComplexityInlayHintSupplier.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.github._1c_syntax.bsl.languageserver.context.computer.ComplexitySecondaryLocation;
2626
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
2727
import lombok.RequiredArgsConstructor;
28+
import org.springframework.beans.factory.config.BeanDefinition;
29+
import org.springframework.context.annotation.Role;
2830
import org.springframework.stereotype.Component;
2931

3032
import java.util.List;
@@ -34,6 +36,7 @@
3436
* Поставщик подсказок о цикломатической сложности методов.
3537
*/
3638
@Component
39+
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
3740
@RequiredArgsConstructor
3841
public class CyclomaticComplexityInlayHintSupplier extends AbstractComplexityInlayHintSupplier {
3942

0 commit comments

Comments
 (0)