DEV Community

Cover image for Speed up your development with this new VS Code extension

Speed up your development with this new VS Code extension

Alex Barashkov on June 19, 2020

My friend and I recently developed VS Code extension – Snipsnap that aims to solve the existing problem with code snippets collections. Snipsnap i...
Collapse
 
jwp profile image
John Peters

This json based design is excellent! Nothing but goodness on this one! Any plans for Angular?

Collapse
 
alex_barashkov profile image
Alex Barashkov

Hi John, we would like to add Angular and there are available snippets already in other extensions that we can take as a basis, however, we're looking for someone with Angular experience who will be able to review them and adjust if necessary.
If you can help us with that it would be great.

Collapse
 
jwp profile image
John Peters

I'll take a look.

Thread Thread
 
alex_barashkov profile image
Alex Barashkov

We added Angular snippets yesterday, please try and let us know what do you think!

Collapse
 
brpaz profile image
Bruno Paz

It looks a really nice project! Congrats.

I like the idea of introspecting the package.json and similar files to only provide suggestions for installed packages.
It´s a very common problem for me to have too many snippet suggestions because they aren´t tailored to that particular project or file type.

Different snippets extensions follow different rules and use unpredictable shortcuts such as "rccp", "ecrp", 'impp' etc.

100 times this! I don´t understand how people can name snippets like that. ;)
This has stopped me from using many external snippets and always aim to build my own library, which is good as it will only contain what I need but also requires more maintenance.

My naming approach is very similar to yours, which is great. ;)

I also support the vision of a standard snippets format that can be reused between Editors.
I have the idea of building a small tool to convert snippets between Jetbrains and VSCode format which are the main Editors I use. It´s somewhere in my side projects backlog. ;)

Looking forward to have more snippets for more languages like Go.

Collapse
 
alex_barashkov profile image
Alex Barashkov

Glad that you liked it. Having converters and extensions are in our plans so if you decide to start that backlog project, welcome to join our snipsnap team. 😁

Collapse
 
fasani profile image
Michael Fasani

I’ll give it a try, 20 years of programming and I have never really had success in this topic. Finally I am using Alfred which is nice as it works across all windows, iTerm, Code etc. But this looks very interesting!

Collapse
 
bkis profile image
bkis

This looks very interesting and I'd like to try it. I am using VSCodium (a FOSS release of VSCode), which uses open-vsx.org as an extension gallery. Would you mind publishing your extension there, too? VSCodium is gaining popularity, so you'd reach some more people, too.

Collapse
 
alex_barashkov profile image
Alex Barashkov • Edited

Thank you! I've never heard about this, so I will have to read how to publish extensions there. I did not find clear documentation about this from the first glance.
We definitely don't mind to publish it there too, just need to understand how :)

Collapse
 
thenaman047 profile image
TheNaman047

Looks really useful and am definitely gonna try it out.

Also, Can you suggest me a good source to develop such an extension myself. Vs code docs are very confusing to me as I am unable to understand how it works exactly and which extension type I should take to make my extension.

Collapse
 
voiedev profile image
Charles Allen

Prob #1 - you will not install extensions for each small library
Prob #2 - different snippets extensions use unpredictable shortcuts

Check, check! This is exactly why I rarely adopt snippets. Downloading now :)

Collapse
 
sandordargo profile image
Sandor Dargo

Only if this could be integrated with Stackoverflow! :D

Collapse
 
alex_barashkov profile image
Alex Barashkov

Hopefully one day 😁 I wonder about the same.

Collapse
 
mskog profile image
Magnus Skog

This looks great! I'm going to give it a try for sure

Collapse
 
razzeee profile image
Razzeee

I'm quiet confused by this. While I think streamlining how you make snippets searchable is useful, I'm not convinced, that we need to write code for that. I think a smart documented practice would be a great way to get to a standard.
In general, each and every language server should include all the snippets you need for that language/framework that the language server is targeting.

Having standardized collection could allow us to write extensions and converters for all popular IDE's

You actually don't need to do that, as that's exactly what the language server does and it can offer snippets too. microsoft.github.io/language-serve...

Collapse
 
tannerhallman profile image
Tanner Hallman • Edited

This is great, but it's fairly hard to see what shortcut you're about to apply due to the width of my command palette on vscode... I did some research but couldn't find an easy way to make the palette wider... anyone else find a solution for this?

My image

Collapse
 
adriatic profile image
Nikolaj Ivancic • Edited

