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

Feedback for “A simple package” #233

Open
Elysian10 opened this issue Jul 4, 2024 · 1 comment
Open

Feedback for “A simple package” #233

Elysian10 opened this issue Jul 4, 2024 · 1 comment

Comments

@Elysian10
Copy link

I really have a hard time debugging the rust code with vs code. Its very difficult to find info about how to attatch my debugger to rust libraries that is used by node.js. Yarn build appears to make a project.so in the release folder. Is that what I need to debug my rust? I wish there was more information.

@Elysian10
Copy link
Author

It took me the whole day to figure out how to debug rust in napi-rs. I finally got it to work. Here is the vs code configuration. It requires the CodeLLDB extention.

{
"type": "lldb",
"request": "launch",
"sourceLanguages": ["rust"],
"name": "Rust",
"program": "node",
"args": ["${workspaceFolder}/test.mjs"],
"preLaunchTask": "build:debug",
"cwd": "${workspaceFolder}"
}

    oh, it runs a task. vs code will ask you to create one.
    
    {
"version": "2.0.0",
"tasks": [
	{
		"type": "shell",
		"command":"napi build --platform",
		"label": "build:debug"
	}
]

}

Other scripts of interests are in package.json. I assume they all run as a shell type. "yarn": "yarn build" might also be handy to add to package.json scripts in rare scenarios.

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

1 participant