Skip to content

feat: support hover on code import#83

Merged
9romise merged 8 commits intonpmx-dev:mainfrom
hyoban:2-20-hover-on-code-import
Mar 21, 2026
Merged

feat: support hover on code import#83
9romise merged 8 commits intonpmx-dev:mainfrom
hyoban:2-20-hover-on-code-import

Conversation

@hyoban
Copy link
Copy Markdown
Contributor

@hyoban hyoban commented Mar 20, 2026

CleanShot 2026-03-20 at 22 24 53@2x

@hyoban hyoban marked this pull request as ready for review March 20, 2026 14:24
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bd00966c-46a1-431e-a538-442ca34011c8

📥 Commits

Reviewing files that changed from the base of the PR and between 52c56f2 and 04508cc.

📒 Files selected for processing (4)
  • extensions/vscode/src/providers/hover/resolve.ts
  • packages/language-core/src/utils/index.ts
  • packages/language-core/src/utils/source-import.test.ts
  • packages/language-core/src/utils/source-import.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/language-core/src/utils/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • extensions/vscode/src/providers/hover/resolve.ts

📝 Walkthrough

Walkthrough

This pull request refactors the VS Code hover provider functionality by extracting dependency resolution logic into modular, testable helper functions. The change introduces resolveHoverDependency in a new dedicated module to handle mapping cursor positions to resolved dependencies, and adds getImportSpecifierInLine utility to parse import specifiers from text. The hover registration mechanism is updated to support multiple language-specific patterns via HOVER_LANGUAGE_SELECTORS. New test suites validate both helpers with comprehensive coverage of import parsing and dependency resolution scenarios. A new utility module re-export exposes the import specifier functionality from the language-core package.

Possibly related PRs

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description consists only of a screenshot showing TypeScript diagnostics for 'ofetch' import, which directly relates to the changeset's core objective of supporting hover on code imports.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f4050ce7-fc6e-461e-be98-a72d7f23af9c

📥 Commits

Reviewing files that changed from the base of the PR and between 20c9d73 and 52c56f2.

📒 Files selected for processing (7)
  • extensions/vscode/src/providers/hover/index.ts
  • extensions/vscode/src/providers/hover/npmx.ts
  • extensions/vscode/src/providers/hover/resolve.test.ts
  • extensions/vscode/src/providers/hover/resolve.ts
  • extensions/vscode/src/utils/import-specifier.test.ts
  • extensions/vscode/src/utils/import-specifier.ts
  • playground/index.ts

Copy link
Copy Markdown
Member

@9romise 9romise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@9romise 9romise added this pull request to the merge queue Mar 21, 2026
Merged via the queue into npmx-dev:main with commit ce89379 Mar 21, 2026
8 checks passed
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.

2 participants