rust-tools.nvim icon indicating copy to clipboard operation
rust-tools.nvim copied to clipboard

How to execute the "Run Test" inlay ?

Open elankath opened this issue 2 years ago • 6 comments

New to both neovim and rust-tools so I apologize if this issue is not caused by this plugin or I am asking something very stupid. I have Rust tools installed and get this nice inlay with an arrow icon to Run/Debug the current test.

RustRunTestInlay

But clicking on the arrow does nothing. (Its just an inlay and does not appear to be selectable or receive clicks). Is there any way to execute the current test using this arrow inlay and not by using RustRunnables and selecting the test every time ? Why even bother showing this inlay if it cannot receive events ?

elankath avatar Apr 23 '23 16:04 elankath

It's lsp code lens, not inlay hints. You should bind a key to vim.lsp.codelens.run().

cshuaimin avatar May 30 '23 04:05 cshuaimin

Why I don't have this?

image

here is my settings:

require('rust-tools').setup({
    server = {
        settings = {
            ['rust-analyzer'] = {
                completion = {
                    privateEditable = {
                        enable = true,
                    },
                },
                { references = {
                    excludeImports = true,
                } },
            },
        },
    },
    dap = {
        adapter = require('rust-tools.dap').get_codelldb_adapter(
            vim.env.HOME .. '/.local/share/nvim/mason/bin/codelldb',
            vim.env.HOME
                .. '/.local/share/nvim/mason/packages/codelldb/extension/lldb/lib/liblldb.'
                .. (vim.loop.os_uname().sysname == 'Linux' and 'so' or 'dylib')
        ),
    },
})

cathaysia avatar Jun 24 '23 00:06 cathaysia

any idea about this?

cathaysia avatar Jun 25 '23 23:06 cathaysia

@cathaysia Do you refresh codelens (vim.lsp.codelens.refresh()) in an autocmd? e.g. in LunarVim

cshuaimin avatar Jun 26 '23 04:06 cshuaimin

thanks, this works for me. :)


From: Chen Shuaimin @.> Sent: Monday, June 26, 2023 12:23:54 PM To: simrat39/rust-tools.nvim @.> Cc: DragonBillow @.>; Mention @.> Subject: Re: [simrat39/rust-tools.nvim] How to execute the "Run Test" inlay ? (Issue #374)

@cathaysiahttps://github.com/cathaysia Do you refresh codelens (vim.lsp.codelens.refresh()) in an autocmd? e.g. in LunarVimhttps://github.com/LunarVim/LunarVim/blob/407e7b05eace59f571730f7d1467c39f7ba73a90/lua/lvim/lsp/utils.lua#L125-L149

― Reply to this email directly, view it on GitHubhttps://github.com/simrat39/rust-tools.nvim/issues/374#issuecomment-1606572103, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AKBJ6AJADXQ4RY3P5JKZXJ3XNEFFVANCNFSM6AAAAAAXIULIV4. You are receiving this because you were mentioned.Message ID: @.***>

cathaysia avatar Jun 26 '23 04:06 cathaysia

It can also be run using hover command: K and then K again to enter the window

llllvvuu avatar Aug 04 '23 07:08 llllvvuu