-
Notifications
You must be signed in to change notification settings - Fork 121
Refactor Location and Reference classes to use record type and improve range handling methods #3710
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
Conversation
📝 WalkthroughWalkthroughThis pull request refactors the codebase from Lombok-based getter methods to Java records and fluent accessor naming conventions. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/SymbolOccurrence.java (1)
50-56: LGTM! Correct alignment with the new Location record API.The comparator correctly uses the record's accessors (
uri(),startLine(), etc.) and delegates toRanges.comparefor coordinate-based range comparison, avoiding unnecessaryRangeobject allocation.Consider extracting the comparator to a
private static finalfield to avoid reconstructing the comparator chain on eachcompareTocall:🔎 Optional refactor
+ private static final Comparator<SymbolOccurrence> COMPARATOR = + comparing(SymbolOccurrence::location, comparing(Location::uri) + .thenComparing((l1, l2) -> Ranges.compare( + l1.startLine(), l1.startCharacter(), l1.endLine(), l1.endCharacter(), + l2.startLine(), l2.startCharacter(), l2.endLine(), l2.endCharacter()))) + .thenComparing(SymbolOccurrence::occurrenceType) + .thenComparing(SymbolOccurrence::symbol); + @Override public int compareTo(@Nullable SymbolOccurrence other) { if (other == null) { return 1; } - - return comparing(SymbolOccurrence::location, comparing(Location::uri) - .thenComparing((l1, l2) -> Ranges.compare( - l1.startLine(), l1.startCharacter(), l1.endLine(), l1.endCharacter(), - l2.startLine(), l2.startCharacter(), l2.endLine(), l2.endCharacter()))) - .thenComparing(SymbolOccurrence::occurrenceType) - .thenComparing(SymbolOccurrence::symbol) - .compare(this, other); + return COMPARATOR.compare(this, other); }src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Ranges.java (1)
258-278: Correct helper implementation, minor style nit.The
isBeforehelper correctly implements strict lexicographic ordering.There are consecutive blank lines (277-278) that could be reduced to a single blank line for consistency with the rest of the codebase.
🔎 Optional fix
return character1 < character2; } - - /** * Натуральный порядок сравнения Range
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingCommonModuleMethodDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFiller.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Location.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/LocationRepository.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/SymbolOccurrence.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Ranges.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/utils/RangesTest.java
🧰 Additional context used
📓 Path-based instructions (4)
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/references/model/LocationRepository.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFiller.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Location.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingCommonModuleMethodDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/SymbolOccurrence.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Ranges.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/references/model/LocationRepository.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFiller.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/utils/RangesTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Location.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingCommonModuleMethodDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/SymbolOccurrence.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Ranges.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/utils/RangesTest.java
src/main/java/**/diagnostics/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingCommonModuleMethodDiagnostic.java
🧠 Learnings (1)
📚 Learning: 2025-02-10T17:13:41.452Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:54-58
Timestamp: 2025-02-10T17:13:41.452Z
Learning: In ProtectedModuleDiagnostic.java, the usage of `Range` field as a diagnostic target is accepted as is, despite being marked as a temporary solution in the comments.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingCommonModuleMethodDiagnostic.java
⏰ 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). (19)
- GitHub Check: build
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: Benchmark
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
🔇 Additional comments (13)
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFiller.java (1)
333-340: LGTM!The added blank line improves readability by visually separating the condition check from the
addVariableUsagecall.src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/LocationRepository.java (1)
58-61: LGTM!The accessor change from
getUri()touri()correctly aligns with the new Java record API forLocation.src/test/java/com/github/_1c_syntax/bsl/languageserver/utils/RangesTest.java (3)
39-67: Good test coverage for the newcomparemethod.The test cases comprehensively cover all comparison scenarios: equal ranges, differences in start line, start character, end line, and end character. This validates the lexicographic ordering logic.
69-106: Thorough edge-case coverage forcontainsPosition.The tests correctly verify the half-open interval semantics (start inclusive, end exclusive) across single-line and multi-line ranges, boundary conditions, and positions before/after the range.
108-124: LGTM!The
Positionobject overload tests complement the coordinate-based tests, ensuring both API variants behave consistently.src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.java (3)
110-117: LGTM! Efficient coordinate-based position check.Using explicit coordinates avoids allocating a
Rangeobject for each filter check, aligning with the PR's optimization goals.
277-278: LGTM!Correctly updated to use the record accessor
uri().
314-315: LGTM!The use of
uri()and the newgetStart()method aligns with the updatedLocationrecord API.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissingCommonModuleMethodDiagnostic.java (2)
88-95: LGTM! Good caching of the Range object.Extracting
locationandlocationRangeavoids repeatedgetRange()calls, which is beneficial sinceLocation.getRange()allocates a newRangeinstance on each invocation.
101-105: LGTM!Consistent use of the cached
locationRangevariable.src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Location.java (1)
39-51: Clean conversion to Java record.The record type is well-suited for this immutable value object. The secondary constructor and accessor methods provide convenient interoperability with
RangeandPositiontypes.Note: Both
getRange()andgetStart()allocate new objects on each call. Callers in hot paths should cache results if needed (as done inMissingCommonModuleMethodDiagnostic).src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Ranges.java (2)
216-256: LGTM! Well-designed coordinate-based overloads.The new
containsPositionoverloads correctly implement half-open interval semantics[start, end). The delegation pattern between the two overloads avoids code duplication.
322-351: LGTM! Efficient coordinate-based range comparison.The method correctly implements lexicographic comparison of ranges by comparing start positions first, then end positions. Using
Integer.compareensures proper -1/0/1 return values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensDeltaIntegrationTest.java (2)
85-85: Ineffective await condition.
await().until(() -> true)always succeeds immediately since the condition is already true. This effectively just sleeps for the poll interval (100ms) once. If the intent is to wait for async document processing, you should await on a meaningful condition (e.g., checking document state or token availability).
141-142: Prefer Awaitility over Thread.sleep for consistency.Using
Thread.sleep(500)is less robust than Awaitility and inconsistent with the other tests in this class. Consider using Awaitility with a meaningful condition to wait for the change to be processed.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (24)
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CallHierarchyProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/DefinitionProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/HoverProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Reference.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Symbol.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/MethodCallSemanticTokensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensDeltaIntegrationTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceResolverTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SSLSemanticTokensTest.java
🚧 Files skipped from review as they are similar to previous changes (1)
- src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.java
🧰 Additional context used
📓 Path-based instructions (4)
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/references/model/Symbol.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/HoverProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CallHierarchyProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/MethodCallSemanticTokensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/DefinitionProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Reference.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.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/references/model/Symbol.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceResolverTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/HoverProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexReferenceFinderTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CallHierarchyProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/MethodCallSemanticTokensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/DefinitionProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensDeltaIntegrationTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Reference.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SSLSemanticTokensTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.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/references/ReferenceResolverTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensDeltaIntegrationTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SSLSemanticTokensTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.java
src/main/java/**/diagnostics/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.java
🧠 Learnings (4)
📚 Learning: 2025-02-10T17:13:41.452Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:54-58
Timestamp: 2025-02-10T17:13:41.452Z
Learning: In ProtectedModuleDiagnostic.java, the usage of `Range` field as a diagnostic target is accepted as is, despite being marked as a temporary solution in the comments.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.java
📚 Learning: 2025-12-28T11:15:32.357Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 0
File: :0-0
Timestamp: 2025-12-28T11:15:32.357Z
Learning: In PR #3706 about semantic token optimization, I incorrectly stated that the algorithm in findSuffixMatchWithOffset correctly handles inline text insertions (text insertion without line breaks). The actual bug is that when lineOffset=0, tokens after the insertion point have the same deltaLine but different deltaStart, and the old algorithm failed to match them because it checked deltaStart equality. PR #3707 fixes this by allowing deltaStart to differ for the boundary token when lineOffset==0.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensDeltaIntegrationTest.java
📚 Learning: 2025-11-19T09:02:03.154Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3610
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/folding/QueryPackageFoldingRangeSupplier.java:26-26
Timestamp: 2025-11-19T09:02:03.154Z
Learning: В проекте bsl-language-server используется кастомная версия ANTLR4 от 1c-syntax (io.github.1c-syntax:antlr4), которая включает базовый класс org.antlr.v4.runtime.Tokenizer с методами getAst() и getTokens(). SDBLTokenizer и BSLTokenizer наследуются от этого базового класса.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SSLSemanticTokensTest.java
📚 Learning: 2024-12-27T17:03:11.817Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3364
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinder.java:125-127
Timestamp: 2024-12-27T17:03:11.817Z
Learning: В методе `findAnnotation` класса `AnnotationReferenceFinder` уже проверяется, что у аннотации ровно один параметр, поэтому в `getAnnotationName` не требуется отдельная проверка на пустой список.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.java
🧬 Code graph analysis (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.java (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/RelatedInformation.java (1)
RelatedInformation(36-54)
🔇 Additional comments (36)
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Symbol.java (1)
31-31: LGTM! Clean static import usage.The static import of
comparingand its direct usage in the comparator chain improves readability without changing behavior.Also applies to: 64-69
src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.java (1)
72-72: LGTM! Reference API accessor updates are correct.The migration from get-style (
getSelectionRange(),getSymbol(),getFrom()) to fluent-style accessors (selectionRange(),symbol(),from()) is consistent with the record-based Reference API refactor.Also applies to: 81-84, 188-188
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/MethodCallSemanticTokensSupplier.java (1)
55-55: LGTM! Reference accessor update is correct.The change from
getSelectionRange()toselectionRange()aligns with the record-based Reference API.src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/DefinitionProvider.java (1)
68-68: LGTM! Reference accessor updates are correct.The migration to
symbol()andselectionRange()is consistent with the record-based Reference API refactor.Also applies to: 74-74
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.java (1)
70-70: LGTM! Reference accessor update is correct.The change from
getOccurrenceType()tooccurrenceType()aligns with the record-based Reference API.src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CallHierarchyProvider.java (1)
114-115: LGTM! Reference accessor updates are correct.The migration to
from(),symbol(), andselectionRange()(both method references and direct calls) is consistent with the record-based Reference API refactor.Also applies to: 144-147
src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplier.java (1)
89-93: LGTM! Reference accessor updates are correct.The migration from
getOccurrenceType()andgetSelectionRange()tooccurrenceType()andselectionRange()is consistent with the record-based Reference API refactor, correctly applied to both occurrence type branches.src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/HoverProvider.java (1)
65-66: LGTM! Accessor updates are correct.The transition from
getSymbol()→symbol()andgetSelectionRange()→selectionRange()aligns with the Reference record refactoring and Java record conventions.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java (1)
56-62: LGTM! Consistent accessor migration.All Reference accessor calls updated correctly:
symbol(),from(), andselectionRange()replace their getter equivalents. Logic remains unchanged.src/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.java (1)
51-53: LGTM! Test assertions updated correctly.Test assertions now use the fluent-style accessors
from(),symbol(), andselectionRange(), maintaining test coverage for the refactored API.src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceResolverTest.java (1)
63-63: LGTM! Test and mock updates are correct.Both test assertions and mock setup now use
uri()instead ofgetUri(), maintaining consistency with the refactored Reference API.Also applies to: 72-72, 111-111
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java (1)
62-64: LGTM! Accessor updates are correct.The diagnostic now uses
selectionRange()andsymbol()accessors, consistent with the Reference record refactoring.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.java (1)
93-93: LGTM! All accessor updates are consistent.The diagnostic correctly uses
uri(),selectionRange(), andsymbol()accessors throughout, maintaining the existing logic while adopting the new API.Also applies to: 105-106
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.java (1)
61-64: LGTM! Comprehensive test coverage with new accessors.All test assertions throughout the file consistently use the fluent-style accessors:
from(),symbol(),symbol().getName(),symbol().getSymbolKind(), andselectionRange(). The test coverage is preserved with the updated API.Also applies to: 83-86, 105-108, 148-151, 186-186, 228-228, 244-244, 322-324
src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.java (1)
81-81: LGTM! Rename provider correctly updated.The provider now uses
uri()for grouping references by document andselectionRange()for obtaining edit ranges, maintaining the rename functionality with the new accessor API.Also applies to: 105-105, 111-111
src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/SemanticTokensDeltaIntegrationTest.java (1)
46-52: Good integration test structure.Well-designed integration tests covering delta semantic token scenarios with proper LSP workflow simulation. The test class appropriately handles both delta and full token response paths.
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexReferenceFinderTest.java (2)
109-112: LGTM - accessor updates align with Reference record migration.The test assertions correctly use the new record accessor methods (
uri(),from(),symbol(),selectionRange()) consistent with the Reference refactoring to a Java record.
130-133: Accessor updates consistent with the Reference record API.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.java (4)
183-184: Accessor update aligns with Reference record API.
200-201: Consistent with the Reference record migration.
206-211: Correct usage offrom()accessor.
232-235: LGTM - RelatedInformation creation uses correct record accessors.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.java (4)
106-108: Sorting logic correctly updated.The comparator correctly uses the
selectionRange()accessor from the Reference record.
129-131: Accessor update for occurrence type check.
148-160: Correct accessor usage for position extraction.Both
defRef.selectionRange().getStart()andnextRef.selectionRange().getStart()correctly chain the record accessor with the Range method.
176-191: LGTM - Diagnostic creation uses correct record accessors.The
reference.selectionRange()andnodeForIssue.selectionRange()calls properly use the new Reference record API.src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Reference.java (3)
32-47: Clean migration to Java record.The conversion from Lombok
@Valueclass to a Java record is well-executed. The record preserves immutability, provides automatic accessor methods, and maintains all existing functionality. Good use of Javadoc@paramtags to document the record components.
49-61: Existing helper methods preserved correctly.The
getSourceDefinedSymbol(),isSourceDefinedSymbolReference(), andtoLocation()methods are correctly retained and work with the record's component accessors.
63-75: Factory methods provide convenient construction.The
of()factory methods properly parse the Location's URI and extract the Range, providing a clean API for creating Reference instances.src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.java (3)
73-80: Method reference updates align with record accessors.The test correctly uses
Reference::symbolandReference::selectionRangemethod references with AssertJ'sextracting().
152-164: Comprehensive accessor coverage in assertions.Properly validates
symbol,from, andoccurrenceTypeusing the new record accessors.
317-320: URI filtering uses correct accessor.The
ref.uri().equals()filter pattern is correctly applied across multiple test methods.src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.java (4)
159-162: LGTM - Comprehensive accessor updates.All four accessor calls (
from(),symbol(),selectionRange(),uri()) correctly use the new Reference record API.
176-199: Multiple reference assertions correctly updated.The filtering by
reference.uri()and subsequent assertions onfrom(),symbol(),selectionRange(), anduri()are consistent with the record migration.
214-239: Accessor updates consistent throughout test methods.
247-249: Correct usage in containsRange filter.The
reference.selectionRange()accessor is properly used withRanges.containsRange().
...test/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SSLSemanticTokensTest.java
Outdated
Show resolved
Hide resolved
7e3c028 to
0b3c3c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.java (1)
110-115: Consider removing explicit lambda parameter type.The explicit type annotation
(SymbolOccurrence symbolOccurrence)can be simplified using type inference for cleaner code.🔎 Proposed simplification
- .filter((SymbolOccurrence symbolOccurrence) -> { + .filter(symbolOccurrence -> { var location = symbolOccurrence.location(); return Ranges.containsPosition( location.startLine(), location.startCharacter(), location.endLine(), location.endCharacter(), position); })
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CallHierarchyProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/DefinitionProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/HoverProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Reference.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Symbol.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/MethodCallSemanticTokensSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplier.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceResolverTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.java
🚧 Files skipped from review as they are similar to previous changes (12)
- src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Reference.java
- src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexReferenceFinderTest.java
- src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexTest.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TransferringParametersBetweenClientAndServerDiagnostic.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/DefinitionProvider.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/HoverProvider.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/PrivilegedModuleMethodCallDiagnostic.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/SymbolsSemanticTokensSupplier.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CallHierarchyProvider.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/semantictokens/MethodCallSemanticTokensSupplier.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/Symbol.java
- src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/UnusedLocalVariableDiagnostic.java
🧰 Additional context used
📓 Path-based instructions (4)
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/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.java
src/main/java/**/diagnostics/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Each diagnostic should have: Java implementation class, resource bundle for localized messages, unit tests, and documentation
Files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.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/diagnostics/RewriteMethodParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceResolverTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.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/references/ReferenceResolverTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.javasrc/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.java
🧠 Learnings (2)
📚 Learning: 2024-12-27T17:03:11.817Z
Learnt from: nixel2007
Repo: 1c-syntax/bsl-language-server PR: 3364
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinder.java:125-127
Timestamp: 2024-12-27T17:03:11.817Z
Learning: В методе `findAnnotation` класса `AnnotationReferenceFinder` уже проверяется, что у аннотации ровно один параметр, поэтому в `getAnnotationName` не требуется отдельная проверка на пустой список.
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.java
📚 Learning: 2025-02-10T17:13:41.452Z
Learnt from: theshadowco
Repo: 1c-syntax/bsl-language-server PR: 3408
File: src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/ProtectedModuleDiagnostic.java:54-58
Timestamp: 2025-02-10T17:13:41.452Z
Learning: In ProtectedModuleDiagnostic.java, the usage of `Range` field as a diagnostic target is accepted as is, despite being marked as a temporary solution in the comments.
Applied to files:
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java
🔇 Additional comments (14)
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndex.java (4)
155-155: LGTM!The migration from
getFrom()tofrom()is consistent with the Reference record conversion and fluent accessor naming conventions.
277-277: LGTM!The migration from
getUri()touri()is consistent with the Location record conversion and fluent accessor naming conventions.
314-315: LGTM! Good optimization.The migration to fluent accessors (
uri()) and the direct access to start position viagetStart()avoids creating an unnecessary Range object, which aligns with the PR's optimization objectives.
329-329: LGTM!The migration from
getFrom()tofrom()is consistent with the Reference record conversion and fluent accessor naming conventions.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/MissedRequiredParameterDiagnostic.java (1)
62-64: LGTM! Accessor migration is correct.The changes correctly update from getter-style to fluent record accessors (
selectionRange(),symbol()). The logic remains intact.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/RewriteMethodParameterDiagnostic.java (1)
107-107: LGTM! Consistent accessor updates.All accessor calls have been correctly migrated to the fluent record style across sorting, filtering, and diagnostic creation.
src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/RenameProvider.java (1)
81-81: LGTM! Rename provider correctly updated.All accessor calls migrated to fluent style, including method references. The rename functionality is preserved.
src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/SourceDefinedMethodCallInlayHintSupplier.java (1)
72-84: LGTM! Inlay hint supplier properly updated.The migration to fluent accessors is consistent throughout. The addition of
.toList()on line 76 is idiomatic for Java 17.src/test/java/com/github/_1c_syntax/bsl/languageserver/references/SourceDefinedSymbolDeclarationReferenceFinderTest.java (1)
51-53: LGTM! Test assertions correctly updated.All test expectations now use the fluent record accessors, maintaining the same verification logic.
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/AnnotationReferenceFinderTest.java (1)
61-64: LGTM! Comprehensive test updates.All test assertions across the file have been correctly migrated to use fluent record accessors. Test coverage and verification logic remain intact.
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceResolverTest.java (1)
63-72: LGTM! Test and mocks properly updated.Both test assertions and mock configuration have been consistently updated to use the fluent
uri()accessor.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/DeprecatedMethodCallDiagnostic.java (1)
56-62: LGTM! Diagnostic correctly refactored.All accessor calls migrated to fluent record style. The diagnostic logic for detecting deprecated method calls remains correct.
src/test/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFillerTest.java (2)
74-74: LGTM! Consistent API updates to fluent accessor naming.All test assertions correctly updated from getter methods (
getSymbol(),getFrom(),getSelectionRange(),getOccurrenceType()) to fluent-style accessors (symbol(),from(),selectionRange(),occurrenceType()), consistent with the Reference record type conversion. Test logic and coverage remain unchanged.Also applies to: 79-79, 153-153, 158-158, 163-163, 211-211, 235-235, 260-260, 265-265
318-318: LGTM! Stream filter operations correctly updated.All stream filter predicates consistently updated from
ref.getUri()toref.uri(), maintaining the same filtering logic while using the new fluent accessor API.Also applies to: 327-327, 360-360, 370-370, 402-402, 411-411, 443-443, 453-453
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the Location class from a Lombok value class to a Java record and optimizes range handling by introducing deconstructed parameter methods in the Ranges utility class. The changes reduce unnecessary Range object creation by allowing direct use of coordinate values where the full Range object isn't needed.
Key Changes:
- Converted
LocationandReferenceclasses from Lombok value classes to Java records - Added new overloaded methods in
Rangesclass to work with deconstructed coordinates (startLine, startCharacter, endLine, endCharacter) - Updated all references to use record accessor methods (e.g.,
getUri()→uri(),getFrom()→from())
Reviewed changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
Location.java |
Converted from Lombok value class to record with deconstructed coordinates |
Reference.java |
Converted from Lombok value class to record |
Ranges.java |
Added deconstructed parameter variants of containsPosition() and compare() methods |
RangesTest.java |
Added comprehensive tests for new deconstructed methods |
SymbolOccurrence.java |
Updated comparator to use deconstructed Location coordinates |
ReferenceIndex.java |
Updated to use deconstructed Location coordinates for position checks |
| Various provider/diagnostic files | Updated to use record accessor methods instead of getter methods |
| Various test files | Updated to use record accessor methods in assertions |
src/main/java/com/github/_1c_syntax/bsl/languageserver/utils/Ranges.java
Show resolved
Hide resolved
src/main/java/com/github/_1c_syntax/bsl/languageserver/references/ReferenceIndexFiller.java
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 29 out of 29 changed files in this pull request and generated 2 comments.
|
|
||
|
|
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two consecutive blank lines (277-278) that should be reduced to a single blank line to maintain consistent code style. In Java, typically only one blank line is used to separate method declarations.
| public ParserRuleContext visitModuleVarDeclaration(BSLParser.ModuleVarDeclarationContext ctx) { | ||
| findVariableSymbol(ctx.var_name().getText()).ifPresent(s -> { | ||
| if (notVariableInitialization(ctx, s)) { | ||
|
|
Copilot
AI
Dec 29, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an unnecessary blank line after the opening brace of the if statement. This blank line should be removed to maintain consistent code formatting and readability.



Описание
Связанные задачи
Closes
Чеклист
Общие
gradlew precommit)Для диагностик
Дополнительно
Summary by CodeRabbit
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.