30-seconds-of-code: [FEATURE] Integration for VS Code

Created on 27 Aug 2018  路  11Comments  路  Source: 30-seconds/30-seconds-of-code

As the codebase has grown a lot, I think it's time for a major addition to our repository - a file to add our snippets to VS code. This should be built daily and include everything in the normal list (no archive).

Why

I've found myself using some of our snippets a lot. And I am thinking about transitioning to VS Code, so this sounds like one of the things that I would definitely use in my daily life. It's also probably quite easy to write a script that produces them and state that we officially support VS Code as we can integrate with it (maybe even make an extension for it that we update regularly).

Opinions are appreciated, but I think there's no harm in doing this and it will probably help a few people be more productive.

I am aware of the fact that some side projects were made back in the day to support this, but I'd rather support this from inside the repo, as a core feature, so we can do more with it and maintain it properly.

discussion enhancement help wanted opinions needed

Most helpful comment

@skatcat31 Apart from that, there is incentive to use snippets instead of a package to avoid adding a ton of dependencies that might not be maintained in the long run. And based on the fact that 30code offers a wide variety of snippets that correlate to single-function packages, it might offer a choice to developers who do not want to include them.

... We can always do both. Implementing these features is nearly trivial, we just don't have that much time lately.

All 11 comments

If it's a package with JSDoc documentation(which IIRC can support markdown), VS Code will pull it in. It may be worth it to put the documentation in there so that VS Code can show it when it crawls the package

@skatcat31 The idea I was trying to sell here was to allow people to use the snippets without the npm package - essentially copy paste their code for them without including the 30 seconds package. I am not really sure what you mean, please elaborate a bit.

Is this still a planned feature? It sounds like something I could use on a daily basis!

@Chalarangelo VSCode will crawl an import for documentation in JSDoc format. If it finds it for the method you're calling or the object you are expecting it will display the relevant code.

This is sometimes broken in callbacks due to deep nesting and scafolding, but it's something that I've used often in my packages.

The use case for a standalone collection plugin would be snippet pasting for scripts that would not want the whole repo, either from CDN or from a package. I'm hard pressed to think of places for that with webpages or servers, but there could a use case if someone is doing JS development in low overhead, like an Arduino or a super commodity server

@skatcat31 Apart from that, there is incentive to use snippets instead of a package to avoid adding a ton of dependencies that might not be maintained in the long run. And based on the fact that 30code offers a wide variety of snippets that correlate to single-function packages, it might offer a choice to developers who do not want to include them.

... We can always do both. Implementing these features is nearly trivial, we just don't have that much time lately.

i agree, this would make sense to be an extension, i can gladly help!

IF that is the case that vscode snippet integration is considered I would vote that our snippets also include a credits comment so people know where it came from in case it's buggy

Can't wait for this one @Chalarangelo 馃槂 Please keep us posted on update from Azure team

Yup, I will!

The extension is finally live on VSCode Marketplace! Check it out here and remember to download and rate if you can, we need the popularity boost in order to get more people involved in the development of 30-seconds.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for any follow-up tasks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Chalarangelo picture Chalarangelo  路  5Comments

GrosSacASac picture GrosSacASac  路  3Comments

konglx90 picture konglx90  路  6Comments

fuchao2012 picture fuchao2012  路  4Comments

larrybotha picture larrybotha  路  3Comments