Добавлена линза для отладки тестов#3682
Conversation
WalkthroughAdds a DebugTest CodeLens supplier and tests; applies Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant CodeLensManager
participant Config as CodeLensesConfiguration
participant DebugSupplier as DebugTestCodeLensSupplier
participant TestRunner as TestRunnerAdapter
participant Resources
Client->>CodeLensManager: request code lenses for document
CodeLensManager->>Config: get enabled suppliers (sorted by `@Order`)
Config-->>CodeLensManager: ordered supplier list
CodeLensManager->>DebugSupplier: provideCodeLenses(document)
DebugSupplier->>TestRunner: computeTestIdsByTestRunner(document)
TestRunner-->>DebugSupplier: list of test IDs (distinct)
DebugSupplier->>Resources: load localized title
DebugSupplier->>DebugSupplier: assemble debug command using debugTestArguments
DebugSupplier-->>CodeLensManager: CodeLenses with Commands
CodeLensManager-->>Client: return CodeLenses
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java (2)
67-92: Consider strengthening test assertions.The tests
testDryRunandtestRunWithMockedTestIdsonly verify that the result is not null. Consider asserting on the actual size or content of the code lenses to ensure the supplier behavior is correctly validated.Additionally, consider adding a test case for when
debugTestArgumentsis empty (lines 90-92 in the supplier), which should return an empty list.🔎 Suggested improvement for testRunWithMockedTestIds
@Test void testRunWithMockedTestIds() { // given initializeServer("Visual Studio Code"); when(testRunnerAdapter.getTestIds(documentContext)) .thenReturn(List.of("testName")); // when var codeLenses = supplier.getCodeLenses(documentContext); // then - assertThat(codeLenses).isNotNull(); + assertThat(codeLenses).isNotNull().hasSize(1); }
94-109: Verify resolved command content.The test verifies the command is not null but doesn't validate the command ID, title, or arguments. Consider adding assertions to ensure the resolved command has the expected
COMMAND_IDand properly formatted arguments.🔎 Suggested improvement
@Test void testResolve() { // given CodeLens codeLens = new CodeLens(); DebugTestCodeLensSupplier.DebugTestCodeLensData codeLensData = new DebugTestCodeLensSupplier.DebugTestCodeLensData( documentContext.getUri(), supplier.getId(), "testName" ); // when var resolvedCodeLens = supplier.resolve(documentContext, codeLens, codeLensData); // then - assertThat(resolvedCodeLens.getCommand()).isNotNull(); + assertThat(resolvedCodeLens.getCommand()).isNotNull(); + assertThat(resolvedCodeLens.getCommand().getCommand()).isEqualTo("language-1c-bsl.languageServer.debugTest"); }src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java (1)
34-34: Unused@Slf4jannotation.The
@Slf4jannotation generates aLOGGERfield, but it doesn't appear to be used in this class. Consider removing it to keep the code clean, or add logging if needed for debugging purposes.🔎 Proposed fix
import lombok.Getter; import lombok.ToString; import lombok.Value; -import lombok.extern.slf4j.Slf4j; import org.eclipse.lsp4j.CodeLens;And remove from class annotation:
@Component -@Slf4j @Order(3) public class DebugTestCodeLensSupplier
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/test/resources/codelenses/DebugTestCodeLensSupplier.osis excluded by!src/test/resources/**
📒 Files selected for processing (12)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java(1 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java(1 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_en.properties(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_ru.properties(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json(1 hunks)src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java
src/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Java 17 for language and follow Java naming conventions
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
src/test/java/**/*Test.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
🧠 Learnings (11)
📚 Learning: 2025-12-18T18:49:48.694Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.694Z
Learning: Applies to docs/{en/,}diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes
Applied to files:
src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_ru.propertiessrc/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
📚 Learning: 2025-12-18T18:49:48.694Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.694Z
Learning: Applies to src/main/resources/**/diagnostics/**/*.properties : Resource bundles must have both Russian and English versions for diagnostics
Applied to files:
src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_ru.propertiessrc/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_en.properties
📚 Learning: 2025-01-19T21:47:05.209Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:47:05.209Z
Learning: В классе AbstractRunTestsCodeLensSupplier проверка поддержки клиента должна выполняться до вызова getTestIds, чтобы предотвратить выполнение лишних операций и обеспечить корректное поведение при неподдерживаемом клиенте.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java
📚 Learning: 2025-02-10T17:12:56.150Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:63-66
Timestamp: 2025-02-10T17:12:56.150Z
Learning: In BSL Language Server, `documentContext.getServerContext().getConfiguration()` is guaranteed to return a non-null value, making null checks unnecessary.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java
📚 Learning: 2025-01-19T21:34:39.797Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T21:34:39.797Z
Learning: In BSL Language Server configuration classes, immutable collections (Set.of, List.of) should be used for default values, while mutability is achieved through setters generated by Data annotation.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java
📚 Learning: 2025-01-19T21:45:52.703Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:45:52.703Z
Learning: В классах-наследниках AbstractRunTestsCodeLensSupplier метод getCodeLenses должен проверять isApplicable перед выполнением своей логики, чтобы учитывать поддержку клиента и другие условия применимости линз.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-01-19T21:44:32.675Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:44:32.675Z
Learning: В классах-наследниках AbstractRunTestsCodeLensSupplier метод getSelf() должен возвращать this вместо использования Spring-based self-reference, чтобы избежать проблем с циклическими зависимостями и timing issues при тестировании.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-01-20T19:30:29.060Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/AbstractRunTestsCodeLensSupplierTest.java:98-102
Timestamp: 2025-01-20T19:30:29.060Z
Learning: In BSL Language Server, CodeLensProvider handles the isApplicable check before calling getCodeLenses on CodeLensSupplier implementations, so there's no need to add isApplicable check inside getCodeLenses method.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-12-18T18:49:48.694Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.694Z
Learning: Applies to src/test/java/**/diagnostics/**/*Test.java : Write comprehensive unit tests for each diagnostic including edge cases, following existing test patterns
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-12-18T18:49:48.694Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.694Z
Learning: Applies to src/test/java/**/*Test.java : Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
🧬 Code graph analysis (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java (3)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java (2)
Value(146-165)Component(53-166)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java (1)
Component(46-135)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java (1)
Component(58-162)
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/events/LanguageServerInitializeRequestReceivedEvent.java (1)
LanguageServerInitializeRequestReceivedEvent(36-56)src/test/java/com/github/_1c_syntax/bsl/languageserver/util/TestUtils.java (1)
TestUtils(37-80)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Analyse
- GitHub Check: Benchmark
- GitHub Check: build
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (17, macOS-latest)
🔇 Additional comments (11)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java (1)
147-147: LGTM! Good defensive practice.Adding
distinct()ensures test IDs are unique before collection, preventing duplicate entries in the returned list.src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_en.properties (1)
1-1: LGTM! English localization provided.The resource bundle entry is correctly formatted. Both English and Russian versions are present as required.
src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_ru.properties (1)
1-1: LGTM! Russian localization provided.The resource bundle entry is correctly formatted with proper Russian translation.
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java (1)
35-35: LGTM! Spring ordering annotation added.The
@Order(1)annotation establishes this supplier as the highest priority in the code lens execution sequence.Also applies to: 48-48
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java (1)
28-28: LGTM! Spring ordering annotation added.The
@Order(5)annotation positions this complexity supplier appropriately in the execution sequence.Also applies to: 37-37
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.java (1)
32-33: LGTM! Sorting logic correctly implements Spring ordering.The sorting implementation properly retrieves Spring
@Orderannotations viaOrderUtils.getOrder()and defaults toOrdered.LOWEST_PRECEDENCEfor suppliers without explicit ordering, ensuring predictable code lens execution sequence.Also applies to: 36-36, 39-39, 84-85
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java (1)
39-39: LGTM! Spring ordering annotation added.The
@Order(2)annotation appropriately positions this supplier after the "run all tests" lens.Also applies to: 55-55
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java (1)
28-37: LGTM!The addition of
@Order(4)aligns with the PR-wide pattern of organizing CodeLens suppliers by priority. The ordering is logical: test-related lenses (1-3) followed by complexity lenses (4-5).src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json (1)
752-760: LGTM!The new
debugTestArgumentsconfiguration field follows the established pattern of sibling fields likerunTestArguments. The empty default ensures the debug code lens only appears when explicitly configured, which is appropriate behavior.src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java (2)
50-76: LGTM!The class structure, dependencies, and self-injection pattern are consistent with existing suppliers like
RunTestCodeLensSupplierand follow the established patterns from the learnings. The@Order(3)correctly positions this supplier betweenRunTestCodeLensSupplier(@order(2)) and complexity suppliers (@order(4-5)).
81-102: LGTM!The
getCodeLensesimplementation correctly:
- Filters out BSL files (consistent with
RunTestCodeLensSupplier)- Guards against empty
debugTestArgumentsconfiguration- Retrieves test IDs and maps them to code lenses
Based on learnings, the
isApplicablecheck is handled byCodeLensProviderbefore calling this method, so no additional check is needed here.
...main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java
Show resolved
Hide resolved
...om/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java
Show resolved
Hide resolved
a3f6daf to
6693a49
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/test/resources/codelenses/DebugTestCodeLensSupplier.osis excluded by!src/test/resources/**
📒 Files selected for processing (12)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java(1 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java(3 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.java(2 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java(1 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_en.properties(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_ru.properties(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json(1 hunks)src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_ru.properties
- src/main/resources/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier_en.properties
- src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
- src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/infrastructure/CodeLensesConfiguration.java
🧰 Additional context used
📓 Path-based instructions (3)
src/main/java/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
src/main/java/**/*.java: Follow the Style Guide for code formatting and conventions
Use Lombok annotations to reduce boilerplate code and enable annotation processing in IDE
Write JavaDoc for public APIs and include comments for complex logic
Use meaningful, descriptive names for classes and methods following Java naming conventions
Optimize imports before committing; DO NOT optimize imports across the entire project unless specifically working on that task
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java
src/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use Java 17 for language and follow Java naming conventions
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java
src/test/java/**/*Test.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
🧠 Learnings (9)
📚 Learning: 2025-01-19T21:44:32.675Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:44:32.675Z
Learning: В классах-наследниках AbstractRunTestsCodeLensSupplier метод getSelf() должен возвращать this вместо использования Spring-based self-reference, чтобы избежать проблем с циклическими зависимостями и timing issues при тестировании.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java
📚 Learning: 2025-01-19T21:45:52.703Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:45:52.703Z
Learning: В классах-наследниках AbstractRunTestsCodeLensSupplier метод getCodeLenses должен проверять isApplicable перед выполнением своей логики, чтобы учитывать поддержку клиента и другие условия применимости линз.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/test/java/**/diagnostics/**/*Test.java : Write comprehensive unit tests for each diagnostic including edge cases, following existing test patterns
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-01-20T19:30:29.060Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/AbstractRunTestsCodeLensSupplierTest.java:98-102
Timestamp: 2025-01-20T19:30:29.060Z
Learning: In BSL Language Server, CodeLensProvider handles the isApplicable check before calling getCodeLenses on CodeLensSupplier implementations, so there's no need to add isApplicable check inside getCodeLenses method.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java
📚 Learning: 2025-01-19T21:47:05.209Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java:47-47
Timestamp: 2025-01-19T21:47:05.209Z
Learning: В классе AbstractRunTestsCodeLensSupplier проверка поддержки клиента должна выполняться до вызова getTestIds, чтобы предотвратить выполнение лишних операций и обеспечить корректное поведение при неподдерживаемом клиенте.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java
📚 Learning: 2025-12-18T18:49:48.712Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-18T18:49:48.712Z
Learning: Applies to src/test/java/**/*Test.java : Maintain or improve test coverage and use appropriate test frameworks (JUnit, AssertJ, Mockito)
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
📚 Learning: 2025-01-19T20:47:40.061Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T20:47:40.061Z
Learning: Configuration classes in the BSL Language Server project use mutable collections (HashMap, ArrayList) and Data annotation from Lombok, allowing for modification of configuration properties after initialization.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java
📚 Learning: 2025-02-10T17:12:56.150Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:63-66
Timestamp: 2025-02-10T17:12:56.150Z
Learning: In BSL Language Server, `documentContext.getServerContext().getConfiguration()` is guaranteed to return a non-null value, making null checks unnecessary.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java
📚 Learning: 2025-01-19T21:34:39.797Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3388
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/configuration/codelens/TestRunnerAdapterOptions.java:46-46
Timestamp: 2025-01-19T21:34:39.797Z
Learning: In BSL Language Server configuration classes, immutable collections (Set.of, List.of) should be used for default values, while mutability is achieved through setters generated by Data annotation.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java
🧬 Code graph analysis (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java (2)
Value(146-165)Component(53-166)src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java (1)
Component(58-162)
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/events/LanguageServerInitializeRequestReceivedEvent.java (1)
LanguageServerInitializeRequestReceivedEvent(36-56)src/test/java/com/github/_1c_syntax/bsl/languageserver/util/TestUtils.java (1)
TestUtils(37-80)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (12)
- GitHub Check: Analyse
- GitHub Check: Benchmark
- GitHub Check: build
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (21, ubuntu-latest)
🔇 Additional comments (10)
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CognitiveComplexityCodeLensSupplier.java (1)
28-28: LGTM! Correct implementation of code lens ordering.The import and
@Order(4)annotation are correctly applied, aligning this supplier with the PR's objective to establish a consistent ordering for code lens suppliers.Also applies to: 37-37
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java (1)
28-37: LGTM! Order annotation correctly applied.The
@Order(5)annotation is properly added to control the ordering of code lens suppliers, consistent with the pattern established in other suppliers (test suppliers at 1-2, complexity suppliers at 4-5).src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunAllTestsCodeLensSupplier.java (1)
35-35: LGTM! Ordering annotation added appropriately.The
@Order(1)annotation correctly prioritizes this supplier to appear first among test-related code lenses, which makes sense for the "run all tests" functionality.Also applies to: 48-48
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/testrunner/TestRunnerAdapter.java (1)
143-148: Good defensive addition, but consider investigating the root cause.Adding
.distinct()prevents duplicate test IDs from being collected, which is a safe improvement. However, this might indicate that the external test runner or the regex pattern ingetTestsResultPatternis producing duplicates. Consider investigating whether duplicates are expected behavior or if the underlying issue should be addressed.src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/RunTestCodeLensSupplier.java (2)
39-39: LGTM! Ordering annotation added appropriately.The
@Order(2)annotation correctly positions this supplier afterRunAllTestsCodeLensSupplier(@order(1)) and beforeDebugTestCodeLensSupplier(@order(3)), creating a logical sequence for test-related code lenses.Also applies to: 55-55
144-144: Good fix for the JavaDoc.The JavaDoc correction changes the description from complexity-related to test-specific, accurately reflecting the purpose of this DTO.
src/main/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplier.java (4)
50-76: LGTM! Implementation follows established patterns.The class structure correctly follows the same patterns as
RunTestCodeLensSupplierandRunAllTestsCodeLensSupplier, including:
- Spring component registration with
@Order(3)for proper sequencing- Self-injection for cache support in the base class
- Constructor dependency injection
82-102: Good defensive checks in place.The implementation includes appropriate early-return conditions:
- Filtering out BSL file types (consistent with
RunTestCodeLensSupplier)- Checking for empty
debugTestArgumentsconfigurationThese checks prevent unnecessary processing when debug functionality isn't applicable.
116-134: Verify the resolve implementation handles formatting placeholders correctly.The
String.formatcall at line 124 expects two placeholders (path and testId) to match the pattern indebugTestArguments. Ensure that the configuration schema and documentation clearly specify this format requirement (e.g.,%s %sfor path and testId).
147-169: JavaDoc correction applied successfully.The JavaDoc now correctly describes this DTO as storing debug test data rather than the previous incorrect reference to method complexity data from the past review comment.
...om/github/_1c_syntax/bsl/languageserver/codelenses/CyclomaticComplexityCodeLensSupplier.java
Outdated
Show resolved
Hide resolved
| @Test | ||
| void testDryRun() { | ||
| // given | ||
| initializeServer("Visual Studio Code"); | ||
|
|
||
| // when | ||
| var codeLenses = supplier.getCodeLenses(documentContext); | ||
|
|
||
| // then | ||
| assertThat(codeLenses).isNotNull(); | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Expand test assertions beyond null checks.
The test only verifies that codeLenses is not null. Consider adding assertions to verify:
- The actual count of code lenses returned
- Whether code lenses are empty when expected (e.g., for BSL files or when debugTestArguments is empty)
🔎 Example enhancement
// then
- assertThat(codeLenses).isNotNull();
+ assertThat(codeLenses).isNotNull().isEmpty();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @Test | |
| void testDryRun() { | |
| // given | |
| initializeServer("Visual Studio Code"); | |
| // when | |
| var codeLenses = supplier.getCodeLenses(documentContext); | |
| // then | |
| assertThat(codeLenses).isNotNull(); | |
| } | |
| @Test | |
| void testDryRun() { | |
| // given | |
| initializeServer("Visual Studio Code"); | |
| // when | |
| var codeLenses = supplier.getCodeLenses(documentContext); | |
| // then | |
| assertThat(codeLenses).isNotNull().isEmpty(); | |
| } |
🤖 Prompt for AI Agents
In
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
around lines 73 to 83, the test only asserts that codeLenses is not null; expand
assertions to verify expected behavior by asserting the exact size of codeLenses
(or that it isEmpty() when appropriate), assert specific properties of returned
CodeLens objects (e.g., command/title, range or arguments) for at least one
lens, and add a separate case to assert empty result when debugTestArguments are
empty or when using a non-BSL file; update test setup inputs accordingly to make
these assertions deterministic.
| @Test | ||
| void testRunWithMockedTestIds() { | ||
| // given | ||
| initializeServer("Visual Studio Code"); | ||
|
|
||
| when(testRunnerAdapter.getTestIds(documentContext)) | ||
| .thenReturn(List.of("testName")); | ||
|
|
||
| var testRunnerAdapterOptions = mock(TestRunnerAdapterOptions.class); | ||
|
|
||
| when(testRunnerAdapterOptions.getDebugTestArguments()) | ||
| .thenReturn("some"); | ||
|
|
||
| var codeLensOptions = mock(CodeLensOptions.class); | ||
| when(codeLensOptions.getTestRunnerAdapterOptions()) | ||
| .thenReturn(testRunnerAdapterOptions); | ||
|
|
||
| when(LanguageServerConfiguration.getCodeLensOptions()) | ||
| .thenReturn(codeLensOptions); | ||
|
|
||
| // when | ||
| var codeLenses = supplier.getCodeLenses(documentContext); | ||
|
|
||
| // then | ||
| assertThat(codeLenses).isNotNull(); | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Enhance test to verify actual code lens content.
The test mocks dependencies but only checks for non-null results. Consider verifying:
- The number of code lenses matches the mocked test IDs
- Each code lens has the correct range and data
- The code lens data contains the expected test ID
🔎 Example enhancement
// then
- assertThat(codeLenses).isNotNull();
+ assertThat(codeLenses)
+ .isNotNull()
+ .hasSize(1)
+ .first()
+ .satisfies(lens -> {
+ assertThat(lens.getRange()).isNotNull();
+ assertThat(lens.getData()).isInstanceOf(DebugTestCodeLensSupplier.DebugTestCodeLensData.class);
+ });| @Test | ||
| void testResolve() { | ||
| // given | ||
| CodeLens codeLens = new CodeLens(); | ||
| DebugTestCodeLensSupplier.DebugTestCodeLensData codeLensData = new DebugTestCodeLensSupplier.DebugTestCodeLensData( | ||
| documentContext.getUri(), | ||
| supplier.getId(), | ||
| "testName" | ||
| ); | ||
|
|
||
| // when | ||
| var resolvedCodeLens = supplier.resolve(documentContext, codeLens, codeLensData); | ||
|
|
||
| // then | ||
| assertThat(resolvedCodeLens.getCommand()).isNotNull(); | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major
Verify the resolved command details.
The test only checks that the command is not null. Consider verifying:
- The command title matches the expected localized string
- The command ID is correct
- The command arguments contain the properly formatted debug text
🔎 Example enhancement
// then
- assertThat(resolvedCodeLens.getCommand()).isNotNull();
+ var command = resolvedCodeLens.getCommand();
+ assertThat(command).isNotNull();
+ assertThat(command.getCommand()).isEqualTo("language-1c-bsl.languageServer.debugTest");
+ assertThat(command.getTitle()).isNotEmpty();
+ assertThat(command.getArguments()).isNotEmpty();📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| @Test | |
| void testResolve() { | |
| // given | |
| CodeLens codeLens = new CodeLens(); | |
| DebugTestCodeLensSupplier.DebugTestCodeLensData codeLensData = new DebugTestCodeLensSupplier.DebugTestCodeLensData( | |
| documentContext.getUri(), | |
| supplier.getId(), | |
| "testName" | |
| ); | |
| // when | |
| var resolvedCodeLens = supplier.resolve(documentContext, codeLens, codeLensData); | |
| // then | |
| assertThat(resolvedCodeLens.getCommand()).isNotNull(); | |
| } | |
| @Test | |
| void testResolve() { | |
| // given | |
| CodeLens codeLens = new CodeLens(); | |
| DebugTestCodeLensSupplier.DebugTestCodeLensData codeLensData = new DebugTestCodeLensSupplier.DebugTestCodeLensData( | |
| documentContext.getUri(), | |
| supplier.getId(), | |
| "testName" | |
| ); | |
| // when | |
| var resolvedCodeLens = supplier.resolve(documentContext, codeLens, codeLensData); | |
| // then | |
| var command = resolvedCodeLens.getCommand(); | |
| assertThat(command).isNotNull(); | |
| assertThat(command.getCommand()).isEqualTo("language-1c-bsl.languageServer.debugTest"); | |
| assertThat(command.getTitle()).isNotEmpty(); | |
| assertThat(command.getArguments()).isNotEmpty(); | |
| } |
🤖 Prompt for AI Agents
In
src/test/java/com/github/_1c_syntax/bsl/languageserver/codelenses/DebugTestCodeLensSupplierTest.java
around lines 112 to 127, the test only asserts the resolved CodeLens command is
non-null; update it to assert the command title equals the expected localized
title, the command id matches the supplier's expected command ID, and the
command arguments contain the correctly formatted debug text (e.g., document
URI, supplier id and test name or the exact string produced by the supplier).
Replace the single notNull assertion with explicit assertions for
command.getTitle(), command.getCommand(), and command.getArguments() (checking
size and content/format), using the same localization helper or constant used by
the supplier so the expected title matches exactly.
6693a49 to
551564b
Compare
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|



Описание
Добавлена линза для отладки тестов, код линзы упорядочены
Связанные задачи
Closes: #3681
Чеклист
Общие
gradlew precommit)Для диагностик
Дополнительно
1c-syntax/vsc-language-1c-bsl#340
Summary by CodeRabbit
New Features
Configuration
Documentation
Chores
Bug Fixes
Tests
Localization
✏️ Tip: You can customize this high-level summary in your review settings.