elijah-potter / harper

The Grammar Checker for Developers
https://writewithharper.com
Apache License 2.0
743 stars 22 forks source link

Error in nvim when choosing adding to dictionary action #134

Open PSeitz opened 1 week ago

PSeitz commented 1 week ago

I get this error when I choose: Add "tantivy" to the global dictionary. or Add "tantivy" to the file dictionary.

E5108: Error executing lua: ...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:30: attempt to call field 'execute_command' (a nil value)
stack traceback:

        ...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:30: in function 'apply_action'
        ...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:59: in function 'on_user_choice'
        ...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:98: in function <...aceanvim/lua/rustaceanvim/commands/code_action_group.lua:88>

spell

Choosing Replace with: “tastily” works.

elijah-potter commented 1 week ago

This doesn't appear to be an issue with Harper, rather an issue with rustaceanvim. I would give it an update. If that doesn't work, let me know and I'll dive a bit deeper for you.

PSeitz commented 1 week ago

Thanks! Yes updating was the first thing I tried.

This is the failing function. Maybe I should open an issue there?

function M.apply_action(action, client, ctx)
  if action.edit then
    vim.lsp.util.apply_workspace_edit(action.edit, client.offset_encoding)
  end
  if action.command then
    local command = type(action.command) == 'table' and action.command or action
    local fn = vim.lsp.commands[command.command]
    if fn then
      fn(command, ctx)
    else
      M.execute_command(command) // This fails, code_action_group.lua:30
    end
  end
end
elijah-potter commented 6 days ago

I would open an issue over on their repository, if you haven't already. Link it here if you do.