rust-doc.vim
rust-doc.vim copied to clipboard
Document directory is not found
Hey, was just testing this plugin but couldn't really wrap my head around the following error after looking up any kind of doc (whether it be std or third party):
rust-doc-open: Document directory is not found
rust-doc: No document is found for 'String'
I have rust-doc installed (it comes bundled with the latest stable toolchain). I tried setting the downloaded_rust_doc_dir, to no avail. Have I done something wrong?
I'm on the latest Rust stable toolchain on the latest Fedora.
I can confirm I have the same error :-(
Also failed to load std-doc; rust stable; fedora
Fix:
autoload/rust_doc.vim::143; swap comparison from !=# to ==#
i.e., in rust_doc#get_doc_dirs() change
if g:rust_doc#downloaded_rust_doc_dir !=# ''
to
if g:rust_doc#downloaded_rust_doc_dir ==# ''
Hi, I has the same error, I fixed it changing a line at rust_doc.vim file in ~/.vim/bundle/rust_doc.vim/autoload/rust_doc.vim . In the function function! rust_doc#get_doc_dirs(hint) abort, I changed the first if (if g:rust-doc#dowloaded_rust_doc_dir !=# '') to ( if g:rust-doc#dowloaded_rust_doc_dir ==# '' ) and now work perfectly.
I think removing if g:rust_doc#downloaded_rust_doc_dir !=# '' completely works better; the function rust_doc#find_std_doc_dir already handles the empty case. The end result is
function! rust_doc#get_doc_dirs(hint) abort
let docs = []
let d = rust_doc#find_std_doc_dir()
if isdirectory(d)
let docs += [d]
endif
silent let project_root = rust_doc#find_rust_project_dir(a:hint)
if project_root ==# ''
return docs
endif
" ...