Class AbstractMethodComplexityCodeLensSupplier
java.lang.Object
com.github._1c_syntax.bsl.languageserver.codelenses.AbstractMethodComplexityCodeLensSupplier
- All Implemented Interfaces:
CodeLensSupplier
- Direct Known Subclasses:
CognitiveComplexityCodeLensSupplier
,CyclomaticComplexityCodeLensSupplier
public abstract class AbstractMethodComplexityCodeLensSupplier
extends Object
implements CodeLensSupplier
Базовый класс для реализации линз, показывающих сложность методов в документе.
Конкретный сапплаер должен иметь ресурс-бандл со свойством title
, имеющим один числовой параметр %d
.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractMethodComplexityCodeLensSupplier(LanguageServerConfiguration configuration)
-
Method Summary
Modifier and TypeMethodDescriptiongetCodeLenses(DocumentContext documentContext)
protected abstract Map<MethodSymbol,Integer>
getMethodsComplexity(DocumentContext documentContext)
protected abstract boolean
-
Field Details
-
configuration
-
-
Constructor Details
-
AbstractMethodComplexityCodeLensSupplier
@ConstructorProperties("configuration") public AbstractMethodComplexityCodeLensSupplier(LanguageServerConfiguration configuration)
-
-
Method Details
-
getCodeLenses
- Specified by:
getCodeLenses
in interfaceCodeLensSupplier
- Parameters:
documentContext
- Контекст документа, для которого надо рассчитать линзы.- Returns:
- Список линз.
-
supplierIsEnabled
protected abstract boolean supplierIsEnabled()- Returns:
- Нужно ли применять конкретный сапплаер.
-
getMethodsComplexity
protected abstract Map<MethodSymbol,Integer> getMethodsComplexity(DocumentContext documentContext)- Parameters:
documentContext
- Документ, для которого нужно рассчитать информацию о сложностях методов.- Returns:
- Данные о сложности методов.
-