flycheck / flycheck-inline

Display Flycheck errors inline
GNU General Public License v3.0
137 stars 10 forks source link

Doesn't work in CLI Emacs #2

Closed losingkeys closed 6 years ago

losingkeys commented 6 years ago

I see this error when trying to use this tool in emacs -nw:

Flycheck error display error: (wrong-number-of-arguments (1 . 1) 0)

Version info:

Let me know if I can help debug! Works in graphical Emacs, and is very nice :)

cpitclaudel commented 6 years ago

Thanks for the report! Can you M-x toggle-debug-on-error and reproduce the issue? It should give a full stack trace.

losingkeys commented 6 years ago

Yep, for this file:

fn whatever() {

}

I get this error immediately upon opening it (and after M-x toggle-debug-on-error), probably because the cursor lands right on the error when the file is opened:

  flycheck-display-error-messages()
  flycheck-inline-error-messages(([cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "#[warn(dead_code)] on by default" info "dead_code" group] [cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "function is never used: `whatever`" warning "dead_code" group]))
  flycheck-display-errors(([cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "#[warn(dead_code)] on by default" info "dead_code" group] [cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "function is never used: `whatever`" warning "dead_code" group]))
  flycheck-display-error-at-point()
  flycheck-finish-current-syntax-check(([cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "function is never used: `whatever`" warning "dead_code" group] [cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "#[warn(dead_code)] on by default" info "dead_code" group]) "/home/me/")
  flycheck-report-buffer-checker-status([cl-struct-flycheck-syntax-check #<buffer test.rs> rust #<process flycheck-rust> "/home/me/"] finished ([cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "function is never used: `whatever`" warning "dead_code" group] [cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "#[warn(dead_code)] on by default" info "dead_code" group]))
  apply(flycheck-report-buffer-checker-status [cl-struct-flycheck-syntax-check #<buffer test.rs> rust #<process flycheck-rust> "/home/me/"] (finished ([cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "function is never used: `whatever`" warning "dead_code" group] [cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "#[warn(dead_code)] on by default" info "dead_code" group])))
  #[128 "\301\302\300#\207" [[cl-struct-flycheck-syntax-check #<buffer test.rs> rust #<process flycheck-rust> "/home/me/"] apply flycheck-report-buffer-checker-status] 5 "\n\n(fn &rest ARGS)"](finished ([cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "function is never used: `whatever`" warning "dead_code" group] [cl-struct-flycheck-error #<buffer test.rs> rust "/home/me/test.rs" 1 1 "#[warn(dead_code)] on by default" info "dead_code" group]))
  flycheck-finish-checker-process(rust 0 nil "{\"message\":\"function is never used: `whatever`\",\"code\":{\"code\":\"dead_code\",\"explanation\":null},\"level\":\"warning\",\"spans\":[{\"file_name\":\"/home/me/test.rs\",\"byte_start\":0,\"byte_end\":14,\"line_start\":1,\"line_end\":1,\"column_start\":1,\"column_end\":15,\"is_primary\":true,\"text\":[{\"text\":\"fn whatever () {\",\"highlight_start\":1,\"highlight_end\":15}],\"label\":null,\"suggested_replacement\":null,\"suggestion_applicability\":null,\"expansion\":null}],\"children\":[{\"message\":\"#[warn(dead_code)] on by default\",\"code\":null,\"level\":\"note\",\"spans\":[],\"children\":[],\"rendered\":null}],\"rendered\":\"warning: function is never used: `whatever`\\n --> /home/me/test.rs:1:1\\n  |\\n1 | fn whatever () {\\n  | ^^^^^^^^^^^^^^\\n  |\\n  = note: #[warn(dead_code)] on by default\\n\\n\"}\n" #[128 "\301\302\300#\207" [[cl-struct-flycheck-syntax-check #<buffer test.rs> rust #<process flycheck-rust> "/home/me/"] apply flycheck-report-buffer-checker-status] 5 "\n\n(fn &rest ARGS)"] "/home/me/")
  flycheck-handle-signal(#<process flycheck-rust> "finished\n")
fmdkdd commented 6 years ago

Ok I see what's going on. You are using stardiviner/flycheck-inline which is the flycheck-inline on MELPA. This repository is also called flycheck-inline, and isn't on MELPA. It will replace stardiviner/flycheck-inline on MELPA soon, since we've all agreed that they were very similar, and this was a confusing situation. Indeed it is ;)

I'm happy to report that this version of flycheck-inline seems to work fine with emacs -nw. The switch on MELPA should happen soon enough.

fmdkdd commented 6 years ago

MELPA PR : https://github.com/melpa/melpa/pull/5518

losingkeys commented 6 years ago

Sweet! Sorry for the confusing PR, then. Looks like I can just wait until yours is merged, and re-run my (use-package flycheck-inline) config. Thanks again!

fmdkdd commented 6 years ago

MELPA PR has been merged. :tada:

losingkeys commented 6 years ago

Updated, it works! (and there are colors, ooooo). Thanks again!