Skip to content

feat(types): ссылка «См.» на форму по полному имени - #4382

Merged
nixel2007 merged 3 commits into
developfrom
feat/types-see-ref-form
Aug 3, 2026
Merged

nixel2007 merged 3 commits into
developfrom
feat/types-see-ref-form

Conversation

@nixel2007

@nixel2007 nixel2007 commented Aug 3, 2026

Copy link
Copy Markdown
Member

Пункт 3.29 рекомендации «Типизация кода»: «Ссылка на форму указывается по полному имени формы».

// Параметры:
//  Форма - См. Справочник.Товары.Форма.ФормаЭлемента
Процедура ПриСозданииНаСервере(Форма)
	Ссылка = Форма.Объект.Ссылка;
	Форма.Элементы.Артикул.Видимость = Истина;

Что было

Тип не выводился вовсе. Синтетический тип формы регистрируется под именем «базовый тип формы + ссылка на объект метаданных» — ФормаКлиентскогоПриложения.Справочник.Товары.Форма.ФормаЭлемента (FormTypesProvider#selfTypeQualifiedName), а в ссылке пишут только вторую половину. Разбор ссылки пробовал табличную часть, реквизит объекта и полное имя типа — ни одно не подошло.

Что сделано

Разбор См.-ссылки, не найдя пути в метаданных, спрашивает FormByNameResolver — тот самый, что типизирует ПолучитьФорму("<полное имя>"): он перебирает приставки базовых типов форм и, если не нашёл точного имени, пробует основную форму объекта. Новой логики поиска не появилось, добавилась связка.

Проверки

SeeFormRefInferenceTest: ссылка даёт тип конкретной формы, а через него — основной реквизит (Форма.Объект.СсылкаСправочникСсылка.Справочник1) и элемент формы (Форма.Элементы.НаименованиеПолеФормы). Оба теста красные до правки.

Прогоны *types.* и *providers.* — зелёные.

Summary by CodeRabbit

  • Bug Fixes

    • Improved type and hyperlink resolution for qualified form references.
    • Form references in documentation now correctly resolve to the associated form type, attributes, and elements.
  • Tests

    • Added coverage for form reference type inference and updated hyperlink resolution test setup.

Форму в описании называют полным именем, а её синтетический тип зарегистрирован
с приставкой базового типа формы. Сопоставляет одно с другим тот же резолвер,
что типизирует «ПолучитьФорму(<полное имя>)», — теперь его спрашивает и разбор
ссылки, когда путь метаданных не разрешился.
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@nixel2007, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e907d7b4-d8f8-437e-807b-b83381a9f2f9

📥 Commits

Reviewing files that changed from the base of the PR and between c943eba and f58275a.

📒 Files selected for processing (1)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/index/SymbolTypeIndex.java
📝 Walkthrough

Walkthrough

SymbolTypeIndex now resolves qualified form references through FormByNameResolver when existing resolution paths fail. Tests verify inferred form types, object reference attributes, and form elements.

Changes

Form reference resolution

Layer / File(s) Summary
Form resolver fallback
src/main/java/com/github/_1c_syntax/bsl/languageserver/types/index/SymbolTypeIndex.java
SymbolTypeIndex stores FormByNameResolver and uses it as a fallback in resolveSeeReference. Resolved forms are returned as a single-element TypeSet.
Form inference validation
src/test/java/com/github/_1c_syntax/bsl/languageserver/types/SeeFormRefInferenceTest.java, src/test/java/com/github/_1c_syntax/bsl/languageserver/types/index/SymbolTypeIndexHyperlinkTest.java
Tests verify inferred form types and update test construction with the resolver dependency.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes support for resolving «См.» references to forms by their full names.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/types-see-ref-form

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/main/java/com/github/_1c_syntax/bsl/languageserver/types/index/SymbolTypeIndex.java`:
- Around line 386-392: Update the JavaDoc for resolveSeeReference to document
form-name resolution as a fallback, then update the corresponding user-facing
documentation in both docs/ and docs/en/. Describe the supported behavior and
usage without exposing resolver implementation details; leave the existing
formByNameResolver implementation unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d350d4f-7424-45bd-b445-481a7e23d4b0

📥 Commits

Reviewing files that changed from the base of the PR and between 3449901 and c8d5132.

📒 Files selected for processing (3)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/types/index/SymbolTypeIndex.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/types/SeeFormRefInferenceTest.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/types/index/SymbolTypeIndexHyperlinkTest.java

Помимо квалифицированной ссылки и имени типа разбор понимает путь в нотации
конфигуратора и полное имя формы.
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Test Results

 3 990 files  + 6   3 990 suites  +6   52m 33s ⏱️ - 1m 37s
 4 132 tests + 2   4 061 ✅ + 2   71 💤 ±0  0 ❌ ±0 
24 792 runs  +12  24 362 ✅ +12  430 💤 ±0  0 ❌ ±0 

Results for commit f58275a. ± Comparison against base commit 3449901.

♻️ This comment has been updated with latest results.

Виды ссылки — цепочка членов, путь метаданных, имя формы — перебираются в одном
месте, а сам разбор «См.» остался про выбор между квалифицированной ссылкой,
локальной функцией и именем типа.
@sonarqubecloud

sonarqubecloud Bot commented Aug 3, 2026

Copy link
Copy Markdown

@nixel2007
nixel2007 merged commit d5c24f9 into develop Aug 3, 2026
37 checks passed
@nixel2007
nixel2007 deleted the feat/types-see-ref-form branch August 3, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant