Skip to content

feat(CompletionProvider): commitCharacters для членов и вызываемых#4091

Merged
nixel2007 merged 1 commit into
developfrom
claude/completion-commitcharacters
Jun 13, 2026
Merged

feat(CompletionProvider): commitCharacters для членов и вызываемых#4091
nixel2007 merged 1 commit into
developfrom
claude/completion-commitcharacters

Conversation

@nixel2007

Copy link
Copy Markdown
Member

Проблема

В textDocument/completion пункты не задавали commitCharacters. Из-за этого клиент не мог фиксировать вызываемый вводом ( или член-объект вводом . — нажатие такого символа не выбирало подсвеченный пункт и не вставляло его вместе с символом.

Решение

Добавлен helper applyCommitCharacters(CompletionItem), проставляющий набор по CompletionItemKind:

  • Method / Function / Constructor["("] — фиксация вставкой открывающей скобки;
  • Field / Property / Variable / Module["."] — осмысленно дальнейшее обращение к члену;
  • ключевые слова, классы и прочее — не задаются.

Гейтинг по клиентской capability completionItem.commitCharactersSupport: флаг кэшируется в handleInitializeEvent рядом со snippetSupport / labelDetailsSupport / resolveSupport. Если клиент не объявил поддержку — commitCharacters не задаются вовсе. Серверный triggerCharacters (точка как триггер completion) не затрагивается — это отдельный механизм.

Helper вызывается строго локально в местах выдачи item-ов: buildMemberItem (члены dot-completion и глобальные функции), локальные методы/переменные документа, глобальные контексты и квалифицированные имена MD-объектов. Чужие правки (sortText, resolve, MarkupContent, labelDetails) не переформатированы.

Тесты

Новые тесты в CompletionProviderTest (red-first, затем реализация):

  • methodMemberGetsOpenParenCommitCharacter — метод получает ["("];
  • propertyMemberGetsDotCommitCharacter — свойство получает ["."];
  • localVariableGetsDotCommitCharacter — локальная переменная получает ["."];
  • keywordHasNoCommitCharacters — ключевое слово без commitCharacters;
  • methodMemberHasNoCommitCharactersWhenClientLacksSupport — при клиенте без commitCharactersSupport не задаются.

Прогон: ./gradlew test --tests "...CompletionProviderTest" — 78 tests, 0 failures.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

More reviews will be available in 12 minutes and 9 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df610d1a-d465-4726-90c3-5e7e997704f2

📥 Commits

Reviewing files that changed from the base of the PR and between 8022af7 and 92055e8.

📒 Files selected for processing (2)
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/providers/CompletionProvider.java
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/providers/CompletionProviderTest.java
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/completion-commitcharacters

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

Test Results

 3 270 files  ± 0   3 270 suites  ±0   1h 31m 44s ⏱️ + 1m 59s
 3 184 tests + 5   3 169 ✅ + 5  15 💤 ±0  0 ❌ ±0 
19 104 runs  +30  19 014 ✅ +30  90 💤 ±0  0 ❌ ±0 

Results for commit 91a2fa1. ± Comparison against base commit 0ce96dd.

@sonarqubecloud

Copy link
Copy Markdown

@nixel2007
nixel2007 force-pushed the claude/completion-commitcharacters branch from 91a2fa1 to 92055e8 Compare June 13, 2026 14:32
@nixel2007
nixel2007 merged commit db6a8b9 into develop Jun 13, 2026
22 of 23 checks passed
@nixel2007
nixel2007 deleted the claude/completion-commitcharacters branch June 13, 2026 14:37
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