feat: 支持模版标签的右键查看定义的跳转#110
Conversation
📝 WalkthroughWalkthroughThe ChangesComponent Tag Definition Provider
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 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 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.
🧹 Nitpick comments (1)
packages/language-service/src/plugins/mpx-sfc-template-links.ts (1)
257-265: 💤 Low valueConsider avoiding the type assertion if upstream types permit.
The
as SfcJsonBlockUsingComponents | undefinedcast works but could mask type drift if the upstreamresolvedUsingComponents.resultshape changes. If the@mpxjs/language-corepackage already exports properly typed result, narrowing without the cast would be safer.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/language-service/src/plugins/mpx-sfc-template-links.ts` around lines 257 - 265, The type assertion on the usingComponents assignment in the return object is masking potential type issues. Remove the as SfcJsonBlockUsingComponents | undefined cast and rely on the type that is already provided by the upstream resolvedUsingComponents.result from root.sfc.json. TypeScript should be able to infer the correct type automatically when you assign the result property value directly to usingComponents without the explicit type assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/language-service/src/plugins/mpx-sfc-template-links.ts`:
- Around line 257-265: The type assertion on the usingComponents assignment in
the return object is masking potential type issues. Remove the as
SfcJsonBlockUsingComponents | undefined cast and rely on the type that is
already provided by the upstream resolvedUsingComponents.result from
root.sfc.json. TypeScript should be able to infer the correct type automatically
when you assign the result property value directly to usingComponents without
the explicit type assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5366725c-4aec-46dc-ba2a-b8ea28a90a07
📒 Files selected for processing (1)
packages/language-service/src/plugins/mpx-sfc-template-links.ts
Summary by CodeRabbit
Release Notes
New Features
Improvements