Skip to content

fix(inlayhints): показывать значения по умолчанию пропущенных аргументов#4106

Merged
nixel2007 merged 1 commit into
developfrom
claude/inlayhint-default-values
Jun 14, 2026
Merged

fix(inlayhints): показывать значения по умолчанию пропущенных аргументов#4106
nixel2007 merged 1 commit into
developfrom
claude/inlayhint-default-values

Conversation

@nixel2007

@nixel2007 nixel2007 commented Jun 14, 2026

Copy link
Copy Markdown
Member

Что

Подсказки inlay-hint для платформенных методов теперь показывают значение по умолчанию для пропущенных аргументов.

Поведение

  • Метод(а,,б) — для пропущенного (пустого) второго аргумента теперь отображается подсказка со значением по умолчанию.
  • Метод() и Новый Тип() (единственный пустой аргумент / вызов без аргументов) по-прежнему подсказок не дают.

Выделено из #4077 (часть 1 из 2).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Inlay hints for method calls with skipped arguments now conditionally display parameter default values when the feature is enabled.
  • Tests

    • Expanded test coverage for inlay hint behavior with skipped arguments and empty call arguments.

@coderabbitai

coderabbitai Bot commented Jun 14, 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: fdeaeb87-d05f-4400-87bf-bf98da70ebc9

📥 Commits

Reviewing files that changed from the base of the PR and between 3c41a89 and 503a0be.

📒 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/PlatformMethodCallInlayHintSupplierUnitTest.java

📝 Walkthrough

Walkthrough

appendHints now detects whether a call contains skipped arguments (args.size() > 1) and passes an argumentSkipAllowed flag to appendHint. appendHint replaces its unconditional blank-argument early return with conditional default-value hint emission. Two new unit tests cover the skipped-argument default-value hint and the empty-call no-hint cases.

Changes

Skipped-argument default-value inlay hints

Layer / File(s) Summary
appendHints/appendHint skipped-argument detection and hint emission
src/main/java/.../inlayhints/PlatformMethodCallInlayHintSupplier.java
appendHints computes argumentSkipAllowed from args.size() > 1 and passes it to appendHint. appendHint replaces its unconditional blank-argument early return with conditional default-value hint emission guarded by argumentSkipAllowed, showDefaultValues, and a non-blank parameter default value.
Unit tests for skipped-argument hint and empty-call no-hint
src/test/java/.../inlayhints/PlatformMethodCallInlayHintSupplierUnitTest.java
Imports extended with configuration, type-model, tokenization, LSP, and Mockito utilities. Two new tests stub AST and type-service responses: one asserts a default-value hint label for a skipped middle argument in СтрНайти; the other asserts no hints for an empty Сообщить() call.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • 1c-syntax/bsl-language-server#3942: Modifies the same appendHints/appendHint methods in PlatformMethodCallInlayHintSupplier to adjust hint emission for blank/skipped argument parameters.

Poem

🐇 Hop, hop! A blank spot in the call,
No longer silenced — defaults stand tall!
argumentSkipAllowed leads the way,
Default values get their hint display.
The rabbit tested СтрНайти with glee,
And empty Сообщить() stays hint-free! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% 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 title accurately describes the main change: displaying default values for skipped arguments in inlay hints, which matches the implementation that conditionally shows hints for skipped arguments when default values are available.
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/inlayhint-default-values

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.

@nixel2007
nixel2007 merged commit 384003b into develop Jun 14, 2026
37 checks passed
@nixel2007
nixel2007 deleted the claude/inlayhint-default-values branch June 14, 2026 10:28
@sonarqubecloud

Copy link
Copy Markdown

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