I find this idea very appealing and if it gets done right, it would be a perfect tool for nearly all developers doing the prototyping work. Even more important (in my opinion) is its use in the technical documentation - see the (much less elegant) solution that I did with a couple of great guys, allowing the members of the Aurelia (aurelia.io/) community to prototype their aurelia apps by running their KendoUI (telerik.com/kendo-ui) elements similarly to your snip-snap (and no, I do not like this name, it seems too cheap for such great idea:

Example: aurelia-ui-toolkits.github.io/demo... results with:

Collapse
 
jeferson_sb profile image
Jeferson Brito

Man I loved it!
"Different snippets extensions follow different rules and use unpredictable shortcuts such as "rccp", "ecrp", 'impp' etc." - Totally true.
take for example some extentions like ES7 React/Redux/whatever.. what the hell is "imbrnl"?
Snipsnap looks great

Collapse
 
neatwolf profile image
Alessandro Salvati • Edited

I would so love to get this to use with Rider / C# Unity!
Any plans for a port?

Collapse
 
alex_barashkov profile image
Alex Barashkov

Currently extension focused on languages with package managers where we can tell clearly what snippets will you need for development, however nothing is stopping us in the future to extend languages support for c# as well.

Collapse
 
x8core profile image
x8core • Edited

Vs code is shit

Collapse
 
offendingcommit profile image
Jonathan Irvin

Can this work offline or behind a firewall?

Collapse
 
alex_barashkov profile image
Alex Barashkov

You basically just need to fetch snippets once, after that you could even commit them to the repository. After first project opening it will load snippets to .vscode/snipsnap.code-snippets
You can read more in readme.

Since it also fully open source project you can run even your own snippets server under your private network.

Collapse
 
ddaypunk profile image
Andy Delso

Loving this idea and plan to try it out with the React based UI Testing site I am putting together to use my Selenium Framework on!

Collapse
 
srinivaassunil profile image
sunil

Nice extension. Very handy.

Collapse
 
mohammedha profile image
Mo

This looks awesome, any plans for PowerShell

Collapse
 
mjcoder profile image
Mohammad Javed

Woah! This looks awesome.

Collapse
 
bernardbaker profile image
Bernard Baker

I'll install Snipsnap and give feedback here.

Collapse
 
theketan2 profile image
Ketan Ramteke

Promising. Will definitely use it 🙏

Collapse
 
enbonnet profile image
Ender Bonnet

Nice work!

Collapse
 
synapse709 profile image
Tim Titus

Just installed. Great work friends!

Collapse
 
masteramuk profile image
Masteramuk • Edited

Very nice. Good and thank you for developing the extension for vs code.

Collapse
 
rushannotofficial profile image
Rushan S J

This is amazing, always wanted to create such libraries without searching and installing snippet extension for each language. Thanks a lot.

Collapse
 
alex_barashkov profile image
Alex Barashkov

Thank you for the feedback. Currently there is way only to disable certain linraries by adding them to .snipsnapignore.

Collapse
 
lakshmigandh profile image
lakshmigandh • Edited

As I see from the description, it requires some config files to be downloaded.

Can you describe in few steps how to install this extension (For React, Redux) in offline/portable mode. I've to move them from an Internet machine to an Non-Internet machine

Collapse
 
alex_barashkov profile image
Alex Barashkov

Basically to make it work offline you just need to install the extension first time somewhere with internet, it will fetch all snippets for your project and add them to .vscode/snipsnap.code-snippets file.You can then commit to your repository and use anywhere without internet connection.

Collapse
 
spicyfiona profile image
Fiona Lai

Perfect timing Alex!! I'm learning to build a react responsive web app as a designer and I'm so thankful you've built this!! Saves so much time!! Thank you!!!

Collapse
 
alex_barashkov profile image
Alex Barashkov

Let us know about your experience with the extension. Do you miss snippets for some libraries?

Collapse
 
alex_escalante profile image
Alex Escalante

Very good idea! I will have a look…

Collapse
 
ramong1145 profile image
Ramón Gallo

Hi Alex! I really like this initiative.
Currently installing and going for a test run. :)

Collapse
 
alex_barashkov profile image
Alex Barashkov

How did it go? :) Curious to know what do you think.

Collapse
 
sumnanazadi profile image
Sumnan Azadi

Any plan on overall python and python django ?

Collapse
 
alex_barashkov profile image
Alex Barashkov

We have plans for supporting Go, Python, Ruby, PHP. Stay tuned.

Collapse
 
good3n profile image
Tom Gooden✨

All I can think of is the Dinner Party episode of The Office. “Snip snap snip snap snip snap!”

Collapse
 
alex_barashkov profile image
Alex Barashkov

Have not seen it 😁But it seems i have too now.

Collapse
 
damianrivas profile image
Damian Rivas

It would be awesome if we could get preact snippets!

Collapse
 
slyvan25 profile image
Silvan Paul

any plans for emberjs?

Collapse
 
alex_barashkov profile image
Alex Barashkov

We currently focus on libraries which we know and use. However we’re looking forward for anyone who would like to adapt or create from scratch snippets for any libraries. The snippets format is very simple and well documented, since it uses default VS Code format just with some guidelines for standardization.

Collapse
 
osoraa profile image
Osoraa

Real nice...

Collapse
 
consciousness_dev profile image
Ario Setiawan

Pros & Cons VS Tabnine?

Collapse
 
alex_barashkov profile image
Alex Barashkov

I have not used Tabnine, so I can't compare it. From their webpage, it is not clear which languages, frameworks they support. The first impression they do some smart autocomplete but for very short constructions.
Could they create React component after typing a few words, or create Next.js specific common functions?
Also, the pricing model based on the project size in KB makes me very sick.

Collapse
 
surjithctly profile image
Surjith S M

Only JS? Can integrate HTML & Bootstrap ? So I don't need multiple extensions.

Collapse
 
danielres profile image
Daniel R

This is a truly fantastic idea!!
Looking forward to trying snipsnap.