ruby_hl_lvar.vim icon indicating copy to clipboard operation
ruby_hl_lvar.vim copied to clipboard

Warning on swapping array elements

Open kaosf opened this issue 10 years ago • 8 comments
trafficstars

Sample file ruby_hl_lvar.vim-error-example.rb:

x = [10, 20]
x[0], x[1] = x[1], x[0]

Warning messages:

"ruby_hl_lvar.vim-error-example.rb" 2L, 37C
WARN: Unsupported ast item in handle_massign_lhs: [:aref_field, [:var_ref, [:@ident, "x", [2, 0]]], [:args_add_block, [[:@int, "0", [2, 2]]], false]]
WARN: Unsupported ast item in handle_massign_lhs: [:aref_field, [:var_ref, [:@ident, "x", [2, 6]]], [:args_add_block, [[:@int, "1", [2, 8]]], false]]

kaosf avatar Jan 13 '15 06:01 kaosf

Thank you for reporting.

Warning is disabled by default at 797c0939bb11441617387de7ca9d1f1a0ee7f27d

todesking avatar Jan 13 '15 15:01 todesking

Open the file at first, and then execute :e to reload (reopen) it... The Vim window CRASHES :fearful:

x = [10, 20]     type  :help sponsor<Enter>    for information
x[0], x[1] = x[1], x[0]
~                type  :q<Enter>               to exit
~                type  :help<En                 or on-line help
~                type  :help version7<Enter>   for version info
~
~
[No Name]                                                          00,001][100%]
"a.rb" 2L, 37CUnsu                                           ref_field, [:var_re
f, [:@ident, "x", [2, 0]]], [:args_add_block, [[:@int, "0", [2, 2]]], false]]
                                                                             Uns
upported ast item                                              f, [:@ident, "x",
 [2, 6]]], [:args_add_block, [[:@int, "1", [2, 8]]], false]]
                                                               upported ast item
 in handle_massig                                               [2, 0]]], [:args
_add_block, [[:@i
                                           Unsupported ast item in handle_massig
n_lhs: [:aref_field, [:var_ref, [:@ident, "x", [2, 6]]], [:args_add_block, [[:@i

kaosf avatar Jan 13 '15 16:01 kaosf

This is my environment: https://gist.github.com/kaosf/5f2fa08a406984d8f3e2

kaosf avatar Jan 13 '15 17:01 kaosf

I made some changes:

  • Disable warnings by default
  • Fix logging method

The problem would fix.

todesking avatar Jan 14 '15 16:01 todesking

I pulled and checked the commit 5780bee798f742c00037bcda3bd0edb5b094dea3 yesterday. When opening that Ruby file first, no warning messages are shown. But execute :e after that, some messages appear.

Now, I found the new commit cb310ba4e104c23dfd72114af1854b4cfc904254.

Sorry, but nothing changed on my Vim :cry:

At first, the configuration of let g:ruby_hl_lvar_show_warnings = 1 makes no changes.

kaosf avatar Jan 14 '15 16:01 kaosf

英語の自信がナッシングすぎるので日本語で補足させてもらうと,最初開いた時は何も出ないんですが後から :e するとやっぱり警告文が表示されてしまいます.

kaosf avatar Jan 14 '15 16:01 kaosf

(;´Д`)

todesking avatar Jan 15 '15 06:01 todesking

(´・ω・`)

kaosf avatar Jan 15 '15 13:01 kaosf