I'd love to have a command that can put the current symbol on the clipboard, and this would be short-work if the current symbol where available via a TM_* variable, but I'm not seeing it.
My particular use case is Python and I'd like to be able to easily construct "<module>.<class>.<method>" or "<class>.<method>".
I see no way of getting this information, short of writing a python- specific parser to grab it (using TM_LINE_NUMBER to figure out where the cursor is). Am I missing something?
j.
On 16. May 2007, at 20:28, Jay Soffian wrote:
I'd love to have a command that can put the current symbol on the clipboard, and this would be short-work if the current symbol where available via a TM_* variable, but I'm not seeing it.
My particular use case is Python and I'd like to be able to easily construct "<module>.<class>.<method>" or "<class>.<method>".
So you would need more than just the symbol, thus you would need to grep the document (from stdin) anyway?
I see no way of getting this information, short of writing a python- specific parser to grab it (using TM_LINE_NUMBER to figure out where the cursor is). Am I missing something?
It is not available.
On May 17, 2007, at 7:41 AM, Allan Odgaard wrote:
So you would need more than just the symbol, thus you would need to grep the document (from stdin) anyway?
Well, I was thinking that TM_CURRENT_SYMBOL could be either a . or / separated path to the current symbol, where TextMate could use indentation in the current symbol to determine its nesting. Obviously for this to work properly requires a sane symbolTransformation. Perhaps even a separate transformation list is appropriate to allow bundle designers control over what TM_CURRENT_SYMBOL is set to.
Anyway, I've attached the two commands I setup for Python. I find them highly useful in any case. :-)
j.
On 17. May 2007, at 17:09, Jay Soffian wrote:
On May 17, 2007, at 7:41 AM, Allan Odgaard wrote:
So you would need more than just the symbol, thus you would need to grep the document (from stdin) anyway?
Well, I was thinking that TM_CURRENT_SYMBOL could be either a . or / separated path to the current symbol, where TextMate could use indentation in the current symbol to determine its nesting. Obviously for this to work properly requires a sane symbolTransformation. Perhaps even a separate transformation list is appropriate to allow bundle designers control over what TM_CURRENT_SYMBOL is set to.
Yeah, this won’t really work ;)
But there will be something else (in 2.0) that could be used to gather this bread crumb trail for use in commands.