vim-hdevtools icon indicating copy to clipboard operation
vim-hdevtools copied to clipboard

Implement "insert type definition of outer function under cursor".

Open annaluiseblume opened this issue 6 years ago • 3 comments

This adds a function hdevtools#insert_type() which inserts the type definition of the outer function under the cursor. The definition is inserted right above the definition of the function.

The functions first gets the number of the first line of the outer function via the last line of output of hdevtools type <file> <line of cursor> <column of cursor>

This line number is then used to find the identifier of the function. The type is then determined via hdevtools info <file> <identifier>

annaluiseblume avatar May 10 '19 03:05 annaluiseblume

Thanks, it might take me a while to look over this. If I don't reply here again withing a few weeks then please feel free to remind me about this by commenting/pinging me here

bitc avatar May 11 '19 19:05 bitc

That's a cool feature. Pinging you as suggested @bitc :)

freuk avatar Jul 18 '19 19:07 freuk

@annaluiseblume I'm testing that branch and having issues. It uses build_command_bare, which ignores my hdevtools_options. If I change that call, I get an error that seems to pertain to an empty list, where l:type_lines[0] results in a `list index out of range:0. I'll leave it at that - sorry not to dig further, I don't know vimscript.

freuk avatar Jul 18 '19 20:07 freuk