simrat39 / rust-tools.nvim

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

Inlay hints don't work correctly #264

Open xbladesub opened 1 year ago

xbladesub commented 1 year ago

I have an issue with inlay hints - it it works unpredictable. If I open neovim and non-rust file first - inlay hints don't work when I open rust file afterwards. Also sometimes it just stops to display inlay hints while opening new rust files and other buffers.

Here is my config:

local executors = require "rust-tools.executors"
require("rust-tools").setup {
    tools = {
        executor = executors.toggleterm,
        runnables = {
            use_telescope = true,
        },
        autosethints = true,
        inlay_hints = { show_parameter_hints = true },
        hover_actions = { auto_focus = true }
    },
    server = {
        on_attach = function(client, bufnr)
            require("lvim.lsp").common_on_attach(client, bufnr)
            local rt = require "rust-tools"
            vim.keymap.set("n", "<leader>la", rt.code_action_group.code_action_group, { buffer = bufnr })
        end,
        on_init = require("lvim.lsp").common_on_init,
        settings = {
            ["rust-analyzer"] = {
                lens = {
                    enable = true,
                },
                checkonsave = {
                    command = "clippy",
                },
            },
        },
    },
}
ehsanonline commented 1 year ago

i removed the rust-analyzer from lvim.lsp.installer.setup.ensure_installed = { ... } then hints showed up.