bmalehorn / vscode-print-it Goto Github PK
View Code? Open in Web Editor NEWWrap a print statment around current word or selection
Wrap a print statment around current word or selection
Hi, there.
In my code i use a lot of multiline functions and classes.
for example:
my_class.some_action(
msg="...",
meta="...",
id="...",
response="...",
raw="...",
comment="..."
)
If I select with a mouse "my_class" and press hot keys combination, PrintIt places print statement to the next line - right inside parenthesis. See example below.
my_class.some_action(
print(f"{my_class=}")
msg="...",
meta="...",
id="...",
response="...",
raw="...",
comment="..."
)
This action breaks my code. I have to move print statement 8 lines down with Cut & Paste or with Vs Code hotkeys.
Not sure If it's possible. But it would be great if PrintIt can analyze nearest code and place print statement after multiline blocks, not inside them.
Hi there.
Thanx for great extension for VS Code.
The best practice of printing statements in python is using f-strings.
This is the most convenient way.
Example:
my_var = "test"
print(f"{my_var=}")
The output of this example is:
my_var='test'
So I would like to make a template for python with f-string.
If my PrintIt templeate is
print(f"{{{raw=}}})
the output for my_var is:
print(f"})
Please fix "PrintIt" so we could create templates with { } inside {{ }}.
Would like to use the icecream package the way your extension does. Essentially instead of wrapping in a print statement, it would wrap in an ic statement.
Keep in mind user would have to use
from icecream import ic
See the following page for details on the package
https://github.com/gruns/icecream
I've looked at the code and it looks like you're using micromustache package. I've come up with the following, but it won't print the desired output:
"print-it.python.template": "print(f'{{escaped}}: \u007B{{raw}}\u007D')",
desired output:
print(f'var: {var}')
actual output:
print(var: }')
The following works, but that requires a space between curly braces:
"print-it.python.template": "print(f'{{escaped}}: { {{raw}} }')",
actual output:
print(f'var: { var }')
How do I escape the curly brace wrapping the double curly braces?
It's not an issue, a request.
Is it possible to add a colon ":" after text? So, it will seem like this;
console.log('x :', x)
And for the people who used to without colon, it can be an option or a parameter got from the user because some people would want;
console.log('x =, x)
hey i was work whit c
and it dont work very wile
can it have a “other” mod
any Language not in it ,can manul it in "other opthion "
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.