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

Error when using custom repl commands #10

Open
carschandler opened this issue Jan 16, 2024 · 0 comments
Open

Error when using custom repl commands #10

carschandler opened this issue Jan 16, 2024 · 0 comments

Comments

@carschandler
Copy link

The nvim-dap REPL can be customized to use custom commands using the following syntax:

local repl = require('dap.repl')
repl.commands = vim.tbl_extend('force', repl.commands, {
  custom_commands = {
    ['.restart'] = function()
      dap.restart()
      repl.open()
      vim.cmd.wincmd('j')
    end,
    ['.clear'] = repl.clear()
  },
})

When using these custom commands alongside cmp-dap, an error is thrown:

Error detected while processing TextChangedI Autocommands for "*":
Error executing lua callback: vim/shared.lua:0: s: expected string, got function
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        vim/shared.lua: in function 'startswith'
        ...chan/.local/share/nvim/lazy/cmp-dap/lua/cmp_dap/init.lua:88: in function 'complete'
        .../chan/.local/share/nvim/lazy/nvim-cmp/lua/cmp/source.lua:334: in function 'complete'
        /home/chan/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:299: in function 'complete'
        /home/chan/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:169: in function 'callback'
        /home/chan/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:229: in function 'autoindent'
        /home/chan/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:161: in function 'on_change'
        /home/chan/.local/share/nvim/lazy/nvim-cmp/lua/cmp/init.lua:338: in function 'callback'
        ...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/autocmd.lua:49: in function 'emit'
        ...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/autocmd.lua:23: in function <...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/autocmd.lua:22>
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