Skip to content

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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

annaluiseblume
Copy link

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 annaluiseblume mentioned this pull request May 10, 2019
@bitc
Copy link
Owner

bitc commented May 11, 2019

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

@annaluiseblume annaluiseblume force-pushed the master branch 2 times, most recently from 4c555f9 to 6b169ba Compare May 15, 2019 15:25
Implement the function hdevtools#insert_type() which inserts the type
signature of the top level variable or operator at the cursor. The type
signature is inserted right above the definition of top level variable
or operator.
@freuk
Copy link

freuk commented Jul 18, 2019

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

@freuk
Copy link

freuk commented Jul 18, 2019

@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.

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

Successfully merging this pull request may close these issues.

3 participants