luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
270 stars 20 forks source link

Keywordprg returns not-found #79

Closed Dmusulas closed 7 months ago

Dmusulas commented 7 months ago

I have tried using DevdocsKeywordprg module and have set in my options via vim.opt.keywordprg=":DevdocsKeywordprg". It correctly calls it but it never finds documentation even though I have tested on function such as useState, which entry definitely exists in React docs. Can be verified by opening Devdocs and searching for it. Calling it as a command i.e. DevdocsKeywordprg useState does not return results either.

Furthermore, I am sure LSP is not overwriting it because I get notified by devdocs and my mapping for calling it is:

map("n", "<leader>K", "<cmd>norm! K<cr>", { desc = "Keywordprg" })

Steps to reproduce:

  1. Set keywordprg to ":DevdocsKeywordprg"
  2. Go to any textobject which should have documentation for it
  3. Execute `:DevdocsKeywordprg" on it
  4. ERROR [nvim-devdocs] No documentation found for <textobject>
luckasRanarison commented 7 months ago

If you've tried using it in actual code then it's not yet implemented, see #61. But it should work in the docs preview and you don't have to set the mappings yourself, it will replace K by default.

Dmusulas commented 7 months ago

Thank you for answer @luckasRanarison I saw the issue #61 but I though the limitation is that LSPHover is overriding it. With different keymap this doesn't seem to be a problem. But I guess issue is somewhere else as well. I am closing the issue.

luckasRanarison commented 7 months ago

The tricky part of that is the re-implementation of the K key functionalities. So using the command by itself won't do something useful.