feat(DocumentSymbolProvider): detail с сигнатурой параметров метода#4082
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR enriches DocumentSymbol output for MethodSymbol instances by setting DocumentSymbol.detail to a formatted parameter signature string (parenthesized parameter names; optional parameters marked with ChangesMethod Symbol Detail Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Необязательные параметры имеет смысл помечать знаком вопроса, а не равно. Как в hover |
…метода Co-Authored-By: Claude Fable 5 <[email protected]>
По ревью: единообразно с hover (HoverParameters: optional → "?"), а не "=". Co-Authored-By: Claude Fable 5 <[email protected]>
c5ba721 to
f5b402b
Compare
|
Поправил: необязательные параметры теперь помечаются |
|
Test Results 3 276 files 3 276 suites 1h 20m 13s ⏱️ Results for commit f5b402b. |



Проблема
toDocumentSymbolстроилDocumentSymbolтолько из name/kind/range/selectionRange, полеdetailоставалосьnull. В Outline и breadcrumbs у методов не было краткой подписи параметров.Решение
При построении символа метода (
symbol instanceof MethodSymbol) заполняемdetailкраткой сигнатурой по именам параметров:(Пар1, Пар2). Необязательные параметры (с значением по умолчанию,ParameterDefinition.isOptional()) помечаются суффиксом=, например(Первое, Второе =). Метод без параметров получает(). Имя метода в detail не дублируется. Переменные оставлены без detail (тип дёшево недоступен).Тесты
testMethodDetailContainsParameterNames— функция с обязательным и необязательным параметром получает detail(Первое, Второе =).testMethodWithoutParametersHasEmptyParenthesesDetail— процедура без параметров получает detail().testDocumentSymbolиtestIncompleteVariableDeclarationDoesNotBreakSelectionRangeпроходят без изменений (структура символов не сломана).Финальный прогон
DocumentSymbolProviderTest: 4 теста PASSED, BUILD SUCCESSFUL.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests