Git Product home page Git Product logo

vscode-print-it's Introduction

VSCode Print It

version number install count

Add print statements in one keystroke!

โŒฅ [, Alt [: wrap print statement

Demo

demo

Supported Languages

language example
JavaScript console.log("variable", variable);
TypeScript console.log("variable", variable);
React console.log("variable", variable);
Vue console.log("variable", variable);
HTML console.log("variable", variable);
Python print("variable", variable)
Go fmt.Printf("variable %#v\n", variable)
Ruby pp('variable', variable)
Java System.out.format("variable %s\n", variable);
PHP echo "\$variable "; print_r($variable); echo "\n";
C# Console.WriteLine("variable {0}", variable);
C++ std::cout << "variable " << variable << std::endl;
Rust println!(\"variable {:?}\", raw);
Dart print("variable = ${variable}");
Kotlin System.out.format("variable %s\n", variable)
Elixir IO.puts "variable " <> inspect(variable)
Bash echo "variable $variable"
Fish echo "variable $variable"

Templating

Want to change the default formatting? Set the configuration option print-it.[language].template:

  "print-it.javascriptreact.template": "console.log(\"The value of {{escaped}} is:\", {{raw}});"

This will make new print statements look like this:

console.log("The value of variable is:", variable);

A full list of supported options is available under the "Contributions" tab.

The following variables are available:

variable example exaplanation
{{raw}} "hello " + name the current selection, or current word
{{escaped}} \"hello \" + name raw, but escaped for use in a string

For all other languages, you can set the value of print-it.default.template:

  "print-it.default.template": "printf(\"{{escaped}} %s\\n\", {{raw}});"

Related Projects

vscode-print-it's People

Contributors

bmalehorn avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.