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

Command completion broken in Neovim 0.9 #47

Closed
h0pes opened this issue Nov 10, 2023 · 2 comments · Fixed by #48
Closed

Command completion broken in Neovim 0.9 #47

h0pes opened this issue Nov 10, 2023 · 2 comments · Fixed by #48
Assignees
Labels
bug Something isn't working

Comments

@h0pes
Copy link

h0pes commented Nov 10, 2023

Neovim version (nvim -v)

NVIM v0.9.4 Build type: Release LuaJIT 2.1.1697887905 system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim" Run :checkhealth for more info

Operating system/version

Linux arch 6.5.9-arch2-1 #1 SMP PREEMPT_DYNAMIC Thu, 26 Oct 2023 00:52:20 +0000 x86_64 GNU/Linux

Output of :checkhealth rustaceanvim

rustaceanvim: require("rustaceanvim.health").check() Checking for Lua dependencies ~ - OK mfussenegger/nvim-dap installed. Checking external dependencies ~ - OK rust-analyzer: found rust-analyzer 0.3.1722-standalone - OK Cargo: found cargo 1.73.0 (9c4383fb5 2023-08-26) - OK rustc: found rustc 1.73.0 (cc66ad468 2023-10-03) - OK lldb: found lldb version 16.0.6 Checking config ~ - OK vim.g.rustaceanvim is not set - OK No errors found in config. Checking for conflicting plugins ~ - OK No conflicting plugins detected.

How to reproduce the issue

Enter command mode and type TAB after any Rust command followed by a space.

Example: :RustAnalyzer[space][TAB]

Expected behaviour

I would expect to see a list of available options to run the command. In the example of RustAnalyzer, they should be start and stop

Actual behaviour

I get the attached error whenever hitting the TAB key.
Manually typing the command option switch (i.e. start or stop) works fine.
2023-11-10_17-39_RustAnalyzer

The same happens with any of the RustLsp command switches.

2023-11-10_16-33_RustLsp

Pressing TAB with other plugins in command mode, seems to work fine (see attached example for Trouble auto completion)
2023-11-10_16-37_TroubleTab

Sorry if this is an issue from my side/config. I'm just trying to move from rust-tools to your new plugin for which you deserve a big thank you!

The minimal config used to reproduce this issue.

plugins.lua

  {
  'mrcjkb/rustaceanvim',
  version = '^3', -- Recommended
  ft = { 'rust' },
    config = function(_, opts)
      require("core.utils").load_mappings("rustaceanvim")
    end
},

mappings.lua

M.rustaceanvim = {
  n = {
    ["<leader>rdc"] = { "<cmd>RustLsp externalDocs<CR>", "open Rust documentation"},
    ["<leader>rr"] = { "<cmd>RustLsp runnables<CR>", "Rust runnables"},
    ["<leader>rd"] = { "<cmd>RustLsp debuggables<CR>", "Rust debuggables"},
    ["<leader>rem"] = { "<cmd>RustLsp expandMacro<CR>", "Rust expand macros recursively"},
    ["<leader>rmr"] = { "<cmd>RustLsp rebuildProcMacros<CR>", "Rust rebuild proc macros"},
    ["<leader>rmu"] = { "<cmd>RustLsp moveItem up<CR>", "Rust move item up"},
    ["<leader>rmd"] = { "<cmd>RustLsp moveItem down<CR>", "Rust move item down"},
    ["<leader>rh"] = { "<cmd>RustLsp hover actions<CR>", "Rust hover actions (run)"},
    ["<leader>ree"] = { "<cmd>RustLsp explainError<CR>", "Rust explain errors"},
    ["<leader>rot"] = { "<cmd>RustLsp openCargo<CR>", "Rust open cargo.toml"},
    ["<leader>rjl"] = { "<cmd>RustLsp joinLines<CR>", "Rust join lines"},
    ["<leader>rcg"] = { "<cmd>RustLsp crateGraph<CR>", "Rust view crate graph"},
    ["<leader>rss"] = { "<cmd>RustLsp ssr<CR>", "Rust structural search and replace"},
    ["<leader>rst"] = { "<cmd>RustLsp syntaxTree<CR>", "Rust view syntax tree"},
    ["<leader>rcc"] = { "<cmd>RustLsp flyCheck<CR>", "Rust run cargo check"},
  },
}
@h0pes h0pes added the bug Something isn't working label Nov 10, 2023
@mrcjkb
Copy link
Owner

mrcjkb commented Nov 10, 2023

Hey 👋

Thanks for reporting this.
I use vim.iter in the code for tab completion, which appears to have been added in Neovim nightly.

I'll look into fixing that 😄

@mrcjkb mrcjkb changed the title Pressing TAB after Rust* command does not provide available options and errors out Command completion broken in Neovim 0.9 Nov 10, 2023
@mrcjkb mrcjkb self-assigned this Nov 10, 2023
@mrcjkb mrcjkb linked a pull request Nov 10, 2023 that will close this issue
@h0pes
Copy link
Author

h0pes commented Nov 11, 2023

Thank you. It works! Much appreciated

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