luckasRanarison / nvim-devdocs

Neovim DevDocs integration
MIT License
270 stars 20 forks source link

Cannot install cpp documentation #71

Open nitnelave opened 10 months ago

nitnelave commented 10 months ago

Running :DevdocsInstall cpp gives me:

[nvim-devdocs] Plugin initialized
[nvim-devdocs] Installing required docs
[nvim-devdocs] cpp docs is too large (41709474)
[nvim-devdocs] Fetching cpp documentation entries...
[nvim-devdocs] Downloading cpp documentation...
Error executing vim.schedule lua callback: Vim:E474: Expected string end: {"index":"<h1>C++ Programming Language</h1>                 <p>The interface of C++ standard library is defined by the following collection of headers.</p>\n<table class=\"t-dsc-begin\"> <tr> <td colspan=\"2\">  <h3 id=\"Concepts_library\"> Concepts library</h3> </td>\n</tr> <tr class=\"t-dsc\"> <td> <div><a href=\"header/concepts\" title=\"cpp/header/concepts\"> <span class=\"t-lines\"><span>&lt;concepts&gt;</span></span></a></div>\n<div><span class=\"t-lines\"><span><span class=\"t-mark-rev t-since-cxx20\">(C++20)</span></span></span></div> </td> <td> <a href=\"concepts\" title=\"cpp/concepts\">Fundamental library concepts</a> </td>\n</tr> <tr> <td colspan=\"2\"> <h3 id=\"Coroutines_library\"> Coroutines library</h3> </td>\n</tr> <tr class=\"t-dsc\"> <td> <div><a href=\"header/coroutine\" title=\"cpp/header/coroutine\"> <span class=\"t-lines\"><span>&lt;coroutine&gt;</span></span></a></div>\n<div><span class=\"t-lines\"><span><span class=\"t-mark-rev t-since-cxx20\">(C++20)</span>
stack traceback:
    [C]: in function 'json_decode'
    ...e/nvim/lazy/nvim-devdocs/lua/nvim-devdocs/operations.lua:72: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

neovim version: 0.9.2 nvim-devdocs just installed from git.

nitnelave commented 10 months ago

(also, the "ensure_installed" config key doesn't seem to do anything. Nothing gets installed at startup, and :checkhealth says WARNING {nvim-devdocs}: unknown key <ensure_installed>)

nitnelave commented 10 months ago

The error seems to imply that a string in the returned JSON is not closed by the time we reached the end. Maybe the output is truncated? What does "cpp docs is too large" imply?

luckasRanarison commented 10 months ago

It looks like it's an issue with curl, as you said the output was truncated resulting in an invalid JSON. "large docs" exceed 10Mb but some docs are really big, according to the devdocs website CPP docs is about 41Mb. curl probably failed to download. I haven't configured a checkhealth though, and I can't reproduce it.

nitnelave commented 9 months ago

Yeah, after some investigation, it only happens on my company's network. I pulled it at home, packed the devdocs folder into an archive and sent it to my work computer to unpack there. It's not great, but it's a workaround.

I'll leave it to you whether to close the bug or not, given that I can't give you a reproduction.