Skip to content

Deoplete: No suggestions for member fields/methods in Rust with ALE integration after typing a dot  #2593

Closed
@vimpunk

Description

@vimpunk

(originally opened in deoplete repo and was redirected here)

Problems summary

No suggestions are offered for member fields/methods in Rust with ALE integration after typing a dot. Not sure if I misconfigured something or if it's a big.

Expected

When typing e.g. some_variable. I'd expect a list of suggestions for the public methods and/or fields the object has.

Environment Information

  • deoplete version: latest

  • OS: Ubuntu 19.04

  • neovim/Vim :version output:

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 07 2019 11:42:36)
Included patches: 1-320
Modified by team+vim@tracker.debian.org
Compiled by team+vim@tracker.debian.org
Huge version with GTK3 GUI.  Features included (+) or not (-):
+acl               +clipboard         +dnd               +gettext           +localmap          +mouse_urxvt       +profile           +syntax            +user_commands     -xfontset
+arabic            +cmdline_compl     -ebcdic            -hangul_input      +lua               +mouse_xterm       -python            +tag_binary        +vartabs           +xim
+autocmd           +cmdline_hist      +emacs_tags        +iconv             +menu              +multi_byte        +python3           +tag_old_static    +vertsplit         +xpm
+autochdir         +cmdline_info      +eval              +insert_expand     +mksession         +multi_lang        +quickfix          -tag_any_white     +virtualedit       +xsmp_interact
-autoservername    +comments          +ex_extra          +job               +modify_fname      -mzscheme          +reltime           +tcl               +visual            +xterm_clipboard
+balloon_eval      +conceal           +extra_search      +jumplist          +mouse             +netbeans_intg     +rightleft         +termguicolors     +visualextra       -xterm_save
+balloon_eval_term +cryptv            +farsi             +keymap            +mouseshape        +num64             -ruby              +terminal          +viminfo
+browse            +cscope            +file_in_path      +lambda            +mouse_dec         +packages          +scrollbind        +terminfo          +vreplace
++builtin_terms    +cursorbind        +find_in_path      +langmap           +mouse_gpm         +path_extra        +signs             +termresponse      +wildignore
+byte_offset       +cursorshape       +float             +libcall           -mouse_jsbterm     +perl              +smartindent       +textobjects       +wildmenu
+channel           +dialog_con_gui    +folding           +linebreak         +mouse_netterm     +persistent_undo   +startuptime       +timers            +windows
+cindent           +diff              -footer            +lispindent        +mouse_sgr         +postscript        +statusline        +title             +writebackup
+clientserver      +digraphs          +fork()            +listcmds          -mouse_sysmouse    +printer           -sun_workshop      +toolbar           +X11

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)

Unfortunately the below didn't seem to work, as in my own vimrc basic completion works except for the member completion, but with the below not even that worked. Including anyway for completeness:

set nocompatible
set hidden

call plug#begin('~/.vim/bundle')

Plug 'w0rp/ale'
if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
endif

call plug#end()

let g:ale_completion_enabled = 0 " turn off native completion in favor of deoplete
let g:ale_rust_rls_toolchain = 'stable'
let g:ale_linters = {
    \ 'rust': ['rls'],
    \ }
let g:ale_fixers = {
    \ '*': ['remove_trailing_lines', 'trim_whitespace'],
    \ 'rust': ['rustfmt'],
    \ }
let g:ale_fix_on_save = 1

let g:deoplete#enable_at_startup = 1
" use ALE for completion sources for all code
call deoplete#custom#option('sources', {
\ '_': ['ale'],
\})

Reproduction

  1. install rust and rls
  2. create a rust crate with cargo new --bin deopleterepro
  3. cd deopleterepro
  4. write this in src/main.rs:
struct Example {
    a: i32,
    b: i32,
}

fn main() {
    println!("Hello, world!");

    let e = Example { a: 1, b: 2 };
}
  1. vim src/* -u <vimrc path>
  2. after let e = ... type: e. and wait for completion. None are given.

:ALEInfo


 Current Filetype: rust
Available Linters: ['cargo', 'rls', 'rustc']
  Enabled Linters: ['rls']
 Suggested Fixers: 
  'remove_trailing_lines' - Remove all blank lines at the end of a file.
  'rustfmt' - Fix Rust files with Rustfmt.
  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
 Linter Variables:

let g:ale_rust_rls_config = {}
let g:ale_rust_rls_executable = 'rls'
let g:ale_rust_rls_toolchain = 'stable'
 Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 100
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = 50
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 1
let g:ale_fixers = {'*': ['remove_trailing_lines', 'trim_whitespace'], 'rust': ['rustfmt']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'rust': ['rls']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
  Command History:

(executable check - success) rls
(started) ['/usr/bin/zsh', '-c', '''rls'' +''stable''']

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions