Добавление игнонирование регистра в диагностику Typo#3630
Conversation
WalkthroughAdds an optional case-insensitive flag to the Typo diagnostic (expands ignored words by case), updates configuration schema and localization, fixes a build utility, and adds a test for case-insensitive ignore behavior. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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: 1
🧹 Nitpick comments (2)
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.java (1)
86-100: Test coverage for case-insensitive feature looks good.The test validates that mixed-case exclusion words match when
caseInsensitive=true. Consider adding a complementary test to verify thatcaseInsensitive=false(the default) does not exclude differently-cased variants — this would confirm the strict matching behavior described in issue #2889.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java (1)
118-121: Use primitivebooleaninstead of wrapperBoolean.For consistency with other diagnostic parameters (e.g.,
minWordLengthuses primitiveint) and to avoid potential null-related issues, prefer the primitive type.@DiagnosticParameter( type = Boolean.class ) - private Boolean caseInsensitive = false; + private boolean caseInsensitive = false;
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
src/test/resources/diagnostics/TypoDiagnostic.bslis excluded by!src/test/resources/**
📒 Files selected for processing (7)
build.gradle.kts(1 hunks)src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java(4 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json(2 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_en.properties(1 hunks)src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_ru.properties(1 hunks)src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.java(1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/diagnostics/*.properties
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Resource bundles for diagnostics should have both Russian and English versions
Files:
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_en.propertiessrc/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_ru.properties
**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.java: Follow the Style Guide provided in docs/en/contributing/StyleGuide.md
Use Lombok annotations to reduce boilerplate code and enable annotation processing in your IDE
Optimize imports before committing but do NOT optimize imports across the entire project unless specifically working on that task
Follow Java naming conventions with meaningful, descriptive names; keep class and method names concise but clear
Write JavaDoc for public APIs and include comments for complex logic
Use Target Java 17 as the language version
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java
**/diagnostics/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Each diagnostic should have a Java implementation class, resource bundle for localized messages, unit tests, and documentation
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.javasrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java
**/diagnostics/*Test.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Write comprehensive unit tests for each diagnostic including test cases for edge cases, following existing test patterns
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.java
**/test/java/**/*.java
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use appropriate test frameworks (JUnit, AssertJ, Mockito) for testing
Files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.java
build.gradle.kts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
build.gradle.kts: Use Gradle with Kotlin DSL for build configuration
Be cautious with external dependencies and review security alerts from CodeQL and Dependabot
Files:
build.gradle.kts
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to docs/*/diagnostics/**/*.md : Update diagnostic documentation in both Russian and English with examples of problematic code and fixes
📚 Learning: 2025-11-27T07:17:33.726Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to **/diagnostics/*.properties : Resource bundles for diagnostics should have both Russian and English versions
Applied to files:
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_en.propertiessrc/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_ru.properties
📚 Learning: 2025-11-27T07:17:33.726Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to docs/*/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/diagnostics/TypoDiagnostic_en.propertiessrc/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.javasrc/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_ru.propertiessrc/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.jsonsrc/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java
📚 Learning: 2025-11-27T07:17:33.726Z
Learnt from: CR
Repo: 1c-syntax/bsl-language-server PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-27T07:17:33.726Z
Learning: Applies to **/diagnostics/*Test.java : Write comprehensive unit tests for each diagnostic including test cases for edge cases, following existing test patterns
Applied to files:
src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.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: Analyze the repo with CodeSee
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (17, windows-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: build (25, ubuntu-latest)
- GitHub Check: build (25, macOS-latest)
- GitHub Check: build (21, windows-latest)
- GitHub Check: build (17, ubuntu-latest)
- GitHub Check: build (17, macOS-latest)
- GitHub Check: build (25, windows-latest)
- GitHub Check: build (21, macOS-latest)
- GitHub Check: build (21, ubuntu-latest)
- GitHub Check: build (17, windows-latest)
🔇 Additional comments (6)
build.gradle.kts (1)
451-458: LGTM!The
updateLicensestask provides a convenient alias for precommit workflows, and thebuildTime()function correctly returns the formatted timestamp.src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json (1)
927-986: LGTM!Formatting changes to multi-line enum arrays improve readability without affecting functionality.
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_en.properties (1)
10-11: LGTM!English localization for the new
caseInsensitiveparameter is properly added, maintaining consistency with the Russian resource bundle.src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic_ru.properties (1)
18-19: LGTM!Russian localization for the new
caseInsensitiveparameter is properly added, consistent with the English resource bundle.src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json (1)
1983-1989: LGTM!The
caseInsensitiveproperty is correctly defined with appropriate type, default value, and description. Defaultfalseensures backward compatibility.src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java (1)
130-147: Verify case transformation handles edge cases with multi-word exceptions.When
WordUtils.capitalizeFully(exceptions, delimiter)is called, it treats the comma as a word delimiter. Ensure this produces expected results for compound words like "HttpСоединение" that might appear in the exceptions list. The implementation looks correct for the stated requirements.
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java
Show resolved
Hide resolved
|



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