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

Copy link
Contributor

@owjs3901 owjs3901 left a comment

Choose a reason for hiding this comment

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

changepacks 로그를 추가 부탁드립니다.

},
"reactComponentLens.codelens.enabled": {
"type": "boolean",
"default": false,
Copy link
Contributor

Choose a reason for hiding this comment

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

좋은 기능인 만큼 기본 값을 true로 하면 어떨까 합니다.

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