Repository navigation
A VS Code extension that shows bun run and bun test output on the line that logged it #47835
lagudafuadtosin
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi Bun folks. This is Inline Logs, a free VS Code extension I made that works with Bun.
The way it hooks in: VS Code's terminal gets a
BUN_OPTIONSvalue with--preloadpointing at a small script, written in a form every bun command accepts. Sobun runandbun testpick it up with nothing added to your project. The script wrapsconsole, Bun'shttpandhttpscalls and the built-inWebSocket, and sends each entry to the extension on 127.0.0.1. The extension puts the value at the end of the source line that made it.With
bun test, a log inside a test lands on that test's line, so you can see what a failing test printed without scrolling the terminal. Bun's stack frames for top-level code have no column, and those map to the right line too. Programs built withbun build --compileare left alone, so a compiled CLI you run in the same terminal does not report into your editor.GPL, no account, no paid tier, and everything stays on your machine.
Marketplace: https://marketplace.visualstudio.com/items?itemName=lagudafuadtosin.inline-logs
Code: https://github.com/lagudafuadtosin/inline-logs
I would love to hear from anyone running it on a bigger Bun project, especially if something lands on the wrong line.

All reactions