rust-doc.vim icon indicating copy to clipboard operation
rust-doc.vim copied to clipboard

Document directory is not found

Open vimpunk opened this issue 6 years ago • 4 comments
trafficstars

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.

vimpunk avatar Mar 16 '19 17:03 vimpunk

I can confirm I have the same error :-(

dirvine avatar Mar 28 '19 01:03 dirvine

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 ==# ''

vimgodfrey avatar Nov 16 '19 16:11 vimgodfrey

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.

hsequeda avatar Mar 02 '20 14:03 hsequeda

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

" ...

benknoble avatar Jul 30 '20 18:07 benknoble