You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe a dumb question. I am attempting to write a function that, starting from a blank line, will walk nodes above the cursor position to find the nearest type or method declaration and then return that type name:
It seems like this can't work with get_node_at_cursor because it's a blank line, so there's no node. Is there a way to reference nodes relative to a cursor on a blank line?
(As an aside, the use case for returning this is a go method declaration luasnip snippet that auto populates the receiver type with the nearest type or method receiver type above the current line)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Maybe a dumb question. I am attempting to write a function that, starting from a blank line, will walk nodes above the cursor position to find the nearest type or method declaration and then return that type name:
It seems like this can't work with
get_node_at_cursor
because it's a blank line, so there's no node. Is there a way to reference nodes relative to a cursor on a blank line?(As an aside, the use case for returning this is a go method declaration luasnip snippet that auto populates the receiver type with the nearest type or method receiver type above the current line)
Beta Was this translation helpful? Give feedback.
All reactions