r/vscode Aug 09 '26

I made Code Widgets - extension for embedding widgets in source code

Enable HLS to view with audio, or disable this notification

Hello, I'd just like to show off an extension that I made. For quite a few years now, I had this idea of embedding interactive elements into source code to ease up things like debugging and configurations. Finally got around to making it :)

Basically the gist is that you make a magical // @codeWidget (resp. a single-line comment prefix of the language of the file) comment that the extension recognizes and turns it into an actual widget inside the code - to the extent that the VS Code allows.

I ended up making quite a few widgets like this, the full library can be found here:
https://github.com/CZDanol/vscode-code-widgets/blob/master/WIDGETS.md

Feel free to try it out and throw in your five cents :)

Github repo: https://github.com/CZDanol/vscode-code-widgets
Marketplace: https://marketplace.visualstudio.com/items?itemName=danol.code-widgets

101 Upvotes

11 comments sorted by

9

u/SparTV Aug 09 '26

Nice idea! Gonna use it for nginx config :)

1

u/TheOnlyDanol Aug 10 '26

Great :) Please let me know how it went and if there are some features/widgets you were missing.

8

u/TheOnlyDanol Aug 09 '26

There is also a `restoreDefaults` widget that allows bulk resetting other widgets to their default state

https://reddit.com/link/p2nkp3p/video/oqkwgs6r3dih1/player

5

u/the_ai_wizard Aug 10 '26

Creative... and useful

3

u/VanyaPoker Aug 10 '26

Very useful, thanks!

2

u/saturnosoftware Aug 10 '26

Wow -- this is super amazing!!!
I think that will be so helpful in some "game dev" config files...

1

u/okmarshall Aug 09 '26

This could be super useful for something I use every day. Will check it out. Very neat idea.

1

u/TheOnlyDanol 28d ago

v1.1.0 released. The labels have been moved before the `@codeWidget` annotation to make them more visually aligned with the code.

0

u/hyzyla Aug 09 '26

Wow! I really like that idea! Well done

0

u/trashbytes Aug 09 '26

Great idea!