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

config validation fails if server.settings option is a table #56

Closed
darkseid-is opened this issue Nov 13, 2023 · 2 comments · Fixed by #57
Closed

config validation fails if server.settings option is a table #56

darkseid-is opened this issue Nov 13, 2023 · 2 comments · Fixed by #57
Assignees
Labels
bug Something isn't working

Comments

@darkseid-is
Copy link

darkseid-is commented Nov 13, 2023

Neovim version (nvim -v)

v0.10.0-dev-1046+g3afbf4745

Operating system/version

Debian

Output of :checkhealth rustaceanvim

rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 0.3.1705-standalone
- OK Cargo: found cargo 1.73.0 (9c4383fb5 2023-08-26)
- OK rustc: found rustc 1.73.0 (cc66ad468 2023-10-03)
- OK debug adapter: found codelldb 

Checking config ~
- OK vim.g.rustaceanvim is set
- ERROR Invalid config: server.settings: expected function, got table

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

How to reproduce the issue

Open any rust file with latest version of plugin.

Expected behaviour

No errors.

Actual behaviour

Error detected while processing BufNewFile Autocommands for "*":
Error executing lua callback: /usr/local/share/nvim/runtime/filetype.lua:30: Error executing lua: /usr/local/share/nvim/runtime/filetype.lua:31: BufNewFile Autocommands for "*"..FileType
Autocommands for "rust"..FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20]..script /home/user/.local/share/nvim/lazy/rustaceanvim/ftplugin/rust.lua: Vim(runtime):rustace
anvim: Invalid config: server.settings: expected function, got table
stack traceback:
        [C]: in function 'nvim_cmd'
        /usr/local/share/nvim/runtime/filetype.lua:31: in function </usr/local/share/nvim/runtime/filetype.lua:30>
        [C]: in function 'nvim_buf_call'
        /usr/local/share/nvim/runtime/filetype.lua:30: in function </usr/local/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        /usr/local/share/nvim/runtime/filetype.lua:30: in function </usr/local/share/nvim/runtime/filetype.lua:10>

The minimal config used to reproduce this issue.

vim.g.rustaceanvim = {
        server = {
                settings = {
                        ['rust-analyzer'] = {
                                cargo = { allFeatures = true },
                                checkOnSave = true,
                                check = {
                                        enable = true,
                                        command = "clippy",
                                        features = "all",
                                },
                                procMacro = {
                                        enable = true
                                }

                        },
                },
        },
}
@darkseid-is darkseid-is added the bug Something isn't working label Nov 13, 2023
@mrcjkb
Copy link
Owner

mrcjkb commented Nov 13, 2023

Thanks for the detailed report!

@mrcjkb mrcjkb self-assigned this Nov 13, 2023
@mrcjkb mrcjkb changed the title Broken autoload config validation fails if server.settings option is a table Nov 13, 2023
@darkseid-is
Copy link
Author

Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants