fix: separate class getters from methods in docs rendering#1949
fix: separate class getters from methods in docs rendering#1949ghostdevv merged 4 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change refactors the documentation rendering system to properly categorise and display class getters separately from methods. A 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
test/unit/server/utils/docs/render.spec.ts (1)
24-133: Add one test for untyped properties to cover the other behaviour change in this PR.Nice coverage for getter/method separation. Please also add a case asserting that a class property without
tsTyperenders without a: typesuffix, so that change is protected from regressions.✅ Suggested additional test
+ it('omits ": type" for properties without explicit tsType', async () => { + const symbol = createClassSymbol({ + properties: [ + { name: 'clientId' }, // no tsType + ], + }) + + const html = await renderDocNodes([symbol], new Map()) + + expect(html).toContain('<h4>Properties</h4>') + expect(html).toContain('clientId') + expect(html).not.toContain('clientId:') + })As per coding guidelines, “
**/*.{test,spec}.{ts,tsx}: Write unit tests for core functionality usingvitest”.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 33b18d44-bf42-4d65-9447-791c8f676413
📒 Files selected for processing (3)
server/utils/docs/render.tsshared/types/deno-doc.tstest/unit/server/utils/docs/render.spec.ts
507e23b to
640b6e4
Compare

🔗 Linked issue
Fixes #1943
🧭 Context
📚 Description
This PR splits class getter methods (such as
get clientId()) into a separate "Getters" section and uses theget name: typeformat.Also:
renderMemberListhelper to deduplicate Properties/Getters/Methods rendering: typesuffix for properties without explicit type annotations