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

Dap UI not working #145

Closed
ray-x opened this issue Jun 29, 2022 · 10 comments
Closed

Dap UI not working #145

ray-x opened this issue Jun 29, 2022 · 10 comments

Comments

@ray-x
Copy link
Owner

ray-x commented Jun 29, 2022

This check doesn't work for me, it keeps opening windows indefinitely

go.nvim/lua/go/dap.lua

Lines 272 to 275 in d402d9c

local lys = require("dapui.windows").layouts
if next(lys) and lys[1]:is_open() == false then
require("dapui").open()
end

Originally posted by @Davincible in #139 (comment)

@ray-x
Copy link
Owner Author

ray-x commented Jun 29, 2022

@Davincible
What is your workflow? I checked debug with unit test it looks good.
Also just to be sure you are using latest dap-ui, right?

@Davincible
Copy link
Contributor

Davincible commented Jun 29, 2022

Well I haven't actually gotten debugging to work yet, everytime I set a breakpoint and run GoDebug (without any arguments, just like that), I get could not remove /tmp/test/go/__debug_bin: remove /tmp/test/go/__debug_bin: no such file or directory

And the dap plugins has this notification; Error on launch: Failed to launch

@Davincible
Copy link
Contributor

Everything should be latest, according to packer

@Davincible
Copy link
Contributor

Davincible commented Jun 30, 2022

Just replicated everything with a very minimal config, same behavior for both.

local execute = vim.api.nvim_command
local fn = vim.fn
 
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
 
if fn.empty(fn.glob(install_path)) > 0 then
        fn.system({ "git", "clone", "https://github.com/wbthomason/packer.nvim", install_path })
        execute("packadd packer.nvim")
end
 
return require("packer").startup(function()
        -- Packer can manage itself    
        use("wbthomason/packer.nvim")
 
        -- Nvim Treesitter
        use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
        use("kyazdani42/nvim-web-devicons")
 
        -- Golang
        use({
                "ray-x/go.nvim",
                requires = {
                        "mfussenegger/nvim-dap", -- Debug Adapter Protocol
                        "rcarriga/nvim-dap-ui",
                        "theHamsta/nvim-dap-virtual-text",
                        "ray-x/guihua.lua",
                },
        })
 
        local path = require("nvim-lsp-installer.core.path")
        local install_root_dir = path.concat({ vim.fn.stdpath("data"), "lsp_servers" })
        require("go").setup({
                gopls_cmd = { install_root_dir .. "/go/gopls" },
        })
 
        -- Nvim LSP
        use({ "neovim/nvim-lspconfig", "williamboman/nvim-lsp-installer", after = "go.nvim" })
end)
Delve Debugger
Version: 1.8.3
Build: $Id: f92bb46b82b3b92d79ce59c4b55eeefbdd8d040c $

ray-x added a commit that referenced this issue Jun 30, 2022
@ray-x
Copy link
Owner Author

ray-x commented Jun 30, 2022

Your config look good. I pushed an update. Could you check if it works for you?

@Davincible
Copy link
Contributor

You updated the readme? I tried GoDebug and GoDebug -c, -r, -p, all same result.

ray-x added a commit that referenced this issue Jun 30, 2022
@ray-x
Copy link
Owner Author

ray-x commented Jun 30, 2022

Sorry, the merge was not successful, re-push a new version.
You can use init.lua in playground folder to run some tests.

@Davincible
Copy link
Contributor

Yeeaahh it works now. But also the reason the UI keeps double opening is because the session failed to launch, and thus the check is session running fails, causing the UI to open again.

I can start a debug session now successfully. But if you just set your cursor on line 1 (package definition), it will fail to start the debug session as expected, but open the UI. If you then run GoDebug again, it doesn't detect a running session and re-opens another UI

ray-x added a commit that referenced this issue Jun 30, 2022
@ray-x
Copy link
Owner Author

ray-x commented Jun 30, 2022

Filed an issue here:
rcarriga/nvim-dap-ui#115
Also, commit a check for that as well.

@ray-x
Copy link
Owner Author

ray-x commented Jun 30, 2022

Close this for now. Most parts of the issue are solved.

@ray-x ray-x closed this as completed Jun 30, 2022
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

2 participants