napthedev / console-flash Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://marketplace.visualstudio.com/items?itemName=NAPTheDevHcj.console-flash
Home Page: https://marketplace.visualstudio.com/items?itemName=NAPTheDevHcj.console-flash
An option to include pretext. As I have cycled through the many console.log extensions all seem eventually support extension options for things like {label}, {filename}, {fullpath}, {line}, surrounding {function} or {class}. I think it would be better to build them into he pretext rather than hardcoding as individual options.
Example: pretext set to
📢 [{filename}:{line}] {function}() -> {label}:
becomes
📢 [index.js:12]: handleSubmit() -> index: 12);
This illustrates what I am suggesting, look in console.
CodeSandbox
In addition to single and double quotes, support options of using backticks.
Would require a breaking change of setttings
from
console-flash.double-quotes
with boolean true/false
to something like
console-flash.quotes
with options ', " , `
Other console.log extensions support multiple cursors like...
let var1
= 10;
// ...lots of code
let var2
= 20;
black is 2 multiple cursor selections of variables should give
let var1 = 10;
console.log("var1", var1);
// ... lots of code
let var2 = 20;
console.log("var2", var2);
current console flash behavior is
let var1 = 10;
// lots of code
let var2 = 20;
console.log("var2", var2);
Although addition of this is an idea. I would propose a slightly different implementation. If you think about it it you don't often want to know the value of var1 high in the code, but rather at a certain point in your code you want to know var1 and var2. Think about this...
let var1
= 10;
// ...lots of code
let var2
= 20;
black is 2 multiple cursor selections of variables and the proposed should give
let var1 = 10;
// ... lots of code
let var2 = 20;
console.log("var1, var2", 10, 20);
The console log would be inserted at the line after the last selection, and now the console log allows you to see each of those values easily at a specific point in your code. This seem much more useful to me.
Think about triggering multiple cursors (⌥ down), and clicking every variable you want, then trigger ⌘ ⇧ L and you get the goods!
This illustrates what I am suggesting, look in console.
Identify if there is surrounding text such as
let a
= 50;
cursor is at black selection, and in this case there is left text (let
) as well as right text ( = 50;
) so do not reposition cursor at end...keep on coding
on the other hand if we have
my var
and cursor is the black selection, there is no non-whitespace text to the left or right and this line is going to be replaced with the console log anyways, so position the cursor at the end of insertion like
console.log("my var", myvar
);
with the black selection
also apply this for empty lines
becomes
console.log(
);
with the black selection
This illustrates what I am suggesting, look in console.
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.