a.k.a. pseudometa
- Research Associate in sociology, studying the social mechanisms underlying the digital economy
- Developer of various plugins for Obsidian, Neovim, and Alfred
Speed up log creation. Create various kinds of language-specific log statements, such as logs of variables, assertions, or time-measuring.
License: MIT License
I use prettier
to format my code so when a log line is too long it will spread it across multiple lines.
Then when I try to remove the lines with removeLogs
it only removes the first line of the log.
Example:
console.log("[🪲 dlvhdr] beep 🔵 will return", {
data: [
{
id: `cluster-${services[0].k8sClusterName}`,
name: services[0].k8sClusterName ?? "",
kind: WorkspaceKind.Cluster,
value: {
clusterName: services[0].k8sClusterName ?? "",
},
},
],
});
No response
removeLogs
only removes the first line.0.10.0
Neovim has a great feature called marks, which essentially act like "bookmarks" for lines. Once you mark a line, you can quickly jump to the mark in one motion.
If chainsaw marked every log line, it would make operations such as deletion easier on these lines. This could help prevent unintentionally deleting actual code which for whatsoever reason includes your marker substring.
Markers behave pretty logically most of the time, the mark moves with the text (if you were to prepend some lines of text before the log line for example), and the mark also gets deleted if you were to delete the line of text using dd
. However, I did find one edge case, if i marked a line and then deleted it by going into insert and backspacing away the whole line, the mark shifts onto the line of code below it, ending up marking the wrong line.
I'm personally not super well versed with marks and the nvim lua api, so I'm not too sure how exactly to avoid such edgecases, but if implemented correctly marks have the potential to make bulk operations on log lines more efficient and robust.
No response
Thank you for this useful plugin!
When removing beep logs manually the counter is not reset before removeLogs()
is called.
edit: same bug applicable to timeLog
No response
example.ts
dd
0.9.5
The timeLogs()
function is not aware of manual entry removal, so it follows the creation loop unconditionally
No response
0.9.5
When I call require('chainsaw').messageLog()
, this traceback pops:
.../nvim-data/lazy/nvim-chainsaw/lua/chainsaw/init.lua:31: attempt to call field 'normal' (a nil value)
stack traceback:
.../nvim-data/lazy/nvim-chainsaw/lua/chainsaw/init.lua:31: in function 'messageLog'
utils.normal
is a local function, see below:
nvim-chainsaw/lua/chainsaw/init.lua
Line 31 in 1932aae
nvim-chainsaw/lua/chainsaw/utils.lua
Line 4 in 1932aae
No response
require("chainsaw").messageLog()
NVIM v0.10.0-dev-1988+g1ef60ea65
Hey @chrisgrieser wasn't sure of another way to get hold of you outside a GitHub issue, apologies for doing it this way. Feel free to connect with me on email at [email protected] (based on my GitHub handle) if you like.
Anyway, I'm the maintainer of https://github.com/andrewferrier/debugprint.nvim, just thought you might be interested in this since there's some similarity with what you're doing with nvim-chainsaw
. I guess we came to some of the same ideas independently which is great, just thought you might like to know about it in case there's any ideas you want to adapt or combine efforts in some way. Totally up to you...
By the way, I use both your gx.nvim
and nvim-various-textobjs
in my own dotfiles, thanks so much for maintaining these!
No response
x
x
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.