Skip to content

fix(inlayhints): не задваивать подсказки параметров конструктора oscript-класса#4158

Merged
nixel2007 merged 1 commit into
developfrom
claude/oscript-duplicate-inlay-hints-bmwdcl
Jun 18, 2026
Merged

fix(inlayhints): не задваивать подсказки параметров конструктора oscript-класса#4158
nixel2007 merged 1 commit into
developfrom
claude/oscript-duplicate-inlay-hints-bmwdcl

Conversation

@nixel2007

@nixel2007 nixel2007 commented Jun 18, 2026

Copy link
Copy Markdown
Member

Конструктор OneScript-класса (ПриСозданииОбъекта) — source-defined символ,
и подсказки имён его параметров уже выдаёт SourceDefinedMethodCallInlayHintSupplier
(через ссылку на конструктор в индексе). Однако PlatformMethodCallInlayHintSupplier
в ветке Новый Тип(...) резолвил конструкторы любого типа через TypeService и
выдавал те же подсказки повторно — в итоге каждое имя параметра показывалось
дважды в одной позиции.

Ветка обычных методов уже фильтрует source-defined (sourceSymbol == null);
для конструкторов добавлена симметричная фильтрация: платформенный supplier
пропускает типы TypeKind.USER, оставляя их source-defined supplier'у.

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01UE1EVZoWWZHyqqCs1UxfhH

Summary by CodeRabbit

  • Bug Fixes
    • Fixed duplicate inlay hints appearing for user-defined constructors in OneScript code.

…ipt-класса

Конструктор OneScript-класса (ПриСозданииОбъекта) — source-defined символ,
и подсказки имён его параметров уже выдаёт SourceDefinedMethodCallInlayHintSupplier
(через ссылку на конструктор в индексе). Однако PlatformMethodCallInlayHintSupplier
в ветке Новый Тип(...) резолвил конструкторы любого типа через TypeService и
выдавал те же подсказки повторно — в итоге каждое имя параметра показывалось
дважды в одной позиции.

Ветка обычных методов уже фильтрует source-defined (sourceSymbol == null);
для конструкторов добавлена симметричная фильтрация: платформенный supplier
пропускает типы TypeKind.USER, оставляя их source-defined supplier'у.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01UE1EVZoWWZHyqqCs1UxfhH
@nixel2007

Copy link
Copy Markdown
Member Author

/buildJar

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 109ed839-62e3-4d09-b8f9-493f845c1900

📥 Commits

Reviewing files that changed from the base of the PR and between 96bdefc and e42b204.

📒 Files selected for processing (2)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/PlatformMethodCallInlayHintSupplier.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/inlayhints/PlatformMethodCallInlayHintSupplierTest.java

📝 Walkthrough

Walkthrough

PlatformMethodCallInlayHintSupplier adds a TypeKind import and an early-return guard in appendConstructorHints that skips inlay hint generation when the resolved type's kind is TypeKind.USER. A new integration test configures OScript constructor fixtures, reindexes OScriptLibraryIndex, and asserts that the supplier returns no hints for that scenario.

Changes

User Constructor Inlay Hint Suppression

Layer / File(s) Summary
TypeKind.USER guard and integration test
src/main/java/.../inlayhints/PlatformMethodCallInlayHintSupplier.java, src/test/java/.../inlayhints/PlatformMethodCallInlayHintSupplierTest.java
Imports TypeKind and adds an early return in appendConstructorHints for TypeKind.USER types; test injects OScriptLibraryIndex, sets up constructor fixture paths, and asserts an empty hint set for source-defined OScript constructors.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐇 A hop through the hints, a skip through the code,
When USER types call, we lighten the load.
No duplicate hints for the source-defined kind,
The inlay hint rabbit leaves nothing behind!
Empty the set — what a tidy abode! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately summarizes the main change: fixing duplicate inlay hints for OneScript class constructors by preventing the platform supplier from processing user-defined types.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 claude/oscript-duplicate-inlay-hints-bmwdcl

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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Собраны JAR-файлы для этого PR по команде /buildJar.

Артефакт: 7732021877

Файлы внутри:

  • bsl-language-server-claude-oscript-duplicate-inlay-hints-bmwdcl-e42b204-exec.jar

@nixel2007
nixel2007 enabled auto-merge June 18, 2026 18:17
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@nixel2007
nixel2007 disabled auto-merge June 18, 2026 18:32
@nixel2007
nixel2007 merged commit 9811e6d into develop Jun 18, 2026
38 of 39 checks passed
@nixel2007
nixel2007 deleted the claude/oscript-duplicate-inlay-hints-bmwdcl branch June 18, 2026 18:32
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.

2 participants