Skip to content

Add CodeLens annotations for Server/Client Components#8

Open
yongsk0066 wants to merge 2 commits intodev-five-git:mainfrom
yongsk0066:feature/codelens
Open

Add CodeLens annotations for Server/Client Components#8
yongsk0066 wants to merge 2 commits intodev-five-git:mainfrom
yongsk0066:feature/codelens

Conversation

@yongsk0066
Copy link

안녕하세요! 너무 좋은 기능같아서 개인적으로 codelens 형태로도 보여주면 좋겠다 생각해서 PR 올려봅니다.

Adds CodeLens annotations that display "Server Component" or "Client Component" above import statements, component declarations, and JSX tags. Clicking a CodeLens opens a peek preview of the component's source file at its declaration.

What it does

  • Shows component kind (Server/Client) as inline CodeLens labels
  • Peek-to-declaration on click via editor.action.peekLocations
  • Respects the global enabled setting

Settings

Setting Default Description
codelens.enabled false Toggle CodeLens on/off
codelens.clientComponent true Show labels for client components
codelens.serverComponent true Show labels for server components

Demo

codelens-screenshot

codelens-demo

- Add ComponentCodeLensProvider with component kind labels above code lines
- Respect global enabled setting to properly disable all features
- Add codelens.enabled, codelens.clientComponent, codelens.serverComponent settings
- Move signature helpers to resolver.ts for contextual locality
- Add tests for CodeLens scope behavior
Use analyzer.findComponentDeclaration() to resolve the declaration
offset in source files, enabling peek preview at the actual component
definition instead of the file start.
@github-actions
Copy link

Changepacks

react-component-lens@0.2.2 - package.json

Maybe you forgot to write the following files to the latest version

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