Skip to content

Fix ClassCastException in MagicNumberDiagnostic with soft error handling #3486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 22 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
337d432
Initial plan for issue
Copilot Jun 14, 2025
80a646b
Fix ClassCastException in MagicNumberDiagnostic with soft error handling
Copilot Jun 14, 2025
50e7a28
Implement general solution for ClassCastException in diagnostic confi…
Copilot Jun 14, 2025
240c0fe
Simplify ClassCastException handling to just try/catch with error log…
Copilot Jun 14, 2025
503081e
Implement localized error messages and crash test for DiagnosticBeanP…
Copilot Jun 14, 2025
d60200f
Address code review feedback: change log level, fix localization, imp…
Copilot Jun 14, 2025
ad3410a
Use getBean for DiagnosticBeanPostProcessor in test instead of manual…
Copilot Jun 14, 2025
1681c41
Add reflection-based verification of diagnostic parameter values afte…
Copilot Jun 14, 2025
d21e17d
Use DiagnosticObjectProvider and autowired DiagnosticBeanPostProcesso…
Copilot Jun 14, 2025
ea69b6e
Replace reflection with getter method for DiagnosticsOptions configur…
Copilot Jun 15, 2025
7346b69
Add verification of default authorized numbers in test as requested
Copilot Jun 15, 2025
df49d65
Implement JSON schema validation for diagnostic parameters
Copilot Jun 15, 2025
dae5993
Implement cached JSON schema validation for diagnostic parameters per…
Copilot Jun 15, 2025
0443adb
Extract DiagnosticParameterValidator class to enable Spring caching f…
Copilot Jun 15, 2025
7bdfb53
Add Javadoc to DiagnosticParameterValidator class and use @Getter(laz…
Copilot Jun 24, 2025
dafc798
Fix deprecated method usage and Spring Bean warnings in DiagnosticBea…
Copilot Jun 24, 2025
7a4c86d
Add ROLE_INFRASTRUCTURE to core infrastructure beans to resolve Sprin…
Copilot Jun 24, 2025
d69d92d
Complete Spring Bean warnings fix by adding ROLE_INFRASTRUCTURE to al…
Copilot Jun 24, 2025
7276b9d
Remove inappropriate ROLE_INFRASTRUCTURE annotations from regular bea…
Copilot Jun 24, 2025
6e38274
Fix failing tests and eliminate Spring Bean warnings by removing sche…
Copilot Jun 24, 2025
631c220
Reintegrate JSON schema validation in DiagnosticBeanPostProcessor wit…
Copilot Jun 24, 2025
291d79b
Restore DiagnosticParameterValidator component with infrastructure ro…
Copilot Jun 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ dependencies {
// (de)serialization
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-xml")

// JSON schema validation
implementation("com.networknt:json-schema-validator:1.5.4")

// graphs
implementation("org.jgrapht", "jgrapht-core", "1.5.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.util.Map;
Expand All @@ -33,6 +35,7 @@
* Сапплаер линз, показывающий когнитивную сложность методов.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это обычный бин, не инфраструктурный.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from CognitiveComplexityCodeLensSupplier as it's a regular bean. Commit: 7276b9d

public class CognitiveComplexityCodeLensSupplier extends AbstractMethodComplexityCodeLensSupplier {

public CognitiveComplexityCodeLensSupplier(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import com.github._1c_syntax.bsl.languageserver.context.DocumentContext;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.util.Map;
Expand All @@ -33,6 +35,7 @@
* Сапплаер линз, показывающий когнитивную сложность методов.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from CyclomaticComplexityCodeLensSupplier as it's a regular bean. Commit: 7276b9d

public class CyclomaticComplexityCodeLensSupplier extends AbstractMethodComplexityCodeLensSupplier {

public CyclomaticComplexityCodeLensSupplier(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import org.eclipse.lsp4j.Command;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.nio.file.Paths;
Expand All @@ -43,6 +45,7 @@
* Поставщик линзы для запуска всех тестов в текущем файле.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from RunAllTestsCodeLensSupplier as it's a regular bean. Commit: 7276b9d

@Slf4j
public class RunAllTestsCodeLensSupplier
extends AbstractRunTestsCodeLensSupplier<DefaultCodeLensData> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
import org.eclipse.lsp4j.Command;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.beans.ConstructorProperties;
Expand All @@ -50,6 +52,7 @@
* Поставщик линз для запуска теста по конкретному тестовому методу.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from RunTestCodeLensSupplier as it's a regular bean. Commit: 7276b9d

@Slf4j
public class RunTestCodeLensSupplier
extends AbstractRunTestsCodeLensSupplier<RunTestCodeLensSupplier.RunTestCodeLensData> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.event.EventListener;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.io.IOException;
Expand All @@ -56,6 +58,7 @@
* Физически выполняет команды по получению идентификаторов тестов на основании конфигурации.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from TestRunnerAdapter as it's a regular bean. Commit: 7276b9d

@RequiredArgsConstructor
@Slf4j
@CacheConfig(cacheNames = "testIds")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@

import com.github._1c_syntax.bsl.languageserver.commands.complexity.AbstractToggleComplexityInlayHintsCommandSupplier;
import com.github._1c_syntax.bsl.languageserver.inlayhints.CognitiveComplexityInlayHintSupplier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

/**
* Поставщик команды переключения подсказок когнитивной сложности.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from ToggleCognitiveComplexityInlayHintsCommandSupplier as it's a regular bean. Commit: 7276b9d

public class ToggleCognitiveComplexityInlayHintsCommandSupplier
extends AbstractToggleComplexityInlayHintsCommandSupplier {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@

import com.github._1c_syntax.bsl.languageserver.commands.complexity.AbstractToggleComplexityInlayHintsCommandSupplier;
import com.github._1c_syntax.bsl.languageserver.inlayhints.CyclomaticComplexityInlayHintSupplier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

/**
* Поставщик команды переключения подсказок цикломатической сложности.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from ToggleCyclomaticComplexityInlayHintsCommandSupplier as it's a regular bean. Commit: 7276b9d

public class ToggleCyclomaticComplexityInlayHintsCommandSupplier
extends AbstractToggleComplexityInlayHintsCommandSupplier {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,23 @@
import com.github._1c_syntax.bsl.languageserver.codelenses.CodeLensSupplier;
import com.github._1c_syntax.bsl.languageserver.commands.CommandArguments;
import com.github._1c_syntax.bsl.languageserver.commands.CommandSupplier;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Role;

import java.util.ArrayList;
import java.util.Collection;
import java.util.stream.Collectors;

@Configuration
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class ObjectMapperConfiguration {

@Bean
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Lazy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сомнительно

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from ObjectMapperConfiguration as requested. Commit: 7276b9d

public ObjectMapper objectMapper(
Collection<CodeLensSupplier<? extends CodeLensData>> codeLensResolvers,
Collection<CommandSupplier<? extends CommandArguments>> commandSuppliers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,30 @@
import com.github._1c_syntax.bsl.languageserver.configuration.LanguageServerConfiguration;
import com.github._1c_syntax.bsl.languageserver.diagnostics.BSLDiagnostic;
import com.github._1c_syntax.bsl.languageserver.diagnostics.metadata.DiagnosticInfo;
import com.github._1c_syntax.bsl.languageserver.utils.Resources;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.lsp4j.jsonrpc.messages.Either;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.util.Map;

@RequiredArgsConstructor
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

сомнительно. все BPP и так инфраструктурные.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from DiagnosticBeanPostProcessor since all BPPs are already infrastructure by default. Commit: 7276b9d

@Slf4j
public class DiagnosticBeanPostProcessor implements BeanPostProcessor {

private final LanguageServerConfiguration configuration;
private final Map<Class<? extends BSLDiagnostic>, DiagnosticInfo> diagnosticInfos;
@Lazy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

а вот это точно лишнее

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from the objectMapper @bean method. Commit: 7276b9d

private final Resources resources;
@Lazy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и это

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from ObjectMapperConfiguration class. Commit: 7276b9d

private final DiagnosticParameterValidator diagnosticParameterValidator;

@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
Expand Down Expand Up @@ -65,7 +76,17 @@ public Object postProcessAfterInitialization(Object bean, String beanName) {
configuration.getDiagnosticsOptions().getParameters().get(diagnostic.getInfo().getCode().getStringValue());

if (diagnosticConfiguration != null && diagnosticConfiguration.isRight()) {
diagnostic.configure(diagnosticConfiguration.getRight());
try {
// Validate configuration against JSON schema if available
var diagnosticCode = diagnostic.getInfo().getCode().getStringValue();
diagnosticParameterValidator.validateDiagnosticConfiguration(diagnosticCode, diagnosticConfiguration.getRight());

diagnostic.configure(diagnosticConfiguration.getRight());
} catch (Exception e) {
var errorMessage = resources.getResourceString(getClass(), "diagnosticConfigurationError",
diagnostic.getInfo().getCode().getStringValue(), e.getMessage());
LOGGER.warn(errorMessage, e);
}
}

return diagnostic;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
/*
* This file is a part of BSL Language Server.
*
* Copyright (c) 2018-2025
* Alexey Sosnoviy <labotamy@gmail.com>, Nikita Fedkin <nixel2007@gmail.com> and contributors
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*
* BSL Language Server is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3.0 of the License, or (at your option) any later version.
*
* BSL Language Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with BSL Language Server.
*/
package com.github._1c_syntax.bsl.languageserver.diagnostics.infrastructure;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.github._1c_syntax.bsl.languageserver.configuration.events.LanguageServerConfigurationChangedEvent;
import com.github._1c_syntax.bsl.languageserver.utils.Resources;
import com.networknt.schema.JsonSchema;
import com.networknt.schema.JsonSchemaFactory;
import com.networknt.schema.SpecVersion;
import com.networknt.schema.ValidationMessage;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Role;
import org.springframework.context.event.EventListener;
import org.springframework.core.io.ClassPathResource;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

/**
* Валидатор параметров диагностик с кешированием результатов проверки.
* <p>
* Выполняет валидацию конфигурации диагностик против JSON-схемы для обеспечения
* корректности параметров. Результаты валидации кешируются по классу диагностики
* и конфигурации для повышения производительности при работе с prototype-бинами.
* <p>
* Кеш автоматически сбрасывается при получении события {@link LanguageServerConfigurationChangedEvent}.
* Ошибки валидации логируются как предупреждения, но не препятствуют созданию диагностик.
*
* @see LanguageServerConfigurationChangedEvent
* @see DiagnosticBeanPostProcessor
*/
@RequiredArgsConstructor
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
@Slf4j
@CacheConfig(cacheNames = "diagnosticSchemaValidation")
public class DiagnosticParameterValidator {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужен javadoc на класс

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added comprehensive Javadoc documentation to the DiagnosticParameterValidator class explaining its purpose, caching functionality, and key features. Commit: 7bdfb53


private final Resources resources;
@Lazy
private final ObjectMapper objectMapper;

@Getter(lazy = true)
@Nullable
private final JsonSchema parametersSchema = loadParametersSchema();
private final Map<String, JsonSchema> diagnosticSchemas = new ConcurrentHashMap<>();

/**
* Обработчик события {@link LanguageServerConfigurationChangedEvent}.
* <p>
* Сбрасывает кеш валидации схем при изменении конфигурации.
*
* @param event Событие
*/
@EventListener
@CacheEvict(allEntries = true)
public void handleLanguageServerConfigurationChange(LanguageServerConfigurationChangedEvent event) {
// No-op. Служит для сброса кеша при изменении конфигурации
}

/**
* Cached validation of diagnostic configuration against JSON schema.
* Results are cached per diagnostic class and configuration to improve performance for prototype beans.
*
* @param diagnosticCode Diagnostic code
* @param configuration Configuration map to validate
*/
@Cacheable
public void validateDiagnosticConfiguration(String diagnosticCode, Map<String, Object> configuration) {
try {
var schema = getDiagnosticSchema(diagnosticCode);
if (schema != null) {
var configNode = objectMapper.valueToTree(configuration);
Set<ValidationMessage> errors = schema.validate(configNode);

if (!errors.isEmpty()) {
var errorMessages = errors.stream()
.map(ValidationMessage::getMessage)
.reduce((msg1, msg2) -> msg1 + "; " + msg2)
.orElse("Unknown validation error");

var localizedMessage = resources.getResourceString(DiagnosticBeanPostProcessor.class, "diagnosticSchemaValidationError",
diagnosticCode, errorMessages);
LOGGER.warn(localizedMessage);
}
}
} catch (Exception e) {
// Schema validation failed, but don't prevent diagnostic configuration
LOGGER.debug("Schema validation failed for diagnostic '{}': {}", diagnosticCode, e.getMessage());
}
}

private JsonSchema getDiagnosticSchema(String diagnosticCode) {
return diagnosticSchemas.computeIfAbsent(diagnosticCode, this::loadDiagnosticSchema);
}

private JsonSchema loadDiagnosticSchema(String diagnosticCode) {
try {
var schema = getParametersSchema();
if (schema != null) {
// Extract the specific diagnostic schema from the main schema
var schemaNode = schema.getSchemaNode();
var definitionsNode = schemaNode.get("definitions");
if (definitionsNode != null && definitionsNode.has(diagnosticCode)) {
var diagnosticSchemaNode = definitionsNode.get(diagnosticCode);
var factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
return factory.getSchema(diagnosticSchemaNode);
}
}
} catch (Exception e) {
LOGGER.debug("Failed to load schema for diagnostic '{}': {}", diagnosticCode, e.getMessage());
}
return null;
}

private JsonSchema loadParametersSchema() {
try {
var schemaResource = new ClassPathResource("com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json");
if (schemaResource.exists()) {
var factory = JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V7);
return factory.getSchema(schemaResource.getInputStream());
}
} catch (IOException e) {
LOGGER.warn("Failed to load parameters schema: {}", e.getMessage());
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.github._1c_syntax.bsl.languageserver.context.computer.ComplexitySecondaryLocation;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.util.List;
Expand All @@ -34,6 +36,7 @@
* Поставщик подсказок о когнитивной сложности методов.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишнее

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from CognitiveComplexityInlayHintSupplier as it's a regular bean. Commit: 7276b9d

@RequiredArgsConstructor
public class CognitiveComplexityInlayHintSupplier extends AbstractComplexityInlayHintSupplier {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import com.github._1c_syntax.bsl.languageserver.context.computer.ComplexitySecondaryLocation;
import com.github._1c_syntax.bsl.languageserver.context.symbol.MethodSymbol;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Role;
import org.springframework.stereotype.Component;

import java.util.List;
Expand All @@ -34,6 +36,7 @@
* Поставщик подсказок о цикломатической сложности методов.
*/
@Component
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

лишнее

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ROLE_INFRASTRUCTURE annotation from CyclomaticComplexityInlayHintSupplier as it's a regular bean. Commit: 7276b9d

@RequiredArgsConstructor
public class CyclomaticComplexityInlayHintSupplier extends AbstractComplexityInlayHintSupplier {

Expand Down
Loading