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

How to debug with neovim? #14

Open
flyingTan opened this issue Mar 29, 2021 · 10 comments
Open

How to debug with neovim? #14

flyingTan opened this issue Mar 29, 2021 · 10 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@flyingTan
Copy link

你好,我对 SpaceVim 不是很熟悉,我现在已经安装 SpaceVim、ccls,看了几遍你文档和官方文档,但还是有些无从下手,麻烦有时间解答一下。我想实现以下功能:

【1】 Python 光标位置显示定义 Common(类似于 VScode intelligence);
【2】 Python 带有有参数的 Debug。
【3】 可交互式的 Debug。

目前已有配置如下:

image

因为对 VIM 不是特别熟悉,请帮忙尽可能详细描述一下配置步骤。

@Martins3
Copy link
Owner

Martins3 commented Mar 29, 2021 via email

@Martins3
Copy link
Owner

Martins3 commented Mar 29, 2021 via email

@flyingTan
Copy link
Author

flyingTan commented Mar 29, 2021

很抱歉,我在这方面貌似没你专业,因为我平时用 VScode 等 IDE 比较多,所以现在用你配置有点棘手,有点无从下手。本质问题在与中间很多工作没做到位,所以向你请教一种循序渐进的方法。但是又没太多想法,只能硬看。

  • 平时debug python 用的就是 ipdb,和gdb 差不多比较原始,高级用法我没涉猎。

@Martins3
Copy link
Owner

Martins3 commented Mar 29, 2021 via email

@Martins3 Martins3 changed the title Python Debug 环境搭建 Python Debug Environment Setup Mar 31, 2021
@Martins3
Copy link
Owner

使用这个项目配置的,下面是调试 CPP 的效果。具体的配置还需要打磨一下。

image

@Martins3
Copy link
Owner

写一下我自己的想法:

  1. 两个框架的作者都是准备集成这个 vimspector 的
  1. 我自己尝试了一些,配置并不是很难,主要是很多快捷键需要重新映射
➜  test git:(master) ✗ cat .vimspector.json
{
  "configurations": {
    "Vim - run a test": {
      "adapter": "vscode-cpptools",
      "configuration": {
        "type":    "cppdbg",
        "request": "launch",
        "program": "${workspaceRoot}/a.out",
        "args": [
        ],
        "cwd": "${workspaceRoot}",
        "environment": [
          { "name": "runtime", "value": "${workspaceRoot}/runtime" }
        ],
        "externalConsole": true,
        "stopAtEntry": true,
        "MIMode": "gdb",
        "logging": {
          "engineLogging": false
        }
      }
    }
  }
}
  1. vimspector 的设计 vscode 很类似
  2. 在我的文中提到过几种 gdb 的强化产品,我个人感觉可以很大的挽救调试的体验,所以 vimspector 的使用并没有那么紧迫。

综合上面的内容,我不想自己写一个 vimspector 成为现在 coc.nvim / spsacevim 尚未集成 vimspector 的过渡品。

@Martins3 Martins3 pinned this issue Apr 22, 2021
@Martins3 Martins3 added the help wanted Extra attention is needed label Apr 22, 2021
@Martins3 Martins3 changed the title Python Debug Environment Setup How to debug with neovim? Apr 22, 2021
@Martins3
Copy link
Owner

Martins3 commented Sep 14, 2021

@Martins3
Copy link
Owner

Martins3 commented Feb 2, 2022

这个人花了三天才才配置好,看来到如今,在 nvim 中还是比较难集成调试https://www.reddit.com/r/neovim/comments/silikv/debugging_in_neovim/

@Martins3 Martins3 unpinned this issue May 14, 2022
@Martins3
Copy link
Owner

Martins3 commented Oct 15, 2022

https://github.com/Martins3/My-Linux-Config/tree/debug 在这个分支中简单测试 dap 的功能,基本上可以说是开箱即用,但是:

  1. ARM MAC 不支持
  2. nixos 不支持
  3. 需要引入超级多配置
  4. 引入非 mainstream 的插件

我建议如果没有额外的精力,可以再等一年

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants