Debug in Neovim
Esta página aún no está disponible en tu idioma.
There are many different plugins that can be used to debug Rust code in Neovim. This guide will show you how to set up nvim-dap
and some additional plugins to debug Tauri application.
Prerequisites
nvim-dap
extension requires codelldb
binary. Download the version for your system from https://github.com/vadimcn/codelldb/releases and unzip it. We will point to it later in the nvim-dap
configuration.
Configuring nvim-dap
Install nvim-dap
and nvim-dap-ui
plugins. Follow the instructions provided on their github pages or simply use your favourite plugin manager.
Note that nvim-dap-ui
requires nvim-nio
plugin.
Next, setup the plugin in your Neovim configuration:
This setup will ask you to point to the Tauri App binary you want to debug each time you lanuch the debugger.
Optionally, you can setup nvim-dap-ui
plugin to toggle debugger view automatically each time debugging session starts and stops:
Lastly, you can change the default way the breakpoints are displayed in the editor:
Starting the dev server
Since we’re not using Tauri CLI to launch the app the development server will not start automatically. To control the state of development server from Neovim you can use the overseer plugin.
Best way to control tasks running in background is to use VS Code style task configuration. To do this create a .vscode/tasks.json
file in the projects directory.
You can find example task configuration for project using trunk
below.
Example key bindings
Below you can find example key bindings to start and control debugging sessions.
© 2024 Tauri Contributors. CC-BY / MIT