Skip to content

[FR] print Lua variable names when function is assigned to a variable #73

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

Closed
andrewcrook opened this issue Apr 14, 2024 · 3 comments · Fixed by #74
Closed

[FR] print Lua variable names when function is assigned to a variable #73

andrewcrook opened this issue Apr 14, 2024 · 3 comments · Fixed by #74
Labels
feature request A requested feature or option good first issue Good for newcomers

Comments

@andrewcrook
Copy link

andrewcrook commented Apr 14, 2024

I was just testing this plugin to see if I will add it to my new configuration.

If I do the following in Lua an anonymous function assigned to a variable.

{ 'andersevenrud/nvim_context_vt'
     config = function()
         -- do something
     endfunction
},

The plugin works by showing the closing function.
However, it would be useful to show the variable name that the function is assigned to.
Something like ...

endconfig => function

of course, this is probably the same for other language support.

@andrewcrook andrewcrook changed the title [FR] print Lua function names when assign to a variable [FR] print Lua varible names when function is assigned to a variable Apr 14, 2024
@andrewcrook andrewcrook changed the title [FR] print Lua varible names when function is assigned to a variable [FR] print Lua variable names when function is assigned to a variable Apr 14, 2024
@andersevenrud
Copy link
Owner

andersevenrud commented Apr 14, 2024

However, it would be useful to show the varible name that the function is assigned to.

I'll look into it. Not sure about adding something like this as builtin because the nodes varies between languages etc., but adding some examples on how to do this via custom callbacks in the configuration would be useful!

@andersevenrud andersevenrud added good first issue Good for newcomers feature request A requested feature or option labels Apr 14, 2024
@andrewcrook
Copy link
Author

being able to do this via custom callback (i.e completely optional) for individual languages would be great.

andersevenrud added a commit that referenced this issue Apr 18, 2024
Shows assignments and context inside tables, etc.

Closes #73
andersevenrud added a commit that referenced this issue Apr 18, 2024
Shows assignments and context inside tables, etc.

Closes #73
@andersevenrud
Copy link
Owner

Turns out there was a much simpler solution to this. Just update and it should be working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A requested feature or option good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants