simrat39 / rust-tools.nvim

Tools for better development in rust using neovim's builtin lsp
MIT License
2.17k stars 158 forks source link

waiting for cargo meta or cargo check #318

Closed Nithin745 closed 1 year ago

Nithin745 commented 1 year ago

2023-01-17-13:32:20-screenshot

I get this error whenever i open the a file in a rust project.

local rt = require("rust-tools")
local provider = require("config.status").provider
local M = {}

M.setup = function(on_attach, capabilities, on_init)
    rt.setup({
        server = {
            -- on_attach = function(_, bufnr)
            --     -- Hover actions
            --     vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
            --     -- Code action groups
            --     vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
            -- end,
            -- cmd = { "rustup", "run", "nightly", "rust-analyzer" },
            on_attach = on_attach,
            capabilities = capabilities,
            on_init = on_init,
            settings = {
                ["rust-analyzer"] = {
                    inlayHints = { locationLinks = false },
                    unstable_features = true,
                    build_on_save = false,
                    all_features = true,
                    checkOnSave = {
                        -- enable = true,
                        command = "clippy"
                    },
                    diagnostics = {
                        enable = true,
                        experimental = {
                            enable = true
                        }
                    },
                    assist = {
                        importGranularity = "module",
                        importPrefix = "by_self",
                    },
                    cargo = {
                        loadOutDirsFromCheck = true
                    },
                    procMacro = {
                        enable = true
                    },
                },
            }
        },
    })
end
simrat39 commented 1 year ago

Looks like a rust-analyzer/lspconfig issue. Does the issue persist with the same config and lspconfig's rust-analyzer setup?

Nithin745 commented 1 year ago

Looks like a rust-analyzer/lspconfig issue. Does the issue persist with the same config and lspconfig's rust-analyzer setup?

I don't what happened, i updated rust_analyzer through Mason today and also updated nvim plugins multiple times since i posted this issue, now i'm not getting this error message.