Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在cursor中点击组件,会使用vscode打开源代码🤔 #178

Open
pangxzi opened this issue Sep 18, 2024 · 3 comments
Open

在cursor中点击组件,会使用vscode打开源代码🤔 #178

pangxzi opened this issue Sep 18, 2024 · 3 comments

Comments

@pangxzi
Copy link

pangxzi commented Sep 18, 2024

No description provided.

@zthxxx
Copy link
Owner

zthxxx commented Sep 18, 2024

custom your REACT_EDITOR:

@z-juln
Copy link

z-juln commented Nov 27, 2024

                <Inspector
                    // props see docs:
                    // https://github.com/zthxxx/react-dev-inspector#inspector-component-props
                    keys={['command', 'z', 'x']}
                    disableLaunchEditor={true}
                    onClickElement={({ codeInfo }: InspectParams) => {
                        if (!codeInfo?.absolutePath) return;
                        const { absolutePath, lineNumber, columnNumber } =
                            codeInfo;
                        // you can change the url protocol if you are using in Web IDE
                        const EDITOR_APP = 'cursor'; // or 'vscode'
                        window.open(
                            `${EDITOR_APP}://file/${absolutePath}:${lineNumber}:${columnNumber}`
                        );
                    }}
                />

@zthxxx
Copy link
Owner

zthxxx commented Nov 27, 2024

也可以只需要在 ~/.zshrc(~/.bashrc) 中添加 export REACT_EDITOR=cursor

You need to run the Shell Command: Install 'cursor' command command from the Command Palette in Cursor.
https://forum.cursor.com/t/how-to-open-cursor-from-terminal/3757

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

No branches or pull requests

3 participants