antosha417 / nvim-lsp-file-operations

Neovim plugin that adds support for file operations using built-in LSP
Apache License 2.0
271 stars 16 forks source link

`setup` Error When No Arguments #4

Closed alex-courtis closed 1 year ago

alex-courtis commented 1 year ago
require("lsp-file-operations").setup()
Error detected while processing /home/alex/.dotfiles/config/nvim/init.lua:
E5113: Error while calling lua chunk: vim/shared.lua:0: after the second argument: expected table, got nil
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function 'validate'
        vim/shared.lua: in function 'tbl_deep_extend'
        ...art/nvim-lsp-file-operations/lua/lsp-file-operations.lua:11: in function 'setup'

Might want to null check the argument, something like

opts = vim.tbl_deep_extend("force", default_config, opts or {})
antosha417 commented 1 year ago

Good catch! Thank you! Fixed it.

alex-courtis commented 1 year ago

Good catch! Thank you! Fixed it.

Love your work.