Skip to content

Code lens

Informational lines above procedures: cognitive and cyclomatic complexity, test run and coverage.

Shortcut: automatic

← All features

CodeLens: method complexity

The cursor sits on a method declaration in a .bsl module, and a CodeLens line appears above it. The lens shows the method's metrics — cognitive and cyclomatic complexity.

codeLens-01

CodeLens: navigate to bean definition (Autumn DI)

In a OneScript class, a «go to definition» lens is shown above the &Пластилин Autumn DI injection point and gets clicked. The editor navigates to the bean class (&Желудь) that provides the injected dependency.

codeLens-02-autumn-injection

CodeLens: bean usages (Autumn DI)

On a &Желудь bean class declaration (Autumn DI), a lens with the injection-points count is clicked. A peek window opens listing every place where this bean is injected.

codeLens-03-autumn-usages

CodeLens: run OneScript tests

Above the &Тест methods in a OneScript module, «Run test» and «Run all tests» lenses are shown, and one of them is clicked. A terminal opens and executes the test-runner command.

codeLens-04-run-tests

CodeLens: complexity counters on click

In .bsl code, the «Cognitive complexity» lens above a method is clicked. Inline complexity counters appear in the code: +1 on branches and +2 (nesting=1) on nested constructs.

codeLens-05-complexity-toggle


← Back: Inlay hints · Next: Colors: preview and picker →