todesking / ruby_hl_lvar.vim

Highlight Ruby local variables
MIT License
53 stars 10 forks source link

Warning on swapping array elements #4

Open kaosf opened 9 years ago

kaosf commented 9 years ago

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]]
todesking commented 9 years ago

Thank you for reporting.

Warning is disabled by default at 797c0939bb11441617387de7ca9d1f1a0ee7f27d

kaosf commented 9 years ago

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 commented 9 years ago

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

todesking commented 9 years ago

I made some changes:

The problem would fix.

kaosf commented 9 years ago

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 commented 9 years ago

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

todesking commented 9 years ago

(;´Д`)

kaosf commented 9 years ago

(´・ω・`)