Skip to content
Thomas Legris edited this page Oct 31, 2018 · 9 revisions

RLS is in the alpha stage of development. It may not work as expected in some cases.

Installing server

rustup update
rustup component add rls-preview rust-analysis rust-src

Follow instructions at https://github.com/rust-lang-nursery/rls#setup in order to install and setup rust language server.

Registering in .vimrc

This code requires neovim v0.2.0+; in earlier versions, it will cause a syntax error.

if executable('rls')
    au User lsp_setup call lsp#register_server({
        \ 'name': 'rls',
        \ 'cmd': {server_info->['rustup', 'run', 'nightly', 'rls']},
        \ 'root_uri':{server_info->lsp#utils#path_to_uri(lsp#utils#find_nearest_parent_file_directory(lsp#utils#get_buffer_path(), 'Cargo.toml'))},
        \ 'whitelist': ['rust'],
        \ })
endif

Clone this wiki locally