is it possible to make a python snippet that transforms code like i explain in my example?
"Hello world".print
- hit tab transforms it into
print("Hello world")
it will be nice if automatically understand is it string or expression so if i make a variable for example "a" and i write ".print" at the end and hit tab it will not add " " or ' ' so in that way it will not convert it in something else.
a = 10
a.print - hitting tab
transforms it into:
print(a)
not into:
print("a")
Progress ( if it can be say as that way )
so
TM_CURRENT_LINE
is not working correctly ( may be ).
So "${TM_CURRENT_LINE/[0-9a-z.]//g}" it sopose to remove every number, lowercase character and "." from the line. This little piece of regex code (snippet) works but not really.
When i write
mytext.py - hit tab/enter
it remove everything that is between the prefix point
Code snippet that is used in the picture.
"Print to console - test": {
"scope": "python",
"prefix": ".print",
"body": [
"${TM_CURRENT_LINE/[0-9a-z.]//g}"
],
"description": "Log output to console"
}
Do im wrong or this spouse to delete everything in that line?