-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider changing console.debug to console.log #72
Comments
This has been done: c8341fd. |
@CarlosMed hmm, this is a tricky one. JavaScript is not just used in browsers, but in NodeJS and other runtimes too, so I'm cautious about optimising for the browser use case by creating an exception from the usual principle of making DEBUGPRINT stand out, common though it might be. Is that the default behaviour of your browser? |
As far as I know, NodeJS also has a console.log as well as DenoJS and BunJS. On the above with |
@CarlosMed so I've done some testing of
I can't recreate what you are showing in your screenshots. My guess would be (I don't do much browser JavaScript) that you are logging an variable/object with a stacktrace called 'error', in which case it makes sense (I think) that it's expanded. So I'm unclear what issue you're referring to when you say 'way too much info' - from my testing it seems like it's the same level of info whichever console method you use. Can you provide some more specific recreation instructions? Of course, remember you can always override the behaviour in any event in your own config as described here. If you specify an existing filetype, it will override the behaviour for that filetype. |
The above solved my issue. Since it makes it flexible. Thank you! |
OK, thanks. I'm closing this issue since I can't recreate the specific problem you described and it sounds like you've fixed with changes to your own config. Thanks for your contribution! |
For those who followed by I'm changed return {
{
"andrewferrier/debugprint.nvim",
config = function()
require("debugprint").setup({
filetypes = {
["js"] = {
left = 'console.info("',
right = '")',
mid_var = '", ',
right_var = ")",
},
["javascript"] = {
left = 'console.info("',
right = '")',
mid_var = '", ',
right_var = ")",
},
["javascriptreact"] = {
left = 'console.info("',
right = '")',
mid_var = '", ',
right_var = ")",
},
["typescript"] = {
left = 'console.info("',
right = '")',
mid_var = '", ',
right_var = ")",
},
["typescriptreact"] = {
left = 'console.info("',
right = '")',
mid_var = '", ',
right_var = ")",
},
},
})
end,
version = "*",
},
} |
Thanks @tolluset! I'll keep the default will stay at By the way, you can do this a bit more efficiently like this:
|
Oh, and just a heads-up @tolluset - |
This way looks great!! Thanks!!! |
FYI - I'm now starting to track configurations such as this in a showcase. |
https://www.reddit.com/r/neovim/comments/1848aoc/comment/kaw948m/?utm_source=share&utm_medium=web2x&context=3
The text was updated successfully, but these errors were encountered: