Skip to content

fix(diagnostics): Typo учитывает словарь исключений без объекта параметров - #4958

Merged
nixel2007 merged 1 commit into
1c-syntax:developfrom
SanMisha:fix/typo-default-dictionary
Nov 15, 2026
Merged

nixel2007 merged 1 commit into
1c-syntax:developfrom
SanMisha:fix/typo-default-dictionary

Conversation

@SanMisha

@SanMisha SanMisha commented Nov 14, 2026 •

Copy link
Copy Markdown

Описание

Регрессия с 207c08c (0.25.0): сборку встроенного словаря исключений перенесли из check() в configure(), а его вызывают только при объекте параметров. Без него Typo помечает опечатками «Модифицированность», «Субконто», «Возр».

Теперь словарь собирается в init() с @PostConstruct, а configure(), как и раньше, пересобирает его с учётом параметров.

Связанные задачи

Closes #4953

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Без правки тест testDiagnosticExceptionsWithoutConfigure() падает. На примере из issue develop даёт четыре замечания Typo, ветка — одно. С открытым #4268 конфликтов нет.

Summary by CodeRabbit

  • Bug Fixes
    • Typo diagnostics are now available when the diagnostic is used without prior configuration, with results matching the configured default behavior.
    • Improved initialization ensures the default words-to-ignore list is ready when typo checking begins.

…етров

Встроенный словарь diagnosticExceptions попадал в wordsToIgnore только в configure(), а его
вызывают лишь при объекте параметров. Без записи Typo в diagnostics.parameters и с "Typo": true
слова словаря («Модифицированность», «Субконто», «Возр») помечались опечатками. Теперь множество
собирается в @PostConstruct, а configure() по-прежнему пересобирает его с userWordsToIgnore и
caseInsensitive.

Closes 1c-syntax#4953

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

TypoDiagnostic now initializes its ignored-word list during lifecycle startup. A test checks the diagnostic results when the diagnostic is used without an explicit configure call.

Changes: Typo diagnostic initialization

Layer / File(s) Summary
Initialize ignored words and verify default diagnostics
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java, src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.java
A @PostConstruct method initializes wordsToIgnore using makeWordsToIgnore(). A test checks that calling getDiagnostics() without configure produces three diagnostics at the expected ranges.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to 26fb2

The change makes the Typo diagnostic honor built-in exception words when no parameters are configured. It adds a test for that case, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the Typo diagnostic now applies its exception dictionary when no parameters object is configured. The raw summary shows a @PostConstruct init() that builds wordsToIgnore, a…
Linked Issues check Passed [#4953] The issue requires that words from the built-in diagnosticExceptions dictionary are not flagged by Typo in all configurations: no diagnostics.parameters entry, "Typo": true, and a para…
Out of Scope Changes check Passed The reviewed changes are limited to TypoDiagnostic.java (adds the @PostConstruct init() method and its import, +9 lines) and TypoDiagnosticTest.java (adds `testDiagnosticExceptionsWithoutConfi…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the change: the Typo diagnostic now applies its exception dictionary when no parameters object is configured. The raw summary shows a @PostConstruct init() that builds wordsToIgnore, and a new test for the no-configure case, which match the title. The title is written in Russian and uses a conventional type prefix, which is acceptable. It is specific and not vague.

Full details: Linked Issues check

Explanation

[#4953] The issue requires that words from the built-in diagnosticExceptions dictionary are not flagged by Typo in all configurations: no diagnostics.parameters entry, "Typo": true, and a parameters object. The PR adds init() annotated with @PostConstruct in TypoDiagnostic.java. This method calls makeWordsToIgnore(), so the dictionary is loaded when the diagnostic is created, without parameters. configure() still rebuilds the dictionary with userWordsToIgnore and caseInsensitive, so the existing parameter path keeps its behavior. The PR adds testDiagnosticExceptionsWithoutConfigure(), which checks the no-configure case against the expected ranges. The PR description reports one diagnostic on the issue example, compared with four on develop. Limits of the evidence: the test resource src/test/resources/diagnostics/TypoDiagnostic.bsl is excluded by the !src/test/resources/** rule, so the test expectations were not checked against its content. The summary does not show a separate test for {"Typo": {"minWordLength": 3}}. The same configure() path covers that case, and the PR does not report a contrary result.

Full details: Out of Scope Changes check

Explanation

The reviewed changes are limited to TypoDiagnostic.java (adds the @PostConstruct init() method and its import, +9 lines) and TypoDiagnosticTest.java (adds testDiagnosticExceptionsWithoutConfigure(), +11 lines). The init() method directly implements the dictionary requirement from #4953. The new test directly checks that requirement. The PR description states that DiagnosticBeanPostProcessor was not changed, so configure() without parameters does not enable all diagnostics. No unrelated changes appear in the summary. The excluded test resource src/test/resources/diagnostics/TypoDiagnostic.bsl was not reviewed, but it is test data and does not affect this scope verdict.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8304ed0 and 26fb2c9.

Files ignored due to path filters: 1

  • src/test/resources/diagnostics/TypoDiagnostic.bsl is excluded by !src/test/resources/**
Files selected for processing: 2

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnostic.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/TypoDiagnosticTest.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@nixel2007

Copy link
Copy Markdown
Member

спасибо!

@nixel2007
nixel2007 merged commit 9dd6973 into 1c-syntax:develop Nov 15, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants