-
Notifications
You must be signed in to change notification settings - Fork 23
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
Pre-populate variable name prompt with word under cursor if no variable can be found through treesitter #59
Comments
@nobleach absolutely! In that particular case, one way that should work right now would be to use visual mode. Sitting on Alternatively, you could use operator-pending mode: However, I think your case is good, because Typescript is a commonly-used language, and we probably should pick up that word as a variable anyway. Let me keep this issue open and adopt it for that case. |
There's also another interesting idea here, which is that it would be good if the prompt for variable name was pre-populated with whatever's under the cursor (when debugprint cannot automatically detect it as a variable from Treesitter, which is what's happening today). So in fact I'll use this issue for that idea, and open another one for the Typescript-specific issue... |
I think both are great ideas! A couple of years ago, I had written my own "smart console.log" in Lua just to take whatever was under the cursor and print this: |
@nobleach yep, all fair points :) So I'll try and address both of these ideas and that should fix the problem for Typescript out-of-the-box, and give a better fallback for languages where Treesitter support doesn't exist yet. |
Hey that's really cool. I know open source can seem thankless at times, so thank you for the work you're doing on this project! |
That's honestly the quickest turnaround I've ever seen. Thank you so very much for looking at it. I works great. |
No worries, you're welcome :) |
Often I want to log something I am certain is a variable. For example, in Typescript:
If I try to log either of those variables, I'm asked to enter a variable name. That's frustrating as I have to type it out. It defeats the purpose of having a quick keyboard shortcut.
If I select the word in visual mode, I can log it. But still, that's annoying.
Is there a way to say, "trust me, I KNOW this word is a variable, treat it as such"?
The text was updated successfully, but these errors were encountered: