Debugging Rust in (Neo)Vim

Sdílet
Vložit
  • čas přidán 28. 07. 2024
  • 1. gdb cheat sheet: drive.google.com/file/d/1RDbI...
    2. vimspector: github.com/puremourning/vimsp...
    3. microsoft.github.io/language-...
    4. lldb.llvm.org/use/map.html
  • Věda a technologie

Komentáře • 19

  • @jocketf3083
    @jocketf3083 Před 3 lety +6

    Thanks a ton! This will be incredibly useful to me! Also, please replace your fire alarm battery so that you don't die in a fire.

  • @DamienSawyer
    @DamienSawyer Před 2 lety

    Thank you. That was a fantastic tutorial!

  • @pseudoc
    @pseudoc Před rokem

    I was using rust-gdb for quite a long time, but when I started to build applications with async functions, the "step into" won't work as I expected.

  • @Leizcrt
    @Leizcrt Před 3 lety

    Good job man!

  • @marcelowind
    @marcelowind Před 2 lety

    Great stuff! This integration with vimspector makes my vim setup much closer to what I have in CLion.
    One thing that I noticed and couldn't replicate, that maybe you could tell me what I'm missing:
    When I enable codeLens, and set up the rust-analyzer configurations, I can only trigger coc-codelens-action (for Run and Debug) from the function declaration line. While, in the video, you can trigger it from anywhere within the scope of the executable function. Is there an option to enable this that I missed? (Yes, I have been 👀 your dotfiles repo trying to find it! 😅)
    Thanks for the video!

  • @bew
    @bew Před 3 lety +2

    Did you tried nvim-dap plugin? It's a neovim-only plugin for the DebugAdapterProtocol (similar to vimspector)

    • @SeniorMarsTries
      @SeniorMarsTries  Před 3 lety

      I took a lot at it a bit in the past. I just currently like my setup

  • @alexzander__6334
    @alexzander__6334 Před 2 lety

    can this plugin debug multi-threaded rust applications?
    or how do you debug multi processes spawned from rust ?
    or how do you debug subproceses spawned from rust ?

  • @360nickx
    @360nickx Před 3 lety

    SUper awesome.

  • @jacobhayes7552
    @jacobhayes7552 Před 2 lety

    Can you publish your configuration files somewhere so that others can recreate your setup more easily?

  • @amidamarurookie
    @amidamarurookie Před 2 lety

    Could you please share your neovim configs?

  • @user-zu7pl3wl5d
    @user-zu7pl3wl5d Před 3 lety

    How to call out the run and debug boxes?

  • @alexzander__6334
    @alexzander__6334 Před 2 lety

    btw. very nice color scheme.

  • @3ckortreat
    @3ckortreat Před 2 lety

    what is your colorscheme?

  • @SeniorMarsTries
    @SeniorMarsTries  Před rokem

    Update to this, but I have this in
    `~/.config/nvim/after/rust.lua `
    ```lua
    vim.g.termdubgger = "rust-gdb"
    vim.opt.shell = "/opt/homebrew/bin/fish"
    local map = vim.api.nvim_buf_set_keymap
    local options = { silent = true}
    map(0, 'n', '=', ":w:term rustc =expand('%') && ./=expand('%:r')", {noremap = true})
    map(0, 'n', '9', ':CocCommand rust-analyzer.run', {noremap = true})
    map(0, 'n', 'dd', ':CocCommand rust-analyzer.debug', {noremap = true})
    map(0, 'n', 'dc', 'VimspectorContinue', options)
    map(0, 'n', 'di', 'VimspectorStepInto', options)
    map(0, 'n', 'do', 'VimspectorStepOver', options)
    map(0, 'n', 'da', 'VimspectorStepOut', options)
    map(0, 'n', 'ds', 'VimspectorStop', options)
    map(0, 'n', 'db', 'VimspectorToggleBreakpoint', options)
    map(0, 'n', 'de', 'VimspectorBalloonEval', {})
    map(0, 'x', 'de', 'VimspectorBalloonEval', {})
    ```
    CocCommand rust-analyzer.debug allows you to pick what function to debug!

  • @fredericchopin4221
    @fredericchopin4221 Před rokem

    compared to visual studio, this is10x less ergonomic