Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Checking not working #411

Open
Integralist opened this issue Jun 16, 2020 · 5 comments
Open

Error Checking not working #411

Integralist opened this issue Jun 16, 2020 · 5 comments

Comments

@Integralist
Copy link

  • rust.vim version: the latest version as of today †

† I honestly couldn't find where the version was. I started by looking at the local vim plugin files, then grep'ing those files, then moving on to searching the github repo and nowhere was there a reported version. I looked under GitHub 'releases' for this project, nothing. I even checked the commit tags. You'll tell me where to find it and I'm likely going to kick myself 🙂

I'm using vim-plug:

call plug#begin('~/.vim/plugged')
Plug 'rust-lang/rust.vim'
call plug#end()

let g:rustfmt_autosave = 1
let g:syntastic_rust_checkers = ['cargo']

Steps to reproduce:

I was given a rust file that defined a const. I purposely deleted the const but left the reference to it in the code.

Expected vs. actual behavior:

I expected the vim plugin to display an error, such as "your code references something that no longer is being defined" (I'm new to rust so I would have expected something like that from the rust compiler). But the actual behaviour was that nothing happened.

Debugging Info:

lol :RustInfoToClipboard totally didn't work for me 🤷‍♂️ so I had to manually copy from shell.

rust.vim Global Variables:
let g:ftplugin_rust_source_path = v:null
let g:loaded_syntastic_rust_cargo_checker = v:null
let g:loaded_syntastic_rust_filetype = v:null
let g:loaded_syntastic_rust_rustc_checker = v:null
let g:rust_bang_comment_leader = v:null
let g:rust_cargo_avoid_whole_workspace = v:null
let g:rust_clip_command = v:null
let g:rust_conceal = v:null
let g:rust_conceal_mod_path = v:null
let g:rust_conceal_pub = v:null
let g:rust_fold = v:null
let g:rust_last_args = v:null
let g:rust_last_rustc_args = v:null
let g:rust_original_delimitMate_excluded_regions = v:null
let g:rust_playpen_url = v:null
let g:rust_prev_delimitMate_quotes = v:null
let g:rust_recent_nearest_cargo_tol = v:null
let g:rust_recent_root_cargo_toml = v:null
let g:rust_recommended_style = v:null
let g:rust_set_conceallevel = v:null
let g:rust_set_conceallevel=1 = v:null
let g:rust_set_foldmethod = v:null
let g:rust_set_foldmethod=1 = v:null
let g:rust_shortener_url = v:null
let g:rustc_makeprg_no_percent = v:null
let g:rustc_path = v:null
let g:rustfmt_autosave = 1
let g:rustfmt_autosave_if_config_present = v:null
let g:rustfmt_command = 'rustfmt'
let g:rustfmt_emit_files = 1
let g:rustfmt_fail_silently = 0
let g:rustfmt_options = ''
let g:syntastic_extra_filetypes = ['rust']
let g:syntastic_rust_cargo_fname = v:null
rustfmt 1.4.12-stable (a828ffea 2020-03-11)
rustc 1.43.0 (4fb7144ed 2020-04-20)
cargo 1.43.0 (3532cf738 2020-03-17)

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Jun 12 2020 17:04:06)
macOS version
Included patches: 1-960
Compiled by markmcdonnell@MarkMcdonnell-MBP
Huge version without GUI.  Features included (+) or not (-):
+acl               +clipboard         -dnd               +gettext           +listcmds          -mouse_sysmouse    +postscript        +spell             +textobjects       +wildignore
+arabic            +cmdline_compl     -ebcdic            -hangul_input      +localmap          +mouse_urxvt       +printer           +startuptime       +textprop          +wildmenu
+autocmd           +cmdline_hist      +emacs_tags        +iconv             -lua               +mouse_xterm       +profile           +statusline        +timers            +windows
+autochdir         +cmdline_info      +eval              +insert_expand     +menu              +multi_byte        -python            -sun_workshop      +title             +writebackup
-autoservername    +comments          +ex_extra          +ipv6              +mksession         +multi_lang        +python3           +syntax            -toolbar           -X11
-balloon_eval      +conceal           +extra_search      +job               +modify_fname      -mzscheme          +quickfix          +tag_binary        +user_commands     -xfontset
+balloon_eval_term +cryptv            -farsi             +jumplist          +mouse             +netbeans_intg     +reltime           -tag_old_static    +vartabs           -xim
-browse            +cscope            +file_in_path      +keymap            -mouseshape        +num64             +rightleft         -tag_any_white     +vertsplit         -xpm
++builtin_terms    +cursorbind        +find_in_path      +lambda            +mouse_dec         +packages          +ruby              -tcl               +virtualedit       -xsmp
+byte_offset       +cursorshape       +float             +langmap           -mouse_gpm         +path_extra        +scrollbind        +termguicolors     +visual            -xterm_clipboard
@fifn2
Copy link

fifn2 commented Jun 25, 2020

I'm having the same issue. Do we need to install syntastic?

@quadroli
Copy link

@fifn2 @Integralist i to made the same observation, it was only after installing Syntastic that it started working, and seems as if only Syntatsic alone still won't give you error checking, they both need to be installed

@Integralist
Copy link
Author

Thanks @quadroli I'll give that a try tomorrow

@chris-morgan
Copy link
Member

Yeah, this plugin only includes a Syntastic checker; it doesn’t include Syntastic. We should probably try shifting that checker back over to Syntastic.

Syntastic’s kind of old school now, doing things in old and inferior ways. I wouldn’t recommend Syntastic to anyone any more.

ALE arose as a better alternative, better in many ways, and at least as good in almost all the rest. With the advent of Vim 8 and its improvements in asynchrony, it’s even more solid and superior.

Since then, its lunch has been mostly eaten by coc, which I switched to maybe a year ago.

So yeah, if you don’t have a particular reason to want to use Syntastic, I suggest giving coc plus coc-rust-analyzer a go. Not quite plug and play (make sure to read the coc documentation, there’s stuff you need to add to your vimrc to actually engage coc), but with slight effort, vastly superior to what you can get with Syntastic.

@quadroli
Copy link

quadroli commented Feb 14, 2021

hmmm, @chris-morgan i to do notice significant slow downs when using syntastic with Rust, we talking nearly 2min worth of a wait between saves, gets quite frustating at times to, but i've stuck with it cause i feared swicthing to something like ALE or coc would require more memory and an internet connection, i truly dunno how they work but they both do seem to have server in their name so yeah, that's what kinda throws me off, could you kindly enlighten me

Edit: nvm, i think i got it, switched to ALE and now things are real smooth, no more lagging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants